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