OpenCMISS-Zinc C++ API Documentation
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Pages
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 ()
 
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)
 

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.
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.

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.
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 any new graphics.

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.

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