Panda3D
Loading...
Searching...
No Matches
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 */
30class EXPCL_PANDA_EGG EggAnimData : public EggNode {
31PUBLISHED:
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
46public:
47 INLINE PTA_double get_data() const;
48 INLINE void set_data(const PTA_double &data);
49
50PUBLISHED:
51 void quantize(double quantum);
52
53protected:
54 PTA_double _data;
55
56private:
57 double _fps;
58 bool _has_fps;
59
60
61public:
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
76private:
77 static TypeHandle _type_handle;
78};
79
80#include "eggAnimData.I"
81
82#endif
void quantize(double quantum)
Rounds each element of the table to the nearest multiple of quantum.
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
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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(),...