TextureCollection

class TextureCollection

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

Inheritance diagram

Inheritance diagram of TextureCollection

TextureCollection(void)
TextureCollection(TextureCollection const &copy)
TextureCollection(PyObject *self, PyObject *sequence)
void add_texture(Texture *texture)

Adds a new Texture to the collection.

void add_textures_from(TextureCollection const &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.

void append(Texture *texture)

Method names to satisfy Python’s conventions.

Adds a new Texture to the collection. This method duplicates the add_texture() method; it is provided to satisfy Python’s naming convention.

void clear(void)

Removes all Textures from the collection.

void extend(TextureCollection const &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.

Texture *find_texture(std::string const &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(void) const

Returns the number of Textures in the collection.

Texture *get_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.

void output(std::ostream &out) const

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

void remove_duplicate_textures(void)

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.

bool remove_texture(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.

void remove_textures_from(TextureCollection const &other)

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

void reserve(std::size_t 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(void) const

Returns the number of textures in the collection. This is the same thing as get_num_textures().

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

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