Abstract base class for elevation data. More...
#include <TerrainViz/SbTVizData.h>
Public Types | |
enum | OpenMode { TVIZ_UNKNOWN = 0, TVIZ_ASCII, TVIZ_BINARY } |
enum | DataType { TVIZ_UCHAR = 0, TVIZ_USHORT, TVIZ_UINT32, TVIZ_FLOAT, TVIZ_CHAR, TVIZ_SHORT, TVIZ_INT32 } |
enum | Encoding { TVIZ_BIG_ENDIAN = 0, TVIZ_LITTLE_ENDIAN } |
enum | Condition { TVIZ_LOWER = 0, TVIZ_LOWER_OR_EQUAL, TVIZ_EQUAL, TVIZ_GREATER, TVIZ_GREATER_OR_EQUAL } |
Public Member Functions | |
virtual | ~SbTVizData () |
virtual float | getValue (const SbVec2d &point) const =0 |
virtual float | getAvgValue () const =0 |
virtual float | getMaxValue () const =0 |
virtual float | getMinValue () const =0 |
const SbString & | getFileName () const |
const SbVec3d & | getSize () const |
const SbVec3d & | getOffset () const |
void | setHoleValue (float value, Condition cond) |
float | getHoleValue (Condition &cond) const |
void | setHoleEdgePrecision (float holeRez) |
float | getHoleEdgePrecision () const |
DataType | getDataType () const |
OpenMode | getOpenMode () const |
Encoding | getEncoding () const |
virtual SbBool | writeDataFile (const SbString &filename, OpenMode mode)=0 |
This is the top class for the TerrainViz elevation data handling classes.
Elevations can be saved as a .DAT file, in ASCII or binary mode. If binary, the encoding must be specified: BIG_ENDIAN or LITTLE_ENDIAN.
Elevations can be shifted by an offset. All values are expressed in modeling coordinates, not physical units.
This class is to be used with an SoTVizRender node.
SbTVizRegularGridData, SbTVizTexture, SbTVizTextureList, SoTViz, SoTVizRender
enum SbTVizData::DataType |
enum SbTVizData::Encoding |
enum SbTVizData::OpenMode |
virtual SbTVizData::~SbTVizData | ( | ) | [inline, virtual] |
Destructor.
virtual float SbTVizData::getAvgValue | ( | ) | const [pure virtual] |
Returns the average altitude of the data.
Implemented in SbTVizRegularGridData.
DataType SbTVizData::getDataType | ( | ) | const |
Returns the type of the data (UCHAR, USHORT, FLOAT,.
..).
Encoding SbTVizData::getEncoding | ( | ) | const |
Returns the file encoding (BIG_ENDIAN, LITTLE_ENDIAN).
Used only with XML files.
const SbString& SbTVizData::getFileName | ( | ) | const |
Returns the file name.
float SbTVizData::getHoleEdgePrecision | ( | ) | const |
Gets the precision factor used for hole contouring.
Factor ranges from 0. (very poor quality) to 1. for best quality. Default value is 1.
float SbTVizData::getHoleValue | ( | Condition & | cond | ) | const |
Gets the value and condition to manage holes.
virtual float SbTVizData::getMaxValue | ( | ) | const [pure virtual] |
Returns the maximum altitude of the data.
Implemented in SbTVizRegularGridData.
virtual float SbTVizData::getMinValue | ( | ) | const [pure virtual] |
Returns the minimum altitude of the data.
Implemented in SbTVizRegularGridData.
const SbVec3d& SbTVizData::getOffset | ( | ) | const |
Returns the offset in 3D coordinates.
The offset is set in the XML terrain file or using SbTVizRegularGridData::loadDataFile.
OpenMode SbTVizData::getOpenMode | ( | ) | const |
Returns the file open mode (UNKNOWN, ASCII, BINARY).
Used only with XML files.
const SbVec3d& SbTVizData::getSize | ( | ) | const |
Returns the size in 3D coordinates.
virtual float SbTVizData::getValue | ( | const SbVec2d & | point | ) | const [pure virtual] |
Returns the altitude of the given 2D point (ground).
Implemented in SbTVizRegularGridData.
void SbTVizData::setHoleEdgePrecision | ( | float | holeRez | ) |
Sets the precision factor used for hole contouring.
Factor ranges from 0. (very poor quality) to 1. for best quality. Default value is 1.
void SbTVizData::setHoleValue | ( | float | value, | |
Condition | cond | |||
) |
Sets the value and condition to manage holes.
virtual SbBool SbTVizData::writeDataFile | ( | const SbString & | filename, | |
OpenMode | mode | |||
) | [pure virtual] |
Writes altitude data to a .dat file (ASCII or BINARY).
Implemented in SbTVizRegularGridData.