Line data Source code
1 :
2 : /* Copyright (c) 2006-2017, 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/api.h>
22 : #include <eq/fabric/types.h>
23 : #include <eq/fabric/vmmlib.h>
24 : #include <iostream>
25 :
26 : namespace eq
27 : {
28 : namespace fabric
29 : {
30 : /**
31 : * A projector definition defining a view frustum.
32 : *
33 : * The frustum is defined by a projection system positioned at origin,
34 : * orientated as defined by the head-pitch-roll angles projecting to a wall at
35 : * the given distance. The fov defines the horizontal and vertical field of view
36 : * of the projector.
37 : */
38 127 : class Projection
39 : {
40 : public:
41 : EQFABRIC_API Projection();
42 :
43 : /**
44 : * Resize the horizontal FOV.
45 : *
46 : * @param ratio the amount by which the FOV is grown or shrunk.
47 : * @version 1.0
48 : */
49 : EQFABRIC_API void resizeHorizontal(const float ratio);
50 :
51 : /**
52 : * Resize the vertical FOV.
53 : *
54 : * @param ratio the amount by which the FOV is grown or shrunk.
55 : * @version 1.0
56 : */
57 : EQFABRIC_API void resizeVertical(const float ratio);
58 :
59 : /**
60 : * Convert the projection parameters from a wall description.
61 : * @version 1.0
62 : */
63 : EQFABRIC_API Projection& operator=(const Wall& wall);
64 :
65 : /**
66 : * @return true if the two projection definitions are identical.
67 : * @version 1.0
68 : */
69 : EQFABRIC_API bool operator==(const Projection& rhs) const;
70 :
71 : /**
72 : * @return true if the two projection definitions are not identical.
73 : * @version 1.0
74 : */
75 : EQFABRIC_API bool operator!=(const Projection& rhs) const;
76 :
77 : Vector3f origin; //!< The position of the projection
78 : float distance; //!< The distance of the projection surface
79 : Vector2f fov; //!< The x and y opening angle of the projection
80 : Vector3f hpr; //!< The orientation (head, pitch, roll)
81 : };
82 :
83 : EQFABRIC_API std::ostream& operator<<(std::ostream& os, const Projection&);
84 : }
85 : }
86 :
87 : #endif // EQFABRIC_PROJECTION_H
|