SIMVoleon  2.1.0
Coin3D volume rendering library
Loading...
Searching...
No Matches
SoVolumeRender Class Reference

Render the full volume. More...

#include <VolumeViz/nodes/SoVolumeRender.h>

Inheritance diagram for SoVolumeRender:
SoShape

Public Types

enum  AbortCode { CONTINUE , ABORT , SKIP }
 
enum  Composition { MAX_INTENSITY , SUM_INTENSITY , ALPHA_BLENDING }
 
enum  Interpolation { NEAREST , LINEAR }
 
enum  NumSlicesControl { ALL , MANUAL , AUTOMATIC }
 
typedef AbortCode SoVolumeRenderAbortCB(int totalslices, int thisslice, void *userdata)
 

Public Member Functions

void setAbortCallback (SoVolumeRenderAbortCB *func, void *userdata=NULL)
 

Static Public Member Functions

static void initClass (void)
 

Public Attributes

SoSFEnum composition
 
SoSFEnum interpolation
 
SoSFVec3f lightDirection
 
SoSFBool lighting
 
SoSFFloat lightIntensity
 
SoSFInt32 numSlices
 
SoSFEnum numSlicesControl
 
SoSFBool viewAlignedSlices
 

Protected Member Functions

virtual void computeBBox (SoAction *action, SbBox3f &box, SbVec3f &center)
 
virtual void generatePrimitives (SoAction *action)
 
virtual void GLRender (SoGLRenderAction *action)
 
virtual void rayPick (SoRayPickAction *action)
 

Detailed Description

Render the full volume.

Insert a node of this type after an SoVolumeData node in the scene graph to render the full volume data set.

See also
SoOrthoSlice, SoObliqueSlice, SoVolumeFaceSet, SoVolumeIndexedFaceSet
SoVolumeTriangleStripSet, SoVolumeIndexedTriangleStripSet

Member Typedef Documentation

◆ SoVolumeRenderAbortCB

AbortCode SoVolumeRender::SoVolumeRenderAbortCB

The function signature for callback function pointers to be passed in to SoVolumeRender::setAbortCallback().

totalslices is the total number of textured slices that is expected to be rendered, unless the callback choose to abort or skip any of them.

thisslice is the index number of the next slice to render. Note that they are rendered back-to-front, and that they are numbered from 1 to totalslices.

userdata is the second argument given to SoVolumeRender::setAbortCallback() when the callback was set up.

Member Enumeration Documentation

◆ AbortCode

The set of valid values that should be returned from a function set up in SoVolumeRender::setAbortCallback().

Enumerator
CONTINUE 

Continue rendering in the usual manner.

ABORT 

Don't render any more textured slices of the volume.

SKIP 

Skip the next textured slice, and resume rendering on the next after that. (The abort callback function will still be called again.)

◆ Composition

Enumeration of available types of composition for partly translucent volumes.

Enumerator
MAX_INTENSITY 

For each on-screen projected pixel, the voxel with the highest alpha intensity along that projection ray will be rendered.

This is for instance useful in medical imaging as a contrast enhancing operator for visualizing blood-flows.

Note that the availability of this composition mode for rendering with 2D- and 3D-texture slices will be dependent on features of the underlying rendering library.

(Specifically, the OpenGL driver must support glBlendEquation(), which is part of the optional "imaging" API-subset of OpenGL version 1.2 and later.)

SUM_INTENSITY 

For each on-screen projected pixel, the intensity of all voxels along that projection ray will be summed up before rendering.

This gives an appearance similar to medical X-ray images. The blending function is known as the "attenuate" operator.

Note that the availability of this composition mode for rendering with 2D- and 3D-texture slices will be dependent on features of the underlying rendering library.

(Specifically, the OpenGL driver must support glBlendEquation(), which is part of the optional "imaging" API-subset of OpenGL version 1.2 and later.)

ALPHA_BLENDING 

Composes volume by rendering voxels with higher opacity such that they progressively obscures voxels behind them.

This is an approximation of the visual appearance of the penetration and reflection of light through a transparent material.

The blending function for this is known as the "over" operator.

◆ Interpolation

Enumeration of available types of voxel color interpolation.

Enumerator
NEAREST 

For "in between" pixels of the screen rasterization, pick the color of the nearest voxel. Will give sharp edges and a distinct blocky look.

LINEAR 

For "in between" pixels of the screen rasterization, interpolate by averaging the colors of several of the nearest voxels. Will give a smoother appearance, but sacrifies some "correctness" for appearance.

◆ NumSlicesControl

Enumeration of strategies for how to render the slices of the volume.

Enumerator
ALL 

Always render as many slices as there are voxels in the depth dimension. This is the default value.

Please note that SoVolumeRender::NumSlicesControl will always be considered as SoVolumeRender::ALL if the SoVolumeRender::numSlices field is less or equal to 0.

MANUAL 

Render as many slices as given by the SoVolumeRender::numSlices field.

AUTOMATIC 

The number of slices to render will be calculated as follows:

unsigned int numslices = complexity * 2.0f * this->numSlices;
SoSFInt32 numSlices
Definition SoVolumeRender.h:72

Where "complexity" is the current SoComplexity::value setting in the scene graph traversal state. The default complexity value for a scene graph with no SoComplexity node(s) is 0.5.

For "this->numSlices", see SoVolumeRender::numSlices.

Member Function Documentation

◆ rayPick()

void SoVolumeRender::rayPick ( SoRayPickAction * action)
protectedvirtual

Picking of a volume doesn't work in quite the same manner as picking polygon geometry: the SoPickedPoint set up in the SoRayPickAction class will only contain the entry point of the ray into the volume.

For further picking information, grab the detail object and cast it to an SoVolumeRenderDetail (after first checking that it is of this type, of course).

◆ setAbortCallback()

void SoVolumeRender::setAbortCallback ( SoVolumeRenderAbortCB * func,
void * userdata = NULL )

Lets the application programmer supply a callback function, by which it will be possible to either prematurely abort the rendering of a set of slices, or to skip certain slices.

Both of these measures are of course optimizations of rendering performance controlled from client code.

Member Data Documentation

◆ composition

SoSFEnum SoVolumeRender::composition

How to compose the projected volume rendering. See SoVolumeRender::Composition.

Default value is SoVolumeRender::ALPHA_BLENDING.

◆ interpolation

SoSFEnum SoVolumeRender::interpolation

How to interpolate color values when rendering "in between" voxels. See SoVolumeRender::Interpolation.

Default value is SoVolumeRender::LINEAR.

◆ numSlices

SoSFInt32 SoVolumeRender::numSlices

Decides how many slices to render if SoVolumeRender::numSlicesControl is set to either SoVolumeRender::MANUAL or SoVolumeRender::AUTOMATIC.

For MANUAL, it sets an absolute number. For AUTOMATIC, a calculation will be done based on the value of this field and the current SoComplexity::value setting in the scene graph traversal state.

Note that the default value of the field is 0.

◆ numSlicesControl

SoSFEnum SoVolumeRender::numSlicesControl

Specifies a strategy to use for calculating the number of slices to use for the visualization. The more slices, the better quality and more correct the visualization will be, but the trade-off is that it will also influence the rendering performance.

The default value is SoVolumeRender::ALL.

(The rendering performance can be severely improved by changing this field's value to either SoVolumeRender::MANUAL or SoVolumeRender::AUTOMATIC, and then tuning the SoVolumeRender::numSlices field.)


The documentation for this class was generated from the following files: