Class SoVolumeClippingGroup
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.inventor.nodes.SoGroup
-
- com.openinventor.volumeviz.nodes.SoVolumeClippingGroup
-
- All Implemented Interfaces:
SafeDisposable
public class SoVolumeClippingGroup extends SoGroup
Clipping a volume with a 3D object. VolumeViz supports clipping a volume against any closed 3D polygonal shape defined by standard Open Inventor geometry. This is done using theSoVolumeClippingGroup
node. Polygon clipping can remove the voxels outside the shape or the voxels inside the shape. Polygon clipping can be used in seismic applications to clip outside a fault block or geobody, in medical applications to cut away an arbitrary region, in core sample applications to apply cylindrical clipping and many other uses.When this node is in the scene graph before a VolumeViz rendering node, all shapes under the
SoVolumeClippingGroup
will be used to clip the volume. These shapes will not be displayed.The geometry defined under
SoVolumeClippingGroup
must represent a set of closed surfaces otherwise the result is unpredictable.The clipping group may include transform nodes, e.g.
SoTransform
, to scale, rotate and translate the geometry. The transformed geometry will be used for clipping.In general, do not put draggers or manipulators, e.g.
SoTabBoxDragger
, in the clipping group. The geometry of the dragger will also be used for clipping and the results may be unexpected. One exception is if the dragger is configured to use the clipping shape as "proxy" geometry (seeSoInteractionKit.setPartAsPath()
). A better solution is to put the dragger in the scene graph outside the clipping group, add a transform node to the clipping group and connect the fields of the dragger to the fields of the transform node (seeSoField.connectFrom()
).The clipping result is based on the odd-winding rule, so the result is not simply the union or the intersection of the closed surfaces. If the goal is to define a clipping shape which is the result of the intersection/union of multiple closed surfaces, consider using the
SoCSGShape
node as a child ofSoVolumeClippingGroup
.In some cases the number of passes specified may not be enough to clip correctly with the specified geometry. The
numPasses
field allows you to increase the clipping quality, for example when using shapes with a lot of concavity. To query the maximum allowed number of passes, which depends on your graphics card, use the static methodgetMaxNumPasses()
. The setNotEnoughPassCallback() method allows the application to be notified when numPasses is not sufficient.Standard clipplanes (see
SoClipPlane
) affect VolumeViz rendering nodes, but the VolumeViz specific clipping nodes generally provide better performance and allow much more complex clipping. Simple axis-aligned clipping can be done more efficiently using theSoROI
node. TheSoUniformGridClipping
orSoUniformGridProjectionClipping
nodes clip against height-field surfaces (e.g. seismic horizons). TheSoVolumeMask
node clips against a boolean mask volume on a per-voxel basis.Notes:
- When using a custom
SoVolumeShader
with this node and redefining the main() function, you must call VVizClipVoxel() in the main() function if you are writing a fragment shader. If you don't do this you will get a GLSL compilation error or clipping won't work. - Because this node uses special textures, all texture units between IVVR_FIRST_RESERVED_TEXTURE_UNIT (or
SoFragmentShader.getMaxTextureImageUnit()
-SoShaderProgram.getNumReservedTextures() if this variable is not set) and IVVR_FIRST_RESERVED_TEXTURE_UNIT-2 are reserved. - Because this node requires closed geometry, clipping planes (
SoClipPlane
) are automatically disabled when computing the clipping shape. - When used inside an
SoOffscreenVolumeRender
results might be incorrect. In specific cases geometry might be seen as opened.
EXAMPLE The following code clips a volume with a cone:
SoVolumeClippingGroup volClipGroup = new SoVolumeClippingGroup(); volClipGroup.addChild( new SoCone() ); SoSeparator volSep = new SoSeparator(); volSep.addChild( volumeData ); volSep.addChild( transferFunction ); volSep.addChild( volClipGroup ); volSep.addChild( volumeRender ); root.addChild( volSep ); Clipping object Clipping applied to a volume File format/default:
VolumeClippingGroup {
numPasses 2 clipOutside true
-
-
Nested Class Summary
-
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 SoSFBool
clipOutside
If true, voxels inside the clipping object will be drawn, voxels outside will be clipped.SoSFInt32
numPasses
Number of passes used to do the clipping.-
Fields inherited from class com.openinventor.inventor.nodes.SoGroup
boundingBoxIgnoring
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoVolumeClippingGroup()
Default constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getMaxNumPasses()
Returns the maximum number of passes supported by the hardware.-
Methods inherited from class com.openinventor.inventor.nodes.SoGroup
addChild, findChild, getChild, getNumChildren, insertChild, removeAllChildren, removeChild, removeChild, replaceChild, replaceChild
-
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
-
numPasses
public final SoSFInt32 numPasses
Number of passes used to do the clipping. Increasing this number increases the image quality but decreases performance. Default is 2 and maximum isSoVolumeClippingGroup.getMaxNumPasses()
.
-
clipOutside
public final SoSFBool clipOutside
If true, voxels inside the clipping object will be drawn, voxels outside will be clipped. Default is true. Note that if the VolumeClippingGroup is empty, setting clipOutside to true will clip everything and setting it to false will clip nothing.
-
-