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

Manages a list of Texture objects, as returned by TexturePool::find_all_textures(). More...

Public Member Functions

 __init__ ()
 
 __init__ (object sequence)
 
 __init__ (const TextureCollection copy)
 
object __reduce__ ()
 
 addTexture (Texture texture)
 Adds a new Texture to the collection. More...
 
 addTexturesFrom (const TextureCollection other)
 Adds all the Textures indicated in the other collection to this texture. More...
 
 append (Texture texture)
 Adds a new Texture to the collection. More...
 
 clear ()
 Removes all Textures from the collection. More...
 
 extend (const TextureCollection other)
 Appends the other list onto the end of this one. More...
 
Texture findTexture (str name)
 Returns the texture in the collection with the indicated name, if any, or NULL if no texture has that name. More...
 
int getNumTextures ()
 Returns the number of Textures in the collection. More...
 
Texture getTexture (int index)
 Returns the nth Texture in the collection. More...
 
list getTextures ()
 
bool hasTexture (Texture texture)
 Returns true if the indicated Texture appears in this collection, false otherwise. More...
 
Texture operator [] (int index)
 Returns the nth Texture in the collection. More...
 
TextureCollection operator+ (const TextureCollection other)
 
TextureCollection operator+= (const TextureCollection other)
 
TextureCollection operator= (const TextureCollection copy)
 
 output (Ostream out)
 Writes a brief one-line description of the TextureCollection to the indicated output stream. More...
 
 removeDuplicateTextures ()
 Removes any duplicate entries of the same Textures on this collection. More...
 
bool removeTexture (Texture texture)
 Removes the indicated Texture from the collection. More...
 
 removeTexturesFrom (const TextureCollection other)
 Removes from this collection all of the Textures listed in the other collection. More...
 
 reserve (int num)
 This is a hint to Panda to allocate enough memory to hold the given number of NodePaths, if you know ahead of time how many you will be adding. More...
 
int size ()
 Returns the number of textures in the collection. More...
 
 write (Ostream out, int indent_level)
 Writes a complete multi-line description of the TextureCollection to the indicated output stream. More...
 

Detailed Description

Manages a list of Texture objects, as returned by TexturePool::find_all_textures().

Member Function Documentation

◆ __init__() [1/3]

__init__ ( )

◆ __init__() [2/3]

__init__ ( object  sequence)

◆ __init__() [3/3]

__init__ ( const TextureCollection  copy)

◆ __reduce__()

object __reduce__ ( )

◆ addTexture()

addTexture ( Texture  texture)

Adds a new Texture to the collection.

◆ addTexturesFrom()

addTexturesFrom ( const TextureCollection  other)

Adds all the Textures indicated in the other collection to this texture.

The other textures are simply appended to the end of the textures in this list; duplicates are not automatically removed.

◆ append()

append ( Texture  texture)

Adds a new Texture to the collection.

This method duplicates the add_texture() method; it is provided to satisfy Python's naming convention.

◆ clear()

clear ( )

Removes all Textures from the collection.

◆ extend()

extend ( const TextureCollection  other)

Appends the other list onto the end of this one.

This method duplicates the += operator; it is provided to satisfy Python's naming convention.

◆ findTexture()

Texture findTexture ( str  name)

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

◆ getNumTextures()

int getNumTextures ( )

Returns the number of Textures in the collection.

◆ getTexture()

Texture getTexture ( int  index)

Returns the nth Texture in the collection.

◆ getTextures()

list getTextures ( )

◆ hasTexture()

bool hasTexture ( Texture  texture)

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

◆ operator []()

Texture operator [] ( int  index)

Returns the nth Texture in the collection.

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

◆ operator+()

TextureCollection operator+ ( const TextureCollection  other)

◆ operator+=()

TextureCollection operator+= ( const TextureCollection  other)

◆ operator=()

TextureCollection operator= ( const TextureCollection  copy)

◆ output()

output ( Ostream  out)

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

◆ removeDuplicateTextures()

removeDuplicateTextures ( )

Removes any duplicate entries of the same Textures on this collection.

If a Texture appears multiple times, the first appearance is retained; subsequent appearances are removed.

◆ removeTexture()

bool removeTexture ( Texture  texture)

Removes the indicated Texture from the collection.

Returns true if the texture was removed, false if it was not a member of the collection.

◆ removeTexturesFrom()

removeTexturesFrom ( const TextureCollection  other)

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

◆ reserve()

reserve ( int  num)

This is a hint to Panda to allocate enough memory to hold the given number of NodePaths, if you know ahead of time how many you will be adding.

◆ size()

int size ( )

Returns the number of textures in the collection.

This is the same thing as get_num_textures().

◆ write()

write ( Ostream  out,
int  indent_level 
)

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