Panda3D
eggAnimData.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 eggAnimData.h
10  * @author drose
11  * @date 1999-02-19
12  */
13 
14 #ifndef EGGANIMDATA_H
15 #define EGGANIMDATA_H
16 
17 #include "pandabase.h"
18 
19 #include "eggNode.h"
20 
21 #include "pointerToArray.h"
22 #include "pta_double.h"
23 
24 #include <math.h>
25 
26 /**
27  * A base class for EggSAnimData and EggXfmAnimData, which contain rows and
28  * columns of numbers.
29  */
30 class EXPCL_PANDA_EGG EggAnimData : public EggNode {
31 PUBLISHED:
32  INLINE explicit EggAnimData(const std::string &name = "");
33  INLINE EggAnimData(const EggAnimData &copy);
34  INLINE EggAnimData &operator = (const EggAnimData &copy);
35 
36  INLINE void set_fps(double type);
37  INLINE void clear_fps();
38  INLINE bool has_fps() const;
39  INLINE double get_fps() const;
40 
41  INLINE void clear_data();
42  INLINE void add_data(double value);
43 
44  INLINE int get_size() const;
45 
46 public:
47  INLINE PTA_double get_data() const;
48  INLINE void set_data(const PTA_double &data);
49 
50 PUBLISHED:
51  void quantize(double quantum);
52 
53 protected:
54  PTA_double _data;
55 
56 private:
57  double _fps;
58  bool _has_fps;
59 
60 
61 public:
62 
63  static TypeHandle get_class_type() {
64  return _type_handle;
65  }
66  static void init_type() {
67  EggNode::init_type();
68  register_type(_type_handle, "EggAnimData",
69  EggNode::get_class_type());
70  }
71  virtual TypeHandle get_type() const {
72  return get_class_type();
73  }
74  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
75 
76 private:
77  static TypeHandle _type_handle;
78 };
79 
80 #include "eggAnimData.I"
81 
82 #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.
A base class for EggSAnimData and EggXfmAnimData, which contain rows and columns of numbers.
Definition: eggAnimData.h:30
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:35
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.