Package com.openinventor.volumeviz.nodes
Class SoOffscreenVolumeRender
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.volumeviz.nodes.SoOffscreenVolumeRender
-
- All Implemented Interfaces:
SafeDisposable
public abstract class SoOffscreenVolumeRender extends SoNode
Extract data from anSoVolumeRender
. TheSoOffscreenVolumeRender
node extracts data by rendering one or more volumes (viaSoVolumeRender
) into a buffer that can then be used for different computation tasks.Volumes of interest are specified by a subscenegraph in
volumerenderSceneGraph
.The region to be extracted is the bounding box of the scene graph specified in the
bboxSceneGraph
field.To implement an extraction, the application must derive a new class from
SoOffscreenVolumeRender
and implement :- the boxComputed method. This method is called with parameters that give access to information about the processed box.
- the getNextSubBox method. This method must return subBox size smaller than getMaxBoxSize. We recommend to request subbox even smaller in order to get more parallelism between extraction processing (done on GPU) and application processing and reduce peak GPU memory resources used.
The resolution of the extraction is controlled by
boxSize
field. As extraction is done using GPU techniques, there is a size limit on the boxSize that can be extract in one call. This limit can be retreived through getMaxBoxSize call.Limitations:
- It is not possible to extract a volume displayed as an isosurface (via
SoVolumeDataDrawStyle
orSoVolumeIsosurface
). SoResetTransform
node usage should be avoided in volumeRenderSceneGraph or bboxSceneGraph scene graph, in order to get the best extraction precision even with very flat extraction box. In general it is possible to useSoTransformSeparator
node instead.
File format/default:
volumerenderSceneGraph NULL bboxSceneGraph NULL boxSize (64, 64, 64) trigger false opacityThreshold 0 components ALPHA - See Also:
SoDataSet
,SoVolumeData
,SoVolumeRender
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoOffscreenVolumeRender.ComponentsType
-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFNode
bboxSceneGraph
Head of the scene graph that defines the 3D off-screen scene cube to consider in world coordinates.SoSFVec3i32
boxSize
Resolution of the output data in the off-screen box.SoSFEnum<SoOffscreenVolumeRender.ComponentsType>
components
Components to get back from the offscreen render.SoSFMatrix
dataSpaceMatrix
This transformation is applied on the volume render texture coordinate during the extraction.SoSFFloat
opacityThreshold
During extraction, voxels with an opacity less than the specified value will be ignored Default is 0.SoSFBool
trigger
Setting this field to true will start the off-screen rendering process.SoSFNode
volumerenderSceneGraph
Head of the scene graph that contains one or multiple VolumeRender node to render in 3D off-screen cube.-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SbVec3i32
getMaxBoxSize()
Calls getMaxBoxSize((com.openinventor.inventor.misc.SoState)null).SbVec3i32
getMaxBoxSize(SoState state)
Returns the maximum boxSize that can be extract in one boxComputed for the current state.SbBox3d
ijkToXyzBox(SbBox3i32 ijkBox)
Convert ijk box coordinates returned by boxComputed method to the bboxSceneGraph space.boolean
synchronousExtraction(SoSceneManager sceneManager)
Does extraction synchronously, whereas using trigger field will execute extraction on next redraw.-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
volumerenderSceneGraph
public final SoSFNode volumerenderSceneGraph
Head of the scene graph that contains one or multiple VolumeRender node to render in 3D off-screen cube.
-
bboxSceneGraph
public final SoSFNode bboxSceneGraph
Head of the scene graph that defines the 3D off-screen scene cube to consider in world coordinates.
-
boxSize
public final SoSFVec3i32 boxSize
Resolution of the output data in the off-screen box.
-
trigger
public final SoSFBool trigger
Setting this field to true will start the off-screen rendering process. This field is set to false when computation is finished. Default is false.
-
opacityThreshold
public final SoSFFloat opacityThreshold
During extraction, voxels with an opacity less than the specified value will be ignored Default is 0. Valid range is [0-1].
-
components
public final SoSFEnum<SoOffscreenVolumeRender.ComponentsType> components
Components to get back from the offscreen render. . Default is ALPHA.
-
dataSpaceMatrix
public final SoSFMatrix dataSpaceMatrix
This transformation is applied on the volume render texture coordinate during the extraction. It allows to change the extraction frame. This matrix is applied on normalized texture coordinates all components are between 0-1 and must be in [0-1] after the transformation. So to inverse an axis, we must apply the following transformation: -1*u+1 (where u is a texture coordinate) and not just a simple negative scale.To swap I and J axis, the matrix would be:
SbMatrix( 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); To reverse I axis, the matrix would be:
SbMatrix(-1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1); To reverse J axis, the matrix would be:
SbMatrix( 1, 0, 0, 0, 0,-1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1); To reverse K axis, the matrix would be:
SbMatrix( 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, -1, 0, 0, 0, 1, 1);
-
-
Method Detail
-
getMaxBoxSize
public SbVec3i32 getMaxBoxSize()
Calls getMaxBoxSize((com.openinventor.inventor.misc.SoState)null).
-
getMaxBoxSize
public SbVec3i32 getMaxBoxSize(SoState state)
Returns the maximum boxSize that can be extract in one boxComputed for the current state.
-
synchronousExtraction
public boolean synchronousExtraction(SoSceneManager sceneManager)
Does extraction synchronously, whereas using trigger field will execute extraction on next redraw.- Parameters:
sceneManager
- the scene manager of the viewer scene to be extracted.- Returns:
- true on success.
-
-