Equalizer  2.1.0
Parallel Rendering Framework
wall.h
1 
2 /* Copyright (c) 2006-2017, Stefan Eilemann <eile@equalizergraphics.com>
3  * Daniel Nachbaur <danielnachbaur@gmail.com>
4  *
5  * This library is free software; you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License version 2.1 as published
7  * by the Free Software Foundation.
8  *
9  * This library is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12  * details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this library; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef EQFABRIC_WALL_H
20 #define EQFABRIC_WALL_H
21 
22 #include <eq/fabric/api.h>
23 #include <eq/fabric/types.h>
24 #include <eq/fabric/vmmlib.h>
25 #include <iostream>
26 
27 namespace eq
28 {
29 namespace fabric
30 {
37 class Wall
38 {
39 public:
41  EQFABRIC_API Wall();
42 
44  EQFABRIC_API Wall(const Vector3f& bottomLeft, const Vector3f& bottomRight,
45  const Vector3f& topLeft);
46 
53  EQFABRIC_API void resizeHorizontal(const float ratio);
54 
61  EQFABRIC_API void resizeVertical(const float ratio);
62 
69  EQFABRIC_API void resizeLeft(const float ratio);
70 
77  EQFABRIC_API void resizeRight(const float ratio);
78 
85  EQFABRIC_API void resizeTop(const float ratio);
86 
93  EQFABRIC_API void resizeBottom(const float ratio);
94 
101  EQFABRIC_API void resizeHorizontalToAR(const float aspectRatio);
102 
113  EQFABRIC_API void moveFocus(const Vector3f& eye, const float ratio);
114 
119  EQFABRIC_API void apply(const Viewport& viewport);
120 
125  EQFABRIC_API void scale(const float ratio);
126 
131  EQFABRIC_API Wall& operator=(const Projection& projection);
132 
137  EQFABRIC_API Wall& operator=(const Matrix4f& xfm);
138 
140  float getWidth() const { return (bottomRight - bottomLeft).length(); }
142  float getHeight() const { return (topLeft - bottomLeft).length(); }
144  EQFABRIC_API bool operator==(const Wall& rhs) const;
145 
147  EQFABRIC_API bool operator!=(const Wall& rhs) const;
148 
150  Vector3f getU() const { return bottomRight - bottomLeft; }
152  Vector3f getV() const { return topLeft - bottomLeft; }
154  Vector3f getW() const { return vmml::cross(getU(), getV()); }
155  Vector3f bottomLeft;
156  Vector3f bottomRight;
157  Vector3f topLeft;
158 
160  enum Type
161  {
164  };
166 };
167 
168 EQFABRIC_API std::ostream& operator<<(std::ostream&, const Wall&);
169 EQFABRIC_API std::ostream& operator<<(std::ostream&, const Wall::Type&);
170 }
171 }
172 
173 #endif // EQFABRIC_WALL_H
Vector3f bottomRight
The bottom-right corner.
Definition: wall.h:156
EQFABRIC_API void resizeRight(const float ratio)
Resize the wall on the right side.
EQFABRIC_API bool operator!=(const Wall &rhs) const
EQFABRIC_API Wall & operator=(const Projection &projection)
Set the wall parameters from a projection description.
Defines export visibility macros for library EqualizerFabric.
A fractional viewport with methods for manipulation.
Definition: viewport.h:34
EQFABRIC_API void resizeVertical(const float ratio)
Resize the wall vertically.
float getHeight() const
Definition: wall.h:142
float getWidth() const
Definition: wall.h:140
A wall defining a view frustum.
Definition: wall.h:37
Vector3f getV() const
Definition: wall.h:152
A wall fixed to the observer (head-mounted display)
Definition: wall.h:163
EQFABRIC_API void resizeBottom(const float ratio)
Resize the wall on the bottom side.
Vector3f bottomLeft
The bottom-left corner.
Definition: wall.h:155
EQFABRIC_API void resizeHorizontalToAR(const float aspectRatio)
Resize the wall horizontally to match the given aspect ratio.
EQFABRIC_API void resizeHorizontal(const float ratio)
Resize the wall horizontally.
A projector definition defining a view frustum.
Definition: projection.h:38
EQFABRIC_API bool operator==(const Wall &rhs) const
A fixed mounted projection wall.
Definition: wall.h:162
EQFABRIC_API void resizeTop(const float ratio)
Resize the wall on the top side.
Vector3f topLeft
The top-left corner.
Definition: wall.h:157
The Equalizer client library.
Definition: eq/agl/types.h:23
EQFABRIC_API void scale(const float ratio)
Move each wall corner by the given ratio.
std::ostream & operator<<(std::ostream &os, const AxisEvent &event)
Print the axis event to the given output stream.
Definition: axisEvent.h:49
EQFABRIC_API void resizeLeft(const float ratio)
Resize the wall on the left side.
Type
The reference system type of the wall.
Definition: wall.h:160
EQFABRIC_API void moveFocus(const Vector3f &eye, const float ratio)
Resize the wall by the given ratio as observed from the eye position.
Type type
The wall type.
Definition: wall.h:165
EQFABRIC_API Wall()
Construct a new wall description.
Vector3f getU() const
Definition: wall.h:150
Vector3f getW() const
Definition: wall.h:154
EQFABRIC_API void apply(const Viewport &viewport)
Compute the sub-frustum for a 2D area on the full wall.