9 #ifndef CMZN_MATERIAL_HPP__ 10 #define CMZN_MATERIAL_HPP__ 12 #include "opencmiss/zinc/material.h" 13 #include "opencmiss/zinc/context.hpp" 14 #include "opencmiss/zinc/field.hpp" 41 explicit Material(cmzn_material_id material_id) :
46 id(cmzn_material_access(material.id))
51 cmzn_material_id temp_id = cmzn_material_access(material.id);
54 cmzn_material_destroy(&
id);
64 cmzn_material_destroy(&
id);
143 return cmzn_material_is_managed(
id);
160 return cmzn_material_set_managed(
id, value);
171 return cmzn_material_get_attribute_real(
id,
172 static_cast<cmzn_material_attribute>(attribute));
185 return cmzn_material_set_attribute_real(
id,
186 static_cast<cmzn_material_attribute>(attribute), value);
198 return cmzn_material_get_attribute_real3(
id,
199 static_cast<cmzn_material_attribute>(attribute), valuesOut3);
212 return cmzn_material_set_attribute_real3(
id,
213 static_cast<cmzn_material_attribute>(attribute), valuesIn3);
224 return cmzn_material_get_name(
id);
236 return cmzn_material_set_name(
id, name);
247 return Field(cmzn_material_get_texture_field(
id, textureNumber));
263 return cmzn_material_set_texture_field(
id, textureNumber, textureField.
getId());
282 cmzn_materialiterator_id id;
295 id(cmzn_materialiterator_access(materialiterator.id))
300 cmzn_materialiterator_id temp_id = cmzn_materialiterator_access(materialiterator.id);
303 cmzn_materialiterator_destroy(&
id);
313 cmzn_materialiterator_destroy(&
id);
336 return Material(cmzn_materialiterator_next(
id));
353 cmzn_materialmodule_id id;
361 explicit Materialmodule(cmzn_materialmodule_id in_materialmodule_id) :
362 id(in_materialmodule_id)
366 id(cmzn_materialmodule_access(materialModule.id))
371 cmzn_materialmodule_id temp_id = cmzn_materialmodule_access(
375 cmzn_materialmodule_destroy(&
id);
385 cmzn_materialmodule_destroy(&
id);
404 cmzn_materialmodule_id
getId()
const 417 return Material(cmzn_materialmodule_create_material(
id));
445 return Material(cmzn_materialmodule_find_material_by_name(
id, name));
459 return cmzn_materialmodule_begin_change(
id);
473 return cmzn_materialmodule_end_change(
id);
485 return cmzn_materialmodule_define_standard_materials(
id);
496 return Material(cmzn_materialmodule_get_default_material(
id));
510 return cmzn_materialmodule_set_default_material(
id, material.
getId());
521 return Material(cmzn_materialmodule_get_default_selected_material(
id));
532 return cmzn_materialmodule_set_default_selected_material(
id, material.
getId());
543 return Material(cmzn_materialmodule_get_default_surface_material(
id));
556 return cmzn_materialmodule_set_default_surface_material(
id, material.
getId());
int setTextureField(int textureNumber, const Field &textureField)
Definition: material.hpp:261
Definition: material.hpp:108
int getAttributeReal3(Attribute attribute, double *valuesOut3)
Definition: material.hpp:196
int endChange()
Definition: material.hpp:471
Definition: material.hpp:94
Definition: material.hpp:115
int beginChange()
Definition: material.hpp:457
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:51
Material getDefaultSurfaceMaterial()
Definition: material.hpp:541
bool isValid() const
Definition: material.hpp:73
Materialmodule getMaterialmodule()
Definition: material.hpp:560
Attribute
Definition: material.hpp:92
Definition: material.hpp:102
Material createMaterial()
Definition: material.hpp:415
cmzn_material_id getId() const
Definition: material.hpp:83
char * getName()
Definition: material.hpp:222
int setDefaultSurfaceMaterial(const Material &material)
Definition: material.hpp:554
int setDefaultMaterial(const Material &material)
Definition: material.hpp:508
int setDefaultSelectedMaterial(const Material &material)
Definition: material.hpp:530
Material next()
Definition: material.hpp:334
An iterator for looping through all the materials in a materialmodule.
Definition: material.hpp:278
cmzn_materialmodule_id getId() const
Definition: material.hpp:404
cmzn_field_id getId() const
Definition: field.hpp:103
bool isValid() const
Definition: material.hpp:394
int defineStandardMaterials()
Definition: material.hpp:483
Material getDefaultMaterial()
Definition: material.hpp:494
Zinc materials specify colouring of graphics.
Definition: material.hpp:29
int setManaged(bool value)
Definition: material.hpp:158
Materialiterator createMaterialiterator()
Definition: material.hpp:432
bool isValid() const
Definition: material.hpp:322
Module managing all materials.
Definition: material.hpp:350
Definition: material.hpp:96
bool isManaged()
Definition: material.hpp:141
Definition: material.hpp:126
Material findMaterialByName(const char *name)
Definition: material.hpp:443
Definition: material.hpp:121
Material getDefaultSelectedMaterial()
Definition: material.hpp:519
int setAttributeReal(Attribute attribute, double value)
Definition: material.hpp:183
The OpenCMISS namespace.
Definition: context.hpp:20
int setAttributeReal3(Attribute attribute, const double *valuesIn3)
Definition: material.hpp:210
int setName(const char *name)
Definition: material.hpp:234
Field getTextureField(int textureNumber)
Definition: material.hpp:245
double getAttributeReal(Attribute attribute)
Definition: material.hpp:169