OpenCMISS-Zinc C++ API Documentation
Public Member Functions | List of all members
OpenCMISS::Zinc::GlyphColourBar Class Reference

A specialised glyph type which draws a cylindrical colour bar. More...

#include <glyph.hpp>

Inheritance diagram for OpenCMISS::Zinc::GlyphColourBar:
OpenCMISS::Zinc::Glyph

Public Member Functions

 GlyphColourBar (cmzn_glyph_colour_bar_id colour_bar_id)
 
int getAxis (int valuesCount, double *valuesOut)
 
int setAxis (int valuesCount, const double *valuesIn)
 
int getCentre (int valuesCount, double *valuesOut)
 
int setCentre (int valuesCount, const double *valuesIn)
 
double getExtendLength ()
 
int setExtendLength (double extendLength)
 
int getLabelDivisions ()
 
int setLabelDivisions (int labelDivisions)
 
Material getLabelMaterial ()
 
int setLabelMaterial (const Material &material)
 
char * getNumberFormat ()
 
int setNumberFormat (const char *numberFormat)
 
int getSideAxis (int valuesCount, double *valuesOut)
 
int setSideAxis (int valuesCount, const double *valuesIn)
 
Spectrum getSpectrum ()
 
double getTickLength ()
 
int setTickLength (double tickLength)
 
- Public Member Functions inherited from OpenCMISS::Zinc::Glyph
 Glyph (cmzn_glyph_id in_glyph_id)
 
 Glyph (const Glyph &glyph)
 
Glyphoperator= (const Glyph &glyph)
 
bool isValid () const
 
cmzn_glyph_id getId () const
 
char * getName ()
 
int setName (const char *name)
 
bool isManaged ()
 
int setManaged (bool value)
 
GlyphAxes castAxes ()
 
GlyphColourBar castColourBar ()
 

Additional Inherited Members

- Public Types inherited from OpenCMISS::Zinc::Glyph
enum  ChangeFlag {
  CHANGE_FLAG_NONE = CMZN_GLYPH_CHANGE_FLAG_NONE, CHANGE_FLAG_ADD = CMZN_GLYPH_CHANGE_FLAG_ADD, CHANGE_FLAG_REMOVE = CMZN_GLYPH_CHANGE_FLAG_REMOVE, CHANGE_FLAG_IDENTIFIER = CMZN_GLYPH_CHANGE_FLAG_IDENTIFIER,
  CHANGE_FLAG_DEFINITION = CMZN_GLYPH_CHANGE_FLAG_DEFINITION, CHANGE_FLAG_FULL_RESULT = CMZN_GLYPH_CHANGE_FLAG_FULL_RESULT, CHANGE_FLAG_FINAL = CMZN_GLYPH_CHANGE_FLAG_FINAL
}
 
enum  RepeatMode {
  REPEAT_MODE_INVALID = CMZN_GLYPH_REPEAT_MODE_INVALID, REPEAT_MODE_NONE = CMZN_GLYPH_REPEAT_MODE_NONE, REPEAT_MODE_AXES_2D = CMZN_GLYPH_REPEAT_MODE_AXES_2D, REPEAT_MODE_AXES_3D = CMZN_GLYPH_REPEAT_MODE_AXES_3D,
  REPEAT_MODE_MIRROR = CMZN_GLYPH_REPEAT_MODE_MIRROR
}
 
enum  ShapeType {
  SHAPE_TYPE_INVALID = CMZN_GLYPH_SHAPE_TYPE_INVALID, SHAPE_TYPE_NONE = CMZN_GLYPH_SHAPE_TYPE_NONE, SHAPE_TYPE_ARROW = CMZN_GLYPH_SHAPE_TYPE_ARROW, SHAPE_TYPE_ARROW_SOLID = CMZN_GLYPH_SHAPE_TYPE_ARROW_SOLID,
  SHAPE_TYPE_AXIS = CMZN_GLYPH_SHAPE_TYPE_AXIS, SHAPE_TYPE_AXIS_SOLID = CMZN_GLYPH_SHAPE_TYPE_AXIS_SOLID, SHAPE_TYPE_CONE = CMZN_GLYPH_SHAPE_TYPE_CONE, SHAPE_TYPE_CONE_SOLID = CMZN_GLYPH_SHAPE_TYPE_CONE_SOLID,
  SHAPE_TYPE_CROSS = CMZN_GLYPH_SHAPE_TYPE_CROSS, SHAPE_TYPE_CUBE_SOLID = CMZN_GLYPH_SHAPE_TYPE_CUBE_SOLID, SHAPE_TYPE_CUBE_WIREFRAME = CMZN_GLYPH_SHAPE_TYPE_CUBE_WIREFRAME, SHAPE_TYPE_CYLINDER = CMZN_GLYPH_SHAPE_TYPE_CYLINDER,
  SHAPE_TYPE_CYLINDER_SOLID = CMZN_GLYPH_SHAPE_TYPE_CYLINDER_SOLID, SHAPE_TYPE_DIAMOND = CMZN_GLYPH_SHAPE_TYPE_DIAMOND, SHAPE_TYPE_LINE = CMZN_GLYPH_SHAPE_TYPE_LINE, SHAPE_TYPE_POINT = CMZN_GLYPH_SHAPE_TYPE_POINT,
  SHAPE_TYPE_SHEET = CMZN_GLYPH_SHAPE_TYPE_SHEET, SHAPE_TYPE_SPHERE = CMZN_GLYPH_SHAPE_TYPE_SPHERE, SHAPE_TYPE_AXES = CMZN_GLYPH_SHAPE_TYPE_AXES, SHAPE_TYPE_AXES_123 = CMZN_GLYPH_SHAPE_TYPE_AXES_123,
  SHAPE_TYPE_AXES_XYZ = CMZN_GLYPH_SHAPE_TYPE_AXES_XYZ, SHAPE_TYPE_AXES_COLOUR = CMZN_GLYPH_SHAPE_TYPE_AXES_COLOUR, SHAPE_TYPE_AXES_SOLID = CMZN_GLYPH_SHAPE_TYPE_AXES_SOLID, SHAPE_TYPE_AXES_SOLID_123 = CMZN_GLYPH_SHAPE_TYPE_AXES_SOLID_123,
  SHAPE_TYPE_AXES_SOLID_XYZ = CMZN_GLYPH_SHAPE_TYPE_AXES_SOLID_XYZ, SHAPE_TYPE_AXES_SOLID_COLOUR = CMZN_GLYPH_SHAPE_TYPE_AXES_SOLID_COLOUR
}
 
typedef int ChangeFlags
 
- Protected Attributes inherited from OpenCMISS::Zinc::Glyph
cmzn_glyph_id id
 

Detailed Description

A specialised glyph type which draws a cylindrical colour bar.

A specialised glyph type which draws a cylindrical colour bar showing the colours and range of a spectrum with controllable size, scale ticks and label etc. The colour bar automatically updates to show changes to the spectrum.

Member Function Documentation

int OpenCMISS::Zinc::GlyphColourBar::getAxis ( int  valuesCount,
double *  valuesOut 
)
inline

Gets the vector defining the main axis of the colour bar.

Parameters
valuesCountThe size of valuesOut array. Gets maximum of 3 values.
valuesOutArray to receive axis vector.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::GlyphColourBar::getCentre ( int  valuesCount,
double *  valuesOut 
)
inline

Gets the centre position of the colour bar.

Parameters
valuesCountThe size of valuesOut array. Gets maximum of 3 values.
valuesOutArray to receive centre position.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
double OpenCMISS::Zinc::GlyphColourBar::getExtendLength ( )
inline

Gets the extend length used at each end of the colour bar to show values outside the spectrum range.

Returns
The extend length, or 0.0 if error.
int OpenCMISS::Zinc::GlyphColourBar::getLabelDivisions ( )
inline

Gets the number of divisions between labels.

Returns
The number of label divisions, or 0 if error.
Material OpenCMISS::Zinc::GlyphColourBar::getLabelMaterial ( )
inline

Gets the material used for colour bar labels and ticks. Can be NULL.

Returns
Handle to material, or NULL/invalid handle if none or failed.
char* OpenCMISS::Zinc::GlyphColourBar::getNumberFormat ( )
inline

Get the number format used to write value labels on the colour bar.

Returns
Allocated string containing number format, or NULL on failure. Up to caller to free using cmzn_deallocate().
int OpenCMISS::Zinc::GlyphColourBar::getSideAxis ( int  valuesCount,
double *  valuesOut 
)
inline

Gets the vector defining the side/tick axis of the colour bar.

Parameters
valuesCountThe size of valuesOut array. Gets maximum of 3 values.
valuesOutArray to receive side axis vector.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
Spectrum OpenCMISS::Zinc::GlyphColourBar::getSpectrum ( )
inline

Gets the spectrum shown by the colour bar.

Returns
Handle to spectrum, or NULL/invalid handle if none or failed.
double OpenCMISS::Zinc::GlyphColourBar::getTickLength ( )
inline

Gets the tick length.

Returns
The tick length, or 0.0 if error.
int OpenCMISS::Zinc::GlyphColourBar::setAxis ( int  valuesCount,
const double *  valuesIn 
)
inline

Sets the vector defining the main axis of the colour bar. The magnitude of this vector gives the length of the bar without the extend length. The default axis is (0,1,0) for vertical orientation in window coordinates.

Parameters
valuesCountThe size of valuesIn array. Sets maximum of 3 values.
valuesInArray containing axis vector. If fewer than 3 values then assumes zero for remaining components.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::GlyphColourBar::setCentre ( int  valuesCount,
const double *  valuesIn 
)
inline

Sets the centre position of the colour bar. The default centre is (0,0,0). It is recommended that this not be changed and instead use the graphics point attributes glyph offset.

See also
Graphicspointattributes::setGlyphOffset
Parameters
valuesCountThe size of valuesIn array. Sets maximum of 3 values.
valuesInArray containing centre position. If fewer than 3 values then assumes zero for remaining components.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::GlyphColourBar::setExtendLength ( double  extendLength)
inline

Sets the extend length used at each end of the colour bar to show values outside the spectrum range. The default extend length is 0.05.

Parameters
extendLengthThe new extend length. Must be non-negative.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::GlyphColourBar::setLabelDivisions ( int  labelDivisions)
inline

Sets the number of divisions between labels. This is one less than the number of labels/ticks. The default label divisions is 10.

Parameters
labelDivisionsThe new number of divisions, at least 1.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::GlyphColourBar::setLabelMaterial ( const Material material)
inline

Sets the material used for colour bar labels and ticks. Can be NULL. Default is none i.e. use the same material as for the colour bar itself, which is supplied by the graphics.

Parameters
materialThe new label material; can be NULL to clear.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::GlyphColourBar::setNumberFormat ( const char *  numberFormat)
inline

Set the number format used to write value labels on the colour bar. This is a C printf format string with a single numerical format in the form: %[+/-/0][length].precision Other characters can be added before or after the number format. Note a literal % is entered by repeating it i.e. %%. The default format is "%+.4e".

Parameters
numberFormatThe printf number format used for value labels.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::GlyphColourBar::setSideAxis ( int  valuesCount,
const double *  valuesIn 
)
inline

Sets the vector defining the side/tick axis of the colour bar. The magnitude of this vector gives the diameter of the bar. The default side axis is (0.1,0,0) for vertical bar and horizontal ticks in window coordinates.

Parameters
valuesCountThe size of valuesIn array. Sets maximum of 3 values.
valuesInArray containing side axis vector. If fewer than 3 values then assumes zero for remaining components.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::GlyphColourBar::setTickLength ( double  tickLength)
inline

Sets the tick length measured from outside radius of the colour bar, in the direction of the side axis. The default tick length is 0.05.

Parameters
tickLengthThe new tick length. Must be non-negative.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.

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