Panda3D
 All Classes Functions Variables Enumerations
animBundleNode.h
1 // Filename: animBundleNode.h
2 // Created by: drose (06Mar02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef ANIMBUNDLENODE_H
16 #define ANIMBUNDLENODE_H
17 
18 #include "pandabase.h"
19 
20 #include "animBundle.h"
21 
22 #include "pandaNode.h"
23 #include "dcast.h"
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : AnimBundleNode
27 // Description : This is a node that contains a pointer to an
28 // AnimBundle. Like PartBundleNode, it exists solely to
29 // make it easy to store AnimBundles in the scene graph.
30 ////////////////////////////////////////////////////////////////////
31 class EXPCL_PANDA_CHAN AnimBundleNode : public PandaNode {
32 PUBLISHED:
33  INLINE AnimBundleNode(const string &name, AnimBundle *bundle);
34 
35 protected:
36  INLINE AnimBundleNode();
37  INLINE AnimBundleNode(const AnimBundleNode &copy);
38 
39 public:
40  virtual PandaNode *make_copy() const;
41  virtual bool safe_to_flatten() const;
42 
43 PUBLISHED:
44  INLINE AnimBundle *get_bundle() const;
45 
46  static AnimBundle *find_anim_bundle(PandaNode *root);
47 
48 private:
49  PT(AnimBundle) _bundle;
50 
51 public:
52  static void register_with_read_factory();
53  virtual void write_datagram(BamWriter* manager, Datagram &me);
54  virtual int complete_pointers(TypedWritable **p_list,
55  BamReader *manager);
56 
57 protected:
58  static TypedWritable *make_from_bam(const FactoryParams &params);
59  void fillin(DatagramIterator& scan, BamReader* manager);
60 
61 public:
62  virtual TypeHandle get_type() const {
63  return get_class_type();
64  }
65  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
66  static TypeHandle get_class_type() {
67  return _type_handle;
68  }
69  static void init_type() {
70  PandaNode::init_type();
71  register_type(_type_handle, "AnimBundleNode",
72  PandaNode::get_class_type());
73  }
74 
75 private:
76  static TypeHandle _type_handle;
77 };
78 
79 #include "animBundleNode.I"
80 
81 #endif
A basic node of the scene graph or data graph.
Definition: pandaNode.h:72
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
Definition: pandaNode.cxx:4164
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition: bamReader.h:122
This is the root of an AnimChannel hierarchy.
Definition: animBundle.h:31
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:37
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
Definition: pandaNode.cxx:604
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:73
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
Definition: pandaNode.cxx:4153
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin()...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:40
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
This is a node that contains a pointer to an AnimBundle.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition: datagram.h:43
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating ...
Definition: pandaNode.cxx:237