Panda3D
Public Member Functions
TextureCollection Class Reference

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

#include "textureCollection.h"

List of all members.

Public Member Functions

 TextureCollection (const TextureCollection &copy)
void add_texture (Texture *texture)
 Adds a new Texture to the collection.
void add_textures_from (const TextureCollection &other)
 Adds all the Textures indicated in the other collection to this texture.
void append (Texture *texture)
 Adds a new Texture to the collection.
void clear ()
 Removes all Textures from the collection.
void extend (const TextureCollection &other)
 Appends the other list onto the end of this one.
Texturefind_texture (const string &name) const
 Returns the texture in the collection with the indicated name, if any, or NULL if no texture has that name.
int get_num_textures () const
 Returns the number of Textures in the collection.
Textureget_texture (int index) const
 Returns the nth Texture in the collection.
bool has_texture (Texture *texture) const
 Returns true if the indicated Texture appears in this collection, false otherwise.
 MAKE_SEQ (get_textures, get_num_textures, get_texture)
TextureCollection operator+ (const TextureCollection &other) const
 Returns a TextureCollection representing the concatenation of the two lists.
void operator+= (const TextureCollection &other)
 Appends the other list onto the end of this one.
void operator= (const TextureCollection &copy)
Textureoperator[] (int index) const
 Returns the nth Texture in the collection.
void output (ostream &out) const
 Writes a brief one-line description of the TextureCollection to the indicated output stream.
void remove_duplicate_textures ()
 Removes any duplicate entries of the same Textures on this collection.
bool remove_texture (Texture *texture)
 Removes the indicated Texture from the collection.
void remove_textures_from (const TextureCollection &other)
 Removes from this collection all of the Textures listed in the other collection.
int size () const
 Returns the number of textures in the collection.
void write (ostream &out, int indent_level=0) const
 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().

Definition at line 27 of file textureCollection.h.


Member Function Documentation

Adds a new Texture to the collection.

Definition at line 131 of file textureCollection.cxx.

Referenced by add_textures_from(), append(), and NodePath::find_all_textures().

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.

Definition at line 191 of file textureCollection.cxx.

References add_texture(), get_num_textures(), and get_texture().

Referenced by operator+=().

void TextureCollection::append ( Texture texture) [inline]

Adds a new Texture to the collection.

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

Definition at line 56 of file textureCollection.I.

References add_texture().

Removes all Textures from the collection.

Definition at line 269 of file textureCollection.cxx.

void TextureCollection::extend ( const TextureCollection other) [inline]

Appends the other list onto the end of this one.

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

Definition at line 68 of file textureCollection.I.

References operator+=().

Texture * TextureCollection::find_texture ( const string &  name) const

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

Definition at line 281 of file textureCollection.cxx.

References get_num_textures(), and get_texture().

Returns the number of Textures in the collection.

Definition at line 298 of file textureCollection.cxx.

Referenced by add_textures_from(), find_texture(), has_texture(), output(), remove_duplicate_textures(), remove_textures_from(), StaticTextFont::StaticTextFont(), and write().

Texture * TextureCollection::get_texture ( int  index) const
bool TextureCollection::has_texture ( Texture texture) const

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

Definition at line 254 of file textureCollection.cxx.

References get_num_textures(), and get_texture().

Referenced by remove_textures_from().

TextureCollection TextureCollection::operator+ ( const TextureCollection other) const [inline]

Returns a TextureCollection representing the concatenation of the two lists.

Definition at line 42 of file textureCollection.I.

void TextureCollection::operator+= ( const TextureCollection other) [inline]

Appends the other list onto the end of this one.

Definition at line 31 of file textureCollection.I.

References add_textures_from().

Referenced by extend().

Texture * TextureCollection::operator[] ( int  index) const

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.

Definition at line 322 of file textureCollection.cxx.

void TextureCollection::output ( ostream &  out) const

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

Definition at line 346 of file textureCollection.cxx.

References get_num_textures().

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.

Definition at line 227 of file textureCollection.cxx.

References get_num_textures(), and get_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.

Definition at line 154 of file textureCollection.cxx.

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

Definition at line 206 of file textureCollection.cxx.

References get_num_textures(), get_texture(), and has_texture().

int TextureCollection::size ( ) const

Returns the number of textures in the collection.

This is the same thing as get_num_textures().

Definition at line 335 of file textureCollection.cxx.

void TextureCollection::write ( ostream &  out,
int  indent_level = 0 
) const

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

Definition at line 361 of file textureCollection.cxx.

References get_num_textures(), and get_texture().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations