Hugintrunk
0.1
|
Allow the user to change the cropping region by dragging it in the fast preview. More...
#include <PreviewCropTool.h>
Public Member Functions | |
PreviewCropTool (PreviewToolHelper *helper) | |
void | Activate () |
Switch on a tool. More... | |
void | ReallyAfterDrawImagesEvent () |
Draw (using OpenGL) the overlays, e.g. crop highlights, guides. 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... | |
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 | MouseWheelEvent (wxMouseEvent &e) |
Notify of a mouse wheel event on the panorama preview. More... | |
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 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 | moving_left |
bool | moving_right |
bool | moving_top |
bool | moving_bottom |
bool | mouse_down |
double | top |
double | bottom |
double | left |
double | right |
double | start_drag_x |
double | start_drag_y |
HuginBase::PanoramaOptions | start_drag_options |
HuginBase::PanoramaOptions | opts |
vigra::Rect2D | new_roi |
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... | |
Allow the user to change the cropping region by dragging it in the fast preview.
Definition at line 31 of file PreviewCropTool.h.
|
explicit |
Definition at line 41 of file PreviewCropTool.cpp.
|
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 47 of file PreviewCropTool.cpp.
References Tool::helper, mouse_down, ToolHelper::MOUSE_MOVE, ToolHelper::MOUSE_PRESS, moving_bottom, moving_left, moving_right, moving_top, ToolHelper::NotifyMe(), ToolHelper::REALLY_DRAW_OVER_IMAGES, and ToolHelper::SetStatusMessage().
|
virtual |
Notify of a mouse button press on the panorama preview.
e | The event created by wxWidgets. |
Reimplemented from Tool.
Definition at line 284 of file PreviewCropTool.cpp.
References PanoCommand::CommandHistory::addCommand(), bottom, PanoCommand::GlobalCmdHist::getInstance(), ViewState::GetOptions(), ToolHelper::GetPanoramaPtr(), GLPreviewFrame::getPreview(), ToolHelper::GetPreviewFrame(), HuginBase::PanoramaOptions::getROI(), VisualizationState::getViewState(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, left, mouse_down, moving_bottom, moving_left, moving_right, moving_top, new_roi, opts, right, start_drag_options, start_drag_x, start_drag_y, and top.
|
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 119 of file PreviewCropTool.cpp.
References bottom, VisualizationState::ForceRequireRedraw(), HuginBase::PanoramaOptions::getROI(), VisualizationState::getViewState(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, left, mouse_down, moving_bottom, moving_left, moving_right, moving_top, new_roi, opts, VisualizationState::Redraw(), right, ViewState::SetOptions(), HuginBase::PanoramaOptions::setROI(), start_drag_options, start_drag_x, start_drag_y, and top.
|
virtual |
Draw (using OpenGL) the overlays, e.g. crop highlights, guides.
Reimplemented from Tool.
Definition at line 60 of file PreviewCropTool.cpp.
References bottom, TextureManager::DisableTexture(), ViewState::GetOptions(), HuginBase::PanoramaOptions::getROI(), ViewState::GetTextureManager(), VisualizationState::getViewState(), ToolHelper::GetViewStatePtr(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, left, mouse_down, moving_bottom, moving_left, moving_right, moving_top, new_roi, opts, right, ViewState::SetOptions(), HuginBase::PanoramaOptions::setROI(), and top.
|
private |
Definition at line 41 of file PreviewCropTool.h.
Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
Definition at line 41 of file PreviewCropTool.h.
Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
Definition at line 40 of file PreviewCropTool.h.
Referenced by Activate(), MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
Definition at line 40 of file PreviewCropTool.h.
Referenced by Activate(), MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
Definition at line 40 of file PreviewCropTool.h.
Referenced by Activate(), MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
Definition at line 40 of file PreviewCropTool.h.
Referenced by Activate(), MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
Definition at line 40 of file PreviewCropTool.h.
Referenced by Activate(), MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
Definition at line 45 of file PreviewCropTool.h.
Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
Definition at line 43 of file PreviewCropTool.h.
Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
Definition at line 41 of file PreviewCropTool.h.
Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
Definition at line 43 of file PreviewCropTool.h.
Referenced by MouseButtonEvent(), and MouseMoveEvent().
|
private |
Definition at line 42 of file PreviewCropTool.h.
Referenced by MouseButtonEvent(), and MouseMoveEvent().
|
private |
Definition at line 42 of file PreviewCropTool.h.
Referenced by MouseButtonEvent(), and MouseMoveEvent().
|
private |
Definition at line 41 of file PreviewCropTool.h.
Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().