Panda3D
 All Classes Functions Variables Enumerations
eggXfmAnimData.h
1 // Filename: eggXfmAnimData.h
2 // Created by: drose (19Feb99)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef EGGXFMANIMDATA_H
16 #define EGGXFMANIMDATA_H
17 
18 #include "pandabase.h"
19 
20 #include "eggAnimData.h"
21 #include "eggXfmSAnim.h"
22 
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : EggXfmAnimData
26 // Description : Corresponding to an <Xfm$Anim> entry, this stores a
27 // two-dimensional table with up to nine columns, one
28 // for each component of a transformation. This is an
29 // older syntax of egg anim table, not often used
30 // currently--it's replaced by EggXfmSAnim.
31 ////////////////////////////////////////////////////////////////////
32 class EXPCL_PANDAEGG EggXfmAnimData : public EggAnimData {
33 PUBLISHED:
34  INLINE EggXfmAnimData(const string &name = "",
35  CoordinateSystem cs = CS_default);
36  EggXfmAnimData(const EggXfmSAnim &convert_from);
37 
38  INLINE EggXfmAnimData(const EggXfmAnimData &copy);
39  INLINE EggXfmAnimData &operator = (const EggXfmAnimData &copy);
40 
41  INLINE void set_order(const string &order);
42  INLINE void clear_order();
43  INLINE bool has_order() const;
44  INLINE const string &get_order() const;
45  INLINE static const string &get_standard_order();
46 
47  INLINE void set_contents(const string &contents);
48  INLINE void clear_contents();
49  INLINE bool has_contents() const;
50  INLINE const string &get_contents() const;
51 
52  INLINE CoordinateSystem get_coordinate_system() const;
53 
54  INLINE int get_num_rows() const;
55  INLINE int get_num_cols() const;
56  INLINE double get_value(int row, int col) const;
57 
58  void get_value(int row, LMatrix4d &mat) const;
59 
60  virtual bool is_anim_matrix() const;
61  virtual void write(ostream &out, int indent_level) const;
62 
63 protected:
64  virtual void r_transform(const LMatrix4d &mat, const LMatrix4d &inv,
65  CoordinateSystem to_cs);
66  virtual void r_mark_coordsys(CoordinateSystem cs);
67 
68 private:
69  string _order;
70  string _contents;
71  CoordinateSystem _coordsys;
72 
73 public:
74 
75  static TypeHandle get_class_type() {
76  return _type_handle;
77  }
78  static void init_type() {
79  EggAnimData::init_type();
80  register_type(_type_handle, "EggXfmAnimData",
81  EggAnimData::get_class_type());
82  }
83  virtual TypeHandle get_type() const {
84  return get_class_type();
85  }
86  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
87 
88 private:
89  static TypeHandle _type_handle;
90 };
91 
92 #include "eggXfmAnimData.I"
93 
94 #endif
95 
virtual bool is_anim_matrix() const
Returns true if this node represents a table of animation transformation data, false otherwise...
Definition: eggNode.cxx:86
This is a 4-by-4 transform matrix.
Definition: lmatrix.h:4716
This corresponds to an &lt;Xfm$Anim_S$&gt; entry, which is a collection of up to nine &lt;S$Anim&gt; entries that...
Definition: eggXfmSAnim.h:33
A base class for EggSAnimData and EggXfmAnimData, which contain rows and columns of numbers...
Definition: eggAnimData.h:32
Corresponding to an &lt;Xfm$Anim&gt; entry, this stores a two-dimensional table with up to nine columns...
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85