Equalizer 1.0

frustum.h

00001 
00002 /* Copyright (c) 2009-2011, Stefan Eilemann <eile@equalizergraphics.com> 
00003  *
00004  * This library is free software; you can redistribute it and/or modify it under
00005  * the terms of the GNU Lesser General Public License version 2.1 as published
00006  * by the Free Software Foundation.
00007  *  
00008  * This library is distributed in the hope that it will be useful, but WITHOUT
00009  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00010  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00011  * details.
00012  * 
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this library; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00016  */
00017 
00018 #ifndef EQFABRIC_FRUSTUM_H
00019 #define EQFABRIC_FRUSTUM_H
00020 
00021 #include <eq/fabric/projection.h> // member
00022 #include <eq/fabric/wall.h>       // member
00023 #include <eq/fabric/api.h>       // decl
00024 
00025 namespace co
00026 {
00027     class DataOStream;
00028     class DataIStream;
00029 }
00030 
00031 namespace eq
00032 {
00033 namespace fabric
00034 {
00036     class Frustum
00037     {
00038     public:
00040         EQFABRIC_API Frustum();
00041         
00043         EQFABRIC_API virtual ~Frustum();
00044 
00046         enum Type
00047         {
00048             TYPE_NONE,        
00049             TYPE_WALL,        
00050             TYPE_PROJECTION   
00051         };
00052 
00054         EQFABRIC_API virtual void setWall( const Wall& wall );
00055         
00057         EQFABRIC_API virtual void setProjection( const Projection& projection );
00058 
00060         const Wall& getWall() const { return _data.wall; }
00061 
00063         const Projection& getProjection() const { return _data.projection; }
00064 
00066         Type getCurrentType() const { return _data.current; }
00067 
00069         EQFABRIC_API virtual void unsetFrustum();
00070 
00071         EQFABRIC_API virtual void backup(); 
00072         EQFABRIC_API virtual void restore(); 
00073 
00074     private:
00075         struct BackupData
00076         {
00077             BackupData() : current( TYPE_NONE ) {}
00078 
00080             Wall wall;
00081 
00083             Projection projection;
00084 
00086             Type current;
00087         }
00088             _data, _backup; 
00089 
00090         struct Private;
00091         Private* _private; // placeholder for binary-compatible changes
00092     };
00093 
00094     EQFABRIC_API std::ostream& operator << ( std::ostream& os, const Frustum& );
00095     EQFABRIC_API co::DataOStream& operator << (co::DataOStream&, const Frustum&);
00096     EQFABRIC_API co::DataIStream& operator >> (co::DataIStream&, Frustum& );
00097 }
00098 }
00099 #endif // EQFABRIC_FRUSTUM_H
Generated on Sun May 8 2011 19:11:05 for Equalizer 1.0 by  doxygen 1.7.3