lib/client/frustum.h

00001 
00002 /* Copyright (c) 2009, 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 EQ_FRUSTUM_H
00019 #define EQ_FRUSTUM_H
00020 
00021 #include <eq/client/object.h>     // base class
00022 #include <eq/client/projection.h> // member
00023 #include <eq/client/wall.h>       // member
00024 
00025 namespace eq
00026 {
00028     class Frustum : public Object
00029     {
00030     public:
00032         EQ_EXPORT Frustum();
00033         
00035         EQ_EXPORT virtual ~Frustum();
00036 
00038         enum Type
00039         {
00040             TYPE_NONE,        
00041             TYPE_WALL,        
00042             TYPE_PROJECTION   
00043         };
00044 
00046         EQ_EXPORT void setWall( const Wall& wall );
00047         
00049         EQ_EXPORT void setProjection( const Projection& projection );
00050 
00052         EQ_EXPORT const Wall& getWall() const { return _wall; }
00053 
00055         EQ_EXPORT const Projection& getProjection() const { return _projection;}
00056 
00058         EQ_EXPORT Type getCurrentType() const { return _current; }
00059 
00061         EQ_EXPORT void unsetFrustum();
00062 
00063     protected:
00065         EQ_EXPORT virtual void serialize( net::DataOStream& os,
00066                                           const uint64_t dirtyBits );
00068         EQ_EXPORT virtual void deserialize( net::DataIStream& is, 
00069                                             const uint64_t dirtyBits );
00070 
00072         enum DirtyBits
00073         {
00074             DIRTY_TYPE       = Object::DIRTY_CUSTOM << 0,
00075             DIRTY_WALL       = Object::DIRTY_CUSTOM << 1,
00076             DIRTY_PROJECTION = Object::DIRTY_CUSTOM << 2,
00077             DIRTY_FILL1      = Object::DIRTY_CUSTOM << 3,
00078             DIRTY_FILL2      = Object::DIRTY_CUSTOM << 4,
00079             DIRTY_CUSTOM     = Object::DIRTY_CUSTOM << 5,
00080         };
00081 
00082     private:
00084         Wall _wall;
00085 
00087         Projection _projection;
00088 
00090         Type _current;
00091 
00092         union // placeholder for binary-compatible changes
00093         {
00094             char dummy[64];
00095         };
00096     };
00097 
00098     EQ_EXPORT std::ostream& operator << ( std::ostream& os, const Frustum& );
00099 }
00100 #endif // EQ_FRUSTUM_H
Generated on Mon Aug 10 18:58:33 2009 for Equalizer 0.9 by  doxygen 1.5.8