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

Module managing all materials. More...

#include <material.hpp>

Public Member Functions

 Materialmodule (cmzn_materialmodule_id in_materialmodule_id)
 
 Materialmodule (const Materialmodule &materialModule)
 
Materialmoduleoperator= (const Materialmodule &materialModule)
 
bool isValid () const
 
cmzn_materialmodule_id getId () const
 
Material createMaterial ()
 
Materialiterator createMaterialiterator ()
 
Material findMaterialByName (const char *name)
 
int beginChange ()
 
int endChange ()
 
int defineStandardMaterials ()
 
Material getDefaultMaterial ()
 
int setDefaultMaterial (const Material &material)
 
Material getDefaultSelectedMaterial ()
 
int setDefaultSelectedMaterial (const Material &material)
 
Material getDefaultSurfaceMaterial ()
 
int setDefaultSurfaceMaterial (const Material &material)
 

Protected Attributes

cmzn_materialmodule_id id
 

Detailed Description

Module managing all materials.

Module managing all materials. Note that only default and default selected materials exist on start-up, so many users will want to define standard materials early in their program. Standard materials include basic colours, greys, bioengineering materials (bone, muscle, tissue), etc. Alternative and additional materials can be defined using the API.

See also
Materialmodule::defineStandardMaterials

Member Function Documentation

int OpenCMISS::Zinc::Materialmodule::beginChange ( )
inline

Begin caching or increment cache level for this material module. Call this function before making multiple changes to minimise number of change messages sent to clients. Must remember to end_change after completing changes. Can be nested.

See also
Materialmodule::endChange
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
Material OpenCMISS::Zinc::Materialmodule::createMaterial ( )
inline

Create and return a new material.

material will belong to.

Returns
Handle to new material, or NULL/invalid handle on failure.
Materialiterator OpenCMISS::Zinc::Materialmodule::createMaterialiterator ( )
inline

Create a material iterator object for iterating through the materials in the material module, in alphabetical order of name. The iterator initially points at the position before the first material, so the first call to the material iterator next() method returns the first material and advances the iterator. Iterator becomes invalid if materials are added, removed or renamed while in use.

See also
Materialiterator::next

be iterated over.

Returns
Handle to material iterator, or NULL/invalid handle on failure.
int OpenCMISS::Zinc::Materialmodule::defineStandardMaterials ( )
inline

Define a list of standard cmgui materials and store them as they are managed by graphics module.

Returns
Status OpenCMISS::Zinc::OK if successfully create a list of standard materials into material module, any other value on failure.
int OpenCMISS::Zinc::Materialmodule::endChange ( )
inline

Decrement cache level or end caching of changes for the material module. Call matching begin change method before making multiple changes and call this afterwards. When change level is restored to zero, cached change messages are sent out to clients.

See also
Materialmodule::beginChange
Returns
Status OpenCMISS::Zinc::OK on success, any other value on failure.
Material OpenCMISS::Zinc::Materialmodule::findMaterialByName ( const char *  name)
inline

Find the material with the specified name, if any.

Parameters
nameThe name of the material.
Returns
Handle to material, or NULL/invalid handle if not found or failed.
Material OpenCMISS::Zinc::Materialmodule::getDefaultMaterial ( )
inline

Get the default material, if any.

See also
Materialmodule::setDefaultMaterial
Returns
Handle to material, or NULL/invalid handle if none or failed.
Material OpenCMISS::Zinc::Materialmodule::getDefaultSelectedMaterial ( )
inline

Get the default selected material, if any. This material is used as the default selected material for any new graphics.

Returns
Handle to material, or NULL/invalid handle if none or failed.
Material OpenCMISS::Zinc::Materialmodule::getDefaultSurfaceMaterial ( )
inline

Get the default surface material, if any.

See also
Materialmodule::setDefaultSurfaceMaterial
Returns
Handle to material, or NULL/invalid handle if none or failed.
cmzn_materialmodule_id OpenCMISS::Zinc::Materialmodule::getId ( ) const
inline

Return the C handle of the Materialmodule object.

Returns
C handle of Materialmodule if this objects is valid, 0 otherwise.
bool OpenCMISS::Zinc::Materialmodule::isValid ( ) const
inline

Check if this is a valid Materialmodule object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Materialmodule::setDefaultMaterial ( const Material material)
inline

Set the default material. This material is used as the default material for new graphics, but note if the default surface material is set it is used instead for new surface and contours graphics.

See also
Materialmodule::setDefaultSurfaceMaterial
Parameters
materialThe material to set as default.
Returns
OpenCMISS::Zinc::OK on success otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Materialmodule::setDefaultSelectedMaterial ( const Material material)
inline

Set the default selected material.

Parameters
materialThe material to set as default.
Returns
OpenCMISS::Zinc::OK on success otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Materialmodule::setDefaultSurfaceMaterial ( const Material material)
inline

Set the default surface material set for new surface and contours graphics. If this is not set, the default material is used instead.

Parameters
materialThe material to set as default for surfaces. Pass NULL or unvalid material to clear.
Returns
OpenCMISS::Zinc::OK on success otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.

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