00001 // Filename: partBundleNode.h 00002 // Created by: drose (06Mar02) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) 2001, Disney Enterprises, Inc. All rights reserved 00008 // 00009 // All use of this software is subject to the terms of the Panda 3d 00010 // Software license. You should have received a copy of this license 00011 // along with this source code; you will also find a current copy of 00012 // the license at http://www.panda3d.org/license.txt . 00013 // 00014 // To contact the maintainers of this program write to 00015 // panda3d@yahoogroups.com . 00016 // 00017 //////////////////////////////////////////////////////////////////// 00018 00019 #ifndef PARTBUNDLENODE_H 00020 #define PARTBUNDLENODE_H 00021 00022 #include "pandabase.h" 00023 00024 #include "partBundle.h" 00025 00026 #include "pandaNode.h" 00027 #include "dcast.h" 00028 00029 //////////////////////////////////////////////////////////////////// 00030 // Class : PartBundleNode 00031 // Description : This is a node that contains a pointer to an 00032 // PartBundle. Like AnimBundleNode, it exists solely to 00033 // make it easy to store PartBundles in the scene graph. 00034 //////////////////////////////////////////////////////////////////// 00035 class EXPCL_PANDA PartBundleNode : public PandaNode { 00036 public: 00037 INLINE PartBundleNode(const string &name, PartBundle *bundle); 00038 00039 protected: 00040 INLINE PartBundleNode(); 00041 INLINE PartBundleNode(const PartBundleNode ©, PartBundle *bundle = NULL); 00042 00043 public: 00044 virtual bool safe_to_flatten() const; 00045 00046 PUBLISHED: 00047 INLINE PartBundle *get_bundle() const; 00048 00049 private: 00050 PT(PartBundle) _bundle; 00051 00052 public: 00053 virtual void write_datagram(BamWriter* manager, Datagram &me); 00054 virtual int complete_pointers(TypedWritable **p_list, 00055 BamReader *manager); 00056 00057 protected: 00058 void fillin(DatagramIterator& scan, BamReader* manager); 00059 00060 public: 00061 virtual TypeHandle get_type() const { 00062 return get_class_type(); 00063 } 00064 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00065 static TypeHandle get_class_type() { 00066 return _type_handle; 00067 } 00068 static void init_type() { 00069 PandaNode::init_type(); 00070 register_type(_type_handle, "PartBundleNode", 00071 PandaNode::get_class_type()); 00072 } 00073 00074 private: 00075 static TypeHandle _type_handle; 00076 }; 00077 00078 #include "partBundleNode.I" 00079 00080 #endif