Equalizer
1.4.1
|
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 void scale( const float ratio ); 00127 00132 EQFABRIC_API Wall& operator = ( const Projection& projection ); 00133 00135 float getWidth() const { return (bottomRight - bottomLeft).length(); } 00136 00138 float getHeight() const { return (topLeft - bottomLeft).length(); } 00139 00141 EQFABRIC_API bool operator == ( const Wall& rhs ) const; 00142 00144 EQFABRIC_API bool operator != ( const Wall& rhs ) const; 00145 00147 Vector3f getU() const { return bottomRight - bottomLeft; } 00148 00150 Vector3f getV() const { return topLeft - bottomLeft; } 00151 00153 Vector3f getW() const { return getU().cross( getV( )); } 00154 00155 Vector3f bottomLeft; 00156 Vector3f bottomRight; 00157 Vector3f topLeft; 00158 00160 enum Type 00161 { 00162 TYPE_FIXED, 00163 TYPE_HMD 00164 }; 00165 Type type; 00166 }; 00167 00168 EQFABRIC_API std::ostream& operator << ( std::ostream&, const Wall& ); 00169 EQFABRIC_API std::ostream& operator << ( std::ostream&, const Wall::Type& ); 00170 } 00171 } 00172 #endif // EQFABRIC_WALL_H 00173