Panda3D

Loading...
Searching...
No Matches
sequenceNode.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 sequenceNode.h
10 * @author drose
11 * @date 2002-03-06
12 */
13
14#ifndef SEQUENCENODE_H
15#define SEQUENCENODE_H
16
17#include "pandabase.h"
18
19#include "selectiveChildNode.h"
20#include "animInterface.h"
21#include "clockObject.h"
22
23/**
24 * A node that automatically cycles through rendering each one of its children
25 * according to its frame rate.
26 */
27 class EXPCL_PANDA_PGRAPHNODES SequenceNode : public SelectiveChildNode, public AnimInterface {
28PUBLISHED:
29 INLINE explicit SequenceNode(const std::string &name);
30
31 protected:
32 SequenceNode(const SequenceNode &copy);
33
34PUBLISHED:
35 virtual int get_num_frames() const;
36 INLINE void set_frame_rate(double frame_rate);
37
38 MAKE_PROPERTY(frame_rate, get_frame_rate, set_frame_rate);
39
40 public:
41 virtual PandaNode *make_copy() const;
42 virtual bool safe_to_combine() const;
43 virtual bool safe_to_combine_children() const;
44
45 virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
46 virtual int get_first_visible_child() const;
47 virtual bool has_single_child_visibility() const;
48 virtual int get_visible_child() const;
49
50 virtual void output(std::ostream &out) const;
51
52 public:
53 static void register_with_read_factory();
54 virtual void write_datagram(BamWriter *manager, Datagram &dg);
55
56 protected:
57 static TypedWritable *make_from_bam(const FactoryParams &params);
58 void fillin(DatagramIterator &scan, BamReader *manager);
59
60 public:
61 static TypeHandle get_class_type() {
62 return _type_handle;
63 }
64 static void init_type() {
65 SelectiveChildNode::init_type();
66 AnimInterface::init_type();
67 register_type(_type_handle, "SequenceNode",
68 SelectiveChildNode::get_class_type(),
69 AnimInterface::get_class_type());
70 }
71 virtual TypeHandle get_type() const {
72 return get_class_type();
73 }
74 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
75
76 private:
77 static TypeHandle _type_handle;
78};
79
80#include "sequenceNode.I"
81
82#endif
animInterface.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
AnimInterface::get_num_frames
get_num_frames
Returns the number of frames in the animation.
Definition animInterface.h:68
BamReader
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Definition bamReader.h:110
BamWriter
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
Definition bamWriter.h:63
CullTraverser
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
Definition cullTraverser.h:45
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::cull_callback
virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data)
This function will be called during the cull traversal to perform any additional operations that shou...
Definition pandaNode.cxx:386
PandaNode::has_single_child_visibility
virtual bool has_single_child_visibility() const
Should be overridden by derived classes to return true if this kind of node has the special property ...
Definition pandaNode.cxx:442
PandaNode::safe_to_combine
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
Definition pandaNode.cxx:228
PandaNode::get_visible_child
virtual int get_visible_child() const
Returns the index number of the currently visible child of this node.
Definition pandaNode.cxx:451
PandaNode::safe_to_combine_children
virtual bool safe_to_combine_children() const
Returns true if it is generally safe to combine the children of this PandaNode with each other.
Definition pandaNode.cxx:238
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
SelectiveChildNode::get_first_visible_child
virtual int get_first_visible_child() const
Returns the index number of the first visible child of this node, or a number >= get_num_children() i...
Definition selectiveChildNode.cxx:44
SequenceNode::set_frame_rate
set_frame_rate
Changes the advertised frame rate of the SequenceNode.
Definition sequenceNode.h:38
TypeHandle
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
TypedWritable
Base class for objects that can be written to and read from Bam files.
Definition typedWritable.h:35
clockObject.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
selectiveChildNode.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
sequenceNode.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.