cee::ug::ColorMapper Class Reference

Controlling the color mapping and the color setup of the legend. More...

Public Types

enum  ColorScheme {
  NORMAL, NORMAL_INVERTED, BLACK_TO_WHITE, WHITE_TO_BLACK,
  GREEN_TO_BROWN, WHITE_TO_BROWN, METAL_CASTING, BLUE_TO_WHITE_TO_RED,
  THERMAL_1, THERMAL_2, THERMAL_3, CUSTOM
}
 Color scheme used for the color mapper. More...
 
enum  MappingType { FILLED_CONTOURS_UNIFORM, FILLED_CONTOURS, CONTINUOUS }
 MappingType of color mapper. More...
 

Public Member Functions

MappingType type () const
 Returns the type of the current color mapper. More...
 
void setTypeFilledContoursUniform (unsigned int numColors)
 Sets the color mapping to filled contours with uniformly distributed levels. More...
 
void setTypeFilledContours (const std::vector< double > &values)
 Sets the color mapping to filled contours with the provided level values. More...
 
void setTypeContinuous ()
 Sets color mapping to continuous. More...
 
ColorScheme colorScheme () const
 Returns the current color scheme for this scalar result. More...
 
void setColorScheme (ColorScheme scheme)
 Sets the coloring scheme to use for the color legend. More...
 
Color3f aboveRangeColor () const
 Returns the current above range color. More...
 
void setAboveRangeColor (const Color3f &aboveColor)
 Sets the color of all values above the current range of the scalar settings/color legend. More...
 
bool isAboveRangeMaskingEnabled () const
 Returns if the above range parts of the model should be rendered (default) or not. More...
 
void enableAboveRangeMasking (bool enableMasking)
 Sets if the above range parts of the model should be rendered (default) or not. More...
 
Color3f belowRangeColor () const
 Returns the current below range color. More...
 
void setBelowRangeColor (const Color3f &belowColor)
 Sets the color of all values below the current range of the scalar settings/color legend. More...
 
bool isBelowRangeMaskingEnabled () const
 Returns if the below range parts of the model should be rendered (default) or not. More...
 
void enableBelowRangeMasking (bool enableMasking)
 Sets if the below range parts of the model should be rendered (default) or not. More...
 
Color3f undefinedColor () const
 Returns the color that will be used for undefined values (cee::UNDEFINED_DOUBLE). More...
 
void setUndefinedColor (const Color3f &undefinedColor)
 Sets the color to use for undefined values (cee::UNDEFINED_DOUBLE). More...
 
bool isUndefinedMaskingEnabled () const
 Returns if the undefined parts of the model should be rendered (default) or not. More...
 
void enableUndefinedMasking (bool enableMasking)
 Sets if the undefined parts of the model should be rendered (default) or not. More...
 
void setTextureSize (unsigned int textureSize)
 Sets the maximum texture size to use. More...
 
unsigned int numberOfFilledContoursColors () const
 Returns the number of discrete colors used when mapping scalars as filled contours. More...
 
std::vector< Color3ffilledContoursColors () const
 Returns the array of colors for the custom filled contour levels. More...
 
std::vector< double > filledContoursLevelValues () const
 Returns an array with the level values for filled contours modes. More...
 
void setCustomFilledContoursColors (const std::vector< Color3f > &levelColors)
 Sets custom color scheme for filled contours uniform legends. More...
 
std::vector< double > customContinuousValues () const
 Returns the array of values for a custom continuous color mapper. More...
 
std::vector< Color3fcustomContinuousColors () const
 Returns the array of colors for a custom continuous color mapper. More...
 
void setCustomContinuousColorsAtValues (const std::vector< double > &values, const std::vector< Color3f > &colorAtValues)
 Sets custom color scheme for a continuous color legend. More...
 
std::vector< double > customContinuousTickMarks () const
 Returns the custom tick mark values for continuous mapping type. More...
 
void setCustomContinuousTickMarks (const std::vector< double > &tickMarkValues)
 Sets the custom tick mark values for continuous mapper. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 
Inheritance diagram for cee::ug::ColorMapper:
cee::RefCountedObject

Detailed Description

Controlling the color mapping and the color setup of the legend.

See also
ScalarSettings
ModelSpec
UnstructGridModel

Member Enumeration Documentation

Color scheme used for the color mapper.

Enumerator
NORMAL 

Normal.

NORMAL_INVERTED 

Normal inverted.

BLACK_TO_WHITE 

Black to white.

WHITE_TO_BLACK 

White to black.

GREEN_TO_BROWN 

Green to brown.

WHITE_TO_BROWN 

White to brown.

METAL_CASTING 

Metal casting.

BLUE_TO_WHITE_TO_RED 

Blue to white to red.

THERMAL_1 

Thermal 1.

THERMAL_2 

Thermal 2.

THERMAL_3 

Thermal 3.

CUSTOM 

Custom.

MappingType of color mapper.

Enumerator
FILLED_CONTOURS_UNIFORM 

Filled contours color mapping, discrete mapping with uniform size for the legend levels.

FILLED_CONTOURS 

Filled contours color mapping, customized level values for each level.

CONTINUOUS 

Color mapping using a continuous legend.

Member Function Documentation

cee::Color3f cee::ug::ColorMapper::aboveRangeColor ( ) const

Returns the current above range color.

This color can be set by setAboveRangeColor() but will be reset to follow the color legend when using the setColorScheme() method.

cee::Color3f cee::ug::ColorMapper::belowRangeColor ( ) const

Returns the current below range color.

This color can be set by setBelowRangeColor() but will be reset to follow the color legend when using the setColorScheme() method.

ColorMapper::ColorScheme cee::ug::ColorMapper::colorScheme ( ) const

Returns the current color scheme for this scalar result.

See also
ColorScheme
std::vector< Color3f > cee::ug::ColorMapper::customContinuousColors ( ) const

Returns the array of colors for a custom continuous color mapper.

std::vector< double > cee::ug::ColorMapper::customContinuousTickMarks ( ) const

Returns the custom tick mark values for continuous mapping type.

See also
setCustomContinuousTickMarks
std::vector< double > cee::ug::ColorMapper::customContinuousValues ( ) const

Returns the array of values for a custom continuous color mapper.

void cee::ug::ColorMapper::enableAboveRangeMasking ( bool  enableMasking)

Sets if the above range parts of the model should be rendered (default) or not.

void cee::ug::ColorMapper::enableBelowRangeMasking ( bool  enableMasking)

Sets if the below range parts of the model should be rendered (default) or not.

void cee::ug::ColorMapper::enableUndefinedMasking ( bool  enableMasking)

Sets if the undefined parts of the model should be rendered (default) or not.

std::vector< Color3f > cee::ug::ColorMapper::filledContoursColors ( ) const

Returns the array of colors for the custom filled contour levels.

The returned array with have numberOfFilledContoursColors() items and be the same as specified in the setTypeFilledContoursUniform() method or one less than the number of values specified in the setTypeFilledContours() method.

std::vector< double > cee::ug::ColorMapper::filledContoursLevelValues ( ) const

Returns an array with the level values for filled contours modes.

The returned array with have (numberOfFilledContoursColors() + 1) values.

The first value (values[0]) will be the minimum range value, and the last value (values[values.size() - 1]) will be the maximum range value. The other values (values[1] to values[values.size() - 2]) specifies the level values between the colors of the legend and where the contours will be on the model.

bool cee::ug::ColorMapper::isAboveRangeMaskingEnabled ( ) const

Returns if the above range parts of the model should be rendered (default) or not.

bool cee::ug::ColorMapper::isBelowRangeMaskingEnabled ( ) const

Returns if the below range parts of the model should be rendered (default) or not.

bool cee::ug::ColorMapper::isUndefinedMaskingEnabled ( ) const

Returns if the undefined parts of the model should be rendered (default) or not.

unsigned int cee::ug::ColorMapper::numberOfFilledContoursColors ( ) const

Returns the number of discrete colors used when mapping scalars as filled contours.

The return value is only valid when the color mapper is ColorMapper::FILLED_CONTOURS_UNIFORM. For other color mappers, this function always returns 0.

void cee::ug::ColorMapper::setAboveRangeColor ( const Color3f aboveColor)

Sets the color of all values above the current range of the scalar settings/color legend.

This method allows the user to specify a color other than the top color of the color legend to use for values that are above the top indicated color.

Using the setColorScheme() method will reset the above color to match the given color scheme.

void cee::ug::ColorMapper::setBelowRangeColor ( const Color3f belowColor)

Sets the color of all values below the current range of the scalar settings/color legend.

This method allows the user to specify a color other than the bottom color of the color legend to use for values that are below the bottom indicated color.

Using the setColorScheme() method will reset the above color to match the given color scheme.

void cee::ug::ColorMapper::setColorScheme ( ColorScheme  scheme)

Sets the coloring scheme to use for the color legend.

See also
ColorScheme
void cee::ug::ColorMapper::setCustomContinuousColorsAtValues ( const std::vector< double > &  values,
const std::vector< Color3f > &  colorAtValues 
)

Sets custom color scheme for a continuous color legend.

Setup the legend with the given colors at the given values. The two arrays must match in size.

Please note that there is no correlation between the values specified and the tick marks on the legend. The values specify the position of the color on the legend. The tick marks will be distributed on round numbers.

Note
The type() must be CONTINUOUS
void cee::ug::ColorMapper::setCustomContinuousTickMarks ( const std::vector< double > &  values)

Sets the custom tick mark values for continuous mapper.

Sets the values to show as tick marks on the color legend. Note that min/max values are not automatically added and must be included in the array if needed.

Note
Only valid for CONTINUOUS mapper (type() == CONTINUOUS)
See also
setTypeContinuous
void cee::ug::ColorMapper::setCustomFilledContoursColors ( const std::vector< Color3f > &  levelColors)

Sets custom color scheme for filled contours uniform legends.

Setup the legend with the given colors. The first color in the array is the bottom color of the legend.

Note
The levelColors array must have the same size as the current number of levels
The type() must be FILLED_CONTOURS_UNIFORM or FILLED_CONTOURS
void cee::ug::ColorMapper::setTextureSize ( unsigned int  textureSize)

Sets the maximum texture size to use.

Note: Only for experimental use. Should usually be left at the default (currently 1024) Should be a power of two.

void cee::ug::ColorMapper::setTypeContinuous ( )

Sets color mapping to continuous.

This will create a continuous (gradient) legend with a smooth interpolation between the colors

To use custom colors for the continuous legend, use the setCustomContinuousColorsAtValues() method.

See also
type()
setCustomContinuousColorsAtValues()
void cee::ug::ColorMapper::setTypeFilledContours ( const std::vector< double > &  values)

Sets the color mapping to filled contours with the provided level values.

Sets the color mapper to filled contours (ColorMapper::FILLED_CONTOURS).

The values array specifies all the level values. The first item (values[0]) is the minimum range value, and the last item (values[values.size() - 1]) is the maximum range value. The other values (values[1] to values[values.size() - 2]) specifies the level values between the colors of the legend and where the contours will be on the model.

The legend will have (values.size() - 1) different colors. numberOfFilledContoursColors() will return (values.size() - 1).

Note
values must have at least two items, resulting in a legend with one color.
See also
type()
numberOfFilledContoursColors()
void cee::ug::ColorMapper::setTypeFilledContoursUniform ( unsigned int  numColors)

Sets the color mapping to filled contours with uniformly distributed levels.

Sets the color mapper to filled contours (ColorMapper::FILLED_CONTOURS_UNIFORM). The numColors parameter specifies the number of discrete colors to use when doing color mapping of the scalars.

There will be (numColors + 1) level values: min and max value and (numColors - 1) values between the specified number of levels.

The level values will be evenly spaced between the min and max range of the scalar result.

Note
numColors must be at least 1
See also
type()
numberOfFilledContoursColors()
ScalarSettings::setRange()
void cee::ug::ColorMapper::setUndefinedColor ( const Color3f undefinedColor)

Sets the color to use for undefined values (cee::UNDEFINED_DOUBLE).

This color will be used for all items that have a undefined result. The default is (0.588, 0.588, 0.588)

ColorMapper::MappingType cee::ug::ColorMapper::type ( ) const

Returns the type of the current color mapper.

cee::Color3f cee::ug::ColorMapper::undefinedColor ( ) const

Returns the color that will be used for undefined values (cee::UNDEFINED_DOUBLE).