frustumData.h

00001 
00002 /* Copyright (c) 2006-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 EQSERVER_FRUSTUMDATA_H
00019 #define EQSERVER_FRUSTUMDATA_H
00020 
00021 #include <eq/base/base.h>
00022 #include <eq/client/eye.h>   // EYE enum
00023 #include <eq/client/wall.h>  // Wall::Type enum
00024 #include <vmmlib/matrix.hpp>  // member
00025 #include <vmmlib/vector.hpp>  // member
00026 
00027 namespace eq
00028 {
00029     class Projection;
00030     class Wall;
00031 
00032 namespace server
00033 {
00038     class FrustumData
00039     {
00040     public:
00041         FrustumData();
00042 
00043         bool isValid() const { return (_width!=0.f && _height!=0.f); }
00044         void invalidate()    { _width = 0.f; _height = 0.f; }
00045 
00049         void applyProjection( const eq::Projection& projection );
00050 
00052         void applyWall( const eq::Wall& wall );
00054 
00058         const Matrix4f& getTransform() const { return _xfm; }
00059 
00061         float getWidth() const { return _width; }
00062 
00064         float getHeight() const { return _height; }
00065 
00067         eq::Wall::Type getType() const { return _type; }
00069 
00070     private:
00071         float _width;
00072         float _height;
00073         Matrix4f _xfm;
00074         eq::Wall::Type _type;
00075     };
00076 
00077     std::ostream& operator << ( std::ostream& os, const FrustumData& ); 
00078 }
00079 }
00080 #endif // EQ_FRUSTUMDATA_H
Generated on Mon Aug 10 18:58:33 2009 for Equalizer 0.9 by  doxygen 1.5.8