Camera Class Reference
#include <Camera.h>
List of all members.
|
Public Member Functions |
| | Camera () |
| | ~Camera () |
| void | apply (float aspectRatio) |
| void | processWheelEvent (QWheelEvent *event) |
| void | processMouseEvent (Qt::MouseButton button, bool pressed, int screenX, int screenY, int vX, int vY, int vWidth, int vHeight) |
| void | processMotionEvent (int screenX, int screenY, int vX, int vY, int vWidth, int vHeight) |
| void | reset () |
| float | getTranslationX () |
| float | getTranslationY () |
| float | getZoom () |
| void | setTranslationX (float value) |
| void | setTranslationY (float value) |
| void | setZoom (float value) |
| void | setCameraToBoundaries (const float *boundaries) |
Private Attributes |
| float | translationX |
| float | translationY |
| float | oldTranslationX |
| float | oldTranslationY |
| float | zoom |
| float | oldZoom |
| bool | rightButtonPressed |
| bool | leftButtonPressed |
| float | width |
| float | height |
| float | pressXRatio |
| float | pressYRatio |
Static Private Attributes |
| static log4cxx::LoggerPtr | logger |
Detailed Description
Orthogonal camera for the xy-plane
Constructor & Destructor Documentation
Constructs a new camera object
Destroys the camera object
Member Function Documentation
| void Camera::apply |
( |
float |
aspectRatio |
) |
|
Applies the camera transformation and sets the projection aspectRatio Current aspect ratio of the window
| float Camera::getTranslationX |
( |
|
) |
|
Returns the camera translation in x direction
- Returns:
- camera translation in x direction
| float Camera::getTranslationY |
( |
|
) |
|
Returns the camera translation in y direction
- Returns:
- camera translation in y direction
| float Camera::getZoom |
( |
|
) |
|
Returns the zoom of the camera
- Returns:
- zoom of the camera
| void Camera::processMotionEvent |
( |
int |
screenX, |
|
|
int |
screenY, |
|
|
int |
vX, |
|
|
int |
vY, |
|
|
int |
vWidth, |
|
|
int |
vHeight | |
|
) |
| | |
Process the motion event
- Parameters:
-
| screenX | X-Coordinate of the mouse on the screen |
| screenY | Y-Coordinate of the mouse on the screen |
| vX | X-Coordinate of the top-left corner of the viewport |
| vY | Y-Coordinate of the top-left corner of the viewport |
| vWidth | Width of the viewport |
| vHeight | Height of the viewport |
| void Camera::processMouseEvent |
( |
Qt::MouseButton |
button, |
|
|
bool |
pressed, |
|
|
int |
screenX, |
|
|
int |
screenY, |
|
|
int |
vX, |
|
|
int |
vY, |
|
|
int |
vWidth, |
|
|
int |
vHeight | |
|
) |
| | |
Process the mouse event
- Parameters:
-
| button | Button which is pressed or released |
| pressed | Boolean value indicating whether the button is pressed or not |
| screenX | X-Coordinate of the mouse on the screen |
| screenY | Y-Coordinate of the mouse on the screen |
| vX | X-Coordinate of the top-left corner of the viewport |
| vY | Y-Coordinate of the top-left corner of the viewport |
| vWidth | Width of the viewport |
| vHeight | Height of the viewport |
| void Camera::processWheelEvent |
( |
QWheelEvent * |
event |
) |
|
Processes a wheel event from the mouse
- Parameters:
-
Resets the camera transformations
| void Camera::setCameraToBoundaries |
( |
const float * |
boundaries |
) |
|
Sets the zoom and the translation of the camera corresponding to the boundaries of the picture
- Parameters:
-
| boundaris | 4 element array with the boundaries of the picture following the order xMin, yMin, xMax, yMax |
| void Camera::setTranslationX |
( |
float |
value |
) |
|
Sets the translation in x direction of the camera value translation in x direction of the camera
| void Camera::setTranslationY |
( |
float |
value |
) |
|
Sets the translation in y direction of the camera value translation in y direction of the camera
| void Camera::setZoom |
( |
float |
value |
) |
|
Sets the zoom of the camera value zoom of the camera
Member Data Documentation
Determines if the left mouse button is pressed or not
Old Camera translation in x direction
Old Camera translation in y direction
Old Zoom factor of the camera
Ratio of screen in X-Direction
Ratio of screen in Y-Direction
Determines if the right mouse button is pressed or not
Camera translation in x direction
Camera translation in y direction
Zoom factor of the camera
The documentation for this class was generated from the following files:
- Hierarchical_Edge_Bundles/Hierarchical_Edge_Bundles/header/Camera.h
- Hierarchical_Edge_Bundles/Hierarchical_Edge_Bundles/src/Camera.cpp