Volume mask. More...
#include <VolumeViz/nodes/SoVolumeMask.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
Returns the type identifier for this specific instance. | |
SoVolumeMask () | |
Constructor. | |
virtual int | editSubVolume (const SbBox3i32 &subVolume, SoBufferObject *userData) |
Replace the contents of a subvolume with the given data. | |
virtual int | editSubVolume (const SbBox3i32 &subVolume, const double &value) |
Replace the contents of a subvolume with the specified value. | |
virtual int | editSurfaceShape (const SoNode *surfaceShape, const float &thickness, const double &newValue) |
Replace 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) |
Replace all voxels inside the given shape with the specified value. | |
bool | saveEditing (SbString filename, bool recomputeLowerResolution=TRUE, const std::vector< char * >=std::vector< char * >(), SaveEditingCB callback=NULL) |
Save editing done on the volume mask data. | |
void | setDefaultValue (const bool defValue) |
Set default value of the volume mask. | |
bool | getDefaultValue () const |
Returns default value of the volume mask. | |
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 | editTile (const SoLDMTileID &tileId, const double &value) |
Replaces the contents of a tile 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 SoVolumeData * | reSampling (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 SoVolumeData * | subSetting (const SbBox3i32 ®ion) |
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 SbVec3i32 & | getDimension () |
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. | |
SoLDMDataAccess & | getLdmDataAccess () |
Returns a reference to the SoLDMDataAccess object. | |
SbBool | saveEditing () |
Commit all transactions. | |
virtual bool | hasEditedTile () |
Returns true if DataSet has edited tiles. | |
SoLDMReader * | getLDMReader () |
Returns a pointer to the current data set reader object. | |
void | setLDMReader (SoLDMReader *reader) |
Sets the LDM volume reader object to use. | |
SoVolumeReader * | getReader () |
Returns the current data set reader object. | |
SoVolumeReader * | getReader () 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 SoLDMTopoOctree * | getLDMTopoOctree () 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 SoNode * | copy (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 SoField * | getField (const SbName &fieldName) const |
Returns a the field of this object whose name is fieldName. | |
virtual SoField * | getEventIn (const SbName &fieldName) const |
Returns a the eventIn with the given name. | |
virtual SoField * | getEventOut (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 SoNode * | getByName (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 | 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. | |
SoSFLDMResourceParameters | ldmResourceParameters |
Contains an SoLDMResourceParameters object which allows you to set LDM resource parameters. | |
This node specifies an arbitrary voxel-based region of a volume data set (SoVolumeData). A volume mask is itself a data volume consisting of binary values. Zero values are "false" and non-zero values are "true". A large number of masks may be defined simultaneously, using an SoVolumeMask node for each one, and mask regions may overlap if desired.
SoVolumeMask is derived from SoVolumeData. Like SoVolumeData it accesses its data through an SoVolumeReader class. I.e. the data may be in a file or in memory (or any data source using a custom volume reader). The mask volume can be any data type, but unsigned byte is currently the most memory efficient representation.
SoVolumeMask nodes must follow these rules:
SoVolumeMask can be used to clip the data volume on a per-voxel basis.
But the mask mechanism is much more powerful than that. Each region can have its own transfer function (color map) using SoTransferFunction nodes. Each region can also have its own draw style (volume rendering, isosurface or boundary) using SoVolumeDataDrawStyle nodes. Each region, including the original unmasked volume, is only visible if there exists a transfer function (SoTransferFunction) with the same id value.
Mask regions:
A single SoVolumeMask node effectively defines two regions:
Because intersecting regions are allowed, two SoVolumeMask nodes define (up to) four regions:
Each additional mask defines one additional region (voxels that are true only in that mask).
In addition, if there exists a transfer function with the same id as the original volume (SoVolumeData node), the color value from that transfer function is combined with the color value from the mask region's transfer function.
Transfer functions:
A separate transfer function can be specified for each of these regions using SoTransferFunction nodes. The transfer function nodes may be placed under the SoVolumeMaskGroup node, but this is not required.
NOTE: It is not currently possible to specify a different data range for each mask.
Draw Styles:
A separate draw style can be specified for each mask region and for the intersection voxels (but not for false voxels) using SoVolumeDataDrawStyle nodes:
Data Range:
SoVolumeMask currently does not support separate data ranges for each mask region. The same SoDataRange will be applied on all regions.
Note that the inherited undefinedValue field is ignored. Setting it has no effect.
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 |
SoVolumeDataDrawStyle, SoVolumeRender, SoOrthoSlice, SoObliqueSlice, SoVolumeReader, SoVolumeSkin, SoVolumeMask, SoVolumeMaskGroup, SoMultiDataSeparator
Definition at line 178 of file SoVolumeMask.h.
SoVolumeMask::SoVolumeMask | ( | ) |
Constructor.
|
virtual |
Replace all voxels inside the given shape with the specified value.
Returns 0 if successful.
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 results of the intersection/union of multiple closed surfaces, see the SoCSGShape node.
Call startEditing() before calling this method.
Reimplemented from SoVolumeData.
|
virtual |
Replace the contents of a subvolume with the specified value.
Returns 0 if successful.
Call startEditing() before calling this method.
Reimplemented from SoVolumeData.
|
virtual |
Replace the contents of a subvolume with the given data.
Returns 0 if successful.
Call startEditing() before calling this method.
Reimplemented from SoVolumeData.
|
virtual |
Replace all voxels intersecting the polygons or lines defined by the surfaceShape and given thickness with the specified value.
Returns 0 if successful.
Call startEditing() before calling this method.
Reimplemented from SoVolumeData.
|
static |
Returns the type identifier for this class.
bool SoVolumeMask::getDefaultValue | ( | ) | const |
Returns default value of the volume mask.
|
virtual |
Returns the type identifier for this specific instance.
Reimplemented from SoVolumeData.
bool SoVolumeMask::saveEditing | ( | SbString | filename, |
bool | recomputeLowerResolution = TRUE , |
||
const std::vector< char * > | = std::vector< char * >() , |
||
SaveEditingCB | callback = NULL |
||
) |
Save editing done on the volume mask data.
Returns true if save was successful.
void SoVolumeMask::setDefaultValue | ( | const bool | defValue | ) |
Set default value of the volume mask.
Default is 0.