Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# MaterialCollection Class Reference

List of all members.

## Public Member Functions
| MaterialCollection ()
| MaterialCollection (MaterialCollection const copy)
| addMaterial (Material node_material)
| Adds a new Material to the collection.
| addMaterialsFrom (MaterialCollection const other)
| Adds all the Materials indicated in the other collection to this material.
| clear ()
| Removes all Materials from the collection.
Material | findMaterial (string name)
| Returns the material in the collection with the indicated name, if any, or NULL if no material has that name.
Material | getMaterial (int index)
| Returns the nth Material in the collection.
int | getNumMaterials ()
| Returns the number of Materials in the collection.
bool | hasMaterial (Material material)
| Returns true if the indicated Material appears in this collection, false otherwise.
MaterialCollection | operator+ (MaterialCollection const other)
| Returns a MaterialCollection representing the concatenation of the two lists.
MaterialCollection | operator+= (MaterialCollection const other)
| Appends the other list onto the end of this one.
MaterialCollection | operator= (MaterialCollection const copy)
Material | operator[] (int index)
| Returns the nth Material in the collection.
| output (ostream out)
| Writes a brief one-line description of the MaterialCollection to the indicated output stream.
| removeDuplicateMaterials ()
| Removes any duplicate entries of the same Materials on this collection.
bool | removeMaterial (Material node_material)
| Removes the indicated Material from the collection.
| removeMaterialsFrom (MaterialCollection const other)
| Removes from this collection all of the Materials listed in the other collection.
int | size ()
| Returns the number of materials in the collection.
| write (ostream out)
| Writes a complete multi-line description of the MaterialCollection to the indicated output stream.
| write (ostream out, int indent_level)
| Writes a complete multi-line description of the MaterialCollection to the indicated output stream.

## Constructor & Destructor Documentation

MaterialCollection | ( |  | ) |

MaterialCollection | ( | MaterialCollection const | copy | ) |

## Member Function Documentation

addMaterial | ( | Material | node_material | ) |

Adds a new Material to the collection.

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

clear | ( |  | ) |

Removes all Materials from the collection.

Material findMaterial | ( | string | name | ) |

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

Material getMaterial | ( | int | index | ) |

Returns the nth Material in the collection.

int getNumMaterials | ( |  | ) |

Returns the number of Materials in the collection.

bool hasMaterial | ( | Material | material | ) |

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

MaterialCollection operator+ | ( | MaterialCollection const | other | ) |

Returns a MaterialCollection representing the concatenation of the two lists.

MaterialCollection operator+= | ( | MaterialCollection const | other | ) |

Appends the other list onto the end of this one.

MaterialCollection operator= | ( | MaterialCollection const | copy | ) |

Material operator[] | ( | int | index | ) |

Returns the nth Material in the collection.

This is the same as get_material(), but it may be a more convenient way to access it.

output | ( | ostream | out | ) |

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

removeDuplicateMaterials | ( |  | ) |

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

removeMaterialsFrom | ( | MaterialCollection const | other | ) |

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

int size | ( |  | ) |

Returns the number of materials in the collection.

This is the same thing as get_num_materials().

write | ( | ostream | out | ) |

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

write | ( | ostream | out,
|  | int | indent_level
| ) |  |

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

All Classes Namespaces Functions Variables Enumerations Enumerator Properties