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

The context is the primary object created for each instance of Zinc. More...

#include <context.hpp>

Public Member Functions

 Context (const char *contextName)
 
 Context (cmzn_context_id context_id)
 
 Context (const Context &context)
 
bool isValid () const
 
Contextoperator= (const Context &context)
 
cmzn_context_id getId () const
 
int getVersion (int *versionOut3)
 
const char * getRevision ()
 
char * getVersionString ()
 
Region createRegion ()
 
Region getDefaultRegion ()
 
int setDefaultRegion (const Region &region)
 
Fontmodule getFontmodule ()
 
Glyphmodule getGlyphmodule ()
 
Lightmodule getLightmodule ()
 
Logger getLogger ()
 
Materialmodule getMaterialmodule ()
 
Scenefiltermodule getScenefiltermodule ()
 
Sceneviewermodule getSceneviewermodule ()
 
Spectrummodule getSpectrummodule ()
 
Tessellationmodule getTessellationmodule ()
 
Timekeepermodule getTimekeepermodule ()
 

Detailed Description

The context is the primary object created for each instance of Zinc.

The context is the primary object created for each instance of Zinc. All other objects are created or obtained directly or indirectly from it. If multiple contexts are used, ensure that only objects stemming from the same context are used together.

Member Function Documentation

Region OpenCMISS::Zinc::Context::createRegion ( )
inline

Create a new region and return a handle to it. Use this function to create a region forming the root of an independent region tree. Equivalent to region create region method. Compare with region create child/subregion methods which create and add a region to the tree.

See also
Region::createRegion
Region::createChild
Region::createSubregion
Returns
Handle to new region, or NULL/invalid handle on failure.
Region OpenCMISS::Zinc::Context::getDefaultRegion ( )
inline

Returns the default region in the context. A convenience for applications that need only one region tree.

Returns
Handle to region, or NULL/invalid handle on failure.
Fontmodule OpenCMISS::Zinc::Context::getFontmodule ( )
inline

Get the font module which manages fonts for rendering text in graphics.

Returns
Handle to the font module, or NULL/invalid handle on failure.
Glyphmodule OpenCMISS::Zinc::Context::getGlyphmodule ( )
inline

Get the glyph module which stores static graphics for visualising points, vectors, axes etc. Note on startup no glyphs are defined and glyph module functions need to be called to define standard glyphs.

Returns
Handle to the glyph module, or NULL/invalid handle on failure.
cmzn_context_id OpenCMISS::Zinc::Context::getId ( ) const
inline

Return the C handle of the Context object.

Returns
C handle of Context if this objects is valid, 0 otherwise.
Lightmodule OpenCMISS::Zinc::Context::getLightmodule ( )
inline

Return the light module which manages lights used to calculate the final colour of vertices in combination with material colour.

Returns
Handle to the light module, or NULL/invalid handle on failure.
Logger OpenCMISS::Zinc::Context::getLogger ( )
inline

Return the logger which logs debug messages.

Returns
Handle to the logger, or NULL/invalid handle on failure.
Materialmodule OpenCMISS::Zinc::Context::getMaterialmodule ( )
inline

Return the material module which manages materials used to colour, texture and shade graphics. Note on startup only materials "default" and "default_selected" are defined, as white and red, respectively. Additional standard and custom materials can be defined using material module functions.

Returns
Handle to the material module, or NULL/invalid handle on failure.
const char* OpenCMISS::Zinc::Context::getRevision ( )
inline

Get the revision number of this Zinc library.

Returns
Revision of this Zinc library on success, 0 on failure.
Scenefiltermodule OpenCMISS::Zinc::Context::getScenefiltermodule ( )
inline

Get the scene filter module which manages scenefilter objects for filtering contents of scenes with scenepicker and sceneviewer etc.

Returns
Handle to the scene filter module, or NULL/invalid handle on failure.
Sceneviewermodule OpenCMISS::Zinc::Context::getSceneviewermodule ( )
inline

Returns a handle to a sceneviewer module which manages sceneviewer objects for rendering 3-D scenes into rectangular windows or canvases using OpenGL.

Returns
Handle to the sceneviewer module, or NULL/invalid handle on failure.
Spectrummodule OpenCMISS::Zinc::Context::getSpectrummodule ( )
inline

Get the spectrum module which manages spectrum objects controlling how graphics data fields are converted into colours.

Returns
Handle to the spectrum module, or NULL/invalid handle on failure.
Tessellationmodule OpenCMISS::Zinc::Context::getTessellationmodule ( )
inline

Get the tessellation module which manages objects controlling how curves are approximated by line segments in graphics.

Returns
Handle to the tesselation module, or NULL/invalid handle on failure.
Timekeepermodule OpenCMISS::Zinc::Context::getTimekeepermodule ( )
inline

Get the timekeeper module which manages objects for synchronising time across zinc objects.

Returns
Handle to the timekeeper module, or NULL/invalid handle on failure.
int OpenCMISS::Zinc::Context::getVersion ( int *  versionOut3)
inline

Get the version number of this Zinc library. It will return the major version, minor version and patch version in a 3 component integer array.

Parameters
versionOut3Array of size 3 to hold the values of the version number, they are the major version, minor version and patch version respectively.
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
char* OpenCMISS::Zinc::Context::getVersionString ( )
inline

Get the version string of this Zinc library. The version string will be output in the following format "[major version].[minor version].[patch version].r[revision(M)](.Debug)" (M) indicates this binary contains local modifications that are not included in the revision, and (.Debug) indicates this binary is not optimised.

Returns
on success : allocated string containing version details. Up to caller to free using cmzn_deallocate().
bool OpenCMISS::Zinc::Context::isValid ( ) const
inline

Check if this is a valid Context object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Context::setDefaultRegion ( const Region region)
inline

Sets the default region in the context. A convenience for applications that need only one region tree.

Parameters
regionThe new default region.
Returns
OpenCMISS::Zinc::OK on success, otherwise any other status code.

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