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

Attributes object specifying how points are visualised. More...

#include <graphics.hpp>

Public Member Functions

 Graphicspointattributes (cmzn_graphicspointattributes_id point_attributes_id)
 
 Graphicspointattributes (const Graphicspointattributes &pointAttributes)
 
Graphicspointattributesoperator= (const Graphicspointattributes &graphicspointattributes)
 
bool isValid () const
 
int getBaseSize (int valuesCount, double *valuesOut)
 
int setBaseSize (int valuesCount, const double *valuesIn)
 
Font getFont ()
 
int setFont (const Font &font)
 
Glyph getGlyph ()
 
int setGlyph (const Glyph &glyph)
 
int getGlyphOffset (int valuesCount, double *valuesOut)
 
int setGlyphOffset (int valuesCount, const double *valuesIn)
 
Glyph::RepeatMode getGlyphRepeatMode ()
 
int setGlyphRepeatMode (Glyph::RepeatMode glyphRepeatMode)
 
Glyph::ShapeType getGlyphShapeType ()
 
int setGlyphShapeType (Glyph::ShapeType shapeType)
 
Field getLabelField ()
 
int setLabelField (const Field &labelField)
 
int getLabelOffset (int valuesCount, double *valuesOut)
 
int setLabelOffset (int valuesCount, const double *valuesIn)
 
char * getLabelText (int labelNumber)
 
int setLabelText (int labelNumber, const char *labelText)
 
Field getOrientationScaleField ()
 
int setOrientationScaleField (const Field &orientationScaleField)
 
int getScaleFactors (int valuesCount, double *valuesOut)
 
int setScaleFactors (int valuesCount, const double *valuesIn)
 
Field getSignedScaleField ()
 
int setSignedScaleField (const Field &signedScaleField)
 

Protected Attributes

cmzn_graphicspointattributes_id id
 

Detailed Description

Attributes object specifying how points are visualised.

Attributes object specifying how points are visualised in the graphics including glyph, scaling, labels and font.

See also
Graphics::getGraphicspointattributes

Member Function Documentation

int OpenCMISS::Zinc::Graphicspointattributes::getBaseSize ( int  valuesCount,
double *  valuesOut 
)
inline

Gets the base size of the point glyph, up to 3 values, one for each axis.

See also
Graphicspointattributes::setBaseSize.
Parameters
valuesCountThe number of base size values to request, starting with the first axis. If fewer values have been set it is padded with the last base size value. 1 to 3 values can be obtained.
valuesOutArray to receive base sizes. Must be big enough to contain the specified number of values.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
Font OpenCMISS::Zinc::Graphicspointattributes::getFont ( )
inline

Gets the font in the graphics point attributes used to draw the label field.

Returns
Handle to font, or NULL/invalid handle if none or failed.
Glyph OpenCMISS::Zinc::Graphicspointattributes::getGlyph ( )
inline

Gets the glyph in the graphics point attributes used to visualise points.

Returns
Handle to glyph, or NULL/invalid handle if none or failed.
int OpenCMISS::Zinc::Graphicspointattributes::getGlyphOffset ( int  valuesCount,
double *  valuesOut 
)
inline

Gets the offset from the point coordinates to where the glyph origin is drawn, in glyph units along the glyph local axes.

See also
Graphicspointattributes::setGlyphOffset.
Parameters
valuesCountThe number of offset values to request, up to 3.
valuesOutArray to receive offset values, starting with the first axis. Must be big enough to contain the specified number of values.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
Glyph::RepeatMode OpenCMISS::Zinc::Graphicspointattributes::getGlyphRepeatMode ( )
inline

Return the current glyph repeat mode.

See also
Graphicspointattributes::setGlyphRepeatMode
Returns
The current glyph repeat mode.
Glyph::ShapeType OpenCMISS::Zinc::Graphicspointattributes::getGlyphShapeType ( )
inline

Gets the enumerated value identifying the current glyph used in the point attributes.

Returns
The glyph type identifier, or CMZN_GLYPH_SHAPE_TYPE_INVALID if invalid arguments or glyph does not have a valid type.
Field OpenCMISS::Zinc::Graphicspointattributes::getLabelField ( )
inline

Gets the label field from the graphics point attributes.

Returns
Handle to label field, or NULL/invalid handle if none or failed.
int OpenCMISS::Zinc::Graphicspointattributes::getLabelOffset ( int  valuesCount,
double *  valuesOut 
)
inline

Gets the label offset relative to the glyph axes from its origin.

See also
Graphicspointattributes::setLabelOffset
Parameters
valuesCountThe number of offset values to request, up to 3.
valuesOutArray to receive offset values, starting with the first axis. Must be big enough to contain the specified number of values.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
char* OpenCMISS::Zinc::Graphicspointattributes::getLabelText ( int  labelNumber)
inline

Get static label text to be shown near each glyph.

See also
Graphicspointattributes::setLabelText
Parameters
labelNumberThe label_number to get, from 1 to 3.
Returns
Allocated string containing label text, or NULL if none or error. Up to caller to free using cmzn_deallocate().
Field OpenCMISS::Zinc::Graphicspointattributes::getOrientationScaleField ( )
inline

Gets the orientation scale field from the graphics point attributes. This controls scaling and orientation of point glyphs.

See also
Graphicspointattributes::setOrientationScaleField
Returns
Handle to orientation scale field, or NULL/invalid handle if none or failed.
int OpenCMISS::Zinc::Graphicspointattributes::getScaleFactors ( int  valuesCount,
double *  valuesOut 
)
inline

Sets the scale factors used in sizing the point glyph, up to 3 values, one for each axis.

See also
Graphicspointattributes::setScaleFactors.
Parameters
valuesCountThe number of scale_factors to request, starting with the first axis. If fewer values have been set it is padded with the last scale factor value. 1 to 3 values can be obtained.
valuesOutArray to receive scale factors. Must be big enough to contain the specified number of values.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
Field OpenCMISS::Zinc::Graphicspointattributes::getSignedScaleField ( )
inline

Gets the signed scale field from the graphics point attributes.

See also
Graphicspointattributes::setSignedScaleField
Returns
Handle to signed scale field, or NULL/invalid handle if none or failed.
bool OpenCMISS::Zinc::Graphicspointattributes::isValid ( ) const
inline

Check if this is a valid Graphicspointattributes object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Graphicspointattributes::setBaseSize ( int  valuesCount,
const double *  valuesIn 
)
inline

Sets the base size of the point glyph, up to 3 values, one for each axis. For a unit sized glyph, the final size in each direction is: base_size + scale_factor * field_scalar where field_scalar is determined from the orientation_scale_field.

See also
Graphicspointattributes::setOrientationScaleField. The default base size is zero. Tip: to visualise a 2- or 3-component vector orientation_scale_field, use a base size of 0,D,D with scale factors 1,0,0. This ensures the length equals the magnitude and the glyph is fixed to size D on the orthogonal axes.
Parameters
valuesCountThe number of base size values to set, starting with the first axis. If fewer values are set than the number of axes, the last value is assumed for subsequent axes. Hence a single value can be used to set the diameter for a unit sphere glyph.
valuesInArray of base sizes with the number of values specified.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Graphicspointattributes::setFont ( const Font font)
inline

Sets the font in the graphics point attributes used to draw the label field.

Parameters
fontThe font to set.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Graphicspointattributes::setGlyph ( const Glyph glyph)
inline

Sets the glyph in the graphics point attributes used to visualise points.

Parameters
glyphThe glyph to set.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Graphicspointattributes::setGlyphOffset ( int  valuesCount,
const double *  valuesIn 
)
inline

Sets the offset from the point coordinates to where the glyph origin is drawn, in glyph units along the glyph local axes.

See also
Graphicspointattributes::setOrientationScaleField. Tip: offset values can give the effect of moving the centre point / origin of the glyph: just pass in negative coordinates for the new origin.
Parameters
valuesCountThe number of offset values to set, up to 3.
valuesInArray of offset values, starting with the first axis. If fewer than 3 then zero is assumed for all other offset values.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Graphicspointattributes::setGlyphRepeatMode ( Glyph::RepeatMode  glyphRepeatMode)
inline

Sets the glyph repeat mode which controls whether multiple glyphs are drawn at each point and how.

See also
Glyph::RepeatMode
Parameters
glyphRepeatModeThe new repeat mode.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Graphicspointattributes::setGlyphShapeType ( Glyph::ShapeType  shapeType)
inline

Sets the glyph used for visualising a graphics point from a set of enumerations. Requires standard glyphs to first be created.

See also
Glyphmodule::defineStandardGlyphs If no glyph exists with the type identifier, the glyph is unchanged.
Parameters
shapeTypeThe glyph shape type identifier.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Graphicspointattributes::setLabelField ( const Field labelField)
inline

Sets the label field in the graphics point attributes. A string representation of this field's value (if defined) is drawn with the current font at the glyph offset.

Parameters
labelFieldThe label field to set.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Graphicspointattributes::setLabelOffset ( int  valuesCount,
const double *  valuesIn 
)
inline

Sets the label offset relative to the glyph axes from its origin set by the glyph offset. A unit offset moves the label the length of the axis vector.

See also
Graphicspointattributes::setOrientationScaleField.
Parameters
valuesCountThe number of offset values to set, up to 3.
valuesInArray of offset values, starting with the first axis. If fewer than 3 then zero is assumed for all other offset values.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Graphicspointattributes::setLabelText ( int  labelNumber,
const char *  labelText 
)
inline

Set static label text to be shown near each glyph. The number of labels depends on the glyph repeat mode, one label per glyph for REPEAT_MODE_AXES, one label for REPEAT_MODE_NONE and REPEAT_MODE_MIRROR. Note the label field value is written for the first label only, prefixed by the first static label text.

See also
Graphicspointattributes::setGlyphRepeatMode
Parameters
labelNumberThe label_number to set, from 1 to 3.
labelTextThe string to set as static label text.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Graphicspointattributes::setOrientationScaleField ( const Field orientationScaleField)
inline

Sets the orientation scale field in the graphics point attributes. This controls scaling and orientation of point glyphs. Only fields with the following numbers of components are allowed, with the prescribed behaviour: 1 : default orientation in line with local x, y and z axes, with scalar value equally applied in all 3 axes. 2 : 2-D vector giving orientation of 1st axis. 2nd vector is 90 degrees anticlockwise in 2-D plane, and 3rd vector is v1 (x) v2. Scale in all directions is magnitude of vector; use a zero scale factor to not scale in any axis. 3 : 3-D vector giving orientation of first axis. 2nd vector is arbitrary normal to this, and 3rd vector is v1 (x) v2. Scale in all directions is magnitude of vector; use a zero scale factor to not scale in any axis. 4 : 2 2-D vectors each giving orientation and scale (from magnitude) of 1st and 2nd axes. 3rd axis is v1 (x) v2 including scale from its magnitude. 6 : 2 3-D vectors each giving orientation and scale (from magnitude) of 1st and 2nd axes. 3rd axis is v1 (x) v2 including scale from its magnitude. 9 : 3 3-D vectors giving orientation and scale (from magnitude) of all 3 axes, in a right-handed sense. Note the signed scale field provides additional scaling and orientation reversal for negative values.

See also
Graphicspointattributes::setSignedScaleField
Parameters
orientationScaleFieldThe orientation scale field to set.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Graphicspointattributes::setScaleFactors ( int  valuesCount,
const double *  valuesIn 
)
inline

Sets the scale factors used in sizing the point glyph, up to 3 values, one for each axis. For a unit sized glyph, the final size in each direction is: base_size + scale_factor * field_scalar where field_scalar is determined from the orientation_scale_field.

See also
Graphicspointattributes::setOrientationScaleField. Scale factor values default to 1. Tip: to visualise a 2- or 3-component vector orientation_scale_field, use a base size of 0,D,D with scale factors 1,0,0. This ensures the length equals the magnitude and the glyph is fixed to size D on the orthogonal axes.
Parameters
valuesCountThe number of scale factor values to set, starting with the first axis. If fewer values are set than the number of axes, the last value is assumed for subsequent axes. Hence a single value applies to all axes.
valuesInArray of scale factors with the number of values specified.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Graphicspointattributes::setSignedScaleField ( const Field signedScaleField)
inline

Sets the signed scale field in the graphics point attributes. Can have from 1 to 3 components which multiply the scaling from the orientation scale field on the corresponding axis. Note special behaviour applies when used with the GLYPH_REPEAT_MODE_MIRROR mode: If value is negative on the first axis, the origin of the glyph is moved to the end of the first axis and its direction is reversed. This is commonly used to draw stress and strain with mirrored arrow-like glyphs pointing inward for compression, and outward for tension. Do this by passing a single eigenvalue (of stress or strain tensor) as the signed_scale and the corresponding eigenvector as the orientation_scale field, with repeat mirror. Use a separate points graphics for each eigenvalue.

See also
Graphicspointattributes::setGlyphRepeatMode
Parameters
signedScaleFieldThe signed scale field to set.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.

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