Panda3D
eggSAnimData.I
1 // Filename: eggSAnimData.I
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 
16 ////////////////////////////////////////////////////////////////////
17 // Function: EggSAnimData::Constructor
18 // Access: Public
19 // Description:
20 ////////////////////////////////////////////////////////////////////
21 INLINE EggSAnimData::
22 EggSAnimData(const string &name) : EggAnimData(name) {
23 }
24 
25 
26 ////////////////////////////////////////////////////////////////////
27 // Function: EggSAnimData::Copy constructor
28 // Access: Public
29 // Description:
30 ////////////////////////////////////////////////////////////////////
31 INLINE EggSAnimData::
32 EggSAnimData(const EggSAnimData &copy) : EggAnimData(copy) {
33 }
34 
35 
36 ////////////////////////////////////////////////////////////////////
37 // Function: EggSAnimData::Copy assignment operator
38 // Access: Public
39 // Description:
40 ////////////////////////////////////////////////////////////////////
41 INLINE EggSAnimData &EggSAnimData::
42 operator = (const EggSAnimData &copy) {
43  EggAnimData::operator = (copy);
44 
45  return *this;
46 }
47 
48 
49 ////////////////////////////////////////////////////////////////////
50 // Function: EggSAnimData::get_num_rows
51 // Access: Public
52 // Description: Returns the number of rows in the table. For an
53 // SAnim table, each row has one column.
54 ////////////////////////////////////////////////////////////////////
55 INLINE int EggSAnimData::
56 get_num_rows() const {
57  return get_size();
58 }
59 
60 
61 ////////////////////////////////////////////////////////////////////
62 // Function: EggSAnimData::get_value
63 // Access: Public
64 // Description: Returns the value at the indicated row. Row must be
65 // in the range 0 <= row < get_num_rows().
66 ////////////////////////////////////////////////////////////////////
67 INLINE double EggSAnimData::
68 get_value(int row) const {
69  nassertr(row >= 0 && row < get_num_rows(), 0.0);
70  return _data[row];
71 }
72 
73 
74 ////////////////////////////////////////////////////////////////////
75 // Function: EggSAnimData::set_value
76 // Access: Public
77 // Description: Changes the value at the indicated row. Row must be
78 // in the range 0 <= row < get_num_rows().
79 ////////////////////////////////////////////////////////////////////
80 INLINE void EggSAnimData::
81 set_value(int row, double value) {
82  nassertv(row >= 0 && row < get_num_rows());
83  _data[row] = value;
84 }
85 
86 
void set_value(int row, double value)
Changes the value at the indicated row.
Definition: eggSAnimData.I:81
Corresponding to an <S$Anim> entry, this stores a single column of numbers, for instance for a morph ...
Definition: eggSAnimData.h:28
double get_value(int row) const
Returns the value at the indicated row.
Definition: eggSAnimData.I:68
int get_size() const
Returns the number of elements in the table.
Definition: eggAnimData.I:128
A base class for EggSAnimData and EggXfmAnimData, which contain rows and columns of numbers...
Definition: eggAnimData.h:32
int get_num_rows() const
Returns the number of rows in the table.
Definition: eggSAnimData.I:56