Panda3D
eggBackPointer.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 eggBackPointer.h
10  * @author drose
11  * @date 2001-02-26
12  */
13 
14 #ifndef EGGBACKPOINTER_H
15 #define EGGBACKPOINTER_H
16 
17 #include "pandatoolbase.h"
18 
19 #include "typedObject.h"
20 
21 /**
22  * This stores a pointer from an EggJointData or EggSliderData object back to
23  * the referencing data in an egg file. One of these objects corresponds to
24  * each model appearing in an egg file, and may reference either a single
25  * node, or a table, or a slew of vertices and primitives, depending on the
26  * type of data stored.
27  *
28  * This is just an abstract base class. The actual details are stored in the
29  * various subclasses.
30  */
31 class EggBackPointer : public TypedObject {
32 public:
34 
35  virtual double get_frame_rate() const;
36  virtual int get_num_frames() const=0;
37  virtual void extend_to(int num_frames);
38  virtual bool has_vertices() const;
39 
40  virtual void set_name(const std::string &name);
41 
42 public:
43  static TypeHandle get_class_type() {
44  return _type_handle;
45  }
46  static void init_type() {
48  register_type(_type_handle, "EggBackPointer",
49  TypedObject::get_class_type());
50  }
51  virtual TypeHandle get_type() const {
52  return get_class_type();
53  }
54  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
55 
56 private:
57  static TypeHandle _type_handle;
58 };
59 
60 #endif
static void init_type()
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Definition: typedObject.cxx:44
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
virtual void set_name(const std::string &name)
Applies the indicated name change to the egg file.
This is an abstract class that all classes which use TypeHandle, and also provide virtual functions t...
Definition: typedObject.h:88
virtual bool has_vertices() const
Returns true if there are any vertices referenced by the node this points to, false otherwise.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual double get_frame_rate() const
Returns the stated frame rate of this particular joint, or 0.0 if it doesn't state.
virtual void extend_to(int num_frames)
Extends the table to the indicated number of frames.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
This stores a pointer from an EggJointData or EggSliderData object back to the referencing data in an...