PanosphereOverviewCameraTool Class Reference

tool for the manipulation of the opengl 'camera' properties It handles rotation of the camera position around the panosphere and zooming in/out (i.e. More...

#include <OverviewCameraTool.h>

Inheritance diagram for PanosphereOverviewCameraTool:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PanosphereOverviewCameraTool (PanosphereOverviewToolHelper *helper)
virtual ~PanosphereOverviewCameraTool ()
void Activate ()
 Switch on a tool.
void MouseMoveEvent (double x, double y, wxMouseEvent &e)
 Notify when the mouse pointer has moved over the panorama preview.
void MouseButtonEvent (wxMouseEvent &e)
 Notify of a mouse button press on the panorama preview.
void MouseWheelEvent (wxMouseEvent &)
 Notify of a mouse wheel event on the panorama preview.
void ChangeZoomLevel (bool zoomIn, double scale=1.1)
void KeypressEvent (int keycode, int modifiers, bool pressed)
 Notify of a Keypress event.

Private Attributes

bool down
double start_x
double start_y
double start_angx
double start_angy

Static Private Attributes

static const double limit_low = 1.2
static const double limit_high = 5.0

Detailed Description

tool for the manipulation of the opengl 'camera' properties It handles rotation of the camera position around the panosphere and zooming in/out (i.e.

moving the camera closer or further away from the panosphere) TODO add manipulation of the FOV of the camera, i.e. the perspective

Definition at line 36 of file OverviewCameraTool.h.


Constructor & Destructor Documentation

PanosphereOverviewCameraTool::PanosphereOverviewCameraTool ( PanosphereOverviewToolHelper helper  )  [inline]

Definition at line 39 of file OverviewCameraTool.h.

virtual PanosphereOverviewCameraTool::~PanosphereOverviewCameraTool (  )  [inline, virtual]

Definition at line 40 of file OverviewCameraTool.h.


Member Function Documentation

void PanosphereOverviewCameraTool::Activate (  )  [virtual]

Switch on a tool.

Inherited classes also register events they want to respond to with the PreviewToolHelper. As events are lost when the tool is deactivated without notification to the PreviewTool, things from the last activation can be cleaned up here too.

Implements Tool.

Definition at line 30 of file OverviewCameraTool.cpp.

References down, Tool::helper, ToolHelper::KEY_PRESS, ToolHelper::MOUSE_MOVE, ToolHelper::MOUSE_PRESS, ToolHelper::MOUSE_WHEEL, and ToolHelper::NotifyMe().

void PanosphereOverviewCameraTool::ChangeZoomLevel ( bool  zoomIn,
double  scale = 1.1 
)

Definition at line 79 of file OverviewCameraTool.cpp.

References VisualizationState::ForceRequireRedraw(), PanosphereOverviewVisualizationState::getR(), PanosphereOverviewVisualizationState::getSphereRadius(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, limit_high, limit_low, VisualizationState::Redraw(), VisualizationState::SetDirtyViewport(), and PanosphereOverviewVisualizationState::setR().

Referenced by KeypressEvent(), and MouseWheelEvent().

void PanosphereOverviewCameraTool::KeypressEvent ( int  keycode,
int  modifiers,
bool  pressed 
) [virtual]

Notify of a Keypress event.

Currently unused as the preview cannot get keyboard input focus.

Reimplemented from Tool.

Definition at line 106 of file OverviewCameraTool.cpp.

References ChangeZoomLevel().

void PanosphereOverviewCameraTool::MouseButtonEvent ( wxMouseEvent &  e  )  [virtual]

Notify of a mouse button press on the panorama preview.

Parameters:
e The event created by wxWidgets.

Reimplemented from Tool.

Definition at line 59 of file OverviewCameraTool.cpp.

References down, PanosphereOverviewVisualizationState::getAngX(), PanosphereOverviewVisualizationState::getAngY(), ToolHelper::GetMouseScreenPosition(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, ToolHelper::IsMouseOverPano(), start_angx, start_angy, start_x, start_y, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

void PanosphereOverviewCameraTool::MouseMoveEvent ( double  x,
double  y,
wxMouseEvent &  e 
) [virtual]

Notify when the mouse pointer has moved over the panorama preview.

The coordinates are in the space of the panorama output at full size, with no output cropping.

Parameters:
x The horizontal position of the mouse pointer in panorama pixels.
y The vertical position of the mouse pointer in panorama pixels.
e The event created by wxWidgets.

Reimplemented from Tool.

Definition at line 41 of file OverviewCameraTool.cpp.

References down, PanosphereOverviewVisualizationState::getAngX(), PanosphereOverviewVisualizationState::getAngY(), ToolHelper::GetMouseScreenPosition(), PanosphereOverviewVisualizationState::getR(), PanosphereOverviewVisualizationState::getSphereRadius(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, M_PI, VisualizationState::Redraw(), PanosphereOverviewVisualizationState::setAngX(), PanosphereOverviewVisualizationState::setAngY(), start_angx, start_angy, start_x, start_y, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

void PanosphereOverviewCameraTool::MouseWheelEvent ( wxMouseEvent &  e  )  [virtual]

Notify of a mouse wheel event on the panorama preview.

Parameters:
e The event created by wxWidgets.

Reimplemented from Tool.

Definition at line 99 of file OverviewCameraTool.cpp.

References ChangeZoomLevel().


Member Data Documentation

bool PanosphereOverviewCameraTool::down [private]

Definition at line 58 of file OverviewCameraTool.h.

Referenced by Activate(), MouseButtonEvent(), and MouseMoveEvent().

const double PanosphereOverviewCameraTool::limit_high = 5.0 [static, private]

Definition at line 56 of file OverviewCameraTool.h.

Referenced by ChangeZoomLevel().

const double PanosphereOverviewCameraTool::limit_low = 1.2 [static, private]

Definition at line 54 of file OverviewCameraTool.h.

Referenced by ChangeZoomLevel().

double PanosphereOverviewCameraTool::start_angx [private]

Definition at line 62 of file OverviewCameraTool.h.

Referenced by MouseButtonEvent(), and MouseMoveEvent().

double PanosphereOverviewCameraTool::start_angy [private]

Definition at line 62 of file OverviewCameraTool.h.

Referenced by MouseButtonEvent(), and MouseMoveEvent().

double PanosphereOverviewCameraTool::start_x [private]

Definition at line 60 of file OverviewCameraTool.h.

Referenced by MouseButtonEvent(), and MouseMoveEvent().

double PanosphereOverviewCameraTool::start_y [private]

Definition at line 60 of file OverviewCameraTool.h.

Referenced by MouseButtonEvent(), and MouseMoveEvent().


The documentation for this class was generated from the following files:
Generated on 23 Nov 2014 for Hugintrunk by  doxygen 1.4.7