Panda3D
 All Classes Functions Variables Enumerations
auxSceneData.h
00001 // Filename: auxSceneData.h
00002 // Created by:  drose (27Sep04)
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 AUXSCENEDATA_H
00016 #define AUXSCENEDATA_H
00017 
00018 #include "pandabase.h"
00019 
00020 #include "typedReferenceCount.h"
00021 #include "clockObject.h"
00022 
00023 ////////////////////////////////////////////////////////////////////
00024 //       Class : AuxSceneData
00025 // Description : This is a base class for a generic data structure
00026 //               that can be attached per-instance to the camera, to
00027 //               store per-instance data that must be preserved over
00028 //               multiple frames.
00029 //
00030 //               In particular, this is used to implement the
00031 //               FadeLODNode, which must remember during traversal at
00032 //               what point it is in the fade, separately for each
00033 //               instance and for each camera.
00034 ////////////////////////////////////////////////////////////////////
00035 class EXPCL_PANDA_PGRAPH AuxSceneData : public TypedReferenceCount {
00036 protected:
00037   INLINE AuxSceneData(double duration = 0.0);
00038 
00039 PUBLISHED:
00040   INLINE void set_duration(double duration);
00041   INLINE double get_duration() const;
00042 
00043   INLINE void set_last_render_time(double render_time);
00044   INLINE double get_last_render_time() const;
00045 
00046   INLINE double get_expiration_time() const;
00047 
00048   virtual void output(ostream &out) const;
00049   virtual void write(ostream &out, int indent_level = 0) const;
00050 
00051 protected:
00052   double _duration;
00053   double _last_render_time;
00054 
00055 public:
00056   static TypeHandle get_class_type() {
00057     return _type_handle;
00058   }
00059   static void init_type() {
00060     TypedReferenceCount::init_type();
00061     register_type(_type_handle, "AuxSceneData",
00062                   TypedReferenceCount::get_class_type());
00063   }
00064   virtual TypeHandle get_type() const {
00065     return get_class_type();
00066   }
00067   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00068 
00069 private:
00070   static TypeHandle _type_handle;
00071 };
00072 
00073 INLINE ostream &operator << (ostream &out, const AuxSceneData &data);
00074 
00075 #include "auxSceneData.I"
00076 
00077 #endif
 All Classes Functions Variables Enumerations