9 #ifndef CMZN_MATERIAL_HPP__
10 #define CMZN_MATERIAL_HPP__
12 #include "zinc/material.h"
13 #include "zinc/context.hpp"
14 #include "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());
281 cmzn_materialmodule_id id;
289 explicit Materialmodule(cmzn_materialmodule_id in_materialmodule_id) :
290 id(in_materialmodule_id)
294 id(cmzn_materialmodule_access(materialModule.id))
299 cmzn_materialmodule_id temp_id = cmzn_materialmodule_access(
303 cmzn_materialmodule_destroy(&
id);
313 cmzn_materialmodule_destroy(&
id);
332 cmzn_materialmodule_id
getId()
const
345 return Material(cmzn_materialmodule_create_material(
id));
356 return Material(cmzn_materialmodule_find_material_by_name(
id, name));
370 return cmzn_materialmodule_begin_change(
id);
384 return cmzn_materialmodule_end_change(
id);
396 return cmzn_materialmodule_define_standard_materials(
id);
406 return Material(cmzn_materialmodule_get_default_material(
id));
418 return cmzn_materialmodule_set_default_material(
id, material.
getId());
429 return Material(cmzn_materialmodule_get_default_selected_material(
id));
440 return cmzn_materialmodule_set_default_selected_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:382
Definition: material.hpp:94
Definition: material.hpp:115
int beginChange()
Definition: material.hpp:368
Base field type: an abstraction of a mathematical field.
Definition: field.hpp:46
bool isValid() const
Definition: material.hpp:73
Materialmodule getMaterialmodule()
Definition: material.hpp:444
Attribute
Definition: material.hpp:92
Definition: material.hpp:102
Material createMaterial()
Definition: material.hpp:343
cmzn_material_id getId() const
Definition: material.hpp:83
char * getName()
Definition: material.hpp:222
int setDefaultMaterial(const Material &material)
Definition: material.hpp:416
int setDefaultSelectedMaterial(const Material &material)
Definition: material.hpp:438
cmzn_materialmodule_id getId() const
Definition: material.hpp:332
cmzn_field_id getId() const
Definition: field.hpp:98
bool isValid() const
Definition: material.hpp:322
int defineStandardMaterials()
Definition: material.hpp:394
Material getDefaultMaterial()
Definition: material.hpp:404
Zinc materials specify colouring of graphics.
Definition: material.hpp:29
int setManaged(bool value)
Definition: material.hpp:158
Module managing all materials.
Definition: material.hpp:278
Definition: material.hpp:96
bool isManaged()
Definition: material.hpp:141
Definition: material.hpp:126
Material findMaterialByName(const char *name)
Definition: material.hpp:354
Definition: material.hpp:121
Material getDefaultSelectedMaterial()
Definition: material.hpp:427
int setAttributeReal(Attribute attribute, double value)
Definition: material.hpp:183
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