Open Inventor Release 2024.2.1
 
Loading...
Searching...
No Matches
SoHeightFieldGeometry Class Reference

VolumeViz Height field data node More...

#include <VolumeViz/nodes/SoHeightFieldGeometry.h>

+ Inheritance diagram for SoHeightFieldGeometry:

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
 SoHeightFieldGeometry ()
 Constructor.
 
- Public Member Functions inherited from SoVolumeData
 SoVolumeData ()
 Constructor.
 
virtual SbBool getMinMax (int64_t &min, int64_t &max)
 Returns min and max values of the data set data.
 
virtual SbBool getMinMax (double &min, double &max)
 Returns min and max values of the data set.
 
SbBool getHistogram (int &length, int64_t *&histogram)
 Returns the histogram of the volume data.
 
void updateRegions (const SbBox3i32 *region, int num_regions)
 Updates regions of the volume that have been modified.
 
void updateTilesInTextureMemory (SoLDMTileID *tiles, int numTiles)
 Reloads textures corresponding to the given tile IDs.
 
void setRGBAData (const bool flag)
 Force data to be considered as RGBA values.
 
CoordinateType getCoordinateType () const
 
const std::vector< float > & getRectilinearCoordinates (Axis axis) const
 Returns a vector describing mapping from uniform space to rectilinear space.
 
virtual SbBool startEditing (int &transactionId)
 Initiate an editing transaction.
 
virtual int editTile (const SoLDMTileID &tileId, SoBufferObject *userData)
 Replaces the contents of a tile with the given data.
 
virtual int editSubVolume (const SbBox3i32 &subVolume, SoBufferObject *userData)
 Replaces the contents of a subvolume with the given data.
 
virtual int editTile (const SoLDMTileID &tileId, const double &value)
 Replaces the contents of a tile with the specified value.
 
virtual int editSubVolume (const SbBox3i32 &subVolume, const double &value)
 Replaces the contents of a subvolume with the specified value.
 
virtual int editSurfaceShape (const SoNode *surfaceShape, const float &thickness, const double &newValue)
 Replaces all voxels intersecting the polygons or lines defined by the surfaceShape and given thickness with the specified value.
 
virtual int editSolidShape (const SoNode *solidShape, const double &value)
 Replaces all voxels intersecting the given shape with the specified value.
 
virtual int editBoxes (const std::vector< SbVec3i32 > &boxCenters, const int &boxSize, const double &newValue)
 Replace all voxels in the region defined by a list of boxes with the specified value.
 
virtual SbBool finishEditing (int transactionId)
 Terminates an editing transaction.
 
virtual SbBool undoEditing (int transactionId)
 Undo all modifications associated with the specified transaction id.
 
virtual SbBool redoEditing (int transactionId)
 Redo all modifications associated with the specified transaction id.
 
virtual SbBool saveEditing (bool recomputeLowerResolution=TRUE, const std::vector< char * > convertionParameters=std::vector< char * >(), SaveEditingCB *callback=NULL)
 Commit all transactions.
 
SoDEPRECATED SoVolumeDatareSampling (const SbVec3i32 &dimension, SoVolumeData::SubMethod subMethod, SoVolumeData::OverMethod=NONE)
 Re-samples the volume down to or up to the given dimension using the sub-sampling method SubMethod() and the over-sampling method OverMethod().
 
SoDEPRECATED SoVolumeDatasubSetting (const SbBox3i32 &region)
 Extracts the data volume defined by region.
 
SoDEPRECATED void setTexMemorySize (int size)
 Specifies the maximum texture memory size to use in mega texels.
 
SoDEPRECATED int getTexMemorySize ()
 Returns the maximum texture memory size to use in mega texels.
 
- Public Member Functions inherited from SoDataSet
const SbVec3i32getDimension ()
 Returns the data set dimension.
 
SbVec3i32 getTileDimension ()
 Returns the tile dimension.
 
unsigned int getDatumSize ()
 Returns the number of bytes per voxel.
 
virtual size_t readTile (SoBufferObject *&bufferObject, SoLDMTileID tileID, bool transform)
 Copies the specified tile into the provided buffer.
 
virtual void readTile (SoLDMTileID tileID, SoBufferObject *buffer, bool transform)
 Copies the specified tile into the provided buffer.
 
virtual void writeTile (SoLDMTileID tileID, SoBufferObject *buffer, SoVolumeWriter *writer)
 Write the specified tile using the specified writer.
 
bool isInMemory (SoLDMTileID tileID) const
 Indicates whether a tile is in main memory.
 
bool isDataInMemory (const SoLDMTileID &tileID) const
 Indicates whether the data attached to a tile is in main memory.
 
void getTileIDInMemory (std::vector< LDM_TILE_ID_TYPE > &tilesInMemory) const
 Debug purpose only.
 
SoLDMDataAccessgetLdmDataAccess ()
 Returns a reference to the SoLDMDataAccess object.
 
SbBool saveEditing ()
 Commit all transactions.
 
virtual bool hasEditedTile ()
 Returns true if DataSet has edited tiles.
 
SoLDMReadergetLDMReader ()
 Returns a pointer to the current data set reader object.
 
void setLDMReader (SoLDMReader *reader)
 Sets the LDM volume reader object to use.
 
SoVolumeReadergetReader ()
 Returns the current data set reader object.
 
SoVolumeReadergetReader () const
 Returns the current data set reader object.
 
int numSigBits () const
 Returns the number of significant bits.
 
DataType getDataType () const
 Returns the data type.
 
int getDataSize ()
 Returns the number of bytes per voxel in VolumeViz.
 
void setReader (SoVolumeReader &reader, SbBool takeOwnership=FALSE)
 This method allows the data to be read directly from the disk using the specified subclass of SoVolumeReader.
 
virtual SbVec3f voxelToXYZ (const SbVec3f &dataPosition) const
 Converts the specified point in voxel coordinates (I,J,K) to geometric coordinates (X,Y,Z).
 
virtual SbBox3f voxelToXYZ (const SbBox3f &box) const
 Converts the specified box in voxel coordinates (I,J,K) to geometric coordinates (X,Y,Z).
 
virtual SbVec3f XYZToVoxel (const SbVec3f &dataPosition) const
 Converts the specified point in geometric coordinates (X,Y,Z) to voxel coordinates (I,J,K).
 
virtual SbBox3f XYZToVoxel (const SbBox3f &xyzBox) const
 Converts the specified box in geometric coordinates to voxel coordinates.
 
void resetReader ()
 Resets previously set custom reader setup by setReader call.
 
const SoLDMTopoOctreegetLDMTopoOctree () const
 Returns the LDMTopoOctree used by this SoDataSet.
 
virtual SoDEPRECATED void readTile (SoLDMTileID tileID, unsigned char *buffer, bool transform)
 
SoDEPRECATED void setLDMDataTransformFunction (SoLDMDataTransformFunction *func, void *userData=NULL)
 If set, the user-defined function is called after each tile is loaded, but before it is stored in main memory.
 
SoDEPRECATED int getOverlapping ()
 Returns the tile border (overlap) in voxels.
 
- Public Member Functions inherited from SoNode
virtual void setOverride (const SbBool state)
 Turns the override flag on or off.
 
virtual SbBool isOverride () const
 Returns the state of the override flag.
 
virtual SoNodecopy (SbBool copyConnections=FALSE) const
 Creates and returns an exact copy of the node.
 
virtual SbBool affectsState () const
 Returns TRUE if a node has an effect on the state during traversal.
 
virtual void touch ()
 Marks an instance as modified, simulating a change to it.
 
- Public Member Functions inherited from SoFieldContainer
void setToDefaults ()
 Sets all fields in this object to their default values.
 
SbBool hasDefaultValues () const
 Returns TRUE if all of the object's fields have their default values.
 
SbBool fieldsAreEqual (const SoFieldContainer *fc) const
 Returns TRUE if this object's fields are exactly equal to fc's fields.
 
void copyFieldValues (const SoFieldContainer *fc, SbBool copyConnections=FALSE)
 Copies the contents of fc's fields into this object's fields.
 
SoNONUNICODE SbBool set (const char *fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
SbBool set (const SbString &fieldDataString)
 Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.
 
void get (SbString &fieldDataString)
 Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.
 
virtual int getFields (SoFieldList &list) const
 Appends references to all of this object's fields to resultList, and returns the number of fields appended.
 
virtual int getAllFields (SoFieldList &list) const
 Returns a list of fields, including the eventIn's and eventOut's.
 
virtual SoFieldgetField (const SbName &fieldName) const
 Returns a the field of this object whose name is fieldName.
 
virtual SoFieldgetEventIn (const SbName &fieldName) const
 Returns a the eventIn with the given name.
 
virtual SoFieldgetEventOut (const SbName &fieldName) const
 Returns the eventOut with the given name.
 
SbBool getFieldName (const SoField *field, SbName &fieldName) const
 Returns the name of the given field in the fieldName argument.
 
SbBool enableNotify (SbBool flag)
 Notification at this Field Container is enabled (if flag == TRUE) or disabled (if flag == FALSE).
 
SbBool isNotifyEnabled () const
 Notification is the process of telling interested objects that this object has changed.
 
virtual void setUserData (void *data)
 Sets application data.
 
void * getUserData (void) const
 Gets user application data.
 
- Public Member Functions inherited from SoBase
virtual SbName getName () const
 Returns the name of an instance.
 
virtual void setName (const SbName &name)
 Sets the name of an instance.
 
void setSynchronizable (const bool b)
 Sets this to be a ScaleViz synchronizable object.
 
bool isSynchronizable () const
 Gets the ScaleViz synchronizable state of this object.
 
- Public Member Functions inherited from SoRefCounter
void ref () const
 Adds a reference to an instance.
 
void unref () const
 Removes a reference from an instance.
 
void unrefNoDelete () const
 unrefNoDelete() should be called when it is desired to decrement the reference count, but not delete the instance if this brings the reference count to zero.
 
int getRefCount () const
 Returns current reference count.
 
void lock () const
 lock this instance.
 
void unlock () const
 unlock this instance.
 
- Public Member Functions inherited from SoTypedObject
SbBool isOfType (const SoType &type) const
 Returns TRUE if this object is of the type specified in type or is derived from that type.
 
template<typename TypedObjectClass >
SbBool isOfType () const
 Returns TRUE if this object is of the type of class TypedObjectClass or is derived from that class.
 

Static Public Member Functions

static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoVolumeData
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoDataSet
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static int dataSize (DataType dataType)
 Returns the number of bytes per voxel of the specified data type.
 
static SbBool isDataSigned (DataType dataType)
 Returns TRUE if the given data type is a signed integer data type.
 
static SbBool isDataFloat (DataType dataType)
 Returns TRUE if the given data type is a float data type.
 
static int getMaxNumDataSets ()
 Returns the maximum number of data sets that can be render composited on the current hardware (essentially the number of texture units - 1).
 
- Static Public Member Functions inherited from SoNode
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
static SoNodegetByName (const SbName &name)
 A node's name can be set using SoBase::setName().
 
static int getByName (const SbName &name, SoNodeList &list)
 A node's name can be set using SoBase::setName().
 
- Static Public Member Functions inherited from SoFieldContainer
static SoType getClassTypeId ()
 Returns the type of this class.
 
- Static Public Member Functions inherited from SoBase
static SoType getClassTypeId ()
 Returns type identifier for this class.
 
- Static Public Member Functions inherited from SoTypedObject
static SoType getClassTypeId ()
 Returns the type identifier for this class.
 
- Static Public Member Functions inherited from SoVolumeRendering
static void init ()
 Initializes the VolumeViz module database.
 
static void finish ()
 Shuts down the VolumeViz module, which includes freeing any internal static memory that it allocated.
 
static bool isInitialized ()
 Returns TRUE if module is currently initialized.
 
static void setWriteAlternateRep (SbBool flag)
 Sets the writeAlternateRep flag.
 
static SbBool getWriteAlternateRep ()
 Returns the writeAlternateRep flag.
 
static void setReadAlternateRep (SbBool flag)
 Sets the readAlternateRep flag.
 
static SbBool getReadAlternateRep ()
 Returns the readAlternateRep flag.
 
static HW_SupportStatus isSupported (HW_Feature feature)
 Returns information about hardware support for various volume rendering features.
 
static SoDEPRECATED void setDelayedRendering (SbBool flag)
 Sets the delayedRendering flag.
 
static SoDEPRECATED SbBool getDelayedRendering ()
 Returns the delayedRendering flag.
 

Additional Inherited Members

- Public Types inherited from SoVolumeData
enum  CoordinateType {
  COORDINATES_UNIFORM = SoVolumeReader::COORDINATES_UNIFORM ,
  COORDINATES_RECTILINEAR = SoVolumeReader::COORDINATES_RECTILINEAR
}
 Coordinate type used by this data set. More...
 
enum  Axis {
  X ,
  Y ,
  Z
}
 Which axis to handle. More...
 
typedef SoLDMDataAccess LDMDataAccess
 
typedef ::SoLDMResourceParameters SoLDMResourceParameters
 
enum  StorageHint {
  AUTO ,
  TEX2D_MULTI ,
  TEX2D = TEX2D_MULTI ,
  TEX3D ,
  MEMORY
}
 Storage Hints mode TODO: this enum should be in the private section as its storageHints deprecated field coiunterpart BUT it is used in other internal implementation place. More...
 
enum  SubMethod {
  NEAREST ,
  MAX ,
  AVERAGE
}
 Sub sampling method mode. More...
 
enum  OverMethod {
  NONE ,
  CONSTANT ,
  LINEAR ,
  CUBIC
}
 Over sampling method mode. More...
 
- Public Types inherited from SoDataSet
enum  ValueInterpretation {
  CONTINUOUS = 0 ,
  DISCRETE = 1
}
 Specifies an image type: segmented or not segmented. More...
 
enum  DataType {
  UNSIGNED_BYTE = SbDataType::UNSIGNED_BYTE ,
  UNSIGNED_SHORT = SbDataType::UNSIGNED_SHORT ,
  UNSIGNED_INT32 = SbDataType::UNSIGNED_INT32 ,
  SIGNED_BYTE = SbDataType::SIGNED_BYTE ,
  SIGNED_SHORT = SbDataType::SIGNED_SHORT ,
  SIGNED_INT32 = SbDataType::SIGNED_INT32 ,
  FLOAT = SbDataType::FLOAT ,
  DOUBLE = SbDataType::DOUBLE
}
 Supported data type. More...
 
typedef SbBool SaveEditingCB(SoDataSet *dataSet, SoVolumeWriter *writer, int tilesRemaining, int totalTiles)
 This is the declaration to use for saveEditing callback functions.
 
typedef void SoLDMDataTransformFunction(SoDataSet *ds, const SbVec3i32 &bufferDimension, void *bufferToTransform, const SbBox3i32 &dataBox, int resolutionLevel, void *userData)
 
- Public Types inherited from SoVolumeRendering
enum  HW_Feature {
  HW_3DTEXMAP = SoHardwareQuery::HW_3DTEXMAP ,
  HW_TEXCOLORMAP = SoHardwareQuery::HW_TEXCOLORMAP ,
  HW_TEXCOMPRESSION = SoHardwareQuery::HW_TEXCOMPRESSION
}
 Hardware Features Mode. More...
 
enum  HW_SupportStatus {
  NO = SoHardwareQuery::NO ,
  YES ,
  UNKNOWN
}
 Hardware Features support status. More...
 
- Public Attributes inherited from SoVolumeData
SoSFBool usePalettedTexture
 For a volume containing scalar data values, controls whether scalar values (true) or RGBA values (false) are loaded on the GPU (the name is historical).
 
SoSFBool useSharedPalettedTexture
 Note: On graphics boards that support programmable shaders, this field is ignored (virtually all graphics boards support programmable shaders).
 
SoSFBool useExtendedData
 If TRUE, VolumeViz stores an additional copy of each loaded tile.
 
SoSFArray3D data
 Specifies the volume data, including dimensions, data type and number of significant bits.
 
SoSFBool dataRGBA
 Contains TRUE if the volume contains RGBA values rather than scalar values.
 
- Public Attributes inherited from SoDataSet
SoSFInt32 dataSetId
 When using multiple SoDataSet nodes, the dataSetId field uniquely identifies each data set used in the compositing.
 
SoSFFilePathString fileName
 Indicates the file location containing the data set.
 
SoSFBool useCompressedTexture
 Controls use of OpenGL lossy texture compression for RGBA data (if available).
 
SoSFUShort texturePrecision
 For scalar (non-RGBA) data, specifies the size of voxel values on the GPU in bits.
 
SoSFBox3f extent
 The real size (extent) of the volume in modeling coordinates.
 
SoSFLDMDataTransform dataTransform
 If set to an appropriate SoLDMDataTransform object, the object's transformFunction method is called after each tile is loaded, but before it is stored in main memory.
 
SoSFBool allocateResourceOnRender
 Indicates if resource allocation is done only on first render traversal or as soon as the node is created.
 
SoSFDouble undefinedValue
 Data with this value won't be rendered.
 
SoSFEnum valueInterpretation
 Specifies if this dataset corresponds or does not correspond to a segmented image.
 
SoSFLDMResourceParameters ldmResourceParameters
 Contains an SoLDMResourceParameters object which allows you to set LDM resource parameters.
 

Detailed Description

VolumeViz Height field data node

SoHeightFieldGeometry defines a uniform grid in the XY plane whose vertices are height (Z) values stored in 2D LDM format (any LDM data set with the Z dimension equal to 1). Storing only height values is a very efficient way to represent a surface and LDM supports 8 and 16 bit integer data in addition to float (and other types). Adding the combination of LDM data management with advanced GPU features provides a way to handle extremely large surfaces. Just as with volume data, LDM uses tiles of data and multiple levels of resolution to enable interactive frame rates even for data sets that cannot fit in system memory.

SoHeightFieldGeometry is derived from SoVolumeData and serves a similar purpose in the scene graph, providing a reference to an LDM data set which will be loaded as needed by rendering nodes, specifically SoHeightFieldRender in this case. The geometry is given by the inherited field fileName. The given file must be an LDM file built by the LDM converter (see SoConverter). For use with SoHeightFieldRender the data set must have a depth (Z dimension) of exactly 1. The inherited field undefinedValue allows to specify an "undefined" value which will be rendered as holes in the grid. This value can also be specified with the -u option of the converter.

Data set values are converted to height values in 3D space in two ways depending on the data type:

  • Integer values are normalized between [0,1] ([-1,1] for signed types) based on the range of values for the specific data type. For example, for UNSIGNED BYTE values the range 0..255 is mapped to 0..1.
  • Floating point values are not normalized (are used "as is").

Extent in 3D space

A standard SoVolumeData node has no intrinsic "extent" in 3D. The extent of the volume is initially defined by the values returned from the volume reader (normally from the extent tag in the LDM file header). The extent field is initialized with these values from the reader and always contains the current extent values. The application can modify the extent of the volume by changing the values in the extent field. (Note that the actual bounding box of the volume in 3D is the volume extent modified by any transform nodes in the scene graph.)

SoHeightFieldGeometry only uses the X and Y parts of the extent field. The Z extent of the surface in 3D is completely defined by the values in the data set. So the X and Y values in the extent field are the actual extent, but the Z values are not meaningful and changing the Z values in the extent field has no effect. Note that you can always get the current bounding box (X, Y and Z) using an SoGetBoundingBoxAction and you can still control the bounding box using an SoTransform (or similar) node. To scale or offset the height values, put a transform node in the scene graph before the SoHeightFieldGeometry node. For example, to scale the height values by a factor of 2, you could use an SoScale node with the scaleFactor field set to (0,0,2).

Warning
If you implement your own volume reader, we strongly recommend implementing the method SoVolumeReader::getTileMinMax(). The tile min/max is used to improve the tesselation (adjust the number of triangles depending on the difference between min and max). Because of the way the height field algorithm works, if tile min/max info is not available, VolumeViz must load all height field tiles before the first render. This can cause a long delay before the first rendering appears.

FILE FORMAT/DEFAULT

    HeightFieldGeometry {
    allocateResourceOnRender FALSE
    data NODATA 0 0 0 UBYTE 8
    dataRGBA FALSE
    dataSetId 1
    dataTransform NULL
    extent -1 -1 -1 1 1 1
    fileName ""
    texturePrecision 0
    undefinedValue NaN
    useCompressedTexture TRUE
    useExtendedData FALSE
    usePalettedTexture TRUE
    useSharedPalettedTexture TRUE
    }

SEE ALSO

SoHeightFieldRender, SoHeightFieldProperty, SoMultiDataSeparator, SoConverter

Definition at line 124 of file SoHeightFieldGeometry.h.

Constructor & Destructor Documentation

◆ SoHeightFieldGeometry()

SoHeightFieldGeometry::SoHeightFieldGeometry ( )

Constructor.

Member Function Documentation

◆ getClassTypeId()

static SoType SoHeightFieldGeometry::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getTypeId()

virtual SoType SoHeightFieldGeometry::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoVolumeData.


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