All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
gazebo::common::ImageHeightmap Class Reference

Encapsulates an image that will be interpreted as a heightmap. More...

#include <common/common.hh>

Inheritance diagram for gazebo::common::ImageHeightmap:
Inheritance graph
[legend]

Public Member Functions

 ImageHeightmap ()
 Constructor. More...
 
void FillHeightMap (int _subSampling, unsigned int _vertSize, const math::Vector3 &_size, const math::Vector3 &_scale, bool _flipY, std::vector< float > &_heights)
 Create a lookup table of the terrain's height. More...
 
std::string GetFilename () const
 Get the full filename of the image. More...
 
unsigned int GetHeight () const
 Get the terrain's height. More...
 
float GetMaxElevation () const
 Get the maximum terrain's elevation. More...
 
unsigned int GetWidth () const
 Get the terrain's width. More...
 
int Load (const std::string &_filename="")
 Load an image file as a heightmap. More...
 
- Public Member Functions inherited from gazebo::common::HeightmapData
virtual ~HeightmapData ()
 Destructor. More...
 

Detailed Description

Encapsulates an image that will be interpreted as a heightmap.

Constructor & Destructor Documentation

gazebo::common::ImageHeightmap::ImageHeightmap ( )

Constructor.

Parameters
[in]_filenamethe path to the image

Member Function Documentation

void gazebo::common::ImageHeightmap::FillHeightMap ( int  _subSampling,
unsigned int  _vertSize,
const math::Vector3 _size,
const math::Vector3 _scale,
bool  _flipY,
std::vector< float > &  _heights 
)
virtual

Create a lookup table of the terrain's height.

Parameters
[in]_subsamplingMultiplier used to increase the resolution. Ex: A subsampling of 2 in a terrain of 129x129 means that the height vector will be 257 * 257.
[in]_vertSizeNumber of points per row.
[in]_sizeReal dimmensions of the terrain.
[in]_scaleVector3 used to scale the height.
[in]_flipYIf true, it inverts the order in which the vector is filled.
[out]_heightsVector containing the terrain heights.

Implements gazebo::common::HeightmapData.

std::string gazebo::common::ImageHeightmap::GetFilename ( ) const

Get the full filename of the image.

Returns
The filename used to load the image
unsigned int gazebo::common::ImageHeightmap::GetHeight ( ) const
virtual

Get the terrain's height.

Returns
The terrain's height.

Implements gazebo::common::HeightmapData.

float gazebo::common::ImageHeightmap::GetMaxElevation ( ) const
virtual

Get the maximum terrain's elevation.

Returns
The maximum terrain's elevation.

Implements gazebo::common::HeightmapData.

unsigned int gazebo::common::ImageHeightmap::GetWidth ( ) const
virtual

Get the terrain's width.

Returns
The terrain's width.

Implements gazebo::common::HeightmapData.

int gazebo::common::ImageHeightmap::Load ( const std::string &  _filename = "")

Load an image file as a heightmap.

Parameters
[in]_filenamethe path to the image file.
Returns
True when the operation succeeds to open a file.

The documentation for this class was generated from the following file: