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

panda/src/chancfg/chansetup.h

Go to the documentation of this file.
00001 // Filename: chansetup.h
00002 // Created by:  cary (05Feb99)
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 __CHANSETUP_H__
00020 #define __CHANSETUP_H__
00021 
00022 #include <pandabase.h>
00023 
00024 #include <vector_string.h>
00025 
00026 #include "pmap.h"
00027 #include "chanviewport.h"
00028 
00029 typedef vector_string SetupSyms;
00030 
00031 class SetupFOV {
00032 public:
00033   enum FOVType { Invalid, Default, Horizontal, Both };
00034 private:
00035   FOVType _type;
00036   float _horiz, _vert;
00037 public:
00038   INLINE SetupFOV(void);
00039   INLINE SetupFOV(const SetupFOV&);
00040   INLINE ~SetupFOV(void);
00041 
00042   INLINE SetupFOV& operator=(const SetupFOV&);
00043 
00044   INLINE void setFOV(void);
00045   INLINE void setFOV(const float);
00046   INLINE void setFOV(const float, const float);
00047   INLINE FOVType getType(void) const;
00048   INLINE float getHoriz(void) const;
00049   INLINE float getVert(void) const;
00050 };
00051 
00052 class SetupItem {
00053 public:
00054   enum Orientation { Up, Down, Left, Right };
00055 private:
00056   SetupSyms _layouts;
00057   SetupSyms _setups;
00058 
00059   bool _stereo;
00060   bool _hw_chan;
00061   int _chan;
00062   ChanViewport _viewport;
00063   SetupFOV _fov;
00064   Orientation _orientation;
00065 public:
00066   INLINE SetupItem(void);
00067   INLINE SetupItem(const SetupItem&);
00068   INLINE ~SetupItem(void);
00069 
00070   INLINE SetupItem& operator=(const SetupItem&);
00071 
00072   INLINE void setState(const bool, const bool, const int, const ChanViewport&,
00073                        const SetupFOV&, const Orientation&);
00074 
00075   INLINE SetupSyms getLayouts(void) const;
00076   INLINE SetupSyms getSetups(void) const;
00077   INLINE bool getStereo(void) const;
00078   INLINE bool getHWChan(void) const;
00079   INLINE int getChan(void) const;
00080   INLINE ChanViewport getViewport(void) const;
00081   INLINE SetupFOV getFOV(void) const;
00082   INLINE Orientation getOrientation(void) const;
00083 };
00084 
00085 typedef pmap<std::string, SetupItem> SetupType;
00086 
00087 extern SetupType* SetupDB;
00088 
00089 void ResetSetup();
00090 void ParseSetup(istream&);
00091 
00092 #include "chansetup.I"
00093 
00094 #endif /* __CHANSETUP_H__ */

Generated on Fri May 2 00:35:19 2003 for Panda by doxygen1.3