Panda3D

Loading...
Searching...
No Matches
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 {
30PUBLISHED:
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
41PUBLISHED:
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
animBundleNode.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
animBundle.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
AnimBundleNode::AnimBundleNode
AnimBundleNode(const std::string &name, AnimBundle *bundle)
The AnimBundle and its node should be constructed together.
Definition animBundleNode.I:20
AnimBundleNode::find_anim_bundle
static AnimBundle * find_anim_bundle(PandaNode *root)
Recursively walks the scene graph beginning at the indicated node (which need not be an AnimBundleNod...
Definition animBundleNode.cxx:48
AnimBundle
This is the root of an AnimChannel hierarchy.
Definition animBundle.h:29
BamReader
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition bamReader.h:110
DatagramIterator
A class to retrieve the individual data elements previously stored in a Datagram.
Definition datagramIterator.h:30
Datagram
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
Definition datagram.h:38
FactoryParams
An instance of this class is passed to the Factory when requesting it to do its business and construc...
Definition factoryParams.h:36
PandaNode::register_with_read_factory
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
Definition pandaNode.cxx:3593
PandaNode::make_copy
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
Definition pandaNode.cxx:481
PandaNode::write_datagram
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:3602
PandaNode::safe_to_flatten
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
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
TypedWritable::complete_pointers
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().
Definition typedWritable.cxx:81
dcast.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandaNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pandabase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
register_type
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