SoUniformGridClipping Class |
Clips a volume using a 2D surface.
Namespace: OIV.VolumeViz.Nodes
The SoUniformGridClipping type exposes the following members.
Name | Description | |
---|---|---|
SoUniformGridClipping | Constructor. |
Name | Description | |
---|---|---|
AffectsState | Returns true if a node has an effect on the state during traversal. | |
AllowPrequalifyFile | (Inherited from SoTexture2.) | |
Callback | (Inherited from SoTexture2.) | |
Copy | Calls Copy(false). (Inherited from SoNode.) | |
Copy(Boolean) | Creates and returns an exact copy of the node. | |
CopyFieldValues(SoFieldContainer) | Calls CopyFieldValues(fc, false). (Inherited from SoFieldContainer.) | |
CopyFieldValues(SoFieldContainer, Boolean) | Copies the contents of fc's fields into this object's fields. | |
Dispose |
Releases all resources used by SoDisposable.
(Inherited from SoDisposable.) | |
Distribute | (Inherited from SoNode.) | |
DoAction | (Overrides SoTexture2DoAction(SoAction).) | |
DoActionOnRTT | (Overrides SoTexture2DoActionOnRTT(SoAction).) | |
EnableNotify | Notification at this Field Container is enabled (if flag == true) or disabled (if flag == false). | |
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
FieldsAreEqual | Returns true if this object's fields are exactly equal to fc's fields. | |
Get | Returns the values of the fields of this object in the Open Inventor ASCII file format in the given string. | |
GetAllFields | Returns a list of fields, including the eventIn's and eventOut's. | |
GetAlternateRep | This method is called by actions to allow the node to provide an "alternate representation" when appropriate (typically depending on the action type). | |
GetBitmapFileType | Gets the texture file format. | |
GetBoundingBox | (Overrides SoNodeGetBoundingBox(SoGetBoundingBoxAction).) | |
GetEventIn | Returns a the eventIn with the given name. | |
GetEventOut | Returns the eventOut with the given name. | |
GetField | Returns a the field of this object whose name is fieldName. | |
GetFieldName | Returns the name of the given field in the fieldName argument. | |
GetFields | Appends references to all of this object's fields to resultList, and returns the number of fields appended. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetMatrix | (Inherited from SoNode.) | |
GetMaxNumberOfUniformGrids | Calls GetMaxNumberOfUniformGrids((OIV.Inventor.Misc.SoState ^)nullptr). | |
GetMaxNumberOfUniformGrids(SoState) | Returns the maximum number of clipping surfaces supported by the hardware. | |
GetName | Returns the name of an instance. | |
GetPrimitiveCount | (Inherited from SoNode.) | |
GetRenderEngineMode | Returns the supported Render engine mode. | |
GetRenderUnitID | (Inherited from SoNode.) | |
GetStringName | (Inherited from SoBase.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GLRender | (Overrides SoTexture2GLRender(SoGLRenderAction).) | |
GLRenderBelowPath | (Inherited from SoNode.) | |
GLRenderInPath | (Inherited from SoNode.) | |
GLRenderOffPath | (Inherited from SoNode.) | |
GrabEventsCleanup | (Inherited from SoNode.) | |
GrabEventsSetup | (Inherited from SoNode.) | |
HandleEvent | (Inherited from SoNode.) | |
HasDefaultValues | Returns true if all of the object's fields have their default values. | |
IsAllowPrequalifyFile | (Inherited from SoTexture2.) | |
IsBoundingBoxIgnoring | 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. | |
IsNotifyEnabled | Notification is the process of telling interested objects that this object has changed. | |
IsOverride | Returns the state of the override field. | |
IsSupported | Calls IsSupported((OIV.Inventor.Misc.SoState ^)nullptr). | |
IsSupported(SoState) | Returns true if uniform grid clipping is supported by the graphics board. | |
IsSynchronizable | Gets the ScaleViz synchronizable state of this object. | |
LoadTexture | Loads the texture if the OIV.Inventor.Nodes.SoTexture2.loadingMode field is set to MANUAL. | |
Pick | (Inherited from SoNode.) | |
RayPick | (Overrides SoNodeRayPick(SoRayPickAction).) | |
Search | (Inherited from SoNode.) | |
Set | 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. | |
SetBitmapFileType | Sets the texture file format. | |
SetName | (Inherited from SoBase.) | |
SetOverride | Set the state of the override field. | |
SetSynchronizable | Sets this to be a ScaleViz synchronizable object. | |
SetToDefaults | Sets all fields in this object to their default values. | |
ToString |
Converts this SoBase structure to a human readable string.
(Inherited from SoBase.) | |
Touch | Marks an instance as modified, simulating a change to it. | |
Write | (Inherited from SoNode.) |
Name | Description | |
---|---|---|
axis | Height axis: X, Y, or Z. | |
blendColor | Color used for BLEND model. | |
borderColor | Defines border color used for border texture filtering. | |
clipAbove | Clip voxels above the surface. | |
clipBelow | Clip voxels below the surface. | |
enableBorder | Enables borders for textures. | |
enableCompressedTexture | Enables storage of textures on the graphics board in compressed form. | |
extent | Bounding box of the surface in 3D geometric coordinates. | |
filename | Name of the file from which to read texture image. | |
FinishLoadingCallback | Callback invoked when the texture is loaded and ready to use. | |
image | Contains an in-memory representation of the texture map. | |
internalFormat | Internal format for texture storage. | |
IsDisposable | ISafeDisposable interface implementation.
(Inherited from SoDisposable.) | |
loadingMode | Specifies the loading mode. | |
magFilter | Specifies the OpenGL magFilter. | |
maxAnisotropy | Specifies on a per-texture object basis, the maximum degree of anisotropy to account for in texture filtering. | |
minFilter | Specifies the OpenGL minFilter. | |
model | Specifies how to map texture onto surface. | |
renderToTextureProperty | Specifies an OIV.Inventor.Nodes.SoRenderToTextureProperty node containing a scene graph that will be rendered to create the texture image. | |
size | Obsolete. | |
StartLoadingCallback | Callback invoked when starting to load the texture. | |
thickness | Defines a clipping thickness in the axis direction. | |
undefinedValue | Texels in the clipping texture with this value will clip all voxels above and below the surface. | |
UserData |
Gets or sets the user data to be contained by the field container.
(Inherited from SoFieldContainer.) | |
wrapS | Indicates what to do when texture coordinates in the S (horizontal) direction lie outside the range 0-1. | |
wrapT | Indicates what to do when texture coordinates in the T (vertical) direction lie outside the range 0-1. |
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 |
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 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.
Limitations:
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 |
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 |