Hugintrunk
0.1
|
tool for the manipulation of the opengl 'camera' properties It handles zooming in/out of the main preview window More...
#include <PreviewCameraTool.h>
Public Member Functions | |
PreviewCameraTool (PreviewToolHelper *helper) | |
virtual | ~PreviewCameraTool () |
void | Activate () |
Switch on a tool. More... | |
void | MouseWheelEvent (wxMouseEvent &) |
event for mouse wheel processing More... | |
void | MouseButtonEvent (wxMouseEvent &e) |
event for mouse button processing More... | |
void | MouseMoveEvent (double x, double y, wxMouseEvent &e) |
event for mouse move More... | |
Public Member Functions inherited from PreviewTool | |
PreviewTool (PreviewToolHelper *helper) | |
virtual | ~PreviewTool () |
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 | KeypressEvent (int keycode, int modifiers, bool pressed) |
Notify of a Keypress event. 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 Member Functions | |
void | ChangeZoomLevel (bool zoomIn, const hugin_utils::FDiff2D &scrollPos) |
update zoom level More... | |
void | UpdateCenter (const hugin_utils::FDiff2D &moveDist) |
update center, used for panning More... | |
Private Attributes | |
bool | m_moving |
flag to indicate that we are moving the view with middle mouse button More... | |
hugin_utils::FDiff2D | m_lastScreenPos |
last screen position during moving , needed for real-time update More... | |
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 zooming in/out of the main preview window
Definition at line 34 of file PreviewCameraTool.h.
|
inlineexplicit |
Definition at line 37 of file PreviewCameraTool.h.
|
inlinevirtual |
Definition at line 38 of file PreviewCameraTool.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 29 of file PreviewCameraTool.cpp.
References Tool::helper, m_moving, ToolHelper::MOUSE_MOVE, ToolHelper::MOUSE_PRESS, ToolHelper::MOUSE_WHEEL, and ToolHelper::NotifyMe().
|
private |
update zoom level
Definition at line 37 of file PreviewCameraTool.cpp.
References VisualizationState::ForceRequireRedraw(), HuginBase::PanoramaOptions::getHeight(), VisualizationState::GetOptions(), ToolHelper::GetVisualizationStatePtr(), HuginBase::PanoramaOptions::getWidth(), VisualizationState::GetZoomLevel(), Tool::helper, VisualizationState::Redraw(), VisualizationState::SetViewingCenter(), VisualizationState::SetZoomLevel(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.
Referenced by MouseWheelEvent().
|
virtual |
event for mouse button processing
Reimplemented from Tool.
Definition at line 80 of file PreviewCameraTool.cpp.
References ToolHelper::GetMouseScreenPosition(), Tool::helper, ToolHelper::IsMouseOverPano(), m_lastScreenPos, m_moving, and UpdateCenter().
|
virtual |
event for mouse move
Reimplemented from Tool.
Definition at line 106 of file PreviewCameraTool.cpp.
References ToolHelper::GetMouseScreenPosition(), Tool::helper, ToolHelper::IsMouseOverPano(), m_lastScreenPos, m_moving, hugin_utils::TDiff2D< T >::squareLength(), and UpdateCenter().
|
virtual |
event for mouse wheel processing
Reimplemented from Tool.
Definition at line 59 of file PreviewCameraTool.cpp.
References ChangeZoomLevel(), ToolHelper::GetMousePanoPosition(), Tool::helper, and ToolHelper::IsMouseOverPano().
|
private |
update center, used for panning
Definition at line 67 of file PreviewCameraTool.cpp.
References VisualizationState::ForceRequireRedraw(), HuginBase::PanoramaOptions::getHeight(), VisualizationState::GetOptions(), VisualizationState::GetScale(), VisualizationState::GetViewingCenter(), ToolHelper::GetVisualizationStatePtr(), HuginBase::PanoramaOptions::getWidth(), Tool::helper, VisualizationState::Redraw(), VisualizationState::SetDirtyViewport(), VisualizationState::SetViewingCenter(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.
Referenced by MouseButtonEvent(), and MouseMoveEvent().
|
private |
last screen position during moving , needed for real-time update
Definition at line 56 of file PreviewCameraTool.h.
Referenced by MouseButtonEvent(), and MouseMoveEvent().
|
private |
flag to indicate that we are moving the view with middle mouse button
Definition at line 54 of file PreviewCameraTool.h.
Referenced by Activate(), MouseButtonEvent(), and MouseMoveEvent().