00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef MATERIALCOLLECTION_H
00016 #define MATERIALCOLLECTION_H
00017
00018 #include "pandabase.h"
00019 #include "pointerToArray.h"
00020 #include "material.h"
00021
00022
00023
00024
00025
00026 class EXPCL_PANDA_PGRAPH MaterialCollection {
00027 PUBLISHED:
00028 MaterialCollection();
00029 MaterialCollection(const MaterialCollection ©);
00030 void operator = (const MaterialCollection ©);
00031 INLINE ~MaterialCollection();
00032
00033 void add_material(Material *node_material);
00034 bool remove_material(Material *node_material);
00035 void add_materials_from(const MaterialCollection &other);
00036 void remove_materials_from(const MaterialCollection &other);
00037 void remove_duplicate_materials();
00038 bool has_material(Material *material) const;
00039 void clear();
00040
00041 Material *find_material(const string &name) const;
00042
00043 int get_num_materials() const;
00044 Material *get_material(int index) const;
00045 Material *operator [] (int index) const;
00046 int size() const;
00047 INLINE void operator += (const MaterialCollection &other);
00048 INLINE MaterialCollection operator + (const MaterialCollection &other) const;
00049
00050 void output(ostream &out) const;
00051 void write(ostream &out, int indent_level = 0) const;
00052
00053 private:
00054 typedef PTA(PT(Material)) Materials;
00055 Materials _materials;
00056 };
00057
00058 INLINE ostream &operator << (ostream &out, const MaterialCollection &col) {
00059 col.output(out);
00060 return out;
00061 }
00062
00063 #include "materialCollection.I"
00064
00065 #endif
00066
00067