Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/chan/movingPartBase.h

Go to the documentation of this file.
00001 // Filename: movingPartBase.h
00002 // Created by:  drose (22Feb99)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef MOVINGPARTBASE_H
00020 #define MOVINGPARTBASE_H
00021 
00022 #include <pandabase.h>
00023 
00024 #include "partGroup.h"
00025 #include "partBundle.h"
00026 #include "animChannelBase.h"
00027 
00028 ////////////////////////////////////////////////////////////////////
00029 //       Class : MovingPartBase
00030 // Description : This is the base class for a single animatable piece
00031 //               that may be bound to one channel (or more, if
00032 //               blending is in effect).  It corresponds to, for
00033 //               instance, a single joint or slider of a character.
00034 //
00035 //               MovingPartBase does not have a particular value type.
00036 //               See the derived template class, MovingPart, for this.
00037 ////////////////////////////////////////////////////////////////////
00038 class EXPCL_PANDA MovingPartBase : public PartGroup {
00039 protected:
00040   INLINE MovingPartBase(const MovingPartBase &copy);
00041 
00042 public:
00043   MovingPartBase(PartGroup *parent, const string &name);
00044 
00045   virtual TypeHandle get_value_type() const=0;
00046   virtual AnimChannelBase *make_initial_channel() const=0;
00047   virtual void write(ostream &out, int indent_level) const;
00048   virtual void write_with_value(ostream &out, int indent_level) const;
00049   virtual void output_value(ostream &out) const=0;
00050 
00051   virtual bool do_update(PartBundle *root, PartGroup *parent,
00052                          bool parent_changed, bool anim_changed);
00053 
00054   virtual void get_blend_value(const PartBundle *root)=0;
00055   virtual bool update_internals(PartGroup *parent, bool self_changed,
00056                                 bool parent_changed);
00057 
00058 protected:
00059   MovingPartBase(void);
00060 
00061   virtual void pick_channel_index(plist<int> &holes, int &next) const;
00062   virtual void bind_hierarchy(AnimGroup *anim, int channel_index);
00063 
00064   typedef pvector< PT(AnimChannelBase) > Channels;
00065   Channels _channels;
00066 
00067 public:
00068 
00069   virtual TypeHandle get_type() const {
00070     return get_class_type();
00071   }
00072   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00073 PUBLISHED:
00074   static TypeHandle get_class_type() {
00075     return _type_handle;
00076   }
00077 public:
00078   static void init_type() {
00079     PartGroup::init_type();
00080     register_type(_type_handle, "MovingPartBase",
00081                   PartGroup::get_class_type());
00082   }
00083 
00084 private:
00085   static TypeHandle _type_handle;
00086 };
00087 
00088 #include "movingPartBase.I"
00089 
00090 #endif
00091 
00092 
00093 
00094 

Generated on Fri May 2 00:35:08 2003 for Panda by doxygen1.3