Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

panda/src/egg/eggSwitchCondition.h

Go to the documentation of this file.
00001 // Filename: eggSwitchCondition.h
00002 // Created by:  drose (08Feb99)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef EGGSWITCHCONDITION
00020 #define EGGSWITCHCONDITION
00021 
00022 #include <pandabase.h>
00023 
00024 #include "eggObject.h"
00025 #include <luse.h>
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //       Class : EggSwitchCondition
00029 // Description : This corresponds to a <SwitchCondition> entry within
00030 //               a group.  It indicates the condition at which a
00031 //               level-of-detail is switched in or out.  This is
00032 //               actually an abstract base class for potentially any
00033 //               number of specific different kinds of switching
00034 //               conditions; presently, only a <Distance> type is
00035 //               actually supported.
00036 ////////////////////////////////////////////////////////////////////
00037 class EXPCL_PANDAEGG EggSwitchCondition : public EggObject {
00038 public:
00039   virtual EggSwitchCondition *make_copy() const=0;
00040   virtual void write(ostream &out, int indent_level) const=0;
00041 
00042   virtual void transform(const LMatrix4d &mat)=0;
00043 
00044 
00045 public:
00046 
00047   static TypeHandle get_class_type() {
00048     return _type_handle;
00049   }
00050   static void init_type() {
00051     EggObject::init_type();
00052     register_type(_type_handle, "EggSwitchCondition",
00053                   EggObject::get_class_type());
00054   }
00055   virtual TypeHandle get_type() const {
00056     return get_class_type();
00057   }
00058   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00059 
00060 private:
00061   static TypeHandle _type_handle;
00062 };
00063 
00064 
00065 ////////////////////////////////////////////////////////////////////
00066 //       Class : EggSwitchConditionDistance
00067 // Description : A SwitchCondition that switches the levels-of-detail
00068 //               based on distance from the camera's eyepoint.
00069 ////////////////////////////////////////////////////////////////////
00070 class EXPCL_PANDAEGG EggSwitchConditionDistance : public EggSwitchCondition {
00071 public:
00072   EggSwitchConditionDistance(double switch_in, double switch_out,
00073                              const LPoint3d &center, double fade = 0.0);
00074 
00075   virtual EggSwitchCondition *make_copy() const;
00076   virtual void write(ostream &out, int indent_level) const;
00077 
00078   virtual void transform(const LMatrix4d &mat);
00079 
00080   double _switch_in, _switch_out, _fade;
00081   LPoint3d _center;
00082 
00083 public:
00084 
00085   static TypeHandle get_class_type() {
00086     return _type_handle;
00087   }
00088   static void init_type() {
00089     EggSwitchCondition::init_type();
00090     register_type(_type_handle, "EggSwitchConditionDistance",
00091                   EggSwitchCondition::get_class_type());
00092   }
00093   virtual TypeHandle get_type() const {
00094     return get_class_type();
00095   }
00096 
00097 private:
00098   static TypeHandle _type_handle;
00099 };
00100 
00101 
00102 #endif
00103 

Generated on Fri May 2 00:37:58 2003 for Panda by doxygen1.3