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  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
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A basic node of the scene graph or data graph.
Definition: pandaNode.h:64
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:3589
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 root of an AnimChannel hierarchy.
Definition: animBundle.h:29
Base class for objects that can be written to and read from Bam files.
Definition: typedWritable.h:35
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
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition: bamWriter.h:63
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
Definition: pandaNode.cxx:3580
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.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition: factoryParams.h:36
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
Definition: pandaNode.cxx:487
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:81
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:38
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:201