Hugintrunk
0.1
|
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>
Public Member Functions | |
PanosphereOverviewCameraTool (PanosphereOverviewToolHelper *helper) | |
virtual | ~PanosphereOverviewCameraTool () |
void | Activate () |
Switch on a tool. More... | |
void | MouseMoveEvent (double x, double y, wxMouseEvent &e) |
Notify when the mouse pointer has moved over the panorama preview. More... | |
void | MouseButtonEvent (wxMouseEvent &e) |
Notify of a mouse button press on the panorama preview. More... | |
void | MouseWheelEvent (wxMouseEvent &) |
Notify of a mouse wheel event on the panorama preview. More... | |
void | ChangeZoomLevel (bool zoomIn, double scale=1.1) |
void | ChangeFOV (bool zoomIn) |
void | KeypressEvent (int keycode, int modifiers, bool pressed) |
Notify of a Keypress event. More... | |
Public Member Functions inherited from PanosphereOverviewTool | |
PanosphereOverviewTool (PanosphereOverviewToolHelper *helper) | |
virtual | ~PanosphereOverviewTool () |
virtual void | BeforeDrawImagesBackEvent () |
Draw using opengl anything before drawing the front face culled images. More... | |
virtual void | AfterDrawImagesBackEvent () |
Draw using opengl anything after drawing the front face culled images. More... | |
virtual void | BeforeDrawImagesFrontEvent () |
Draw using opengl anything before drawing the back face culled images. More... | |
virtual void | AfterDrawImagesFrontEvent () |
Draw using opengl anything after drawing the back face culled images. More... | |
Public Member Functions inherited from OverviewTool | |
OverviewTool (OverviewToolHelper *helper) | |
virtual | ~OverviewTool () |
Public Member Functions inherited from Tool | |
Tool (ToolHelper *helper) | |
Construct keeping a pointer to a PreviewToolHelper. More... | |
virtual | ~Tool () |
virtual void | ImagesUnderMouseChangedEvent () |
Notify when the images directly underneath the mouse pointer have changed. More... | |
virtual void | BeforeDrawImagesEvent () |
Draw using OpenGL anything the tool requires underneath the images. More... | |
virtual void | AfterDrawImagesEvent () |
Draw (using OpenGL) images above the others. More... | |
virtual void | ReallyAfterDrawImagesEvent () |
Draw (using OpenGL) the overlays, e.g. crop highlights, guides. More... | |
virtual bool | BeforeDrawImageEvent (unsigned int image) |
Draw what the tool requires just before a given image is drawn. More... | |
virtual void | AfterDrawImageEvent (unsigned int image) |
Notification called just after the image was drawn normally. More... | |
virtual void | MarkDirty () |
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 |
Additional Inherited Members | |
Protected Attributes inherited from Tool | |
ToolHelper * | helper |
The PreviewToolHelper that uses the same preview window and panorama as the tool should. More... | |
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.
|
inlineexplicit |
Definition at line 39 of file OverviewCameraTool.h.
|
inlinevirtual |
Definition at line 40 of file OverviewCameraTool.h.
|
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 32 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::ChangeFOV | ( | bool | zoomIn | ) |
Definition at line 138 of file OverviewCameraTool.cpp.
References VisualizationState::ForceRequireRedraw(), PanosphereOverviewVisualizationState::getFOV(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, VisualizationState::Redraw(), VisualizationState::SetDirtyViewport(), and PanosphereOverviewVisualizationState::setFOV().
Referenced by MouseWheelEvent().
void PanosphereOverviewCameraTool::ChangeZoomLevel | ( | bool | zoomIn, |
double | scale = 1.1 |
||
) |
Definition at line 118 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().
|
virtual |
Notify of a Keypress event.
Currently unused as the preview cannot get keyboard input focus.
Reimplemented from Tool.
Definition at line 171 of file OverviewCameraTool.cpp.
References ChangeZoomLevel().
|
virtual |
Notify of a mouse button press on the panorama preview.
e | The event created by wxWidgets. |
Reimplemented from Tool.
Definition at line 92 of file OverviewCameraTool.cpp.
References down, PanosphereOverviewVisualizationState::getAngX(), PanosphereOverviewVisualizationState::getAngY(), ToolHelper::GetMouseScreenPosition(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, PanosphereOverviewVisualizationState::isInsideView(), ToolHelper::IsMouseOverPano(), start_angx, start_angy, start_x, start_y, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.
|
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.
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 43 of file OverviewCameraTool.cpp.
References down, ToolHelper::GetMouseScreenPosition(), PanosphereOverviewVisualizationState::getR(), PanosphereOverviewVisualizationState::getSphereRadius(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, PanosphereOverviewVisualizationState::isInsideView(), 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.
|
virtual |
Notify of a mouse wheel event on the panorama preview.
e | The event created by wxWidgets. |
Reimplemented from Tool.
Definition at line 156 of file OverviewCameraTool.cpp.
References ChangeFOV(), ChangeZoomLevel(), ToolHelper::GetVisualizationStatePtr(), and Tool::helper.
|
private |
Definition at line 59 of file OverviewCameraTool.h.
Referenced by Activate(), MouseButtonEvent(), and MouseMoveEvent().
|
staticprivate |
Definition at line 57 of file OverviewCameraTool.h.
Referenced by ChangeZoomLevel().
|
staticprivate |
Definition at line 55 of file OverviewCameraTool.h.
Referenced by ChangeZoomLevel().
|
private |
Definition at line 63 of file OverviewCameraTool.h.
Referenced by MouseButtonEvent(), and MouseMoveEvent().
|
private |
Definition at line 63 of file OverviewCameraTool.h.
Referenced by MouseButtonEvent(), and MouseMoveEvent().
|
private |
Definition at line 61 of file OverviewCameraTool.h.
Referenced by MouseButtonEvent(), and MouseMoveEvent().
|
private |
Definition at line 61 of file OverviewCameraTool.h.
Referenced by MouseButtonEvent(), and MouseMoveEvent().