Panda3D

animBundleNode.h

00001 // Filename: animBundleNode.h
00002 // Created by:  drose (06Mar02)
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 ANIMBUNDLENODE_H
00016 #define ANIMBUNDLENODE_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "animBundle.h"
00021 
00022 #include "pandaNode.h"
00023 #include "dcast.h"
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : AnimBundleNode
00027 // Description : This is a node that contains a pointer to an
00028 //               AnimBundle.  Like PartBundleNode, it exists solely to
00029 //               make it easy to store AnimBundles in the scene graph.
00030 ////////////////////////////////////////////////////////////////////
00031 class EXPCL_PANDA_CHAN AnimBundleNode : public PandaNode {
00032 PUBLISHED:
00033   INLINE AnimBundleNode(const string &name, AnimBundle *bundle);
00034 
00035 protected:
00036   INLINE AnimBundleNode();
00037   INLINE AnimBundleNode(const AnimBundleNode &copy);
00038 
00039 public:
00040   virtual PandaNode *make_copy() const;
00041   virtual bool safe_to_flatten() const;
00042 
00043 PUBLISHED:
00044   INLINE AnimBundle *get_bundle() const;
00045   
00046   static AnimBundle *find_anim_bundle(PandaNode *root);
00047 
00048 private:
00049   PT(AnimBundle) _bundle;
00050 
00051 public:
00052   static void register_with_read_factory();
00053   virtual void write_datagram(BamWriter* manager, Datagram &me);
00054   virtual int complete_pointers(TypedWritable **p_list,
00055                                 BamReader *manager);
00056 
00057 protected:
00058   static TypedWritable *make_from_bam(const FactoryParams &params);
00059   void fillin(DatagramIterator& scan, BamReader* manager);
00060 
00061 public:
00062   virtual TypeHandle get_type() const {
00063     return get_class_type();
00064   }
00065   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00066   static TypeHandle get_class_type() {
00067     return _type_handle;
00068   }
00069   static void init_type() {
00070     PandaNode::init_type();
00071     register_type(_type_handle, "AnimBundleNode",
00072                   PandaNode::get_class_type());
00073   }
00074 
00075 private:
00076   static TypeHandle _type_handle;
00077 };
00078 
00079 #include "animBundleNode.I"
00080 
00081 #endif
 All Classes Functions Variables Enumerations