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

Zinc Spectrum maps values of graphics data fields to colours. More...

#include <spectrum.hpp>

Public Member Functions

 Spectrum (cmzn_spectrum_id in_spectrum_id)
 
 Spectrum (const Spectrum &spectrum)
 
Spectrumoperator= (const Spectrum &spectrum)
 
bool isValid () const
 
cmzn_spectrum_id getId () const
 
bool isManaged ()
 
int setManaged (bool value)
 
int beginChange ()
 
int endChange ()
 
char * getName ()
 
int setName (const char *name)
 
int getNumberOfSpectrumcomponents ()
 
Spectrumcomponent createSpectrumcomponent ()
 
Spectrumcomponent getFirstSpectrumcomponent ()
 
Spectrumcomponent getNextSpectrumcomponent (const Spectrumcomponent &refComponent)
 
Spectrumcomponent getPreviousSpectrumcomponent (const Spectrumcomponent &refComponent)
 
int moveSpectrumcomponentBefore (const Spectrumcomponent &component, const Spectrumcomponent &refComponent)
 
int removeSpectrumcomponent (const Spectrumcomponent &component)
 
int removeAllSpectrumcomponents ()
 
bool isMaterialOverwrite ()
 
int setMaterialOverwrite (bool overwrite)
 

Protected Attributes

cmzn_spectrum_id id
 

Detailed Description

Zinc Spectrum maps values of graphics data fields to colours.

A Zinc Spectrum maps values of graphics data fields to colours. It consists of a list of spectrumcomponent objects which combine to give the overall colouring.

See Also
Spectrumcomponent

Member Function Documentation

int OpenCMISS::Zinc::Spectrum::beginChange ( )
inline

Call this function before making multiple changes on the spectrum, to stop spectrum from notifying clients about every change. Call spectrum end change method afterwards to send notifications of change made. Can be nested.

See Also
Spectrum::endChange
Parameters
sceneThe handle to the spectrum.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
Spectrumcomponent OpenCMISS::Zinc::Spectrum::createSpectrumcomponent ( )
inline

Create a component for spectrum. Used to colour graphics.

Returns
Handle to new spectrum component, or NULL/invalid handle on failure.
int OpenCMISS::Zinc::Spectrum::endChange ( )
inline

Call spectrum begin change before making multiple changes on the spectrum, and this function afterwards to send a single notification of any changes to clients.

See Also
Spectrum::beginChange
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
Spectrumcomponent OpenCMISS::Zinc::Spectrum::getFirstSpectrumcomponent ( )
inline

Get the first spectrum component on the spectrum list of <component>.

Returns
Handle to first spectrum component, or NULL/invalid handle if none or failed.
cmzn_spectrum_id OpenCMISS::Zinc::Spectrum::getId ( ) const
inline

Return the C handle of the Spectrum object.

Returns
C handle of Spectrum if this objects is valid, 0 otherwise.
char* OpenCMISS::Zinc::Spectrum::getName ( )
inline

Return an allocated string containing spectrum name.

Returns
allocated string containing spectrum name, otherwise NULL. Up to caller to free using cmzn_deallocate().
Spectrumcomponent OpenCMISS::Zinc::Spectrum::getNextSpectrumcomponent ( const Spectrumcomponent refComponent)
inline

Get the next spectrum component after ref_component from list in spectrum.

Parameters
refComponentHandle to a spectrum component object.
Returns
Handle to next spectrum component, or NULL/invalid handle if none or failed.
int OpenCMISS::Zinc::Spectrum::getNumberOfSpectrumcomponents ( )
inline

Returns the number of components in spectrum.

Returns
Returns the number of components in spectrum.
Spectrumcomponent OpenCMISS::Zinc::Spectrum::getPreviousSpectrumcomponent ( const Spectrumcomponent refComponent)
inline

Get the component before <ref_component> on the components list of <spectrum>.

Parameters
refComponentHandle to a spectrum component object.
Returns
Handle to previous spectrum component, or NULL/invalid handle if none or failed.
bool OpenCMISS::Zinc::Spectrum::isManaged ( )
inline

Get if a spectrum is managed. See cmzn_spectrum_set_managed for more information about managed.

Returns
1 if spectrum is managed, otherwise false.
bool OpenCMISS::Zinc::Spectrum::isMaterialOverwrite ( )
inline

Get the overwrite material flag for spectrum. When overwrite flag is true, the spectrum will clear any material rgba on primitive before applying its own rgba. If the flag is false, rgba from the spectrum will be added to the primitives on top of the one given by material.

Returns
true if overwrite flag is set for spectrum, false if the flag is not set or on failure.
bool OpenCMISS::Zinc::Spectrum::isValid ( ) const
inline

Check if this is a valid Spectrum object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Spectrum::moveSpectrumcomponentBefore ( const Spectrumcomponent component,
const Spectrumcomponent refComponent 
)
inline

Move an existing component in spectrum before ref_component. Both <component> and <ref_component> must be from the same spectrum.

Parameters
componentspectrum component to be moved.
refComponent<component> will be moved into the current position of this spectrum component.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Spectrum::removeAllSpectrumcomponents ( )
inline

Removes all components from the spectrum.

from.

Returns
Status OpenCMISS::Zinc::OK if successfully remove all components from spectrum, any other value on failure.
int OpenCMISS::Zinc::Spectrum::removeSpectrumcomponent ( const Spectrumcomponent component)
inline

Removes <component> from <spectrum> and decrements the position of all subsequent graphics.

from.

Parameters
componentThe handle to a spectrum component object which will be removed from the spectrum.
Returns
Status OpenCMISS::Zinc::OK if successfully remove component from spectrum, any other value on failure.
int OpenCMISS::Zinc::Spectrum::setManaged ( bool  value)
inline

When the managed status is 0 (default) spectrum is destroyed when no longer in use, i.e. when number of external references to it drops to zero. Set to 1 to manage spectrum object indefinitely, or until this attribute is reset to zero, effectively marking it as pending destruction.

Parameters
valueThe new value for the managed flag: true or false.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
int OpenCMISS::Zinc::Spectrum::setMaterialOverwrite ( bool  overwrite)
inline

Set the overwrite material flag for spectrum.

Returns
OpenCMISS::Zinc::OK if successfully set, any other value on failure.
int OpenCMISS::Zinc::Spectrum::setName ( const char *  name)
inline

Set/change name for <spectrum>.

Parameters
namename to be set to the spectrum
Returns
status OpenCMISS::Zinc::OK if successfully set/change name for spectrum, any other value on failure.

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