39 #ifndef __HEIGHTFIELD_H__
40 #define __HEIGHTFIELD_H__
52 using namespace Menge;
91 bool initialize(
const std::string & imgName,
float cellSize,
float vertScale,
float xpos,
float zpos,
float smoothParam=0.f );
98 virtual const std::string &
getLabel()
const {
return LABEL; }
112 static Resource * load(
const std::string & fileName );
118 void computeNormals();
129 float getHeightAt(
float x,
float y )
const;
140 Vector3 getNormalAt(
float x,
float y )
const;
150 float getHeightAtCell(
int x,
int y )
const;
160 Vector3 getNormalAtCell(
int x,
int y )
const;
167 int getW()
const {
return _W; }
174 int getH()
const {
return _H; }
210 void smoothElevation(
float smooth );
float _xpos
The x-position of the minimum corner of the heightfield.
Definition: HeightField.h:240
Configures the shared library aspect of the includes.
int _H
The number of cells in the height (z) direction.
Definition: HeightField.h:225
float getCellSize() const
Returns the cellSize of the height field.
Definition: HeightField.h:181
int getH() const
Return the number of cells in the height direction of the field.
Definition: HeightField.h:174
HeightFieldPtr loadHeightField(const std::string &fileName)
Loads the height field of the given name.
Definition: HeightField.cpp:416
ResourcePtr< HeightField > HeightFieldPtr
The definition of the managed pointer for HeightField data.
Definition: HeightField.h:251
Vector3 ** _normalMap
The data for the normals of the height field.
Definition: HeightField.h:235
float _ypos
The y-position of the minimum corner of the heightfield.
Definition: HeightField.h:245
static const std::string LABEL
The unique label for this data type to be used with resource management.
Definition: HeightField.h:201
int _W
The number of cells in the width (x) direction.
Definition: HeightField.h:220
float ** _heightMap
The data for the height field.
Definition: HeightField.h:230
float getCornerY() const
Returns the y-position of the mininum corner of the grid.
Definition: HeightField.h:195
float getCornerX() const
Returns the x-position of the mininum corner of the grid.
Definition: HeightField.h:188
float _cellSize
The size of a cell in the heightfield (in world coordinates)
Definition: HeightField.h:215
int getW() const
Return the number of cells in the width direction of the field.
Definition: HeightField.h:167
A heightfield. A uniform discretization of space which supports queries on height and normal of field...
Definition: HeightField.h:59
virtual const std::string & getLabel() const
Returns a unique resource label to be used to identify different resource types which use the same un...
Definition: HeightField.h:98
The namespace containing the height field resource and Menge elements which use the height field...
Definition: ElevationHeightField.cpp:44