Panda3D
 All Classes Functions Variables Enumerations
animBundle.h
00001 // Filename: animBundle.h
00002 // Created by:  drose (21Feb99)
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 ANIMBUNDLE_H
00016 #define ANIMBUNDLE_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "animGroup.h"
00021 #include "pointerTo.h"
00022 
00023 class FactoryParams;
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : AnimBundle
00027 // Description : This is the root of an AnimChannel hierarchy.  It
00028 //               knows the frame rate and number of frames of all the
00029 //               channels in the hierarchy (which must all match).
00030 ////////////////////////////////////////////////////////////////////
00031 class EXPCL_PANDA_CHAN AnimBundle : public AnimGroup {
00032 protected:
00033   AnimBundle(AnimGroup *parent, const AnimBundle &copy);
00034 
00035 PUBLISHED:
00036   INLINE AnimBundle(const string &name, PN_stdfloat fps, int num_frames);
00037 
00038   PT(AnimBundle) copy_bundle() const;
00039 
00040   INLINE double get_base_frame_rate() const;
00041   INLINE int get_num_frames() const;
00042 
00043   virtual void output(ostream &out) const;
00044 
00045 protected:
00046   INLINE AnimBundle();
00047 
00048   virtual AnimGroup *make_copy(AnimGroup *parent) const;
00049 
00050 private:
00051   PN_stdfloat _fps;
00052   int _num_frames;
00053 
00054 public:
00055   static void register_with_read_factory();
00056   virtual void write_datagram(BamWriter* manager, Datagram &me);
00057 
00058   static TypedWritable *make_AnimBundle(const FactoryParams &params);
00059 
00060 protected:
00061   void fillin(DatagramIterator& scan, BamReader* manager);
00062 
00063 public:
00064 
00065   virtual TypeHandle get_type() const {
00066     return get_class_type();
00067   }
00068   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00069   static TypeHandle get_class_type() {
00070     return _type_handle;
00071   }
00072   static void init_type() {
00073     AnimGroup::init_type();
00074     register_type(_type_handle, "AnimBundle",
00075                   AnimGroup::get_class_type());
00076   }
00077 
00078 private:
00079   static TypeHandle _type_handle;
00080 };
00081 
00082 inline ostream &operator <<(ostream &out, const AnimBundle &bundle) {
00083   bundle.output(out);
00084   return out;
00085 }
00086 
00087 
00088 #include "animBundle.I"
00089 
00090 #endif
 All Classes Functions Variables Enumerations