Hugintrunk
0.1
|
Allows the user to change the yaw, pitch and roll of a connected component of images by dragging them in the fast preview. More...
#include <DragTool.h>
Classes | |
class | ParamStore |
Public Types | |
enum | DragMode { drag_mode_normal, drag_mode_mosaic } |
Public Member Functions | |
DragTool (ToolHelper *helper) | |
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... | |
virtual void | ReallyAfterDrawImagesEvent ()=0 |
Draw (using OpenGL) the overlays, e.g. crop highlights, guides. More... | |
void | setDragMode (DragMode drag_mode) |
DragMode | getDragMode () |
void | getTranslationShift (double &delta_x, double &delta_y) |
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 () |
Protected Member Functions | |
void | SetRotationMatrix (double yaw_shift, double pitch_shift, double roll_shift, double yaw_start, double pitch_start, double roll_start) |
Protected Attributes | |
std::map< unsigned int, ParamStore > | image_params |
std::set< unsigned int > | draging_images |
bool | drag_yaw |
bool | drag_pitch |
bool | drag_roll |
double | start_angle |
double | shift_angle |
hugin_utils::FDiff2D | centre |
hugin_utils::FDiff2D | start_coordinates |
hugin_utils::FDiff2D | shift_coordinates |
bool | shift |
bool | control |
Matrix3 | rotation_matrix |
DragMode | drag_mode |
bool | custom_drag |
Protected Attributes inherited from Tool | |
ToolHelper * | helper |
The PreviewToolHelper that uses the same preview window and panorama as the tool should. More... | |
Allows the user to change the yaw, pitch and roll of a connected component of images by dragging them in the fast preview.
If there are multiple components under the pointer when the user begins to drag, the lowest number one is chosen, since it is drawn on top.
Modifiers | Variables changed |
none | yaw and pitch |
shift | yaw or pitch, depending on biggest difference. |
control | roll |
You can also change only roll by using the secondary mouse button (if there is one).
Reasoning: control click on mac is equivalent right click on other platforms, no modifiers should be close to old behaviour (where no modifiers were used), alt moves windows on some window managers, leaving shift as the only common modifier suitable for constrained drag.
Definition at line 50 of file DragTool.h.
enum DragTool::DragMode |
Enumerator | |
---|---|
drag_mode_normal | |
drag_mode_mosaic |
Definition at line 71 of file DragTool.h.
|
explicit |
Definition at line 42 of file DragTool.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 69 of file DragTool.cpp.
References control, drag_pitch, drag_roll, drag_yaw, Tool::helper, ToolHelper::MOUSE_MOVE, ToolHelper::MOUSE_PRESS, ToolHelper::NotifyMe(), ToolHelper::REALLY_DRAW_OVER_IMAGES, ToolHelper::SetStatusMessage(), and shift.
DragTool::DragMode DragTool::getDragMode | ( | ) |
Definition at line 52 of file DragTool.cpp.
References drag_mode.
Referenced by GLPreviewFrame::panoramaImagesChanged().
void DragTool::getTranslationShift | ( | double & | delta_x, |
double & | delta_y | ||
) |
Definition at line 58 of file DragTool.cpp.
References DEG_TO_RAD, shift_coordinates, start_coordinates, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.
Referenced by MouseMoveEvent().
|
virtual |
Notify of a mouse button press on the panorama preview.
e | The event created by wxWidgets. |
Reimplemented from Tool.
Definition at line 161 of file DragTool.cpp.
References PanoCommand::CommandHistory::addCommand(), GLPreviewFrame::AddImageToDragGroup(), OutputProjectionInfo::AngularToImage(), centre, control, drag_pitch, drag_roll, drag_yaw, draging_images, fill_set(), HuginGraph::ImageGraph::GetComponents(), GLPreviewFrame::GetDragGroupImages(), ToolHelper::GetImageNumbersUnderMouse(), PanoCommand::GlobalCmdHist::getInstance(), ToolHelper::GetMousePanoPosition(), HuginBase::Panorama::getNrOfImages(), ToolHelper::GetPanoramaPtr(), ToolHelper::GetPreviewFrame(), ViewState::GetProjectionInfo(), VisualizationState::GetProjectionInfo(), ViewState::GetSrcImage(), HuginBase::Panorama::getSrcImage(), ToolHelper::GetViewStatePtr(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, image_params, OutputProjectionInfo::ImageToAngular(), GLPreviewFrame::individualDragging(), ToolHelper::IsMouseOverPano(), GLPreviewFrame::RemoveImageFromDragGroup(), rotation_matrix, SetRotationMatrix(), ToolHelper::SetStatusMessage(), shift, shift_angle, shift_coordinates, start_angle, start_coordinates, 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 81 of file DragTool.cpp.
References centre, drag_mode, drag_mode_mosaic, drag_pitch, drag_roll, drag_yaw, ToolHelper::GetMousePanoPosition(), VisualizationState::GetProjectionInfo(), getTranslationShift(), ToolHelper::GetViewStatePtr(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, image_params, OutputProjectionInfo::ImageToAngular(), VisualizationState::Redraw(), rotation_matrix, SetRotationMatrix(), ViewState::SetSrcImage(), ToolHelper::SetStatusMessage(), shift, shift_angle, shift_coordinates, start_angle, start_coordinates, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.
|
pure virtual |
Draw (using OpenGL) the overlays, e.g. crop highlights, guides.
Reimplemented from Tool.
Implemented in OverviewDragTool, and PreviewDragTool.
void DragTool::setDragMode | ( | PreviewDragTool::DragMode | dmode | ) |
Definition at line 47 of file DragTool.cpp.
References drag_mode.
Referenced by GLPreviewFrame::OnDragChoice(), and GLPreviewFrame::panoramaImagesChanged().
|
protected |
Definition at line 417 of file DragTool.cpp.
References DEG_TO_RAD, rotation_matrix, and Matrix3::SetRotationPT().
Referenced by MouseButtonEvent(), and MouseMoveEvent().
|
protected |
Definition at line 85 of file DragTool.h.
Referenced by MouseButtonEvent(), MouseMoveEvent(), and PreviewDragTool::ReallyAfterDrawImagesEvent().
|
protected |
Definition at line 86 of file DragTool.h.
Referenced by Activate(), and MouseButtonEvent().
|
protected |
Definition at line 93 of file DragTool.h.
|
protected |
Definition at line 92 of file DragTool.h.
Referenced by getDragMode(), MouseMoveEvent(), and setDragMode().
|
protected |
Definition at line 83 of file DragTool.h.
Referenced by Activate(), MouseButtonEvent(), MouseMoveEvent(), and PreviewDragTool::ReallyAfterDrawImagesEvent().
|
protected |
Definition at line 83 of file DragTool.h.
Referenced by Activate(), MouseButtonEvent(), MouseMoveEvent(), and PreviewDragTool::ReallyAfterDrawImagesEvent().
|
protected |
Definition at line 83 of file DragTool.h.
Referenced by Activate(), MouseButtonEvent(), MouseMoveEvent(), and PreviewDragTool::ReallyAfterDrawImagesEvent().
|
protected |
Definition at line 82 of file DragTool.h.
Referenced by MouseButtonEvent().
|
protected |
Definition at line 81 of file DragTool.h.
Referenced by MouseButtonEvent(), and MouseMoveEvent().
|
protected |
Definition at line 87 of file DragTool.h.
Referenced by MouseButtonEvent(), MouseMoveEvent(), and SetRotationMatrix().
|
protected |
Definition at line 86 of file DragTool.h.
Referenced by Activate(), MouseButtonEvent(), and MouseMoveEvent().
|
protected |
Definition at line 84 of file DragTool.h.
Referenced by MouseButtonEvent(), MouseMoveEvent(), and PreviewDragTool::ReallyAfterDrawImagesEvent().
|
protected |
Definition at line 85 of file DragTool.h.
Referenced by getTranslationShift(), MouseButtonEvent(), MouseMoveEvent(), and PreviewDragTool::ReallyAfterDrawImagesEvent().
|
protected |
Definition at line 84 of file DragTool.h.
Referenced by MouseButtonEvent(), MouseMoveEvent(), and PreviewDragTool::ReallyAfterDrawImagesEvent().
|
protected |
Definition at line 85 of file DragTool.h.
Referenced by getTranslationShift(), MouseButtonEvent(), MouseMoveEvent(), and PreviewDragTool::ReallyAfterDrawImagesEvent().