Open Inventor Release 2023.2.3
 
Loading...
Searching...
No Matches
SoDataSet Class Reference

Large Data Management Data set node. More...

#include <LDM/nodes/SoDataSet.h>

+ Inheritance diagram for SoDataSet:

Public Types

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.
 

Public Member Functions

virtual SoType getTypeId () const
 Returns the type identifier for this specific instance.
 
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.
 
virtual SbBool startEditing (int &transactionId)
 Initiate an editing transaction.
 
virtual SbBool finishEditing (int transactionId)
 Terminates 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 &value)
 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 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 * > conversionParameters=std::vector< char * >(), SaveEditingCB *callback=NULL)
 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.
 
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.
 
DataType getDataType ()
 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.
 
- 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 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.
 

Public Attributes

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.
 
SoSFLDMResourceParameters ldmResourceParameters
 Contains an SoLDMResourceParameters object which allows you to set LDM resource parameters.
 

Friends

class SoLdmValuationAction
 
class SoLDMGeometry
 

Deprecated

typedef void SoLDMDataTransformFunction(SoDataSet *ds, const SbVec3i32 &bufferDimension, void *bufferToTransform, const SbBox3i32 &dataBox, int resolutionLevel, void *userData)
 
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.
 

Detailed Description

Large Data Management Data set node.

This class specifies a data set and its properties, and also provides utilities for extracting a subset of the data set and for resampling the data set. The data can be read directly from a file or can be accessed via a user-defined volume reader. This class is the parent class of the VolumeViz data nodes: SoVolumeData, SoHeightFieldGeometry, SoHeightFieldProperty, etc. Those nodes provide the data for VolumeViz rendering nodes: SoVolumeRender, SoOrthoSlice, SoObliqueSlice, etc. See SoVolumeData for more details about loading and managing volume data.

The data set can be specified by:

  • Setting the fileName field
    This implies that the data set is stored on disk, in one of the file formats for which LDM has a built-in reader. LDM will automatically select a reader based on the file extension, for example ".am" for the AmiraMesh file format.
  • Calling the setReader() method
    This is the most general method because an application can specify one of the standard LDM readers or implement a customized subclass of SoVolumeReader. LDM will get the data set properties (dimensions, size, data type, etc) and access the data through the specified reader object. This allows the application to completely control how, and from where, the data is loaded.

SEE ALSO

SoDataSetId, SoDataCompositor, SoVolumeData, SoMeshGeometry, SoMeshProperty

Definition at line 138 of file SoDataSet.h.

Member Typedef Documentation

◆ SaveEditingCB

typedef SbBool SoDataSet::SaveEditingCB(SoDataSet *dataSet, SoVolumeWriter *writer, int tilesRemaining, int totalTiles)

This is the declaration to use for saveEditing callback functions.

These callbacks are called just before a tile is written. At the beginning of the saving process, the SaveEditingCB is called with tilesRemaining = totalTiles . Once the save process is done (all tiles written and finalized), the SaveEditingCB is called with tilesRemaining = 0.

Parameters
dataSetDataSet used.
writerWriter used.
tilesRemainingRemaining tiles to save
totalTilesTotal tiles to save.
Returns
TRUE to continue save process. FALSE to abort.

Definition at line 511 of file SoDataSet.h.

◆ SoLDMDataTransformFunction

typedef void SoDataSet::SoLDMDataTransformFunction(SoDataSet *ds, const SbVec3i32 &bufferDimension, void *bufferToTransform, const SbBox3i32 &dataBox, int resolutionLevel, void *userData)


Deprecated since Open Inventor 8.0

Definition at line 803 of file SoDataSet.h.

Member Enumeration Documentation

◆ DataType

Supported data type.

Enumerator
UNSIGNED_BYTE 

unsigned byte

UNSIGNED_SHORT 

unsigned short

UNSIGNED_INT32 

unsigned int (32bits)

SIGNED_BYTE 

signed byte

SIGNED_SHORT 

signed short

SIGNED_INT32 

signed int (32bits)

FLOAT 

float

DOUBLE 

double

Definition at line 604 of file SoDataSet.h.

Member Function Documentation

◆ dataSize()

static int SoDataSet::dataSize ( DataType  dataType)
static

Returns the number of bytes per voxel of the specified data type.

◆ editBoxes()

virtual int SoDataSet::editBoxes ( const std::vector< SbVec3i32 > &  boxCenters,
const int &  boxSize,
const double &  newValue 
)
virtual

Replace all voxels in the region defined by a list of boxes with the specified value.

boxCenter and boxSize are defined in ijk (voxel) space.

Call startEditing() before calling this method. Returns 0 if successful.

Reimplemented in SoVolumeData.

◆ editSolidShape()

virtual int SoDataSet::editSolidShape ( const SoNode solidShape,
const double &  value 
)
virtual

Replaces all voxels intersecting the given shape with the specified value.

The geometry defined under solidShape must represent a list of closed surfaces otherwise the result is unpredictable. solidShape must not contain any lines or open polyhedrons (polyhedron with shapes). The result is based on the odd-winding rule, so the result is not necessarily the union or the intersection of the closed surfaces. If you want to voxelize lines or single polygons, see also the editSurfaceShape method.

If the goal is to define a shape which is the result of the intersection/union of multiple closed surfaces, see the SoCSGShape node.

solidShape is defined in the same 3D space as the dataSet. The solidShape can be deleted after calling this function.

Call startEditing() before calling this method. Returns 0 if successful.

Warning
The modification may be postponed until the tiles are really needed. Therefore the surfaceShape node (and children if any) must not be modified until after saveEditing() is called.

Reimplemented in SoVolumeData, and SoVolumeMask.

◆ editSubVolume() [1/2]

virtual int SoDataSet::editSubVolume ( const SbBox3i32 subVolume,
const double &  value 
)
virtual

Replaces the contents of a subvolume with the specified value.


The subvolume is specified in voxel/cell coordinates. Call startEditing() before calling this method. Returns 0 if successful.

Reimplemented in SoVolumeData, and SoVolumeMask.

◆ editSubVolume() [2/2]

virtual int SoDataSet::editSubVolume ( const SbBox3i32 subVolume,
SoBufferObject userData 
)
virtual

Replaces the contents of a subvolume with the given data.


The buffer size (in bytes) must match the subvolume size (in bytes) exactly. The subvolume is specified in voxel/cell coordinates. Call startEditing() before calling this method. Returns 0 if successful.

Warning
The modification may be postponed until the tiles are really needed. Therefore the contents of the userData buffer must not be modified until after saveEditing() is called. However the buffer may be unref'd.

Reimplemented in SoVolumeData, and SoVolumeMask.

◆ editSurfaceShape()

virtual int SoDataSet::editSurfaceShape ( const SoNode surfaceShape,
const float &  thickness,
const double &  value 
)
virtual

Replaces all voxels intersecting the polygons or lines defined by the surfaceShape and given thickness with the specified value.

surfaceShape is defined in the same 3D space as the dataSet. thickness is defined in voxels. The surfaceShape can be deleted after calling this function.

Call startEditing() before calling this method. Returns 0 if successful.

Warning
The modification may be postponed until the tiles are really needed. Therefore the surfaceShape node (and children if any) must not be modified until after saveEditing() is called.

Reimplemented in SoVolumeData, and SoVolumeMask.

◆ editTile() [1/2]

virtual int SoDataSet::editTile ( const SoLDMTileID tileId,
const double &  value 
)
virtual

Replaces the contents of a tile with the specified value.


Call startEditing() before calling this method. Returns 0 if successful.

Reimplemented in SoVolumeData.

◆ editTile() [2/2]

virtual int SoDataSet::editTile ( const SoLDMTileID tileId,
SoBufferObject userData 
)
virtual

Replaces the contents of a tile with the given data.


The buffer size (in bytes) must match the tile size (in bytes) exactly. Call startEditing() before calling this method. Returns 0 if successful.

Warning
The modification may be postponed until the tile is really needed. Therefore the contents of the userData buffer must not be modified until after saveEditing() is called. However the buffer may be unref'd.

Reimplemented in SoVolumeData.

◆ finishEditing()

virtual SbBool SoDataSet::finishEditing ( int  transactionId)
virtual

Terminates an editing transaction.


Returns true if successful. May only be called with a valid transaction id returned by the startEditing() method. On error does nothing. The finish method will schedule a redraw so the correct data is displayed. To commit the edits, in other words to save the edited data back to the data source, call saveEditing().

Reimplemented in SoVolumeData.

◆ getClassTypeId()

static SoType SoDataSet::getClassTypeId ( )
static

Returns the type identifier for this class.


◆ getDataSize()

int SoDataSet::getDataSize ( )

Returns the number of bytes per voxel in VolumeViz.

◆ getDataType()

DataType SoDataSet::getDataType ( )

Returns the data type.

◆ getDatumSize()

unsigned int SoDataSet::getDatumSize ( )

Returns the number of bytes per voxel.

◆ getDimension()

const SbVec3i32 & SoDataSet::getDimension ( )

Returns the data set dimension.

◆ getLdmDataAccess()

SoLDMDataAccess & SoDataSet::getLdmDataAccess ( )

Returns a reference to the SoLDMDataAccess object.


This object can be used to query data from the volume.

◆ getLDMReader()

SoLDMReader * SoDataSet::getLDMReader ( )

Returns a pointer to the current data set reader object.


The actual type will be a subclass of SoVolumeReader, either one of the predefined subclasses or an application-defined subclass. Returns NULL if no reader is currently being used (for example if setVolumeData() was called).

◆ getLDMTopoOctree()

const SoLDMTopoOctree * SoDataSet::getLDMTopoOctree ( ) const

Returns the LDMTopoOctree used by this SoDataSet.

The LDMTopoOctree is initialized at the initialization of the reader.

◆ getMaxNumDataSets()

static int SoDataSet::getMaxNumDataSets ( )
static

Returns the maximum number of data sets that can be render composited on the current hardware (essentially the number of texture units - 1).

◆ getMinMax() [1/2]

virtual SbBool SoDataSet::getMinMax ( double &  min,
double &  max 
)
virtual

Returns min and max values of the data set.


Returns FALSE if the requested data is not available (for example, if no data set exists).

NOTE: This method might force LDM to load the entire data set if the volume reader does not respond to the getMinMax query. Normally for an LDM format data set, the min and max values are stored in the LDM header. For a non-LDM data set, if a filename and/or reader have been specified and the data set has not yet been loaded, LDM will load the entire data set to compute the min and max values. For a large data set this may take a long time.

Reimplemented in SoVolumeData.

◆ getMinMax() [2/2]

virtual SbBool SoDataSet::getMinMax ( int64_t &  min,
int64_t &  max 
)
virtual

Returns min and max values of the data set data.


Returns FALSE if the requested data is not available (for example, if no data set exists).

NOTE: This method might force LDM to load the entire data set if the volume reader does not respond to the getMinMax query. Normally for an LDM format data set, the min and max values are stored in the LDM header. For a non-LDM data set, if a filename and/or reader have been specified and the data set has not yet been loaded, LDM will load the entire data set to compute the min and max values. For a large data set this may take a long time.

Reimplemented in SoVolumeData.

◆ getOverlapping()

SoDEPRECATED int SoDataSet::getOverlapping ( )

Returns the tile border (overlap) in voxels.

Since OIV 9.0 always returns 0.

◆ getReader() [1/2]

SoVolumeReader * SoDataSet::getReader ( )
inline

Returns the current data set reader object.


The actual type will be a subclass of SoVolumeReader, either one of the predefined subclasses or an application-defined subclass. Returns null if no reader is currently set. Applications should always verify the class type before using the returned object as a specific sub-class of SoVolumeReader.

Definition at line 586 of file SoDataSet.h.

◆ getReader() [2/2]

SoVolumeReader * SoDataSet::getReader ( ) const

Returns the current data set reader object.


The actual type will be a subclass of SoVolumeReader, either one of the predefined subclasses or an application-defined subclass. Returns null if no reader is currently set. Applications should always verify the class type before using the returned object as a specific sub-class of SoVolumeReader.

◆ getTileDimension()

SbVec3i32 SoDataSet::getTileDimension ( )

Returns the tile dimension.

◆ getTileIDInMemory()

void SoDataSet::getTileIDInMemory ( std::vector< LDM_TILE_ID_TYPE > &  tilesInMemory) const

Debug purpose only.

Used for visual feedback to highlight tiles in main memory. Only called if the SoVolumeRendering::DRAW_TOPOLOGY flag is true.

◆ getTypeId()

virtual SoType SoDataSet::getTypeId ( ) const
virtual

Returns the type identifier for this specific instance.

Reimplemented from SoNode.

Reimplemented in SoHeightFieldGeometry, SoHeightFieldProperty, SoHeightFieldPropertyMask, SoVolumeData, and SoVolumeMask.

◆ hasEditedTile()

virtual bool SoDataSet::hasEditedTile ( )
virtual

Returns true if DataSet has edited tiles.

◆ isDataFloat()

static SbBool SoDataSet::isDataFloat ( DataType  dataType)
static

Returns TRUE if the given data type is a float data type.

◆ isDataInMemory()

bool SoDataSet::isDataInMemory ( const SoLDMTileID tileID) const

Indicates whether the data attached to a tile is in main memory.

Called when the node front manager evaluates the texture front.

This allows to manage data that implements SoBufferAsyncInterface. If the specified tile does not implement SoBufferAsyncInterface then this method always returns true. So effectively it always returns true for non-LDM volumes.

◆ isDataSigned()

static SbBool SoDataSet::isDataSigned ( DataType  dataType)
static

Returns TRUE if the given data type is a signed integer data type.

◆ isInMemory()

bool SoDataSet::isInMemory ( SoLDMTileID  tileID) const

Indicates whether a tile is in main memory.

Called when the node front manager evaluates the texture front.

◆ numSigBits()

int SoDataSet::numSigBits ( ) const

Returns the number of significant bits.

◆ readTile() [1/3]

virtual size_t SoDataSet::readTile ( SoBufferObject *&  bufferObject,
SoLDMTileID  tileID,
bool  transform 
)
virtual

Copies the specified tile into the provided buffer.


Applies the data transformation (set in dataTransform field) if transform is true. Returns the size, in bytes, copied in the buffer. If size == 0 nothing was written (probably due to a memory allocation error).

◆ readTile() [2/3]

virtual void SoDataSet::readTile ( SoLDMTileID  tileID,
SoBufferObject buffer,
bool  transform 
)
virtual

Copies the specified tile into the provided buffer.


Applies the data transformation (set in dataTransform field) if transform is true.

◆ readTile() [3/3]

virtual SoDEPRECATED void SoDataSet::readTile ( SoLDMTileID  tileID,
unsigned char *  buffer,
bool  transform 
)
virtual

◆ redoEditing()

virtual SbBool SoDataSet::redoEditing ( int  transactionId)
virtual

Redo all modifications associated with the specified transaction id.

Returns true if successful. On error does nothing. May only be called after the specified transaction has been terminated (see finishEditing() method) and undone (see undoEditing() method). Schedules a redraw so the correct data is displayed.

Note: Redo is no longer available after transactions are saved. After calling saveEditing(), the transaction ids are no longer valid and the modified data is the new reference.

Reimplemented in SoVolumeData.

◆ resetReader()

void SoDataSet::resetReader ( )

Resets previously set custom reader setup by setReader call.

Reference counting:

Warning: This method calls ref() on the reader and then calls unref(). If the reader has a reference count of zero (the default), the call to resetReader() will cause it to be destroyed! A warning message is posted in this case when using a debug build of Open Inventor.

◆ saveEditing()

virtual SbBool SoDataSet::saveEditing ( bool  recomputeLowerResolution = TRUE,
const std::vector< char * >  conversionParameters = std::vector< char * >(),
SaveEditingCB callback = NULL 
)
virtual

Commit all transactions.

All modified tiles are written back to the data source using the current reader format. May only be called when no threads are editing, i.e. after all threads that called startEditing have called finishEditing.

Returns true if successful. On error does nothing returns false. Returns false if:

  • No edits have been done.
  • Transaction(s) still in progress (finishEditing has not been called).
  • Volume was not loaded using a volume reader (direct from memory doesn't work).
  • No volume writer class exists for this volume reader.

Warning: Effectively, saveEditing currently only works for data loaded using an SoVRLDMFileReader (an LDM format tiled data set) or an SoVRMemoryReader (data set completely in memory).

You can specify a callback (see SaveEditingCB) that will be called before saving each tile (even if the data uses a sliced format it is saved tile by tile). If this callback returns FALSE, the saving process is aborted. Warning: In such a case, lower resolutions are not updated and the result will be undefined.

Conversion Parameters:

  • Only apply if the volume reader is an SoVRLDMFileReader. In this case an instance of SoVRLDMFileWriter is used.
  • The options are the same as the LDM converter (see SoConverter), but only a subset of those options are supported.
  • The writer automatically sets verbose = true and histogram = false.
    This is because if histogram = true, ALL tiles must be re-written.
  • The parameter strings must be formatted exactly the same as on an LDM converter command line (see SoConverter).
  • The supported options are:
    • -histogram : sets histogram true or false
    • -q : sets verbose = false
    • -c : compression name
    • -l : compression level

Reimplemented in SoVolumeData.

◆ setLDMDataTransformFunction()

SoDEPRECATED void SoDataSet::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.

This allows you to modify the original data (for example, scaling or filtering) before it is displayed.

◆ setLDMReader()

void SoDataSet::setLDMReader ( SoLDMReader reader)

Sets the LDM volume reader object to use.


This method allows the data to be read directly from the disk using the specified subclass of SoVolumeReader.

◆ setReader()

void SoDataSet::setReader ( SoVolumeReader reader,
SbBool  takeOwnership = FALSE 
)

This method allows the data to be read directly from the disk using the specified subclass of SoVolumeReader.

If the takeOwnership parameter is FALSE (default), LDM will not delete the specified instance. Otherwise, LDM will automatically delete the specified instance, for example, when the SoDataSet node is deleted. If filename is not set before setting the reader, LDM will display an error message just to warn that the reader has not opened any file yet. LDM continues to work as expected.

Note: When using a custom reader, any reader method that changes the volume properties (dimension, size, data type, etc) should notify the SoVolumeData node by calling the reader's touch() method. If this notification is not done, SoDataSet fields, for example SoDataSet::extent, won't be updated correctly.

◆ startEditing()

virtual SbBool SoDataSet::startEditing ( int &  transactionId)
virtual

Initiate an editing transaction.


Returns true if successful and also returns a unique transaction id. This value is required for finishing the edit transaction (see finishEditing()) and for undo/redo (see undoEditing() and redoEditing()). Multiple transactions may be active at the same time.

Reimplemented in SoVolumeData.

◆ undoEditing()

virtual SbBool SoDataSet::undoEditing ( int  transactionId)
virtual

Undo all modifications associated with the specified transaction id.

Returns true if successful. On error does nothing. May only be called after the specified transaction has been terminated (see finishEditing() method). Schedules a redraw so the correct data is displayed.

Note: Undo is no longer available after transactions are saved. After calling saveEditing(), the transaction ids are no longer valid and the modified data is the new reference.

Reimplemented in SoVolumeData.

◆ voxelToXYZ() [1/2]

virtual SbBox3f SoDataSet::voxelToXYZ ( const SbBox3f box) const
virtual

Converts the specified box in voxel coordinates (I,J,K) to geometric coordinates (X,Y,Z).

The geometric coordinates are expressed in "extent" space, where voxel coordinates are mapped to the box defined by the volume extent.

Correctly converts coordinates that are outside the volume dimensions, but the resulting geometric coordinate is outside the volume extent.

See also
voxelToXYZ(const SbVec3f&) const
XYZToVoxel(const SbVec3f&) const
XYZToVoxel(const SbBox3f&) const

◆ voxelToXYZ() [2/2]

virtual SbVec3f SoDataSet::voxelToXYZ ( const SbVec3f dataPosition) const
virtual

Converts the specified point in voxel coordinates (I,J,K) to geometric coordinates (X,Y,Z).

The geometric coordinates are expressed in "extent" space, where voxel coordinates are mapped to the box defined by the volume extent.

The left bottom coordinate of the voxel is returned. Correctly converts coordinates that are outside the volume dimensions, but the resulting geometric coordinate is outside the volume extent.

See also
voxelToXYZ(const SbBox3f&) const
XYZToVoxel(const SbVec3f&) const
XYZToVoxel(const SbBox3f&) const

◆ writeTile()

virtual void SoDataSet::writeTile ( SoLDMTileID  tileID,
SoBufferObject buffer,
SoVolumeWriter writer 
)
virtual

Write the specified tile using the specified writer.

No operations are done on buffer (dataTransform or edition), the buffer is written as is. The writer must be initialized and handles must be properly set (see SoVolumeReader::closeAllHandles and SoVolumeWriter::restoreAllHandles), ie. the current reader's handles must be closed, and the specified writer's handles must be opened.

◆ XYZToVoxel() [1/2]

virtual SbBox3f SoDataSet::XYZToVoxel ( const SbBox3f xyzBox) const
virtual

Converts the specified box in geometric coordinates to voxel coordinates.

The geometric coordinates are expressed in "extent" space, where voxel coordinates are mapped to the box defined by the volume extent.

Correctly converts coordinates that are outside the volume extent, but the resulting voxel coordinate is outside the volume dimensions.

See also
voxelToXYZ(const SbVec3f&) const
voxelToXYZ(const SbBox3f&) const
XYZToVoxel(const SbVec3f&) const

◆ XYZToVoxel() [2/2]

virtual SbVec3f SoDataSet::XYZToVoxel ( const SbVec3f dataPosition) const
virtual

Converts the specified point in geometric coordinates (X,Y,Z) to voxel coordinates (I,J,K).

The geometric coordinates are expressed in "extent" space, where voxel coordinates are mapped to the box defined by the volume extent.

Correctly converts coordinates that are outside the volume extent, but the resulting voxel coordinate is outside the volume dimensions.

See also
voxelToXYZ(const SbVec3f&) const
voxelToXYZ(const SbBox3f&) const
XYZToVoxel(const SbBox3f&) const

Friends And Related Symbol Documentation

◆ SoLDMGeometry

friend class SoLDMGeometry
friend

Definition at line 1309 of file SoDataSet.h.

◆ SoLdmValuationAction

friend class SoLdmValuationAction
friend

Definition at line 1308 of file SoDataSet.h.

Member Data Documentation

◆ allocateResourceOnRender

SoSFBool SoDataSet::allocateResourceOnRender

Indicates if resource allocation is done only on first render traversal or as soon as the node is created.

Default is TRUE. It must be set to FALSE if the dataset is not inserted in a scene graph but will be used for data access for example. Otherwise, memory resources will still remain on default value.

Definition at line 270 of file SoDataSet.h.

◆ dataSetId

SoSFInt32 SoDataSet::dataSetId

When using multiple SoDataSet nodes, the dataSetId field uniquely identifies each data set used in the compositing.

It also specifies the OpenGL texture unit in which the textures for this data set will be stored when doing render compositing. It is 1 by default (texture unit 0 is reserved for the color lookup table by default). The number of available texture units depends on your hardware. You can query this number using getMaxNumDataSets.

Note: The SoDataSetId node can also be used to define dataSetId. If an SoDataSetId node is traversed before the SoDataSet node, the id from the SoDataSetId node is used and this field is ignored.

NOTE: field available since Open Inventor 6.0

Definition at line 161 of file SoDataSet.h.

◆ dataTransform

SoSFLDMDataTransform SoDataSet::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.

This allows you to modify the original data (for example, scaling or filtering) before it is displayed. Default is no transform.

Note: Before Open Inventor 8.0, the data transformFunction was set using the setLDMDataTransformFunction method. That method is now deprecated.

NOTE: field available since Open Inventor 8.0

Definition at line 261 of file SoDataSet.h.

◆ extent

SoSFBox3f SoDataSet::extent

The real size (extent) of the volume in modeling coordinates.

Default is -1,-1,-1 to 1,1,1.

Note this can be used to define a volume with non-uniform voxel spacing. For example, if the volume dimensions (voxels) are 64x64x64, but the voxel spacing in Z is twice the X and Y spacing, then you might specify the volume size as -1 to 1 for X and Y but -2 to 2 for Z.

Definition at line 239 of file SoDataSet.h.

◆ fileName

SoSFFilePathString SoDataSet::fileName

Indicates the file location containing the data set.

Default is an empty string. Depending on the file type, the corresponding SoVolumeReader (if it exists) is used.

File Extension Loader Class Description
.am SoVRAmFileReader Amira Mesh file format
.dc3, .dic, .dicom SoVRDicomFileReader Dicom file format
.fld SoVRAvsFileReader AVS field file format
.lda or .ldm SoVRLdmFileReader Large Data Management file format
.sgy or .segy SoVRSegyFileReader SEG Y revision 1 file format
.vol SoVRVolFileReader Vol file format
.vox SoVRVoxFileReader Vox file format
.lst SoVRRasterStackReader Lst file format

The filename extension is not case sensitive.

Note: SoDataSet and its derived classes (SoVolumeData, etc) do not search the SoInput directory list to find files specified in this field. To check file existence and other properties the SbFileHelper class may be useful.

Definition at line 187 of file SoDataSet.h.

◆ ldmResourceParameters

SoSFLDMResourceParameters SoDataSet::ldmResourceParameters

Contains an SoLDMResourceParameters object which allows you to set LDM resource parameters.

Definition at line 359 of file SoDataSet.h.

◆ texturePrecision

SoSFUShort SoDataSet::texturePrecision

For scalar (non-RGBA) data, specifies the size of voxel values on the GPU in bits.

The valid values are: 0 (default), 8 and 16.
When set to 0, LDM chooses the best precision based on the size of the data type (or if specified, the number of significant bits) - meaning that LDM will store 8-bit values on the GPU for 8-bit data and store 16-bit values for all other data types.

There are several trade-offs influenced by this value, including:

  • 8 bit values use less memory on the GPU than 16-bit values, allowing more data to be stored on the GPU. 8-bit values are adequate for many visualization tasks. But...
  • If the specified (or chosen) precision is smaller than the data type, then LDM must scale down the data values before sending them to the GPU.
    • Limitation: This is currently unavoidable for 32-bit data.
    • Down scaling adds some time whenever a tile of data must be sent to the GPU.
    • In particular, all tiles currently stored on the GPU must be rescaled if the application changes the data range (SoDataRange node).
      Note: As a result, changing the data range may be slow for large volumes.
    • Down scaling also means "aliasing" data values, i.e. multiple data values may scale to the same value on the GPU.

NOTE: field available since Open Inventor 6.0

Definition at line 228 of file SoDataSet.h.

◆ undefinedValue

SoSFDouble SoDataSet::undefinedValue

Data with this value won't be rendered.


Default is NaN (Not a Number) which means that this value is not taken into account. Otherwise, value must be in agreement with data type. Limitations: There are several limitations in order for the undefined value to work :

  • The texturePrecision must be at least equal to the number of significant bits of the data type.
  • The data type must be BYTE, SHORT (either SIGNED or UNSIGNED) or FLOAT
  • The field is ignored in the following classes : SoHeightFieldProperty, SoHeightFieldPropertyMask and SoVolumeMask. Setting this field has no effect in these cases.
  • In the case of multiple SoVolumeData,the undefinedValue must be the same in all SoVolumeData. If different values are provided, only the latest one on the state will be considered for the rendering.

NOTE: field available since Open Inventor 10.11

Definition at line 289 of file SoDataSet.h.

◆ useCompressedTexture

SoSFBool SoDataSet::useCompressedTexture

Controls use of OpenGL lossy texture compression for RGBA data (if available).

Default is TRUE.

A significant advantage of compressed textures is that they conserve texture memory space. At the moment, the extension works on RGBA textures only, not on paletted textures. The compression factor is about 5.

A potential drawback of compressed textures is that lossy compression can result in values on the GPU that are slightly different from the actual value in the volume. For example "gray scale" colors could have a slight color in some cases. You should always set this option to false when using "RGBA" data to store 32-bit "id" values.

Definition at line 202 of file SoDataSet.h.


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