Panda3D
eggAnimData.I
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.I
10  * @author drose
11  * @date 1999-02-19
12  */
13 
14 #include "pnotify.h"
15 
16 /**
17  *
18  */
19 INLINE EggAnimData::
20 EggAnimData(const std::string &name) : EggNode(name) {
21  _has_fps = false;
22 }
23 
24 
25 /**
26  *
27  */
28 INLINE EggAnimData::
29 EggAnimData(const EggAnimData &copy) :
30  EggNode(copy), _data(copy._data),
31  _fps(copy._fps), _has_fps(copy._has_fps) {
32 }
33 
34 
35 /**
36  *
37  */
38 INLINE EggAnimData &EggAnimData::
39 operator = (const EggAnimData &copy) {
40  EggNode::operator = (copy);
41  _data = copy._data;
42  _fps = copy._fps;
43  _has_fps = copy._has_fps;
44 
45  return *this;
46 }
47 
48 
49 /**
50  *
51  */
52 INLINE void EggAnimData::
53 set_fps(double fps) {
54  _fps = fps;
55  _has_fps = true;
56 }
57 
58 
59 /**
60  *
61  */
62 INLINE void EggAnimData::
63 clear_fps() {
64  _has_fps = false;
65 }
66 
67 /**
68  *
69  */
70 INLINE bool EggAnimData::
71 has_fps() const {
72  return _has_fps;
73 }
74 
75 /**
76  * This is only valid if has_fps() returns true.
77  */
78 INLINE double EggAnimData::
79 get_fps() const {
80  nassertr(has_fps(), 0.0);
81  return _fps;
82 }
83 
84 
85 /**
86  * Removes all data and empties the table.
87  */
88 INLINE void EggAnimData::
90  _data.clear();
91 }
92 
93 /**
94  * Adds a single element to the table.
95  */
96 INLINE void EggAnimData::
97 add_data(double value) {
98  _data.push_back(value);
99 }
100 
101 
102 
103 /**
104  * Returns the number of elements in the table.
105  */
106 INLINE int EggAnimData::
107 get_size() const {
108  return _data.size();
109 }
110 
111 
112 /**
113  * Returns the entire table of data.
114  */
115 INLINE PTA_double EggAnimData::
116 get_data() const {
117  return _data;
118 }
119 
120 
121 /**
122  * Replaces the entire table of data.
123  */
124 INLINE void EggAnimData::
125 set_data(const PTA_double &data) {
126  _data = data;
127 }
void add_data(double value)
Adds a single element to the table.
Definition: eggAnimData.I:97
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_size() const
Returns the number of elements in the table.
Definition: eggAnimData.I:107
PTA_double get_data() const
Returns the entire table of data.
Definition: eggAnimData.I:116
void clear_data()
Removes all data and empties the table.
Definition: eggAnimData.I:89
void set_data(const PTA_double &data)
Replaces the entire table of data.
Definition: eggAnimData.I:125
double get_fps() const
This is only valid if has_fps() returns true.
Definition: eggAnimData.I:79
A base class for EggSAnimData and EggXfmAnimData, which contain rows and columns of numbers.
Definition: eggAnimData.h:30
A base class for things that may be directly added into the egg hierarchy.
Definition: eggNode.h:35