Panda3D
Loading...
Searching...
No Matches
textureStageCollection.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file textureStageCollection.h
10 * @author drose
11 * @date 2004-07-23
12 */
13
14#ifndef TEXTURESTAGECOLLECTION_H
15#define TEXTURESTAGECOLLECTION_H
16
17#include "pandabase.h"
18#include "pointerToArray.h"
19#include "textureStage.h"
20
21/**
22 *
23 */
24class EXPCL_PANDA_PGRAPH TextureStageCollection {
25PUBLISHED:
26 TextureStageCollection();
27 TextureStageCollection(const TextureStageCollection &copy);
28 void operator = (const TextureStageCollection &copy);
29 INLINE ~TextureStageCollection();
30
31 void add_texture_stage(TextureStage *node_texture_stage);
32 bool remove_texture_stage(TextureStage *node_texture_stage);
33 void add_texture_stages_from(const TextureStageCollection &other);
34 void remove_texture_stages_from(const TextureStageCollection &other);
36 bool has_texture_stage(TextureStage *texture_stage) const;
37 void clear();
38
39 TextureStage *find_texture_stage(const std::string &name) const;
40
41 int get_num_texture_stages() const;
42 TextureStage *get_texture_stage(int index) const;
43 MAKE_SEQ(get_texture_stages, get_num_texture_stages, get_texture_stage);
44 TextureStage *operator [] (int index) const;
45 int size() const;
46 INLINE void operator += (const TextureStageCollection &other);
47 INLINE TextureStageCollection operator + (const TextureStageCollection &other) const;
48
49 void sort();
50
51 void output(std::ostream &out) const;
52 void write(std::ostream &out, int indent_level = 0) const;
53
54private:
55 typedef PTA(PT(TextureStage)) TextureStages;
56 TextureStages _texture_stages;
57
58 class CompareTextureStageSort {
59 public:
60 INLINE bool operator () (const TextureStage *a, const TextureStage *b) const;
61 };
62
63};
64
65INLINE std::ostream &operator << (std::ostream &out, const TextureStageCollection &col) {
66 col.output(out);
67 return out;
68}
69
71
72#endif
void remove_duplicate_texture_stages()
Removes any duplicate entries of the same TextureStages on this collection.
void sort()
Sorts the TextureStages in this collection into order by TextureStage::sort(), from lowest to highest...
void remove_texture_stages_from(const TextureStageCollection &other)
Removes from this collection all of the TextureStages listed in the other collection.
int size() const
Returns the number of texture stages in the collection.
bool has_texture_stage(TextureStage *texture_stage) const
Returns true if the indicated TextureStage appears in this collection, false otherwise.
get_texture_stage
Returns the nth TextureStage in the collection.
void write(std::ostream &out, int indent_level=0) const
Writes a complete multi-line description of the TextureStageCollection to the indicated output stream...
void add_texture_stages_from(const TextureStageCollection &other)
Adds all the TextureStages indicated in the other collection to this texture_stage.
bool remove_texture_stage(TextureStage *node_texture_stage)
Removes the indicated TextureStage from the collection.
void output(std::ostream &out) const
Writes a brief one-line description of the TextureStageCollection to the indicated output stream.
void clear()
Removes all TextureStages from the collection.
TextureStage * find_texture_stage(const std::string &name) const
Returns the texture_stage in the collection with the indicated name, if any, or NULL if no texture_st...
get_num_texture_stages
Returns the number of TextureStages in the collection.
void add_texture_stage(TextureStage *node_texture_stage)
Adds a new TextureStage to the collection.
Defines the properties of a named stage of the multitexture pipeline.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.