MaterialCollection

class MaterialCollection

Inheritance diagram

Inheritance diagram of MaterialCollection

MaterialCollection(void)
MaterialCollection(MaterialCollection const &copy)
void add_material(Material *node_material)

Adds a new Material to the collection.

void add_materials_from(MaterialCollection const &other)

Adds all the Materials indicated in the other collection to this material. The other materials are simply appended to the end of the materials in this list; duplicates are not automatically removed.

void clear(void)

Removes all Materials from the collection.

Material *find_material(std::string const &name) const

Returns the material in the collection with the indicated name, if any, or NULL if no material has that name.

Material *get_material(int index) const

Returns the nth Material in the collection.

int get_num_materials(void) const

Returns the number of Materials in the collection.

bool has_material(Material *material) const

Returns true if the indicated Material appears in this collection, false otherwise.

void output(std::ostream &out) const

Writes a brief one-line description of the MaterialCollection to the indicated output stream.

void remove_duplicate_materials(void)

Removes any duplicate entries of the same Materials on this collection. If a Material appears multiple times, the first appearance is retained; subsequent appearances are removed.

bool remove_material(Material *node_material)

Removes the indicated Material from the collection. Returns true if the material was removed, false if it was not a member of the collection.

void remove_materials_from(MaterialCollection const &other)

Removes from this collection all of the Materials listed in the other collection.

int size(void) const

Returns the number of materials in the collection. This is the same thing as get_num_materials().

void write(std::ostream &out, int indent_level = 0) const

Writes a complete multi-line description of the MaterialCollection to the indicated output stream.