Equalizer  1.4.1
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 void serialize( co::DataOStream& os ); 
00072         EQFABRIC_API void deserialize( co::DataIStream& is ); 
00073 
00074         EQFABRIC_API virtual void backup(); 
00075         EQFABRIC_API virtual void restore(); 
00076 
00077     protected:
00078         virtual void updateFrustum() {}
00079 
00080     private:
00081         struct BackupData
00082         {
00083             BackupData() : current( TYPE_NONE ) {}
00084 
00086             Wall wall;
00087 
00089             Projection projection;
00090 
00092             Type current;
00093         }
00094             _data, _backup; 
00095 
00096         struct Private;
00097         Private* _private; // placeholder for binary-compatible changes
00098     };
00099     EQFABRIC_API std::ostream& operator << ( std::ostream& os, const Frustum& );
00100 }
00101 }
00102 #endif // EQFABRIC_FRUSTUM_H
Generated on Mon Nov 26 2012 14:41:48 for Equalizer 1.4.1 by  doxygen 1.7.6.1