OpenCMISS-Zinc C++ API Documentation
|
Zinc materials specify colouring of graphics. More...
#include <material.hpp>
Public Types | |
enum | Attribute { ATTRIBUTE_INVALID = CMZN_MATERIAL_ATTRIBUTE_INVALID, ATTRIBUTE_ALPHA = CMZN_MATERIAL_ATTRIBUTE_ALPHA, ATTRIBUTE_AMBIENT = CMZN_MATERIAL_ATTRIBUTE_AMBIENT, ATTRIBUTE_DIFFUSE = CMZN_MATERIAL_ATTRIBUTE_DIFFUSE, ATTRIBUTE_EMISSION = CMZN_MATERIAL_ATTRIBUTE_EMISSION, ATTRIBUTE_SHININESS = CMZN_MATERIAL_ATTRIBUTE_SHININESS, ATTRIBUTE_SPECULAR = CMZN_MATERIAL_ATTRIBUTE_SPECULAR } |
Public Member Functions | |
Material (cmzn_material_id material_id) | |
Material (const Material &material) | |
Material & | operator= (const Material &material) |
bool | isValid () const |
cmzn_material_id | getId () const |
bool | isManaged () |
int | setManaged (bool value) |
double | getAttributeReal (Attribute attribute) |
int | setAttributeReal (Attribute attribute, double value) |
int | getAttributeReal3 (Attribute attribute, double *valuesOut3) |
int | setAttributeReal3 (Attribute attribute, const double *valuesIn3) |
char * | getName () |
int | setName (const char *name) |
Field | getTextureField (int textureNumber) |
int | setTextureField (int textureNumber, const Field &textureField) |
Protected Attributes | |
cmzn_material_id | id |
Zinc materials specify colouring of graphics.
Zinc materials specify colouring of graphics similarly to the original OpenGL shading model with diffuse, ambient, emission and specular colours, shininess and alpha/opacity. Image fields can be attached for texturing (and will be used by OpenGL shaders once enabled in a future release).
Labels of material attributes which may be set or obtained using generic get/set_attribute functions.
|
inline |
Get a real value of an attribute of the material.
attribute | The identifier of the real attribute to get. |
|
inline |
Get a 3 components vectors of an attribute of the material. <values> should be allocated with enough space for 3 components.
attribute | The identifier of the vectors attribute to get. |
|
inline |
|
inline |
Return an allocated string containing material name.
|
inline |
Get field containing an image used for texturing the material.
textureNumber | The number of the texture to get, from 1 to 4. |
|
inline |
Get managed status of material in its owning material module.
|
inline |
Check if this is a valid Material object.
|
inline |
Set a real value for an attribute of the material.
attribute | The identifier of the real attribute to set. |
value | The new value for the attribute. |
|
inline |
Set a 3 components vectors of an attribute for the material. <values> should be a vectors with 3 components containg valid values.
attribute | The identifier of the vectors attribute to get. |
|
inline |
Set managed status of material in its owning material module. If set (managed) the material will remain indefinitely in the material module even if no external references are held. If not set (unmanaged) the material 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.
value | The new value for the managed flag: true or false. |
|
inline |
Set/change name for <material>.
name | name to be set to the material |
|
inline |
Set field containing an image used for texturing the material. Up to 4 textures can be used with a material.
textureNumber | The number of the texture to set, from 1 to 4. Texture 1 is used for texture mapping with the legacy OpenGL shader model. Custom material shaders can use any of the textures explicitly. |
textureField | The field supplying the texture image. Must be of type field_image. |