Equalizer  1.2.1
wall.h
00001 
00002 /* Copyright (c) 2006-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_WALL_H
00019 #define EQFABRIC_WALL_H
00020 
00021 #include <eq/fabric/api.h>
00022 #include <eq/fabric/types.h>
00023 #include <iostream>
00024 
00025 namespace eq
00026 {
00027 namespace fabric
00028 {
00029     class Projection;
00030 
00037     class Wall
00038     {
00039     public:
00041         EQFABRIC_API Wall();
00042 
00044         EQFABRIC_API Wall( const Vector3f& bottomLeft, 
00045                            const Vector3f& bottomRight,
00046                            const Vector3f& topLeft );
00047 
00054         EQFABRIC_API void resizeHorizontal( const float ratio );
00055 
00062         EQFABRIC_API void resizeVertical( const float ratio );
00063         
00070         EQFABRIC_API void resizeLeft( const float ratio );
00071 
00078         EQFABRIC_API void resizeRight( const float ratio );
00079 
00086         EQFABRIC_API void resizeTop( const float ratio );
00087 
00094         EQFABRIC_API void resizeBottom( const float ratio );
00095 
00102         EQFABRIC_API void resizeHorizontalToAR( const float aspectRatio );
00103 
00114         EQFABRIC_API void moveFocus( const Vector3f& eye, const float ratio );
00115 
00120         EQFABRIC_API void apply( const Viewport& viewport);
00121 
00126         EQFABRIC_API Wall& operator = ( const Projection& projection );
00127 
00129         float getWidth() const { return (bottomRight - bottomLeft).length(); }
00130 
00132         float getHeight() const { return (topLeft - bottomLeft).length(); }
00133 
00135         EQFABRIC_API bool operator == ( const Wall& rhs ) const;
00136 
00138         EQFABRIC_API bool operator != ( const Wall& rhs ) const;
00139 
00141         Vector3f getU() const { return bottomRight - bottomLeft; }
00142 
00144         Vector3f getV() const { return topLeft - bottomLeft; }
00145 
00147         Vector3f getW() const { return getU().cross( getV( )); }
00148 
00149         Vector3f bottomLeft;  
00150         Vector3f bottomRight; 
00151         Vector3f topLeft;     
00152         
00154         enum Type
00155         {
00156             TYPE_FIXED, 
00157             TYPE_HMD    
00158         };
00159         Type type; 
00160     };
00161 
00162     EQFABRIC_API std::ostream& operator << ( std::ostream&, const Wall& );
00163     EQFABRIC_API std::ostream& operator << ( std::ostream&, const Wall::Type& );
00164 }
00165 }
00166 #endif // EQFABRIC_WALL_H
00167 
Generated on Fri Jun 8 2012 15:44:33 for Equalizer 1.2.1 by  doxygen 1.8.0