00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef ANIMGROUP_H
00020 #define ANIMGROUP_H
00021
00022 #include "pandabase.h"
00023
00024 #include "typedWritableReferenceCount.h"
00025 #include "pointerTo.h"
00026 #include "namable.h"
00027
00028 class AnimBundle;
00029 class BamReader;
00030 class FactoryParams;
00031
00032
00033
00034
00035
00036
00037
00038
00039 class EXPCL_PANDA AnimGroup : public TypedWritableReferenceCount, public Namable {
00040 protected:
00041
00042
00043
00044
00045 AnimGroup(const string &name = "") : Namable(name) { }
00046
00047 public:
00048
00049 AnimGroup(AnimGroup *parent, const string &name);
00050
00051 PUBLISHED:
00052 int get_num_children() const;
00053 AnimGroup *get_child(int n) const;
00054 AnimGroup *find_child(const string &name) const;
00055
00056 public:
00057 virtual TypeHandle get_value_type() const;
00058
00059 void sort_descendants();
00060
00061 PUBLISHED:
00062 virtual void output(ostream &out) const;
00063 virtual void write(ostream &out, int indent_level) const;
00064
00065 protected:
00066 void write_descendants(ostream &out, int indent_level) const;
00067
00068 protected:
00069 typedef pvector< PT(AnimGroup) > Children;
00070 Children _children;
00071 AnimBundle *_root;
00072
00073 public:
00074 static void register_with_read_factory(void);
00075 virtual void write_datagram(BamWriter* manager, Datagram &me);
00076 virtual int complete_pointers(TypedWritable **p_list,
00077 BamReader *manager);
00078
00079 static TypedWritable *make_AnimGroup(const FactoryParams ¶ms);
00080
00081 protected:
00082 void fillin(DatagramIterator& scan, BamReader* manager);
00083
00084 private:
00085 int _num_children;
00086
00087 public:
00088 virtual TypeHandle get_type() const {
00089 return get_class_type();
00090 }
00091 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00092
00093 static TypeHandle get_class_type() {
00094 return _type_handle;
00095 }
00096 static void init_type() {
00097 TypedWritableReferenceCount::init_type();
00098 register_type(_type_handle, "AnimGroup",
00099 TypedWritableReferenceCount::get_class_type());
00100 }
00101
00102 private:
00103 static TypeHandle _type_handle;
00104 };
00105
00106 inline ostream &operator << (ostream &out, const AnimGroup &anim) {
00107 anim.output(out);
00108 return out;
00109 }
00110
00111 #include "animGroup.I"
00112
00113 #endif
00114
00115