Panda3D

eggXfmAnimData.h

00001 // Filename: eggXfmAnimData.h
00002 // Created by:  drose (19Feb99)
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 EGGXFMANIMDATA_H
00016 #define EGGXFMANIMDATA_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "eggAnimData.h"
00021 #include "eggXfmSAnim.h"
00022 
00023 
00024 ////////////////////////////////////////////////////////////////////
00025 //       Class : EggXfmAnimData
00026 // Description : Corresponding to an <Xfm$Anim> entry, this stores a
00027 //               two-dimensional table with up to nine columns, one
00028 //               for each component of a transformation.  This is an
00029 //               older syntax of egg anim table, not often used
00030 //               currently--it's replaced by EggXfmSAnim.
00031 ////////////////////////////////////////////////////////////////////
00032 class EXPCL_PANDAEGG EggXfmAnimData : public EggAnimData {
00033 PUBLISHED:
00034   INLINE EggXfmAnimData(const string &name = "",
00035                         CoordinateSystem cs = CS_default);
00036   EggXfmAnimData(const EggXfmSAnim &convert_from);
00037 
00038   INLINE EggXfmAnimData(const EggXfmAnimData &copy);
00039   INLINE EggXfmAnimData &operator = (const EggXfmAnimData &copy);
00040 
00041   INLINE void set_order(const string &order);
00042   INLINE void clear_order();
00043   INLINE bool has_order() const;
00044   INLINE const string &get_order() const;
00045   INLINE static const string &get_standard_order();
00046 
00047   INLINE void set_contents(const string &contents);
00048   INLINE void clear_contents();
00049   INLINE bool has_contents() const;
00050   INLINE const string &get_contents() const;
00051 
00052   INLINE CoordinateSystem get_coordinate_system() const;
00053 
00054   INLINE int get_num_rows() const;
00055   INLINE int get_num_cols() const;
00056   INLINE double get_value(int row, int col) const;
00057 
00058   void get_value(int row, LMatrix4d &mat) const;
00059 
00060   virtual bool is_anim_matrix() const;
00061   virtual void write(ostream &out, int indent_level) const;
00062 
00063 protected:
00064   virtual void r_transform(const LMatrix4d &mat, const LMatrix4d &inv,
00065                            CoordinateSystem to_cs);
00066   virtual void r_mark_coordsys(CoordinateSystem cs);
00067 
00068 private:
00069   string _order;
00070   string _contents;
00071   CoordinateSystem _coordsys;
00072 
00073 public:
00074 
00075   static TypeHandle get_class_type() {
00076     return _type_handle;
00077   }
00078   static void init_type() {
00079     EggAnimData::init_type();
00080     register_type(_type_handle, "EggXfmAnimData",
00081                   EggAnimData::get_class_type());
00082   }
00083   virtual TypeHandle get_type() const {
00084     return get_class_type();
00085   }
00086   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00087 
00088 private:
00089   static TypeHandle _type_handle;
00090 };
00091 
00092 #include "eggXfmAnimData.I"
00093 
00094 #endif
00095 
 All Classes Functions Variables Enumerations