Coin Logo Coin3D is Free Software,
published under the BSD 3-clause license.
https://bitbucket.org/Coin3D/
http://www.kongsberg.com/kogt/
SoTransferFunction Class Reference

Contains the transfer function definition. More...

#include <VolumeViz/nodes/SoTransferFunction.h>

Inheritance diagram for SoTransferFunction:
SoVolumeRendering

Public Types

enum  PredefColorMap {
  NONE = 0, GREY, GRAY = GREY, TEMPERATURE,
  PHYSICS, STANDARD, GLOW, BLUE_RED,
  SEISMIC
}
 
enum  ColorMapType { ALPHA, LUM_ALPHA, RGBA }
 
- Public Types inherited from SoVolumeRendering
enum  HW_Feature { HW_VOLUMEPRO, HW_3DTEXMAP, HW_TEXCOLORMAP, HW_TEXCOMPRESSION }
 
enum  HW_SupportStatus { NO, YES, UNKNOWN }
 

Public Member Functions

void reMap (int low, int high)
 
SbBool hasTransparency (void) const
 
- Public Member Functions inherited from SoVolumeRendering
HW_SupportStatus isSupported (HW_Feature feature)
 

Static Public Member Functions

static void initClass (void)
 
- Static Public Member Functions inherited from SoVolumeRendering
static void init (void)
 
static void initClass (void)
 
static void setReadAlternateRep (SbBool flag)
 
static void setWriteAlternateRep (SbBool flag)
 
static SbBool getReadAlternateRep (void)
 
static SbBool getWriteAlternateRep (void)
 
static void setDelayedRendering (SbBool flag)
 
static SbBool getDelayedRendering (void)
 

Public Attributes

SoSFInt32 shift
 
SoSFInt32 offset
 
SoSFEnum predefColorMap
 
SoSFEnum colorMapType
 
SoMFFloat colorMap
 

Protected Member Functions

virtual void doAction (SoAction *action)
 
virtual void GLRender (SoGLRenderAction *action)
 
virtual void callback (SoCallbackAction *action)
 
virtual void pick (SoPickAction *action)
 

Friends

class SoTransferFunctionP
 

Detailed Description

Contains the transfer function definition.

This node sets up the mapping from voxel data values to actual on-screen color values and transparency / opaqueness.

It has a set of pre-defined color maps, commonly used in e.g. seismic visualization, and the option to set up one's own free-form color map lookup table (by setting SoTransferFunction::predefColorMap to NONE).

Member Enumeration Documentation

◆ PredefColorMap

Predefined color transfer functions, each containing exactly 256 colors.

Enumerator
NONE 

If this is set, the SoTransferFunction::colorMap field must be used.

GREY 

Default transfer function color map. The checker board indicates that this gradient is partly transparent.

GRAY 

Same as GREY.

TEMPERATURE 

This gradient is fully opaque.

PHYSICS 

This gradient is fully opaque.

STANDARD 

This gradient is fully opaque.

GLOW 

This gradient is fully opaque.

BLUE_RED 

This gradient is fully opaque.

SEISMIC 

This gradient is partly transparent.

◆ ColorMapType

Type of colormap array. Defines the possible values for the SoTransferFunction::colorMapType field.

Enumerator
ALPHA 

Each color entry in the transfer function has only one component, so the SoTransferFunction::colorMap field should consist of exactly 256 float values, each value representing a transparency value. The RGB colors will all be set to [1,1,1], i.e. all white.

LUM_ALPHA 

Each transfer function color map entry in SoTransferFunction::colorMap has two components, ie. two floats, so the field should contain exactly 256*2 = 512 values. The first float value of each pair is taken to be an intensity / grey color value, and the second float of each pair is a transparency value (as for the ALPHA enum).

RGBA 

Four floats are used to specify each color of the transfer function. SoTransferFunction::colorMap should consist of exactly 256*4 = 1024 float values. Each quadruple consist of intensity values for red, green, and blue, and then the fourth value is an alpha value, as for LUM_ALPHA and ALPHA.

Member Function Documentation

◆ reMap()

void SoTransferFunction::reMap ( int  low,
int  high 
)

Set two thresholds, where all transfer function mappings that ends up below the low value or above the high value are set to be completely transparent.

Initial default values are [0, 65535].

Member Data Documentation

◆ shift

SoSFInt32 SoTransferFunction::shift

Used to shift the voxel attribute value before assigning a color value from the transfer function color map. In pseudo-code:

colorvalue = transferfunction[(voxelvalue << shift) + offset]

(offset is the value of the SoTransferFunction::offset field.)

◆ offset

SoSFInt32 SoTransferFunction::offset

See the SoTransferFunction::shift field.

◆ predefColorMap

SoSFEnum SoTransferFunction::predefColorMap

Sets up the transfer function to use. See SoTransferFunction::PredefColorMap for a list of the pre-defined color maps.

Note that most of the pre-defined color maps are all opaque, even for data value 0. This will often cause the unwanted behavior that the full data set will be completely opaque for visualization, so only the outer "walls" of the volume are shown. To avoid this, use the SoTransferFunction::reMap() method to "narrow" the data values that are to be rendered according to the transfer function (all values outside of the given range will then be fully transparent).

The value SoTransferFunction::NONE has special meaning: it signifies that none of the pre-defined values should be used, but that the transfer function color map should be fetched from the SoTransferFunction::colorMap field instead.

◆ colorMapType

SoSFEnum SoTransferFunction::colorMapType

This field specifies how the SoTransferFunction::colorMap field should be interpreted when SoTransferFunction::predefColorMap is set to SoTransferFunction::NONE.

(Note that it will not have any effect when SoTransferFunction::predefColorMap is set to any of the actual pre-defined transfer function color maps, i.e. not equal to NONE.)

See SoTransferFunction::ColorMapType for what possible values this field can have, and their semantics.

◆ colorMap

SoMFFloat SoTransferFunction::colorMap

An array of floats describing the transfer function. Each value must be normalized to be within [0.0, 1.0] for the intensity value of a color, or the alpha value for transparency.

The array must contain 256 colors. The number of floats needed in the array for each color depends on the SoTransferFunction::ColorMapType setting.


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