public class SoUniformGridClipping extends SoTexture2
SoUniformGridClipping
node specifies a clipping surface defined by a clipping axis (axis field),a bounding box (extent field) in world coordinates and a uniform scalar clipping grid (a 2D array of height values). This tool provides an efficient way for seismic applications to clip volume rendering against horizon surfaces (see also SoUniformGridProjectionClipping
). A flat clipping surface with non-zero thickness can also be used in medical applications to implement "thick slice" rendering. The clipping grid does not need to have the same dimensions as the volume to be clipped (it will be sampled and interpolated). The clipping grid may be rotated and translated by standard Open Inventor transform nodes.
The height values are specified using a 2D texture. Each texel is a normalized value that, together with the extent, specifies a height. For integer valued textures, the range of the integer type (e.g. 0..255 for byte values) is normalized to the floating point range 0..1. For float valued textures the values should already be in the range 0..1. Each normalized value specifies a height based on the range of values in the extent box along the specified clipping axis. The default clipping axis is the Y axis.
NOTE: For integer valued textures this is similar to the way values are interpreted for the SoHeightFieldGeometry
node. However for float valued textures it is quite different because the SoHeightFieldGeometry
node interprets float values as actual height values and ignores the extent values.
It is also possible to specify an "undefined" value using the undefinedValue field. Texels with this value will clip all voxels above and below the surface. The default undefined value is Nan (Not a Number).
The X, Y and Z coordinates of the extent are in the same coordinate system as the volume extent. They specify the bounding box of the clipping surface and also the range of height values that can be specified with the normalized values in the height field texture. They are typically, but not necessariliy, set to the same values as the volume extent. The extent of the clipping surface may be larger than the volume extent. In this case the volume is only clipped where its extent overlaps with the surface. The extent of the clipping surface may also be smaller than the volume extent. In this case the volume is clipped to the "horizontal" extent of the clipping surface (the dimensions perpendicular to the clipping axis). However along the clipping axis the volume is only limited by the surface itself, not by its extent.
SoUniformGridClipping
is derived from SoTexture2
, so the clipping grid texture can be specified by setting the filename field or by directly setting the image field. Directly setting the image field is convenient if the height field data is floating point. All the usual texturing parameters apply. Wrapping and filtering modes are particularly important. Setting wrap mode to something other than CLAMP_TO_EDGE may cause unwanted interpolation on edges. Setting filter mode to NEAREST will give a blocky result which may or may not be desired.
The format of the texture used for the grid should be the LUMINANCE* type for best performance. For example, a grayscale .png file will automatically be in this format. We suggest to use LUMINANCE_FLOAT32
explicitely for floating point data in order to preserve floating point precision. If no red component is available in the format used (for example ALPHA texture...), the grid will be totally flat.
Each clipping surface texture must be stored in a different OpenGL texture unit. One that is not currently used by VolumeViz for multi-data composition (i.e., a texture unit number greater than the highest dataSetId plus 1). Setting the texture unit for a clipping surface is done using the SoTextureUnit
node, just like with any texture node.
The SoUniformGridProjectionClipping
node provides an alternate way to specify the clipping grid. This node may be more convenient when clipping using surface geometry that is already in the scene graph, for example an SoHeightFieldRender
node.
The figure below shows the result (right) of applying the left texture to a volume.
The thickness field expands the clipping surface in both directions perpendicular to the surface.The value of this field is specified in 0..1 normalized units spanning the specified extent of the surface. A completely flat clipping surface with thickness greater than zero can be used to implement "thick slice" (aka "thin slab") rendering. A transform node, for example
When using a custom Limitations:
Only graphics cards supporting the GLSL language can use this node.
The maximum number of
File format/default:
UniformGridClipping {
The following code shows one way to achieve this result. It loads the clipping surface "horizon2D.png" and puts it in texture unit 2:
Clipping surface Clipping applied to a volume
The uniform grid clipping node provides both clipAbove
and clipBelow
boolean fields. By default only clipAbove is true. Using a pair of grid clipping nodes, one with clipAbove and one with clipBelow, allows clipping between two surfaces. This is useful in seismic applications to clip between two "horizon" surfaces. Note that if both of these fields are true and the thickness field is zero then the entire volume will be clipped.
SoTransform
, can be used to position and orient the clipping surface. In this case the transform node and the clipping surface node should usually be placed under an SoTransformSeparator
node. This allows the surface to clip the volume primitives, but prevents the transform node from affecting the volume primitives. Remember that, as usual, the transform node will rotate the clipping surface around the origin (0,0,0) of the world coordinate system.
Notes:
Clipping surface thicknes
SoVolumeShader
with this node and redefining the
main() function, you must call
VVizClipVoxel() in the
main() function if you are writing a fragment shader or
VVizCalcDistToUniformGrid() if it's a vertex shader. If you don't do this, you will get a GLSL compilation error or clipping won't work.
SoUniformGridClipping
nodes that can be applied to the same volume is limited to getMaxNumberOfUniformGrids()
. This limitation depends on the maximum number of sets of OpenGL texture coordinates supported on the graphics board (GL_MAX_TEXTURE_COORDS), which is typically 8, minus 3 sets used elsewhere in VolumeViz, leaving 5 for uniform grids.
}
See also:
axis Y
extent -1,0,-1 1,1,1
filename ""
image 0 0 0
wrapS CLAMP_TO_EDGE
wrapT CLAMP_TO_EDGE
model MODULATE
enableCompressedTexture false
blendColor 0 0 0
enableBorder false
borderColor 0 0 0 0
maxAnisotropy 1.0
minFilter AUTO
magFilter AUTO
loadingMode AUTO
useAutoMipmap false
internalFormat AUTO_INTERNAL_FORMAT
thickness 0
clipBelow false
clipAbove true
SoVolumeRender
, SoPreferences
, SoShaderProgram
, SoTexture2
, SoTextureUnit
, SoVolumeClippingGroup
, SoVolumeIsosurface
, SoVolumeRenderingQuality
, SoUniformGridProjectionClipping
Modifier and Type | Class and Description |
---|---|
static class |
SoUniformGridClipping.AxisType
Slice Axis.
|
SoTexture2.Loadings
SoTexture.FileTypes, SoTexture.Filters, SoTexture.HW_Features, SoTexture.InternalFormats, SoTexture.Models, SoTexture.WrapType
Inventor.ConstructorCommand
Modifier and Type | Field and Description |
---|---|
SoSFEnum<SoUniformGridClipping.AxisType> |
axis
Height axis: X, Y, or Z.
|
SoSFBool |
clipAbove
Clip voxels above the surface.
|
SoSFBool |
clipBelow
Clip voxels below the surface.
|
SoSFBox3f |
extent
Bounding box of the surface in 3D geometric coordinates.
|
SoSFBox3f |
size
Deprecated.
As of Open Inventor 8.0, use
extent instead. |
SoSFFloat |
thickness
Defines a clipping thickness in the axis direction.
|
SoSFFloat |
undefinedValue
Texels in the clipping texture with this value will clip all voxels above and below the surface.
|
static int |
X
Deprecated.
Use
SoUniformGridClipping.AxisType.X instead. |
static int |
Y
Deprecated.
Use
SoUniformGridClipping.AxisType.Y instead. |
static int |
Z
Deprecated.
Use
SoUniformGridClipping.AxisType.Z instead. |
AUTO, filename, image, loadingMode, MANUAL, renderToTextureProperty, wrapT
ADD, ALPHA_FLOAT16, ALPHA_FLOAT32, ALPHA_FORMAT, ALPHA12, ALPHA16, ALPHA4, ALPHA8, AUTO_INTERNAL_FORMAT, BLEND, blendColor, BMP, borderColor, CLAMP, CLAMP_TO_BORDER, CLAMP_TO_EDGE, COMBINE, COMPRESSED_ALPHA, COMPRESSED_INTENSITY, COMPRESSED_LUMINANCE, COMPRESSED_LUMINANCE_ALPHA, COMPRESSED_LUMINANCE_ALPHA_LATC2, COMPRESSED_LUMINANCE_LATC1, COMPRESSED_RED_GREEN_RGTC2, COMPRESSED_RED_RGTC1, COMPRESSED_RGB, COMPRESSED_RGBA, COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2, COMPRESSED_SIGNED_LUMINANCE_LATC1, COMPRESSED_SIGNED_RED_GREEN_RGTC2, COMPRESSED_SIGNED_RED_RGTC1, DDS, DECAL, DEPTH_COMPONENT16, DEPTH_COMPONENT24, DEPTH24_STENCIL8, enableBorder, enableCompressedTexture, GIF, HDRI, HW_AUTOMIPMAP, HW_BORDER_CLAMP, HW_COMPRESSION_LATC, HW_COMPRESSION_RGTC, HW_COMPRESSION_S3TC, HW_DEPTHFORMAT, HW_EDGE_CLAMP, HW_FLOATFORMAT, HW_LAST, HW_MIRRORED_REPEAT, HW_NPOT, INTENSITY_FLOAT16, INTENSITY_FLOAT32, INTENSITY_FORMAT, INTENSITY12, INTENSITY16, INTENSITY4, INTENSITY8, internalFormat, JPEG, JPEG2000, LINEAR, LINEAR_MIPMAP_LINEAR, LINEAR_MIPMAP_NEAREST, LUMINANCE_ALPHA, LUMINANCE_ALPHA_FLOAT16, LUMINANCE_ALPHA_FLOAT32, LUMINANCE_FLOAT16, LUMINANCE_FLOAT32, LUMINANCE_FORMAT, LUMINANCE12, LUMINANCE12_ALPHA12, LUMINANCE12_ALPHA4, LUMINANCE16, LUMINANCE16_ALPHA16, LUMINANCE4, LUMINANCE4_ALPHA4, LUMINANCE6_ALPHA2, LUMINANCE8, LUMINANCE8_ALPHA8, magFilter, maxAnisotropy, minFilter, MIRRORED_REPEAT, model, MODULATE, NEAREST, NEAREST_MIPMAP_LINEAR, NEAREST_MIPMAP_NEAREST, NUM_FILETYPES, PGX, PNG, PNM, R3_G3_B2, RAS, REPEAT, REPLACE, RGB, RGB_FLOAT16, RGB_FLOAT32, RGB_FORMAT, RGB10, RGB10_ALPHA2, RGB12, RGB16, RGB4, RGB5, RGB5_ALPHA1, RGB8, RGBA_FLOAT16, RGBA_FLOAT32, RGBA_FORMAT, RGBA12, RGBA16, RGBA2, RGBA4, RGBA8, SGI, TIFF, UNKNOWN, useAutoMipmap, wrapS
VERBOSE_LEVEL, ZeroHandle
Constructor and Description |
---|
SoUniformGridClipping()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static int |
getMaxNumberOfUniformGrids()
Calls getMaxNumberOfUniformGrids((com.openinventor.inventor.misc.SoState)null).
|
static int |
getMaxNumberOfUniformGrids(SoState state)
Returns the maximum number of clipping surfaces supported by the hardware.
|
static boolean |
isSupported()
Calls isSupported((com.openinventor.inventor.misc.SoState)null).
|
static boolean |
isSupported(SoState state)
Returns true if uniform grid clipping is supported by the graphics board.
|
loadTexture
getBitmapFileType, isSupported, setBitmapFileType
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, 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, getEXTERNPROTO, getName, getPROTO, isDisposable, isSynchronizable, setName, setSynchronizable
getAddress, getNativeResourceHandle, startInternalThreads, stopInternalThreads
@Deprecated public final SoSFBox3f size
extent
instead.@Deprecated public static final int X
SoUniformGridClipping.AxisType.X
instead.@Deprecated public static final int Y
SoUniformGridClipping.AxisType.Y
instead.@Deprecated public static final int Z
SoUniformGridClipping.AxisType.Z
instead.public final SoSFBox3f extent
public final SoSFEnum<SoUniformGridClipping.AxisType> axis
public final SoSFFloat thickness
Value is in the normalized extent
space (can be seen as a percentage of the extent).
Notes:
SoUniformGridClipping
is smaller than the extent of the volume data it applies to.
public final SoSFBool clipBelow
public final SoSFBool clipAbove
public final SoSFFloat undefinedValue
public static int getMaxNumberOfUniformGrids()
public static boolean isSupported()
public static boolean isSupported(SoState state)
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.
public static int getMaxNumberOfUniformGrids(SoState state)
Generated on January 23, 2025, Copyright © Thermo Fisher Scientific. All rights reserved. http://www.openinventor.com