Panda3D
Public Member Functions | List of all members
MaterialCollection Class Reference

Public Member Functions

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

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

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.

◆ operator+()

MaterialCollection operator+ ( const MaterialCollection  other)

◆ operator+=()

MaterialCollection operator+= ( const MaterialCollection  other)

◆ operator=()

MaterialCollection operator= ( const MaterialCollection  copy)

◆ 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.