Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TextureCollection Class Reference

#include <textureCollection.h>

List of all members.

Public Member Functions

 TextureCollection ()
 TextureCollection (const TextureCollection &copy)
void operator= (const TextureCollection &copy)
 ~TextureCollection ()
void add_texture (Texture *node_texture)
 Adds a new Texture to the collection.

bool remove_texture (Texture *node_texture)
 Removes the indicated Texture from the collection.

void add_textures_from (const TextureCollection &other)
 Adds all the Textures indicated in the other collection to this texture.

void remove_textures_from (const TextureCollection &other)
 Removes from this collection all of the Textures listed in the other collection.

void remove_duplicate_textures ()
 Removes any duplicate entries of the same Textures on this collection.

bool has_texture (Texture *texture) const
 Returns true if the indicated Texture appears in this collection, false otherwise.

void clear ()
 Removes all Textures from the collection.

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.

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 write (ostream &out, int indent_level=0) const
 Writes a complete multi-line description of the TextureCollection to the indicated output stream.


Private Types

typedef PointerToArray< PointerTo<
Texture > > 
Textures

Private Attributes

Textures _textures


Member Typedef Documentation

typedef PointerToArray< PointerTo< Texture > > TextureCollection::Textures [private]
 

Definition at line 60 of file textureCollection.h.


Constructor & Destructor Documentation

TextureCollection::TextureCollection  ) 
 

Definition at line 34 of file textureCollection.cxx.

TextureCollection::TextureCollection const TextureCollection &  copy  ) 
 

Definition at line 45 of file textureCollection.cxx.

References _textures.

TextureCollection::~TextureCollection  )  [inline]
 

Definition at line 31 of file textureCollection.I.


Member Function Documentation

void TextureCollection::add_texture Texture node_texture  ) 
 

Adds a new Texture to the collection.

Definition at line 71 of file textureCollection.cxx.

References _textures.

Referenced by NodePath::set_color().

void TextureCollection::add_textures_from 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.

Definition at line 142 of file textureCollection.cxx.

void TextureCollection::clear void   ) 
 

Removes all Textures from the collection.

Definition at line 237 of file textureCollection.cxx.

References _textures, and NULL.

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 254 of file textureCollection.cxx.

int TextureCollection::get_num_textures  )  const
 

Returns the number of Textures in the collection.

Definition at line 274 of file textureCollection.cxx.

References get_texture(), and indent().

Texture * TextureCollection::get_texture int  index  )  const
 

Returns the nth Texture in the collection.

Definition at line 287 of file textureCollection.cxx.

Referenced by get_num_textures(), and remove_textures_from().

bool TextureCollection::has_texture Texture texture  )  const
 

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

Definition at line 219 of file textureCollection.cxx.

References _textures, and PointerToArray< PointerTo< Texture > >::size().

void TextureCollection::operator= const TextureCollection &  copy  ) 
 

Definition at line 58 of file textureCollection.cxx.

References _textures, PointerToArray< PointerTo< Texture > >::get_ref_count(), and PointerToArray< PointerTo< Texture > >::v().

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 306 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 323 of file textureCollection.cxx.

void TextureCollection::remove_duplicate_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 188 of file textureCollection.cxx.

bool TextureCollection::remove_texture Texture node_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 99 of file textureCollection.cxx.

References _textures, and PointerToArray< PointerTo< Texture > >::v().

void TextureCollection::remove_textures_from const TextureCollection &  other  ) 
 

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

Definition at line 161 of file textureCollection.cxx.

References get_texture().

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 342 of file textureCollection.cxx.


Member Data Documentation

Textures TextureCollection::_textures [private]
 

Definition at line 61 of file textureCollection.h.

Referenced by add_texture(), clear(), has_texture(), operator=(), remove_texture(), and TextureCollection().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:55:35 2003 for Panda by doxygen1.3