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

Camera::Camera (  ) 

Constructs a new camera object

Camera::~Camera (  ) 

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:
event the wheel event

void Camera::reset (  ) 

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

float Camera::height [private]

Height of the camera

bool Camera::leftButtonPressed [private]

Determines if the left mouse button is pressed or not

LoggerPtr Camera::logger [static, private]

float Camera::oldTranslationX [private]

Old Camera translation in x direction

float Camera::oldTranslationY [private]

Old Camera translation in y direction

float Camera::oldZoom [private]

Old Zoom factor of the camera

float Camera::pressXRatio [private]

Ratio of screen in X-Direction

float Camera::pressYRatio [private]

Ratio of screen in Y-Direction

Determines if the right mouse button is pressed or not

float Camera::translationX [private]

Camera translation in x direction

float Camera::translationY [private]

Camera translation in y direction

float Camera::width [private]

Width of the camera

float Camera::zoom [private]

Zoom factor of the camera


The documentation for this class was generated from the following files:

Generated on Tue Jun 2 19:53:44 2009 for Hierarchical Edge Bundles by  doxygen 1.5.7.1