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

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

#include <pandadoc.hpp>

Public Member Functions

 __init__ ()
 
 __init__ (const TextureCollection copy)
 
 __init__ (object sequence)
 
object __reduce__ ()
 
 addTexture (Texture texture)
 Adds a new Texture to the collection.
 
 addTexturesFrom (const TextureCollection other)
 Adds all the Textures indicated in the other collection to this texture.
 
 append (Texture texture)
 Adds a new Texture to the collection.
 
 clear ()
 Removes all Textures from the collection.
 
 extend (const TextureCollection other)
 Appends the other list onto the end of this one.
 
Texture findTexture (str name)
 Returns the texture in the collection with the indicated name, if any, or NULL if no texture has that name.
 
int getNumTextures ()
 Returns the number of Textures in the collection.
 
Texture getTexture (int index)
 Returns the nth Texture in the collection.
 
list getTextures ()
 
bool hasTexture (Texture texture)
 Returns true if the indicated Texture appears in this collection, false otherwise.
 
TextureCollection operator+ (const TextureCollection other)
 
TextureCollection operator+= (const TextureCollection other)
 
TextureCollection operator= (const TextureCollection copy)
 
Texture operator[] (int index)
 Returns the nth Texture in the collection.
 
 output (Ostream out)
 Writes a brief one-line description of the TextureCollection to the indicated output stream.
 
 removeDuplicateTextures ()
 Removes any duplicate entries of the same Textures on this collection.
 
bool removeTexture (Texture texture)
 Removes the indicated Texture from the collection.
 
 removeTexturesFrom (const TextureCollection other)
 Removes from this collection all of the Textures listed in the other collection.
 
 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.
 
int size ()
 Returns the number of textures in the collection.
 
 write (Ostream out, int indent_level)
 Writes a complete multi-line description of the TextureCollection to the indicated output stream.
 

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__ ( const TextureCollection copy)

◆ __init__() [3/3]

__init__ ( object sequence)

◆ __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+()

TextureCollection operator+ ( const TextureCollection other)

◆ operator+=()

TextureCollection operator+= ( const TextureCollection other)

◆ operator=()

TextureCollection operator= ( const TextureCollection copy)

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

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