DragTool Class Reference

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>

Inheritance diagram for DragTool:

Inheritance graph
[legend]
List of all members.

Public Types

enum  DragMode { drag_mode_normal, drag_mode_mosaic }

Public Member Functions

 DragTool (ToolHelper *helper)
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.
virtual void ReallyAfterDrawImagesEvent ()=0
 Draw (using OpenGL) the overlays, e.g. crop highlights, guides.
void setDragMode (DragMode drag_mode)
DragMode getDragMode ()
void getTranslationShift (double &delta_x, double &delta_y)

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, ParamStoreimage_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

Detailed Description

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.


Member Enumeration Documentation

enum DragTool::DragMode
 

Enumeration values:
drag_mode_normal 
drag_mode_mosaic 

Definition at line 71 of file DragTool.h.

Referenced by getDragMode().


Constructor & Destructor Documentation

DragTool::DragTool ToolHelper helper  ) 
 

Definition at line 42 of file DragTool.cpp.


Member Function Documentation

void DragTool::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 69 of file DragTool.cpp.

References control, drag_pitch, drag_roll, drag_yaw, ToolHelper::NotifyMe(), ToolHelper::SetStatusMessage(), and shift.

DragTool::DragMode DragTool::getDragMode  ) 
 

Definition at line 52 of file DragTool.cpp.

References DragMode.

Referenced by GLPreviewFrame::OnDragChoice(), and 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().

void DragTool::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 161 of file DragTool.cpp.

References CommandHistory::addCommand(), GLPreviewFrame::AddImageToDragGroup(), OutputProjectionInfo::AngularToImage(), centre, CommandHistory::clear(), control, HuginBase::createCPGraph(), drag_pitch, drag_roll, drag_yaw, draging_images, hugin_utils::FDiff2D, fill_set(), HuginBase::findCPComponents(), GLPreviewFrame::GetDragGroupImages(), ToolHelper::GetImageNumbersUnderMouse(), GlobalCmdHist::getInstance(), ToolHelper::GetMousePanoPosition(), HuginBase::Panorama::getNrOfImages(), ToolHelper::GetPanoramaPtr(), ToolHelper::GetPreviewFrame(), VisualizationState::GetProjectionInfo(), ViewState::GetProjectionInfo(), HuginBase::Panorama::getSrcImage(), ViewState::GetSrcImage(), ToolHelper::GetViewStatePtr(), ToolHelper::GetVisualizationStatePtr(), 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.

void DragTool::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 81 of file DragTool.cpp.

References centre, drag_mode, drag_pitch, drag_yaw, hugin_utils::FDiff2D, ToolHelper::GetMousePanoPosition(), VisualizationState::GetProjectionInfo(), getTranslationShift(), ToolHelper::GetViewStatePtr(), ToolHelper::GetVisualizationStatePtr(), image_params, OutputProjectionInfo::ImageToAngular(), VisualizationState::Redraw(), rotation_matrix, HuginBase::BaseSrcPanoImage::setPitch(), HuginBase::BaseSrcPanoImage::setRoll(), SetRotationMatrix(), ViewState::SetSrcImage(), ToolHelper::SetStatusMessage(), HuginBase::BaseSrcPanoImage::setTranslationPlanePitch(), HuginBase::BaseSrcPanoImage::setTranslationPlaneYaw(), HuginBase::BaseSrcPanoImage::setX(), HuginBase::BaseSrcPanoImage::setY(), HuginBase::BaseSrcPanoImage::setYaw(), HuginBase::BaseSrcPanoImage::setZ(), shift, shift_angle, shift_coordinates, start_coordinates, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

virtual void DragTool::ReallyAfterDrawImagesEvent  )  [pure virtual]
 

Draw (using OpenGL) the overlays, e.g. crop highlights, guides.

Reimplemented from Tool.

Implemented in PreviewDragTool, and OverviewDragTool.

void DragTool::setDragMode DragMode  drag_mode  ) 
 

Referenced by GLPreviewFrame::OnDragChoice(), and GLPreviewFrame::panoramaImagesChanged().

void DragTool::SetRotationMatrix double  yaw_shift,
double  pitch_shift,
double  roll_shift,
double  yaw_start,
double  pitch_start,
double  roll_start
[protected]
 

Definition at line 418 of file DragTool.cpp.

References DEG_TO_RAD, rotation_matrix, and Matrix3::SetRotationPT().

Referenced by MouseButtonEvent(), and MouseMoveEvent().


Member Data Documentation

hugin_utils::FDiff2D DragTool::centre [protected]
 

Definition at line 85 of file DragTool.h.

Referenced by MouseButtonEvent(), and MouseMoveEvent().

bool DragTool::control [protected]
 

Definition at line 86 of file DragTool.h.

Referenced by Activate(), and MouseButtonEvent().

bool DragTool::custom_drag [protected]
 

Definition at line 93 of file DragTool.h.

DragMode DragTool::drag_mode [protected]
 

Definition at line 92 of file DragTool.h.

Referenced by MouseMoveEvent().

bool DragTool::drag_pitch [protected]
 

Definition at line 83 of file DragTool.h.

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

bool DragTool::drag_roll [protected]
 

Definition at line 83 of file DragTool.h.

Referenced by Activate(), and MouseButtonEvent().

bool DragTool::drag_yaw [protected]
 

Definition at line 83 of file DragTool.h.

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

std::set<unsigned int> DragTool::draging_images [protected]
 

Definition at line 82 of file DragTool.h.

Referenced by MouseButtonEvent().

std::map<unsigned int, ParamStore> DragTool::image_params [protected]
 

Definition at line 81 of file DragTool.h.

Referenced by MouseButtonEvent(), and MouseMoveEvent().

Matrix3 DragTool::rotation_matrix [protected]
 

Definition at line 87 of file DragTool.h.

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

bool DragTool::shift [protected]
 

Definition at line 86 of file DragTool.h.

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

double DragTool::shift_angle [protected]
 

Definition at line 84 of file DragTool.h.

Referenced by MouseButtonEvent(), and MouseMoveEvent().

hugin_utils::FDiff2D DragTool::shift_coordinates [protected]
 

Definition at line 85 of file DragTool.h.

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

double DragTool::start_angle [protected]
 

Definition at line 84 of file DragTool.h.

Referenced by MouseButtonEvent().

hugin_utils::FDiff2D DragTool::start_coordinates [protected]
 

Definition at line 85 of file DragTool.h.

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


The documentation for this class was generated from the following files:
Generated on Wed Apr 16 01:25:44 2014 for Hugintrunk by  doxygen 1.3.9.1