Zinc Spectrum maps values of graphics data fields to colours.
More...
#include <spectrum.hpp>
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
Bit flags summarising changes to a spectrum or spectrums in a spectrummodule.
Enumerator |
---|
CHANGE_FLAG_NONE |
spectrum(s) not changed
|
CHANGE_FLAG_ADD |
one or more spectrums added
|
CHANGE_FLAG_REMOVE |
one or more spectrums removed
|
CHANGE_FLAG_IDENTIFIER |
spectrum identifier changed
|
CHANGE_FLAG_DEFINITION |
change to spectrum attributes other than identifier.
|
CHANGE_FLAG_FULL_RESULT |
all resultant values of spectrum changed.
|
CHANGE_FLAG_FINAL |
final notification: owning spectrum module i.e. spectrum module has been destroyed
|
int OpenCMISS::Zinc::Spectrum::autorange |
( |
const Scene & |
scene, |
|
|
const Scenefilter & |
scenefilter |
|
) |
| |
|
inline |
Set the minimum and maximum value for the specified spectrum to match the minimum and maximum field value in scene's grpahics which are coloured with the specified spectrum.
- Parameters
-
&scene | scene to get the autorange data from. |
filter | filter for the scene |
- Returns
- Status OpenCMISS::Zinc::OK if successfully autorange, any other value on failure.
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
-
scene | The handle to the spectrum. |
- Returns
- Status OpenCMISS::Zinc::OK on success, any other value on failure.
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.
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().
Get the next spectrum component after ref_component from list in spectrum.
- Parameters
-
refComponent | Handle 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.
Get the component before <ref_component> on the components list of <spectrum>.
- Parameters
-
refComponent | Handle 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.
Move an existing component in spectrum before ref_component. Both <component> and <ref_component> must be from the same spectrum.
- Parameters
-
component | spectrum 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
-
component | The 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
-
value | The 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
-
name | name 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 files: