Panda3D
auxSceneData.h
1 // Filename: auxSceneData.h
2 // Created by: drose (27Sep04)
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 #ifndef AUXSCENEDATA_H
16 #define AUXSCENEDATA_H
17 
18 #include "pandabase.h"
19 
20 #include "typedReferenceCount.h"
21 #include "clockObject.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : AuxSceneData
25 // Description : This is a base class for a generic data structure
26 // that can be attached per-instance to the camera, to
27 // store per-instance data that must be preserved over
28 // multiple frames.
29 //
30 // In particular, this is used to implement the
31 // FadeLODNode, which must remember during traversal at
32 // what point it is in the fade, separately for each
33 // instance and for each camera.
34 ////////////////////////////////////////////////////////////////////
35 class EXPCL_PANDA_PGRAPH AuxSceneData : public TypedReferenceCount {
36 protected:
37  INLINE AuxSceneData(double duration = 0.0);
38 
39 PUBLISHED:
40  INLINE void set_duration(double duration);
41  INLINE double get_duration() const;
42 
43  INLINE void set_last_render_time(double render_time);
44  INLINE double get_last_render_time() const;
45 
46  INLINE double get_expiration_time() const;
47 
48  virtual void output(ostream &out) const;
49  virtual void write(ostream &out, int indent_level = 0) const;
50 
51 protected:
52  double _duration;
53  double _last_render_time;
54 
55 public:
56  static TypeHandle get_class_type() {
57  return _type_handle;
58  }
59  static void init_type() {
60  TypedReferenceCount::init_type();
61  register_type(_type_handle, "AuxSceneData",
62  TypedReferenceCount::get_class_type());
63  }
64  virtual TypeHandle get_type() const {
65  return get_class_type();
66  }
67  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
68 
69 private:
70  static TypeHandle _type_handle;
71 };
72 
73 INLINE ostream &operator << (ostream &out, const AuxSceneData &data);
74 
75 #include "auxSceneData.I"
76 
77 #endif
This is a base class for a generic data structure that can be attached per-instance to the camera...
Definition: auxSceneData.h:35
A base class for things which need to inherit from both TypedObject and from ReferenceCount.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85