OpenCMISS-Zinc C++ API Documentation
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
OpenCMISS::Zinc::Spectrumcomponent Class Reference

Maps a single component of a data field to colour in a spectrum. More...

#include <spectrum.hpp>

Public Types

enum  ScaleType { SCALE_TYPE_INVALID = CMZN_SPECTRUMCOMPONENT_SCALE_TYPE_INVALID, SCALE_TYPE_LINEAR = CMZN_SPECTRUMCOMPONENT_SCALE_TYPE_LINEAR, SCALE_TYPE_LOG = CMZN_SPECTRUMCOMPONENT_SCALE_TYPE_LOG }
 
enum  ColourMappingType {
  COLOUR_MAPPING_TYPE_INVALID = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_INVALID, COLOUR_MAPPING_TYPE_ALPHA = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_ALPHA, COLOUR_MAPPING_TYPE_BANDED = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_BANDED, COLOUR_MAPPING_TYPE_BLUE = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_BLUE,
  COLOUR_MAPPING_TYPE_GREEN = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_GREEN, COLOUR_MAPPING_TYPE_MONOCHROME = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_MONOCHROME, COLOUR_MAPPING_TYPE_RAINBOW = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_RAINBOW, COLOUR_MAPPING_TYPE_RED = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_RED,
  COLOUR_MAPPING_TYPE_STEP = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_STEP, COLOUR_MAPPING_TYPE_WHITE_TO_BLUE = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_WHITE_TO_BLUE, COLOUR_MAPPING_TYPE_WHITE_TO_RED = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_WHITE_TO_RED, COLOUR_MAPPING_TYPE_WHITE_TO_GREEN = CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_WHITE_TO_GREEN
}
 

Public Member Functions

 Spectrumcomponent (cmzn_spectrumcomponent_id in_spectrumcomponent_id)
 
 Spectrumcomponent (const Spectrumcomponent &spectrumComponent)
 
Spectrumcomponentoperator= (const Spectrumcomponent &spectrumComponent)
 
bool isValid () const
 
cmzn_spectrumcomponent_id getId () const
 
double getRangeMinimum ()
 
int setRangeMinimum (double value)
 
double getRangeMaximum ()
 
int setRangeMaximum (double value)
 
double getColourMinimum ()
 
int setColourMinimum (double value)
 
double getColourMaximum ()
 
int setColourMaximum (double value)
 
double getStepValue ()
 
int setStepValue (double value)
 
double getExaggeration ()
 
int setExaggeration (double value)
 
double getBandedRatio ()
 
int setBandedRatio (double value)
 
bool isActive ()
 
int setActive (bool active)
 
bool isColourReverse ()
 
int setColourReverse (bool reverse)
 
bool isExtendAbove ()
 
int setExtendAbove (bool extend_above)
 
bool isExtendBelow ()
 
int setExtendBelow (bool extend_below)
 
int getFieldComponent ()
 
int setFieldComponent (int componentNumber)
 
int getNumberOfBands ()
 
int setNumberOfBands (int numberOfBands)
 
ScaleType getScaleType ()
 
int setScaleType (ScaleType scaleType)
 
ColourMappingType getColourMappingType ()
 
int setColourMappingType (ColourMappingType colourMapping)
 

Protected Attributes

cmzn_spectrumcomponent_id id
 

Detailed Description

Maps a single component of a data field to colour in a spectrum.

A spectrumcomponent object maps a single component of a data field to one of several colour ramps, rainbow, alpha ramp, contour bands or a step function. A spectrum may blend multiple components to give the overall colouring.

See Also
Spectrum

Member Enumeration Documentation

Colour mapping mode for specctrum component. Appearances of these mappings can be altered by the various APIs provided in spectrum and spectrum components APIs.

Enumerator
COLOUR_MAPPING_TYPE_INVALID 

Unspecified colour mapping type

COLOUR_MAPPING_TYPE_ALPHA 

This colour mapping alters the alpha (transparency value) for primitives. This mode does not alter the rgb value and should be used with other spectrum component or with overwrite_material set to 0 in spectrum.

COLOUR_MAPPING_TYPE_BANDED 

This colour mapping create non-coloured strips/bands. The appearance is controlled by the number of bands and the banded ratio. This mode does not alter the rgb value except at the bands and should be used with other spectrum component or with overwrite_material set to 0 in spectrum.

See Also
Spectrumcomponent::setBandedRatio
Spectrumcomponent::getNumberOfBands
COLOUR_MAPPING_TYPE_BLUE 

This colour mapping create a colour spectrum from black to blue.

COLOUR_MAPPING_TYPE_GREEN 

This colour mapping create a colour spectrum from black to green.

COLOUR_MAPPING_TYPE_MONOCHROME 

This colour mapping create a monochrome (grey scale) spectrum.

COLOUR_MAPPING_TYPE_RAINBOW 

default colour mapping type This colour mapping create a spectrum from blue to red, similar to the colour of a rainbow.

COLOUR_MAPPING_TYPE_RED 

This colour mapping create a colour spectrum from black to red.

COLOUR_MAPPING_TYPE_STEP 

This colour mapping create a spectrum with only two colours, red and green. The boundary between red and green can be altered by CMZN_SPECTRUMCOMPONENT_ATTRIBUTE_STEP_VALUE.

COLOUR_MAPPING_TYPE_WHITE_TO_BLUE 

This colour mapping create a colour spectrum from black to blue.

COLOUR_MAPPING_TYPE_WHITE_TO_RED 

This colour mapping create a colour spectrum from black to red.

COLOUR_MAPPING_TYPE_WHITE_TO_GREEN 

This colour mapping create a colour spectrum from black to green.

Controls the mapping of field value to colour in a spectrum component.

Enumerator
SCALE_TYPE_INVALID 

Unspecified scale type

SCALE_TYPE_LINEAR 

default scale type The colour value on spectrum will be interpolated linearly in range when this mode is chosen.

SCALE_TYPE_LOG 

Logarithm scale type for spectrum component. The colour value on spectrum will be interpolated logarithmically in range when this mode is chosen.

Member Function Documentation

double OpenCMISS::Zinc::Spectrumcomponent::getBandedRatio ( )
inline

Get the value determining the proportion of band present on each section, number of sections in a spectrum is determined by number of bands, value must be larger than 0.0 and must not exceed 1.0.

Returns
banded ratio of the spectrum component on success.
ColourMappingType OpenCMISS::Zinc::Spectrumcomponent::getColourMappingType ( )
inline

Get the colour_mapping_type of this component.

Returns
colour_mapping_type of the spectrum component. CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_INVALID if failed or mode is not set correctly.
double OpenCMISS::Zinc::Spectrumcomponent::getColourMaximum ( )
inline

Get the normalised maximum value for the colour type of this spectrum component. The range of colour displayed by this spectrum ranges from minimum value of colour to the maximum value of colour

Returns
maximum value of colour on success.
double OpenCMISS::Zinc::Spectrumcomponent::getColourMinimum ( )
inline

Get the normalised minimum value for the colour type of this spectrum component. The range of colour displayed by this spectrum ranges from minimum value of colour to the maximum value of colour

Returns
minimum value of colour on success.
double OpenCMISS::Zinc::Spectrumcomponent::getExaggeration ( )
inline

Get the value which alters the colour progression when scale type is set to SCALE_TYPE_LOG.

See Also
Spectrumcomponent::SCALE_TYPE_LOG
Returns
The exaggeration value of the spectrum, or zero on failure.
int OpenCMISS::Zinc::Spectrumcomponent::getFieldComponent ( )
inline

Get the field component lookup number of a spectrum component, this value determines which of the field component this spectrum component will look up on.

See Also
Graphics::setDataField
Returns
positive integer of the field component number to look up to. Any other value if failed or value is not set correctly.
cmzn_spectrumcomponent_id OpenCMISS::Zinc::Spectrumcomponent::getId ( ) const
inline

Return the C handle of the Spectrumcomponent object.

Returns
C handle of Spectrumcomponent if this objects is valid, 0 otherwise.
int OpenCMISS::Zinc::Spectrumcomponent::getNumberOfBands ( )
inline

Get the number of bands this component contains within its range in CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_BANDED

Returns
positive integer of nuymber of bands set for this components. Any other value if failed or value is not set correctly
double OpenCMISS::Zinc::Spectrumcomponent::getRangeMaximum ( )
inline

Get the maximum value of the range this spectrum component will lookup to on targeted field. Primitives with this field value will display the maximum colour value of the component colour type

Returns
value of range maximum on success.
double OpenCMISS::Zinc::Spectrumcomponent::getRangeMinimum ( )
inline

Get the minimum value of the range this spectrum component will lookup to on targeted field. Primitives with this field value will display the minimum colour value of the component colour type

Returns
value of range minimum on success.
ScaleType OpenCMISS::Zinc::Spectrumcomponent::getScaleType ( )
inline

Get the interpolation_mode of this component.

Returns
interpolation_mode set for this spectrum. CMZN_SPECTRUMCOMPONENT_SCALE_TYPE_INVALID if failed or mode is not set correctly
double OpenCMISS::Zinc::Spectrumcomponent::getStepValue ( )
inline

Get the step value of a spectrum component. The step spectrum defines the boundary between the red and blue colour of the COLOUR_MAPPING_TYPE_STEP spectrum compomemt.

Returns
step value of the spectrum component on success.
bool OpenCMISS::Zinc::Spectrumcomponent::isActive ( )
inline

Get the active state of a spectrum component, only active spectrum component will be rendered

Returns
true if spectrum component is active, false if failed or spectrum component is not active
bool OpenCMISS::Zinc::Spectrumcomponent::isColourReverse ( )
inline

Get the reverse flag of a spectrum component, reverse spectrum component will have the colour rendered reversely

Returns
true if spectrum component is reverse, false if failed or spectrum component is not reverse
bool OpenCMISS::Zinc::Spectrumcomponent::isExtendAbove ( )
inline

Get the extend_above flag of a spectrum component, an extend above spectrum component will have the spectrum component colour rendered even when field value exceeds spectrum maximum range.

Returns
true if spectrum component extends above, false if failed or spectrum component does not extend above
bool OpenCMISS::Zinc::Spectrumcomponent::isExtendBelow ( )
inline

Get the extend_below flag of a spectrum component, an extend below spectrum component will have the spectrum component colour rendered even when field value is below spectrum minimum range.

Returns
true if spectrum component extends below, false if failed or spectrum component does not extend below
bool OpenCMISS::Zinc::Spectrumcomponent::isValid ( ) const
inline

Check if this is a valid Spectrumcomponent object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Spectrumcomponent::setActive ( bool  active)
inline

Set the active state of a spectrum component, only active spectrum component will be rendered

Parameters
activeValue to be set to the zinc spectrum component.
Returns
OpenCMISS::Zinc::OK if value is set successfully, any other value if failed.
int OpenCMISS::Zinc::Spectrumcomponent::setBandedRatio ( double  value)
inline

Set the value determining the proportion of band present on each section, number of sections in a spectrum is determined by number of bands, value must be larger than 0.0 and must not exceed 1.0.

the banded ratio to be set

Returns
OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Spectrumcomponent::setColourMappingType ( ColourMappingType  colourMapping)
inline

Set the colour_mapping_type of this component.

Parameters
colourMappingcolour_mapping_type to be set for spectrum component
Returns
OpenCMISS::Zinc::OK if value is set successfully, any other value if failed.
int OpenCMISS::Zinc::Spectrumcomponent::setColourMaximum ( double  value)
inline

Set the normalised maximum value for the colour type of this spectrum component. The range of colour displayed by this spectrum ranges from minimum value of colour to the miximum value of colour

the maximum colour value to be set

Returns
OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Spectrumcomponent::setColourMinimum ( double  value)
inline

Set the normalised minimum value for the colour type of this spectrum component. The range of colour displayed by this spectrum ranges from minimum value of colour to the miximum value of colour

the minimum colour value to be set

Returns
OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Spectrumcomponent::setColourReverse ( bool  reverse)
inline

Set the reverse flag of a spectrum component, reverse spectrum component will have the colour rendered reversely

Parameters
reverseValue to be set to the zinc spectrum component.
Returns
OpenCMISS::Zinc::OK if value is set successfully, any other value if failed.
int OpenCMISS::Zinc::Spectrumcomponent::setExaggeration ( double  value)
inline

Set the value which alters the colour progression when scale type is set to SCALE_TYPE_LOG

See Also
Spectrumcomponent::SCALE_TYPE_LOG
Parameters
valueThe exaggeration value to be set.
Returns
OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Spectrumcomponent::setExtendAbove ( bool  extend_above)
inline

Set the extend_above flag of a spectrum component, an extend_above spectrum component will have the colour rendered even when field value exceeds spectrum maximum range.

Parameters
extend_aboveValue to be set to the zinc spectrum component.
Returns
OpenCMISS::Zinc::OK if value is set successfully, any other value if failed.
int OpenCMISS::Zinc::Spectrumcomponent::setExtendBelow ( bool  extend_below)
inline

Set the extend_below flag of a spectrum component, an extend below spectrum component will have the spectrum component colour rendered even when field value is below spectrum minimum range.

Parameters
extend_belowValue to be set to the zinc spectrum component.
Returns
OpenCMISS::Zinc::OK if value is set successfully, any other value if failed.
int OpenCMISS::Zinc::Spectrumcomponent::setFieldComponent ( int  componentNumber)
inline

Set the field component lookup number of a spectrum component, this value determines which of the field component this spectrum component will look up on.

See Also
Graphics::setDataField
Returns
OpenCMISS::Zinc::OK if value is set successfully, any other value if failed.
int OpenCMISS::Zinc::Spectrumcomponent::setNumberOfBands ( int  numberOfBands)
inline

Set the number of bands this component contains within its range in CMZN_SPECTRUMCOMPONENT_COLOUR_MAPPING_TYPE_BANDED

Parameters
numberOfBandsof bands number of bands for this component
Returns
OpenCMISS::Zinc::OK if value is set successfully, any other value if failed.
int OpenCMISS::Zinc::Spectrumcomponent::setRangeMaximum ( double  value)
inline

Set the maximum value of the range this spectrum component will lookup to on targeted field. Primitives with this field value will display the maximum colour value of the component colour type

the value to be set for range maximum

Returns
OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Spectrumcomponent::setRangeMinimum ( double  value)
inline

Set the minimum value of the range this spectrum component will lookup to on targeted field. Primitives with this field value will display the minimum colour value of the component colour type

the value to be set for range minimum

Returns
OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Spectrumcomponent::setScaleType ( ScaleType  scaleType)
inline

Set the interpolation_mode of this component.

Parameters
scaleTypeInterpolation mode to be set for spectrum component
Returns
OpenCMISS::Zinc::OK if value is set successfully, any other value if failed.
int OpenCMISS::Zinc::Spectrumcomponent::setStepValue ( double  value)
inline

Set the step value of a spectrum component. The step spectrum defines the boundary between the red and blue colour of the COLOUR_MAPPING_TYPE_STEP spectrum component.

the step value to be set

Returns
OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.

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