public class SoFenceSlice extends SoSlice
axis
field to form (in effect) an oblique slice. The default axis is Z, so the 2D points are treated as (X,Y) values. The points may be outside the 3D extent of the volume, but only the portion of the slice inside the volume will be drawn (subject to region of interest and other clipping nodes).
A similar effect could be obtained using volume geometry (e.g. SoVolumeFaceSet
), but SoFenceSlice
is more convenient and is optimized for this specific case.
The 2D coordinates are interpreted according to the following table. See the code example below.
Fence axis | Coordinate axes |
X | Y , Z |
Y | Z , X |
Z | X , Y |
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 fence 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:
SoFenceSlice
does not provide an SoDetail
object.
interpolation
field. The default (LINEAR) does bi-linear interpolation between voxel values. The NEAREST value can be used to display individual voxels. For best image quality we recommend using the MULTISAMPLE_12 value.
SoDataRange
node to specify the actual (or desired) range of data values to be mapped. Also use an SoDataRange
node to implement brightness/contrast control like the Window/Level setting commonly used with medical images.
SoROI
), geometry (SoVolumeClippingGroup
) and/or height fields (SoUniformGridClipping
). They are also clipped by OpenGL clipping planes (SoClipPlane
), but we recommend using the VolumeViz clipping nodes instead.
SoMaterial
node before the slice and setting its diffuseColor field to full white (1,1,1).
SoTransferFunction
) used for volume rendering (SoVolumeRender
) assigns transparency (alpha < 1) to some voxel values. If you want to use the same color map for slice rendering, but render the slice completely opaque, set the alphaUse
field to ALPHA_OPAQUE. This overrides the alpha values in the color map (or an RGBA volume). However it does not affect transparency assigned using an SoMaterial
node. SoMaterial
node and set its transparency field (keeping alphaUse set to ALPHA_AS_IS). Effectively a scale factor 1-transparency is applied to each voxel's alpha value. SoGLRenderAction
.
SoVolumeRenderingQuality
node.
SoVolumeShader
node, if any, allows custom shaders to be defined for special computation or rendering effects, including blending multiple volumes.
SoDataRange
). For smaller volumes, like 512^3, it can be efficient to set the tile size large enough to contain the entire volume. For very large volumes, larger tile sizes are efficient for SoVolumeRender
but somewhat inefficient for slice rendering because complete tiles must be loaded even though the slice only uses part of the data. Applications should experiment. SoConverter
and the "-t" option). For other data data formats the tile size can be specified using the SoVolumeData
node's
ldmResourceParameters field, but only after setting the
filename field or calling the setReader() method. SoDataRange
). We recommend setting this variable to false (see SoPreferences
) unless saving CPU memory is critical.
isSupported()
method to check if the current graphics board can render a FenceSlice.
Please see SoObliqueSlice
for a complete code example. The following shows how to set up the axis
and points
fields of SoFenceSlice
.
SoFenceSlice fenceSlice = new SoFenceSlice(); fenceSlice.axis.setValue( SoFenceSlice.AxisType.Y ); fenceSlice.points.set1Value( 0, new SbVec2f(-0.2f, -0.66f) ); fenceSlice.points.set1Value( 1, new SbVec2f( 0.2f, -0.4f ) ); fenceSlice.points.set1Value( 2, new SbVec2f(-0.2f, 0.4f ) ); fenceSlice.points.set1Value( 3, new SbVec2f( 0.2f, 0.66f) );
Fence slice on Y axis (Colt example data set): |
![]() |
Fence slice on X axis (Colt example data set): |
![]() |
Fence slice on Z axis (Colt example data set): |
![]() |
FenceSlice {
points | [ ] |
axis | Z |
interpolation | LINEAR |
alphaUse | ALPHA_BINARY |
useRGBA | false |
alternateRep | NULL |
enableBumpMapping | false |
bumpScale | 1.0 |
Action behavior:
SoGLRenderAction
Draws a textured shape based on current SoVolumeData
, SoTransferFunction
, and SoROI
nodes.
SoGetBoundingBoxAction
Computes the bounding box that encloses the fence slice.
See also:
SoVolumeData
, SoDataRange
, SoTransferFunction
, SoROI
, SoSlice
SoObliqueSlice
, SoOrthoSlice
, SoFenceSliceDetail
Modifier and Type | Class and Description |
---|---|
static class |
SoFenceSlice.AxisType |
SoSlice.AlphaUses
SoVolumeShape.Compositions, SoVolumeShape.Interpolations
SoShape.ShapeTypes
SoNode.RenderModes
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoSFEnum<SoFenceSlice.AxisType> |
axis
Extrusion axis: X, Y, or Z.
|
SoMFVec2f |
points
Set of points defining a lineset.
|
alphaUse, alternateRep, bumpScale, enableBumpMapping, largeSliceSupport, useRGBA
composition, interpolation
boundingBoxIgnoring
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoFenceSlice()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
isSupported()
Calls isSupported((com.openinventor.inventor.misc.SoState)null).
|
static boolean |
isSupported(SoState state)
Returns true if graphic card can render an
SoFenceSlice . |
getShapeType, isPrimitiveRestartAvailable, isPrimitiveRestartAvailable
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
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
getNativeResourceHandle
public final SoMFVec2f points
axis
is:
All points should be inside the 3D extent of the volume.
public final SoSFEnum<SoFenceSlice.AxisType> axis
public static boolean isSupported()
public static boolean isSupported(SoState state)
SoFenceSlice
.
GPU must support GLSL. When using a debug build of Open Inventor, some "no context available" warning messages may be generated. You can ignore them or see SoGLExtension
for an example of using SoGLContext
to avoid them.Generated on July 31, 2019, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com