Equalizer  1.8.0
Parallel Rendering Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
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 {
38  class Projection
39  {
40  public:
41  EQFABRIC_API Projection();
42 
49  EQFABRIC_API void resizeHorizontal( const float ratio );
50 
57  EQFABRIC_API void resizeVertical( const float ratio );
58 
63  EQFABRIC_API Projection& operator = ( const Wall& wall );
64 
69  EQFABRIC_API bool operator == ( const Projection& rhs ) const;
70 
75  EQFABRIC_API bool operator != ( const Projection& rhs ) const;
76 
77  Vector3f origin;
78  float distance;
79  Vector2f fov;
80  Vector3f hpr;
81  };
82 
83  EQFABRIC_API std::ostream& operator << ( std::ostream& os, const Projection& );
84 }
85 }
86 namespace lunchbox
87 {
88 template<> inline void byteswap( eq::fabric::Projection& value )
89 {
90  byteswap( value.origin );
91  byteswap( value.distance );
92  byteswap( value.fov );
93  byteswap( value.hpr );
94 }
95 }
96 #endif // EQFABRIC_PROJECTION_H
97 
EQFABRIC_API bool operator==(const Projection &rhs) const
EQFABRIC_API void resizeHorizontal(const float ratio)
Resize the horizontal FOV.
A wall defining a view frustum.
Definition: wall.h:36
A projector definition defining a view frustum.
Definition: projection.h:38
Vector2f fov
The x and y opening angle of the projection.
Definition: projection.h:79
float distance
The distance of the projection surface.
Definition: projection.h:78
EQFABRIC_API Projection & operator=(const Wall &wall)
Convert the projection parameters from a wall description.
EQFABRIC_API void resizeVertical(const float ratio)
Resize the vertical FOV.
EQFABRIC_API bool operator!=(const Projection &rhs) const
Vector3f hpr
The orientation (head, pitch, roll)
Definition: projection.h:80
Vector3f origin
The position of the projection.
Definition: projection.h:77