Panda3D
eggScalarTablePointer.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 eggScalarTablePointer.h
10  * @author drose
11  * @date 2003-07-18
12  */
13 
14 #ifndef EGGSCALARTABLEPOINTER_H
15 #define EGGSCALARTABLEPOINTER_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "eggSliderPointer.h"
20 
21 #include "eggSAnimData.h"
22 #include "pointerTo.h"
23 
24 /**
25  * This stores a pointer back to an EggSAnimData table (i.e. an <S$Anim>
26  * entry in an egg file), corresponding to the animation data from a single
27  * bundle for this slider.
28  */
30 public:
32 
33  virtual double get_frame_rate() const;
34  virtual int get_num_frames() const;
35  virtual void extend_to(int num_frames);
36  virtual double get_frame(int n) const;
37 
38  virtual void set_name(const std::string &name);
39 
40 private:
41  PT(EggSAnimData) _data;
42 
43 public:
44  static TypeHandle get_class_type() {
45  return _type_handle;
46  }
47  static void init_type() {
48  EggSliderPointer::init_type();
49  register_type(_type_handle, "EggScalarTablePointer",
50  EggSliderPointer::get_class_type());
51  }
52  virtual TypeHandle get_type() const {
53  return get_class_type();
54  }
55  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
56 
57 private:
58  static TypeHandle _type_handle;
59 };
60 
61 #endif
The highest-level base class in the egg directory.
Definition: eggObject.h:29
Corresponding to an <S$Anim> entry, this stores a single column of numbers, for instance for a morph ...
Definition: eggSAnimData.h:25
This stores a pointer back to an EggSAnimData table (i.e.
virtual double get_frame_rate() const
Returns the stated frame rate of this particular joint, or 0.0 if it doesn't state.
virtual int get_num_frames() const
Returns the number of frames of animation for this particular slider.
virtual double get_frame(int n) const
Returns the value corresponding to this slider position in the nth frame.
virtual void extend_to(int num_frames)
Extends the table to the indicated number of frames.
virtual void set_name(const std::string &name)
Applies the indicated name change to the egg file.
This is a base class for EggVertexPointer and EggScalarTablePointer.
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22