Panda3D
|
00001 // Filename: eggAnimData.h 00002 // Created by: drose (19Feb99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef EGGANIMDATA_H 00016 #define EGGANIMDATA_H 00017 00018 #include "pandabase.h" 00019 00020 #include "eggNode.h" 00021 00022 #include "pointerToArray.h" 00023 #include "pta_double.h" 00024 00025 #include <math.h> 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : EggAnimData 00029 // Description : A base class for EggSAnimData and EggXfmAnimData, 00030 // which contain rows and columns of numbers. 00031 //////////////////////////////////////////////////////////////////// 00032 class EXPCL_PANDAEGG EggAnimData : public EggNode { 00033 PUBLISHED: 00034 00035 INLINE EggAnimData(const string &name = ""); 00036 INLINE EggAnimData(const EggAnimData ©); 00037 INLINE EggAnimData &operator = (const EggAnimData ©); 00038 00039 INLINE void set_fps(double type); 00040 INLINE void clear_fps(); 00041 INLINE bool has_fps() const; 00042 INLINE double get_fps() const; 00043 00044 INLINE void clear_data(); 00045 INLINE void add_data(double value); 00046 00047 INLINE int get_size() const; 00048 00049 public: 00050 INLINE PTA_double get_data() const; 00051 INLINE void set_data(const PTA_double &data); 00052 00053 PUBLISHED: 00054 void quantize(double quantum); 00055 00056 protected: 00057 PTA_double _data; 00058 00059 private: 00060 double _fps; 00061 bool _has_fps; 00062 00063 00064 public: 00065 00066 static TypeHandle get_class_type() { 00067 return _type_handle; 00068 } 00069 static void init_type() { 00070 EggNode::init_type(); 00071 register_type(_type_handle, "EggAnimData", 00072 EggNode::get_class_type()); 00073 } 00074 virtual TypeHandle get_type() const { 00075 return get_class_type(); 00076 } 00077 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00078 00079 private: 00080 static TypeHandle _type_handle; 00081 }; 00082 00083 #include "eggAnimData.I" 00084 00085 #endif