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