Panda3D
 All Classes Functions Variables Enumerations
textureStageCollection.h
1 // Filename: textureStageCollection.h
2 // Created by: drose (23Jul04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef TEXTURESTAGECOLLECTION_H
16 #define TEXTURESTAGECOLLECTION_H
17 
18 #include "pandabase.h"
19 #include "pointerToArray.h"
20 #include "textureStage.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : TextureStageCollection
24 // Description :
25 ////////////////////////////////////////////////////////////////////
26 class EXPCL_PANDA_PGRAPH TextureStageCollection {
27 PUBLISHED:
30  void operator = (const TextureStageCollection &copy);
31  INLINE ~TextureStageCollection();
32 
33  void add_texture_stage(TextureStage *node_texture_stage);
34  bool remove_texture_stage(TextureStage *node_texture_stage);
35  void add_texture_stages_from(const TextureStageCollection &other);
36  void remove_texture_stages_from(const TextureStageCollection &other);
37  void remove_duplicate_texture_stages();
38  bool has_texture_stage(TextureStage *texture_stage) const;
39  void clear();
40 
41  TextureStage *find_texture_stage(const string &name) const;
42 
43  int get_num_texture_stages() const;
44  TextureStage *get_texture_stage(int index) const;
45  MAKE_SEQ(get_texture_stages, get_num_texture_stages, get_texture_stage);
46  TextureStage *operator [] (int index) const;
47  int size() const;
48  INLINE void operator += (const TextureStageCollection &other);
49  INLINE TextureStageCollection operator + (const TextureStageCollection &other) const;
50 
51  void sort();
52 
53  void output(ostream &out) const;
54  void write(ostream &out, int indent_level = 0) const;
55 
56 private:
57  typedef PTA(PT(TextureStage)) TextureStages;
58  TextureStages _texture_stages;
59 
60  class CompareTextureStageSort {
61  public:
62  INLINE bool operator () (const TextureStage *a, const TextureStage *b) const;
63  };
64 
65 };
66 
67 INLINE ostream &operator << (ostream &out, const TextureStageCollection &col) {
68  col.output(out);
69  return out;
70 }
71 
72 #include "textureStageCollection.I"
73 
74 #endif
75 
76 
void output(ostream &out) const
Writes a brief one-line description of the TextureStageCollection to the indicated output stream...
Defines the properties of a named stage of the multitexture pipeline.
Definition: textureStage.h:38