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