Hugintrunk
0.1
|
Tool to delete all cp in a selected rectangle. More...
#include <PreviewEditCPTool.h>
Public Member Functions | |
PreviewEditCPTool (ToolHelper *helper) | |
void | Activate () |
activate the tool More... | |
void | ReallyAfterDrawImagesEvent () |
draw selection rectangle More... | |
void | MouseMoveEvent (double x, double y, wxMouseEvent &e) |
mouse move handling More... | |
void | MouseButtonEvent (wxMouseEvent &e) |
mouse button handling More... | |
HuginBase::UIntSet | GetFoundCPs () |
return set of found control points More... | |
vigra::Rect2D | GetSelectedROI () |
returns selected ROI More... | |
void | SetMenuProcessed () |
reset popup menu status More... | |
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 Member Functions | |
void | AddLineCP (const hugin_utils::FDiff2D &pos1, const hugin_utils::FDiff2D &pos2) |
called to add line control point More... | |
void | FindCPInRect (const hugin_utils::FDiff2D &pos1, const hugin_utils::FDiff2D &pos2) |
search for control points in selected rectangle More... | |
Private Attributes | |
bool | m_mouseDown |
mouse down status More... | |
bool | m_menuPopup |
true, when popup menu is shown, this is to ignore a mouse event when the popup menu is closed More... | |
hugin_utils::FDiff2D | m_startPos |
position where the marking starts More... | |
hugin_utils::FDiff2D | m_startPosScreen |
position where the marking starts in screen coordinates More... | |
hugin_utils::FDiff2D | m_currentPos |
current position of selection More... | |
hugin_utils::FDiff2D | m_currentPosScreen |
current position of selection in screen coordinates More... | |
HuginBase::UIntSet | m_CPinROI |
contains the found cp More... | |
bool | m_line |
if selecting a rectangle or a line 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 to delete all cp in a selected rectangle.
Definition at line 43 of file PreviewEditCPTool.h.
|
inlineexplicit |
Definition at line 46 of file PreviewEditCPTool.h.
|
virtual |
activate the tool
Implements Tool.
Definition at line 48 of file PreviewEditCPTool.cpp.
References Tool::helper, m_mouseDown, ToolHelper::MOUSE_MOVE, ToolHelper::MOUSE_PRESS, ToolHelper::NotifyMe(), ToolHelper::REALLY_DRAW_OVER_IMAGES, and ToolHelper::SetStatusMessage().
|
private |
called to add line control point
Definition at line 253 of file PreviewEditCPTool.cpp.
References PanoCommand::CommandHistory::addCommand(), HuginBase::PTools::Transform::createTransform(), VisualizationState::ForceRequireRedraw(), HuginBase::Panorama::getImage(), ToolHelper::GetImagesUnderPos(), PanoCommand::GlobalCmdHist::getInstance(), HuginBase::Panorama::getOptions(), ToolHelper::GetPanoramaPtr(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, HuginBase::ControlPoint::image1Nr, HuginBase::ControlPoint::image2Nr, HuginBase::ControlPoint::mode, VisualizationState::Redraw(), HuginBase::PTools::Transform::transformImgCoord(), HuginBase::ControlPoint::X, hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, HuginBase::ControlPoint::Y, hugin_utils::TDiff2D< T >::y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.
Referenced by MouseButtonEvent().
|
private |
search for control points in selected rectangle
Definition at line 188 of file PreviewEditCPTool.cpp.
References HuginBase::PTools::Transform::createInvTransform(), HuginBase::Panorama::getActiveImages(), HuginBase::Panorama::getCtrlPoints(), HuginBase::Panorama::getImage(), HuginBase::Panorama::getOptions(), ToolHelper::GetPanoramaPtr(), Tool::helper, m_CPinROI, set_contains(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.
Referenced by MouseButtonEvent().
|
inline |
return set of found control points
Definition at line 56 of file PreviewEditCPTool.h.
References m_CPinROI.
Referenced by GLPreviewFrame::OnRemoveCP().
vigra::Rect2D PreviewEditCPTool::GetSelectedROI | ( | ) |
returns selected ROI
Definition at line 234 of file PreviewEditCPTool.cpp.
References HuginBase::Panorama::getOptions(), ToolHelper::GetPanoramaPtr(), HuginBase::PanoramaOptions::getSize(), Tool::helper, m_currentPos, m_startPos, celeste::max(), celeste::min(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.
Referenced by MouseButtonEvent(), and GLPreviewFrame::OnCreateCP().
|
virtual |
mouse button handling
Reimplemented from Tool.
Definition at line 112 of file PreviewEditCPTool.cpp.
References AddLineCP(), FindCPInRect(), VisualizationState::ForceRequireRedraw(), ToolHelper::GetMousePanoPosition(), ToolHelper::GetMouseScreenPosition(), ToolHelper::GetPreviewFrame(), GetSelectedROI(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, ID_CREATE_CP, ID_REMOVE_CP, m_CPinROI, m_currentPos, m_currentPosScreen, m_line, m_menuPopup, m_mouseDown, m_startPos, m_startPosScreen, VisualizationState::Redraw(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.
|
virtual |
mouse move handling
Reimplemented from Tool.
Definition at line 99 of file PreviewEditCPTool.cpp.
References VisualizationState::ForceRequireRedraw(), ToolHelper::GetMousePanoPosition(), ToolHelper::GetMouseScreenPosition(), ToolHelper::GetVisualizationStatePtr(), Tool::helper, m_currentPos, m_currentPosScreen, m_mouseDown, and VisualizationState::Redraw().
|
virtual |
draw selection rectangle
Reimplemented from Tool.
Definition at line 58 of file PreviewEditCPTool.cpp.
References m_currentPos, m_currentPosScreen, m_line, m_mouseDown, m_startPos, m_startPosScreen, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.
void PreviewEditCPTool::SetMenuProcessed | ( | ) |
reset popup menu status
Definition at line 248 of file PreviewEditCPTool.cpp.
References m_menuPopup.
Referenced by GLPreviewFrame::OnCreateCP(), and GLPreviewFrame::OnRemoveCP().
|
private |
contains the found cp
Definition at line 79 of file PreviewEditCPTool.h.
Referenced by FindCPInRect(), GetFoundCPs(), and MouseButtonEvent().
|
private |
current position of selection
Definition at line 75 of file PreviewEditCPTool.h.
Referenced by GetSelectedROI(), MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
current position of selection in screen coordinates
Definition at line 77 of file PreviewEditCPTool.h.
Referenced by MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
if selecting a rectangle or a line
Definition at line 81 of file PreviewEditCPTool.h.
Referenced by MouseButtonEvent(), and ReallyAfterDrawImagesEvent().
|
private |
true, when popup menu is shown, this is to ignore a mouse event when the popup menu is closed
Definition at line 69 of file PreviewEditCPTool.h.
Referenced by MouseButtonEvent(), and SetMenuProcessed().
|
private |
mouse down status
Definition at line 67 of file PreviewEditCPTool.h.
Referenced by Activate(), MouseButtonEvent(), MouseMoveEvent(), and ReallyAfterDrawImagesEvent().
|
private |
position where the marking starts
Definition at line 71 of file PreviewEditCPTool.h.
Referenced by GetSelectedROI(), MouseButtonEvent(), and ReallyAfterDrawImagesEvent().
|
private |
position where the marking starts in screen coordinates
Definition at line 73 of file PreviewEditCPTool.h.
Referenced by MouseButtonEvent(), and ReallyAfterDrawImagesEvent().