Equalizer  1.6.1
projection.h
1 
2 /* Copyright (c) 2006-2010, Stefan Eilemann <eile@equalizergraphics.com>
3  *
4  * This library is free software; you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License version 2.1 as published
6  * by the Free Software Foundation.
7  *
8  * This library is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11  * details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this library; if not, write to the Free Software Foundation, Inc.,
15  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16  */
17 
18 #ifndef EQFABRIC_PROJECTION_H
19 #define EQFABRIC_PROJECTION_H
20 
21 #include <eq/fabric/types.h>
22 #include <eq/fabric/api.h>
23 
24 #include <iostream>
25 
26 namespace eq
27 {
28 namespace fabric
29 {
30  class Wall;
31 
40  class Projection
41  {
42  public:
43  EQFABRIC_API Projection();
44 
51  EQFABRIC_API void resizeHorizontal( const float ratio );
52 
59  EQFABRIC_API void resizeVertical( const float ratio );
60 
65  EQFABRIC_API Projection& operator = ( const Wall& wall );
66 
71  EQFABRIC_API bool operator == ( const Projection& rhs ) const;
72 
77  EQFABRIC_API bool operator != ( const Projection& rhs ) const;
78 
80  float distance;
83  };
84 
85  EQFABRIC_API std::ostream& operator << ( std::ostream& os, const Projection& );
86 }
87 }
88 namespace lunchbox
89 {
90 template<> inline void byteswap( eq::fabric::Projection& value )
91 {
92  byteswap( value.origin );
93  byteswap( value.distance );
94  byteswap( value.fov );
95  byteswap( value.hpr );
96 }
97 }
98 #endif // EQFABRIC_PROJECTION_H
99 
Vector3f origin
The position of the projection.
Definition: projection.h:79
float distance
The distance of the projection surface.
Definition: projection.h:80
bool operator==(const Projection &rhs) const
vmml::vector< 2, float > Vector2f
A two-component float vector.
Definition: vmmlib.h:45
Vector3f hpr
The orientation (head, pitch, roll)
Definition: projection.h:82
vmml::vector< 3, float > Vector3f
A three-component float vector.
Definition: vmmlib.h:46
A wall defining a view frustum.
Definition: wall.h:38
Projection & operator=(const Wall &wall)
Convert the projection parameters from a wall description.
Vector2f fov
The x and y opening angle of the projection.
Definition: projection.h:81
A projector definition defining a view frustum.
Definition: projection.h:40
void resizeVertical(const float ratio)
Resize the vertical FOV.
bool operator!=(const Projection &rhs) const
void resizeHorizontal(const float ratio)
Resize the horizontal FOV.