Click or drag to resize
SoUniformGridClipping Class

Clips a volume using a 2D surface.

Inheritance Hierarchy

Namespace: OIV.VolumeViz.Nodes
Assembly: OIV.VolumeViz (in OIV.VolumeViz.dll) Version: 2023.2.0.0 (2023.2.0)
public class SoUniformGridClipping : SoTexture2

The SoUniformGridClipping type exposes the following members.

Public methodSoUniformGridClipping


Public methodAffectsState

Returns true if a node has an effect on the state during traversal.

(Inherited from SoNode.)
Public methodAllowPrequalifyFile
(Inherited from SoTexture2.)
Public methodCallback
(Inherited from SoTexture2.)
Public methodCopy
Calls Copy(false).
(Inherited from SoNode.)
Public methodCopy(Boolean)

Creates and returns an exact copy of the node.

(Inherited from SoNode.)
Public methodCopyFieldValues(SoFieldContainer)
Calls CopyFieldValues(fc, false).
(Inherited from SoFieldContainer.)
Public methodCopyFieldValues(SoFieldContainer, Boolean)

Copies the contents of fc's fields into this object's fields.

(Inherited from SoFieldContainer.)
Public methodDispose
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.)
Public methodDistribute
(Inherited from SoNode.)
Public methodDoAction
Public methodDoActionOnRTT
Public methodEnableNotify

Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false).

(Inherited from SoFieldContainer.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodFieldsAreEqual

Returns true if this object's fields are exactly equal to fc's fields.

(Inherited from SoFieldContainer.)
Public methodGet

Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string.

(Inherited from SoFieldContainer.)
Public methodGetAllFields

Returns a list of fields, including the eventIn's and eventOut's.

(Inherited from SoFieldContainer.)
Public methodGetAlternateRep

This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type).

(Inherited from SoNode.)
Public methodGetBitmapFileType

Gets the texture file format.

(Inherited from SoTexture.)
Public methodGetBoundingBox
Public methodGetEventIn

Returns a the eventIn with the given name.

(Inherited from SoFieldContainer.)
Public methodGetEventOut

Returns the eventOut with the given name.

(Inherited from SoFieldContainer.)
Public methodGetField

Returns a the field of this object whose name is fieldName.

(Inherited from SoFieldContainer.)
Public methodGetFieldName

Returns the name of the given field in the fieldName argument.

(Inherited from SoFieldContainer.)
Public methodGetFields

Appends references to all of this object's fields to resultList, and returns the number of fields appended.

(Inherited from SoFieldContainer.)
Public methodGetHashCode
Overrides GetHashCode().
(Inherited from SoNetBase.)
Public methodGetMatrix
(Inherited from SoNode.)
Public methodStatic memberGetMaxNumberOfUniformGrids
Calls GetMaxNumberOfUniformGrids((OIV.Inventor.Misc.SoState ^)nullptr).
Public methodStatic memberGetMaxNumberOfUniformGrids(SoState)

Returns the maximum number of clipping surfaces supported by the hardware.

Public methodGetName

Returns the name of an instance.

(Inherited from SoBase.)
Public methodGetPrimitiveCount
(Inherited from SoNode.)
Public methodGetRenderEngineMode

Returns the supported Render engine mode.

(Inherited from SoNode.)
Public methodGetRenderUnitID
(Inherited from SoNode.)
Public methodGetStringName (Inherited from SoBase.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGLRender
Public methodGLRenderBelowPath
(Inherited from SoNode.)
Public methodGLRenderInPath
(Inherited from SoNode.)
Public methodGLRenderOffPath
(Inherited from SoNode.)
Public methodGrabEventsCleanup
(Inherited from SoNode.)
Public methodGrabEventsSetup
(Inherited from SoNode.)
Public methodHandleEvent
(Inherited from SoNode.)
Public methodHasDefaultValues

Returns true if all of the object's fields have their default values.

(Inherited from SoFieldContainer.)
Public methodIsAllowPrequalifyFile
(Inherited from SoTexture2.)
Public methodIsBoundingBoxIgnoring

This method is used by getBoundingBox action traversal to know if the current node must be traversed or not, ie the bounding should be ignored.

(Inherited from SoNode.)
Public methodIsNotifyEnabled

Notification is the process of telling interested objects that this object has changed.

(Inherited from SoFieldContainer.)
Public methodIsOverride

Returns the state of the override field.

(Inherited from SoTexture.)
Public methodStatic memberIsSupported
Calls IsSupported((OIV.Inventor.Misc.SoState ^)nullptr).
Public methodStatic memberIsSupported(SoState)

Returns true if uniform grid clipping is supported by the graphics board.

Public methodIsSynchronizable

Gets the ScaleViz synchronizable state of this object.

(Inherited from SoBase.)
Public methodLoadTexture

Loads the texture if the OIV.Inventor.Nodes.SoTexture2.loadingMode field is set to MANUAL.

(Inherited from SoTexture2.)
Public methodPick
(Inherited from SoNode.)
Public methodRayPick
Public methodSearch
(Inherited from SoNode.)
Public methodSet

Sets one or more fields in this object to the values specified in the given string, which should be a string in the Open Inventor file format.

(Inherited from SoFieldContainer.)
Public methodSetBitmapFileType

Sets the texture file format.

(Inherited from SoTexture.)
Public methodSetName (Inherited from SoBase.)
Public methodSetOverride

Set the state of the override field.

(Inherited from SoTexture.)
Public methodSetSynchronizable

Sets this to be a ScaleViz synchronizable object.

(Inherited from SoBase.)
Public methodSetToDefaults

Sets all fields in this object to their default values.

(Inherited from SoFieldContainer.)
Public methodToString
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.)
Public methodTouch

Marks an instance as modified, simulating a change to it.

(Inherited from SoNode.)
Public methodWrite
(Inherited from SoNode.)
Public propertyaxis

Height axis: X, Y, or Z.

Public propertyblendColor

Color used for BLEND model.

(Inherited from SoTexture.)
Public propertyborderColor

Defines border color used for border texture filtering.

(Inherited from SoTexture.)
Public propertyclipAbove

Clip voxels above the surface.

Public propertyclipBelow

Clip voxels below the surface.

Public propertyenableBorder

Enables borders for textures.

(Inherited from SoTexture.)
Public propertyenableCompressedTexture

Enables storage of textures on the graphics board in compressed form.

(Inherited from SoTexture.)
Public propertyextent

Bounding box of the surface in 3D geometric coordinates.

Public propertyfilename

Name of the file from which to read texture image.

(Inherited from SoTexture2.)
Public propertyFinishLoadingCallback

Callback invoked when the texture is loaded and ready to use.

(Inherited from SoTexture2.)
Public propertyimage

Contains an in-memory representation of the texture map.

(Inherited from SoTexture2.)
Public propertyinternalFormat

Internal format for texture storage.

(Inherited from SoTexture.)
Public propertyIsDisposable
ISafeDisposable interface implementation.
(Inherited from SoDisposable.)
Public propertyloadingMode

Specifies the loading mode.

(Inherited from SoTexture2.)
Public propertymagFilter

Specifies the OpenGL magFilter.

(Inherited from SoTexture.)
Public propertymaxAnisotropy

Specifies on a per-texture object basis, the maximum degree of anisotropy to account for in texture filtering.

(Inherited from SoTexture.)
Public propertyminFilter

Specifies the OpenGL minFilter.

(Inherited from SoTexture.)
Public propertymodel

Specifies how to map texture onto surface.

(Inherited from SoTexture.)
Public propertyrenderToTextureProperty

Specifies an OIV.Inventor.Nodes.SoRenderToTextureProperty node containing a scene graph that will be rendered to create the texture image.

(Inherited from SoTexture2.)
Public propertysize Obsolete.
Public propertyStartLoadingCallback

Callback invoked when starting to load the texture.

(Inherited from SoTexture2.)
Public propertythickness

Defines a clipping thickness in the axis direction.

Public propertyundefinedValue

Texels in the clipping texture with this value will clip all voxels above and below the surface.

Public propertyUserData
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.)
Public propertywrapS

Indicates what to do when texture coordinates in the S (horizontal) direction lie outside the range 0-1.

(Inherited from SoTexture.)
Public propertywrapT

Indicates what to do when texture coordinates in the T (vertical) direction lie outside the range 0-1.

(Inherited from SoTexture2.)

The OIV.VolumeViz.Nodes.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 OIV.VolumeViz.Nodes.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 OIV.VolumeViz.Nodes.SoHeightFieldGeometry node. However for float valued textures it is quite different because the OIV.VolumeViz.Nodes.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.

OIV.VolumeViz.Nodes.SoUniformGridClipping is derived from OIV.Inventor.Nodes.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 OIV.Inventor.Nodes.SoTexture.InternalFormats.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 OIV.Inventor.Nodes.SoTextureUnit node, just like with any texture node.

The OIV.VolumeViz.Nodes.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 OIV.VolumeViz.Nodes.SoHeightFieldRender node.

The figure below shows the result (right) of applying the left texture to a volume.

Clipping surface Clipping applied to a volume

The following code shows one way to achieve this result. It loads the clipping surface "horizon2D.png" and puts it in texture unit 2:

SoTextureUnit texUnit2 = new SoTextureUnit();
 texUnit2.unit.Value = 2;

SoUniformGridClipping grid = new SoUniformGridClipping();
 grid.filename.Value = "horizon2D.png";

SoSeparator volSep = new SoSeparator();
 volSep.AddChild( volumeData );
 volSep.AddChild( transferFunction );
 volSep.AddChild( texUnit2 );
 volSep.AddChild( grid );
 volSep.AddChild( volumeRender );
root.AddChild( volSep );

The uniform grid clipping node provides both OIV.VolumeViz.Nodes.SoUniformGridClipping.clipAbove and OIV.VolumeViz.Nodes.SoUniformGridClipping.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.

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 OIV.Inventor.Nodes.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 OIV.Inventor.Nodes.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.

Clipping surface thicknes

  • When using a custom OIV.VolumeViz.Nodes.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.


  • Only graphics cards supporting the GLSL language can use this node.

  • The maximum number of OIV.VolumeViz.Nodes.SoUniformGridClipping nodes that can be applied to the same volume is limited to OIV.VolumeViz.Nodes.SoUniformGridClipping.GetMaxNumberOfUniformGrids(OIV.Inventor.Misc.SoState). 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.


UniformGridClipping {
axis Y
extent -1,0,-1 1,1,1
filename ""
image 0 0 0
enableCompressedTexture false
blendColor 0 0 0
enableBorder false
borderColor 0 0 0 0
maxAnisotropy 1.0
minFilter AUTO
magFilter AUTO
loadingMode AUTO
useAutoMipmap false
thickness 0
clipBelow false
clipAbove true

See Also