Panda3D
 All Classes Functions Variables Enumerations
textureStageCollection.h
00001 // Filename: textureStageCollection.h
00002 // Created by:  drose (23Jul04)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef TEXTURESTAGECOLLECTION_H
00016 #define TEXTURESTAGECOLLECTION_H
00017 
00018 #include "pandabase.h"
00019 #include "pointerToArray.h"
00020 #include "textureStage.h"
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //       Class : TextureStageCollection
00024 // Description : 
00025 ////////////////////////////////////////////////////////////////////
00026 class EXPCL_PANDA_PGRAPH TextureStageCollection {
00027 PUBLISHED:
00028   TextureStageCollection();
00029   TextureStageCollection(const TextureStageCollection &copy);
00030   void operator = (const TextureStageCollection &copy);
00031   INLINE ~TextureStageCollection();
00032 
00033   void add_texture_stage(TextureStage *node_texture_stage);
00034   bool remove_texture_stage(TextureStage *node_texture_stage);
00035   void add_texture_stages_from(const TextureStageCollection &other);
00036   void remove_texture_stages_from(const TextureStageCollection &other);
00037   void remove_duplicate_texture_stages();
00038   bool has_texture_stage(TextureStage *texture_stage) const;
00039   void clear();
00040 
00041   TextureStage *find_texture_stage(const string &name) const;
00042 
00043   int get_num_texture_stages() const;
00044   TextureStage *get_texture_stage(int index) const;
00045   MAKE_SEQ(get_texture_stages, get_num_texture_stages, get_texture_stage);
00046   TextureStage *operator [] (int index) const;
00047   int size() const;
00048   INLINE void operator += (const TextureStageCollection &other);
00049   INLINE TextureStageCollection operator + (const TextureStageCollection &other) const;
00050 
00051   void sort();
00052 
00053   void output(ostream &out) const;
00054   void write(ostream &out, int indent_level = 0) const;
00055 
00056 private:
00057   typedef PTA(PT(TextureStage)) TextureStages;
00058   TextureStages _texture_stages;
00059 
00060   class CompareTextureStageSort {
00061   public:
00062     INLINE bool operator () (const TextureStage *a, const TextureStage *b) const;
00063   };
00064 
00065 };
00066 
00067 INLINE ostream &operator << (ostream &out, const TextureStageCollection &col) {
00068   col.output(out);
00069   return out;
00070 }
00071 
00072 #include "textureStageCollection.I"
00073 
00074 #endif
00075 
00076 
 All Classes Functions Variables Enumerations