Oblique slice shape node. More...
#include <VolumeViz/nodes/SoObliqueSlice.h>
Public Member Functions | |
virtual SoType | getTypeId () const |
SoObliqueSlice () | |
Static Public Member Functions | |
static SoType | getClassTypeId () |
Public Attributes | |
SoSFInt32 | dataSetId |
SoSFPlane | plane |
This node defines an oblique (arbitrarily oriented) slice which is the intersection of the volume data defined by an SoVolumeData node and the plane defined by the plane field.
The SoVolumeData node can be specified with dataSetId. When this field is set to 0, the last SoVolumeData node on state is used.
For a non-RGBA (scalar valued) volume, each voxel's RGBA value is determined by the current SoDataRange and SoTransferFunction. The current diffuse color and transparency (set, for example, with an SoMaterial node) modify the appearance of the slice. This means that, for example, the current transparency can be used as a global alpha value to modulate the overall opacity of the slice. For an RGBA volume each voxel's RGBA value comes directly from the volume data.
The interpolation field controls how the texture is interpolated.
The alphaUse field (SoSlice) controls how the voxel's alpha component is used when drawing the slice.
Optionally a bump mapping effect may be applied. Normal vectors are automatically computed from the data value gradient. The enableBumpMapping and bumpScale fields (SoSlice) control whether bump mapping is active and the intensity of the effect.
Notes:
vec3 VVizTextureToTextureVec(in VVizDataSetId datasetSrc, in VVizDataSetId datasetDst, in vec3 texCoord);
Note that some of the property nodes (data, material, color map, etc) will typically be shared by multiple rendering nodes. In other words the volume usually only needs to be loaded once, using a single SoVolumeData node, then multiple slices and/or regions can be rendered using that data node.
Also note that this example is for a data volume, where each voxel can be considered a discrete sample from a continuous data field and interpolation should be used to compute values between voxel centers. If you are rendering a label volume, then each voxel is an "id" assigning that voxel to a specific material, object, etc. In this case, set the interpolation field to NEAREST to disable interpolation.
// Default setting can be a performance bottleneck SoPreferences::setValue( "LDM_USE_IN_MEM_COMPRESSION", "0" ); // Keep volume viz separate from geometry SoSeparator* volSep = new SoSeparator(); root->addChild( volSep ); // Load volume data SoVolumeData* volData = new SoVolumeData(); volData->fileName = "$OIVHOME/examples/data/VolumeViz/3DHead.vol"; volSep->addChild( volData ); // Set range of data values to visualize. // Not required for 8-bit voxels, critical for larger data types. // The getMinMax() call may be expensive for non-LDM file formats. SoDataRange* volRange = new SoDataRange(); if (volData->getDatumSize() > 1) { double minVal, maxVal; volData->getMinMax( minVal, maxVal ); volRange->min = minVal; volRange->max = maxVal; } volSep->addChild( volRange ); // Load opaque intensity ramp SoTransferFunction* volTF = new SoTransferFunction(); volTF->predefColorMap = SoTransferFunction::INTENSITY; volSep->addChild( volTF ); // Display slice at full intensity SoMaterial* volMat = new SoMaterial(); volMat->diffuseColor.setValue( 1, 1, 1 ); volSep->addChild( volMat ); // Remove tile boundary artifacts while moving. SoVolumeShader* volShader = new SoVolumeShader(); volShader->interpolateOnMove = TRUE; volSep->addChild( volShader ); // Display a Z axis slice at center of volume SoObliqueSlice* slice = new SoObliqueSlice(); SbBox3f volext = volData->extent.getValue(); SbVec3f center = volext.getCenter(); slice->plane = SbPlane( SbVec3f(0,0,1), center[2] ); slice->interpolation = SoObliqueSlice::MULTISAMPLE_12; volSep->addChild( slice );
dataSetId | 0 |
plane | 0, 0, 1, 0 |
interpolation | LINEAR |
alphaUse | ALPHA_BINARY |
useRGBA | FALSE |
alternateRep | NULL |
enableBumpMapping | FALSE |
bumpScale | 1.0 |
SoGetBoundingBoxAction
Computes the bounding box that encloses the slice.
SoVolumeData, SoDataRange, SoTransferFunction, SoROI, SoSlice, SoOrthoSlice, SoVolumeShader
SoObliqueSlice::SoObliqueSlice | ( | ) |
Constructor.
static SoType SoObliqueSlice::getClassTypeId | ( | ) | [static] |
Returns the type identifier for this class.
Reimplemented from SoSlice.
Reimplemented in ObliqueSliceBorder.
virtual SoType SoObliqueSlice::getTypeId | ( | ) | const [virtual] |
Returns the type identifier for this specific instance.
Reimplemented from SoSlice.
Reimplemented in ObliqueSliceBorder.
Specifies the SoVolumeData node to use.
This is useful when datasets of different dimensions are present in the scene graph. Please see SoMultiDataSeparator for more details.
When set to 0, the last SoVolumeData node on state is used. Default is 0.
NOTE: field available since Open Inventor 10.11.0Plane defining the slice.
The default plane corresponds to the XY plane.