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

A glyph is a static graphics object used to visualise a point in space. More...

#include <glyph.hpp>

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

Public Types

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
 

Public Member Functions

 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 ()
 

Protected Attributes

cmzn_glyph_id id
 

Detailed Description

A glyph is a static graphics object used to visualise a point in space.

A glyph is a static graphics object used to visualise a point in space, e.g. point, line, sphere, axes etc. Note that the appearance of some glyphs depend on attributes of point graphics used to draw them: circular glyphs (sphere, cylinder etc.) use the circle divisions of the glyph object, axes with labels use the font. Derived glyph types implement custom axes and spectrum colour bar.

Member Typedef Documentation

Type for passing logical OR of ChangeFlag

See also
Glyphmoduleevent::getGlyphChangeFlags

Member Enumeration Documentation

Bit flags summarising changes to a glyph or glyphs in a glyphmodule.

Enumerator
CHANGE_FLAG_NONE 

glyph(s) not changed

CHANGE_FLAG_ADD 

one or more glyphs added

CHANGE_FLAG_REMOVE 

one or more glyphs removed

CHANGE_FLAG_IDENTIFIER 

glyph identifier changed

CHANGE_FLAG_DEFINITION 

change to glyph attributes other than identifier.

CHANGE_FLAG_FULL_RESULT 

all resultant values of glyph changed.

CHANGE_FLAG_FINAL 

final notification: owning glyph module i.e. glyph module has been destroyed

An enum defining how glyphs are repeatedly displayed at points.

See also
Graphicspointattributes
Enumerator
REPEAT_MODE_INVALID 

Unspecified glyph repeat mode

REPEAT_MODE_NONE 

default cmzn_glyph_repeat_mode normal single glyph display, no repeat

REPEAT_MODE_AXES_2D 

draw glyph 2 times treating each axis as a separate vector. Base size and scale factors are applied separately to each axis.

REPEAT_MODE_AXES_3D 

draw glyph 3 times treating each axis as a separate vector. Base size and scale factors are applied separately to each axis.

REPEAT_MODE_MIRROR 

draw glyph twice, second mirrored about axis1 == 0.0. Commonly used with a signed_scale_field to visualise stress and strains using pairs of arrow glyphs pointing inward for compression, outward for tension. Suitable glyphs (line, arrow, cone) span from 0 to 1 along their first axis. Not suitable for sphere, cube etc. which are symmetric about 0.0 on axis 1. In this mode the label is only shown for the first glyph and the label offset is not reversed with the glyph.

See also
Graphicspointattributes::setSignedScaleField

An enumeration defining standard glyph shapes which can be used as an alternative means to specify the glyph used in graphics.

Enumerator
SHAPE_TYPE_INVALID 

Unspecified glyph shape type

SHAPE_TYPE_NONE 

no glyph

SHAPE_TYPE_ARROW 

line arrow from 0,0,0 to 1,0,0, head 1/3 long unit width

SHAPE_TYPE_ARROW_SOLID 

solid arrow from 0,0,0 to 1,0,0, head 1/3 long unit width

SHAPE_TYPE_AXIS 

line arrow from 0,0,0 to 1,0,0, head 0.1 long unit width

SHAPE_TYPE_AXIS_SOLID 

solid arrow from 0,0,0 to 1,0,0, head 0.1 long unit width

SHAPE_TYPE_CONE 

unit diameter cone from base 0,0,0 to apex 1,0,0, open base

SHAPE_TYPE_CONE_SOLID 

unit diameter cone from base 0,0,0 to apex 1,0,0, closed base

SHAPE_TYPE_CROSS 

3 crossed lines on each axis, centre 0,0,0

SHAPE_TYPE_CUBE_SOLID 

solid unit cube centred at 0,0,0 and aligned with axes

SHAPE_TYPE_CUBE_WIREFRAME 

wireframe unit cube centred at 0,0,0 and aligned with axes

SHAPE_TYPE_CYLINDER 

unit diameter cylinder from 0,0,0 to 1,0,0, open ends

SHAPE_TYPE_CYLINDER_SOLID 

unit diameter cylinder from 0,0,0 to 1,0,0, closed ends

SHAPE_TYPE_DIAMOND 

unit regular octahedron centred at 0,0,0; a degenerate sphere

SHAPE_TYPE_LINE 

line from 0,0,0 to 1,0,0

SHAPE_TYPE_POINT 

a single point at 0,0,0

SHAPE_TYPE_SHEET 

unit square in 1-2 plane centred at 0,0,0

SHAPE_TYPE_SPHERE 

unit sphere centred at 0,0,0

SHAPE_TYPE_AXES 

unit line axes without labels

SHAPE_TYPE_AXES_123 

unit line axes with labels 1,2,3

SHAPE_TYPE_AXES_XYZ 

unit line axes with labels x,y,z

SHAPE_TYPE_AXES_COLOUR 

unit line axes with materials red, green, blue

SHAPE_TYPE_AXES_SOLID 

unit solid arrow axes without labels

SHAPE_TYPE_AXES_SOLID_123 

unit solid arrow axes with labels 1,2,3

SHAPE_TYPE_AXES_SOLID_XYZ 

unit solid arrow axes with labels x,y,z

SHAPE_TYPE_AXES_SOLID_COLOUR 

unit solid arrow axes with materials red, green, blue

Member Function Documentation

GlyphAxes OpenCMISS::Zinc::Glyph::castAxes ( )
inline

If the glyph is type axes, returns the type-specific handle.

Returns
Handle to derived axes glyph, or NULL/invalid handle if wrong type or failed.
GlyphColourBar OpenCMISS::Zinc::Glyph::castColourBar ( )
inline

If the glyph is type colour bar, returns the type-specific handle.

Returns
Handle to derived colour bar glyph, or NULL/invalid handle if wrong type or failed.
cmzn_glyph_id OpenCMISS::Zinc::Glyph::getId ( ) const
inline

Return the C handle of the Glyph object.

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

Return an allocated string containing glyph name.

Returns
Allocated string containing glyph name, or NULL on failure. Up to caller to free using cmzn_deallocate().
bool OpenCMISS::Zinc::Glyph::isManaged ( )
inline

Get managed status of glyph in its owning glyph module.

See also
Glyph::setManaged
Returns
true if glyph is managed, otherwise 0 false.
bool OpenCMISS::Zinc::Glyph::isValid ( ) const
inline

Check if this is a valid Glyph object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Glyph::setManaged ( bool  value)
inline

Set managed status of glyph in its owning glyph module. If set (managed) the glyph will remain indefinitely in the glyph module even if no external references are held. If not set (unmanaged) the glyph will be automatically removed from the module when no longer referenced externally, effectively marking it as pending destruction. All new objects are unmanaged unless stated otherwise.

Parameters
valueThe new value for the managed flag: true or false.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Glyph::setName ( const char *  name)
inline

Set name of the glyph.

Parameters
nameName to be set for the glyph.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.

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