Panda3D
Loading...
Searching...
No Matches
Public Member Functions | List of all members
MaterialCollection Class Reference

#include <pandadoc.hpp>

Public Member Functions

 __init__ ()
 
 __init__ (const MaterialCollection copy)
 
 addMaterial (Material node_material)
 Adds a new Material to the collection.
 
 addMaterialsFrom (const MaterialCollection other)
 Adds all the Materials indicated in the other collection to this material.
 
 clear ()
 Removes all Materials from the collection.
 
Material findMaterial (str 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+ (const MaterialCollection other)
 
MaterialCollection operator+= (const MaterialCollection other)
 
MaterialCollection operator= (const MaterialCollection 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 (const MaterialCollection 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, int indent_level)
 Writes a complete multi-line description of the MaterialCollection to the indicated output stream.
 

Member Function Documentation

◆ __init__() [1/2]

__init__ ( )

◆ __init__() [2/2]

__init__ ( const MaterialCollection copy)

◆ addMaterial()

addMaterial ( Material node_material)

Adds a new Material to the collection.

◆ addMaterialsFrom()

addMaterialsFrom ( const MaterialCollection 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()

clear ( )

Removes all Materials from the collection.

◆ findMaterial()

Material findMaterial ( str name)

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

◆ getMaterial()

Material getMaterial ( int index)

Returns the nth Material in the collection.

◆ getNumMaterials()

int getNumMaterials ( )

Returns the number of Materials in the collection.

◆ hasMaterial()

bool hasMaterial ( Material material)

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

◆ operator+()

MaterialCollection operator+ ( const MaterialCollection other)

◆ operator+=()

MaterialCollection operator+= ( const MaterialCollection other)

◆ operator=()

MaterialCollection operator= ( const MaterialCollection copy)

◆ operator[]()

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()

output ( Ostream out)

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

◆ removeDuplicateMaterials()

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.

◆ removeMaterial()

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()

removeMaterialsFrom ( const MaterialCollection other)

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

◆ size()

int size ( )

Returns the number of materials in the collection.

This is the same thing as get_num_materials().

◆ write()

write ( Ostream out,
int indent_level )

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