Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PreviewEditCPTool.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
2 
10 /*
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public
13  * License as published by the Free Software Foundation; either
14  * version 2 of the License, or (at your option) any later version.
15  *
16  * This software is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  * General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public
22  * License along with this software. If not, see
23  * <http://www.gnu.org/licenses/>.
24  *
25  */
26 
27 #ifndef _PREVIEWEDITCPTOOL_H
28 #define _PREVIEWEDITCPTOOL_H
29 
30 #include "Tool.h"
31 #include "base_wx/wxutils.h"
32 
34 
36 enum{
37  ID_CREATE_CP=wxID_HIGHEST + 301,
39 };
40 
43 class PreviewEditCPTool : public Tool
44 {
45 public:
46  explicit PreviewEditCPTool(ToolHelper *helper) : Tool(helper), m_mouseDown(false), m_menuPopup(false), m_line(false) {};
48  void Activate();
52  void MouseMoveEvent(double x, double y, wxMouseEvent & e);
54  void MouseButtonEvent(wxMouseEvent &e);
58  vigra::Rect2D GetSelectedROI();
60  void SetMenuProcessed();
61 private:
63  void AddLineCP(const hugin_utils::FDiff2D& pos1, const hugin_utils::FDiff2D& pos2);
65  void FindCPInRect(const hugin_utils::FDiff2D& pos1, const hugin_utils::FDiff2D& pos2);
81  bool m_line;
82 };
83 
84 #endif
85 
void ReallyAfterDrawImagesEvent()
draw selection rectangle
void SetMenuProcessed()
reset popup menu status
hugin_utils::FDiff2D m_currentPosScreen
current position of selection in screen coordinates
void AddLineCP(const hugin_utils::FDiff2D &pos1, const hugin_utils::FDiff2D &pos2)
called to add line control point
void MouseMoveEvent(double x, double y, wxMouseEvent &e)
mouse move handling
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
ToolHelper * helper
The PreviewToolHelper that uses the same preview window and panorama as the tool should.
Definition: Tool.h:102
void MouseButtonEvent(wxMouseEvent &e)
mouse button handling
Definition: Tool.h:42
hugin_utils::FDiff2D m_currentPos
current position of selection
bool m_line
if selecting a rectangle or a line
bool m_menuPopup
true, when popup menu is shown, this is to ignore a mouse event when the popup menu is closed ...
void Activate()
activate the tool
Tool to delete all cp in a selected rectangle.
bool m_mouseDown
mouse down status
hugin_utils::FDiff2D m_startPos
position where the marking starts
PreviewEditCPTool(ToolHelper *helper)
HuginBase::UIntSet GetFoundCPs()
return set of found control points
HuginBase::UIntSet m_CPinROI
contains the found cp
void FindCPInRect(const hugin_utils::FDiff2D &pos1, const hugin_utils::FDiff2D &pos2)
search for control points in selected rectangle
vigra::Rect2D GetSelectedROI()
returns selected ROI
hugin_utils::FDiff2D m_startPosScreen
position where the marking starts in screen coordinates