Panda3D
 All Classes Functions Variables Enumerations
sequenceNode.h
00001 // Filename: sequenceNode.h
00002 // Created by:  drose (06Mar02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef SEQUENCENODE_H
00016 #define SEQUENCENODE_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "selectiveChildNode.h"
00021 #include "animInterface.h"
00022 #include "clockObject.h"
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //       Class : SequenceNode
00026 // Description : A node that automatically cycles through rendering
00027 //               each one of its children according to its frame rate.
00028 ////////////////////////////////////////////////////////////////////
00029 class EXPCL_PANDA_PGRAPHNODES SequenceNode : public SelectiveChildNode, public AnimInterface {
00030 PUBLISHED:
00031   INLINE SequenceNode(const string &name);
00032 
00033 protected:
00034   SequenceNode(const SequenceNode &copy);
00035 
00036 PUBLISHED:
00037   virtual int get_num_frames() const;
00038   INLINE void set_frame_rate(double frame_rate);
00039 
00040 public:
00041   virtual PandaNode *make_copy() const;
00042   virtual bool safe_to_combine() const;
00043   virtual bool safe_to_combine_children() const;
00044 
00045   virtual bool cull_callback(CullTraverser *trav, CullTraverserData &data);
00046   virtual int get_first_visible_child() const;
00047   virtual bool has_single_child_visibility() const;
00048   virtual int get_visible_child() const;
00049 
00050   virtual void output(ostream &out) const;
00051 
00052 public:
00053   static void register_with_read_factory();
00054   virtual void write_datagram(BamWriter *manager, Datagram &dg);
00055 
00056 protected:
00057   static TypedWritable *make_from_bam(const FactoryParams &params);
00058   void fillin(DatagramIterator &scan, BamReader *manager);
00059 
00060 public:
00061   static TypeHandle get_class_type() {
00062     return _type_handle;
00063   }
00064   static void init_type() {
00065     SelectiveChildNode::init_type();
00066     AnimInterface::init_type();
00067     register_type(_type_handle, "SequenceNode",
00068                   SelectiveChildNode::get_class_type(),
00069                   AnimInterface::get_class_type());
00070   }
00071   virtual TypeHandle get_type() const {
00072     return get_class_type();
00073   }
00074   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00075 
00076 private:
00077   static TypeHandle _type_handle;
00078 };
00079 
00080 #include "sequenceNode.I"
00081 
00082 #endif
 All Classes Functions Variables Enumerations