eng_lod.hh

Go to the documentation of this file.
00001 /*
00008  * LEGAL:   COPYRIGHT (C) 2005 JIM E. BROOKS
00009  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
00010  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
00011  *****************************************************************************/
00012 
00013 #ifndef ENG_LOD_HH
00014 #define ENG_LOD_HH 1
00015 
00016 namespace eng {
00017 
00044 class ObjectLod
00045 {
00046 
00047 public:
00048                 ObjectLod( void );  // any LOD (0.0,1.0)
00049                 ObjectLod( const fp lodMin, const fp lodMax );
00050                 ~ObjectLod();
00051     bool        IfInRange( const ObjectLod& objectLod ) const;
00052 
00053 private:
00054     fp      mLodMin;
00055     fp      mLodMax;
00056 };
00057 
00063 class UserLod
00064 {
00065 
00066 public:
00067     enum eUserLod
00068     {
00069         eUserLod_DEFAULT,
00070 
00071         // 5 levels of user-selected LOD overrides.
00072         eUserLod_MIN,   // 1
00073         eUserLod_LOW,   // 2
00074         eUserLod_MID,   // 3
00075         eUserLod_HIGH,  // 4
00076         eUserLod_MAX,   // 5
00077 
00078         eUserLod_LEVELS = 5,  // eUserLod_DEFAULT isn't counted
00079     };
00080 
00081 public:
00082                 UserLod( void );
00083                 ~UserLod();
00084 
00086     eUserLod    Get( void ) { return mUserLod; }
00087     void        Set( const eUserLod userLod );
00088     void        Reset( void );
00089     void        Inc( void );
00090 
00091     // operator int would open possibility of invalid levels.
00092     bool        operator==( eUserLod userLod ) const { return mUserLod == userLod; }
00093     bool        operator!=( eUserLod userLod ) const { return mUserLod != userLod; }
00094     bool        operator<( eUserLod userLod )  const { return mUserLod < userLod; }
00095     bool        operator>( eUserLod userLod )  const { return mUserLod > userLod; }
00096     bool        operator<=( eUserLod userLod ) const { return mUserLod <= userLod; }
00097     bool        operator>=( eUserLod userLod ) const { return mUserLod >= userLod; }
00098 
00100     const string&   Lod2String( eUserLod lod );
00101     eUserLod        String2Lod( const string& lod );
00102 
00103 private:
00104     eUserLod        mUserLod;
00105 };
00106 
00107 } // namespace eng
00108 
00109 #endif // ENG_LOD_HH
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:08 2007