Image Component Library (ICL)
DragRectangleMouseHandler.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLQt/src/ICLQt/DragRectangleMouseHandler.h **
10 ** Module : ICLQt **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLUtils/Lockable.h>
35 #include <ICLUtils/Rect.h>
36 #include <ICLCore/Color.h>
37 #include <ICLQt/MouseHandler.h>
38 
39 namespace icl{
40  namespace qt{
41 
43  class ICLDrawWidget;
46 
75  protected:
78  int m_minDim;
80 
81  public:
85 
89 
91 
92  DragRectangleMouseHandler(int minDim=4);
93 
95  virtual void process(const MouseEvent &e);
96 
98 
99  void visualize(ICLDrawWidget &w);
100 
102  bool hasRect() const;
103 
105  utils::Rect getRect() const;
106 
108  bool hasDraggedRect() const;
109 
111  utils::Rect getDragggedRect() const;
112 
114  inline void setMinDim(int minDim) { m_minDim = minDim; }
115 
117  inline int getMinDim() const{ return m_minDim; }
118  };
119  } // namespace qt
120 }
121 
core::Color4D m_outerWhileDrag
as m_outer, but for the dragged rectangle
Definition: DragRectangleMouseHandler.h:88
undocument this line if you encounter any issues!
Definition: Any.h:37
utils::Point m_origin
point where the drag gesture started
Definition: DragRectangleMouseHandler.h:76
int getMinDim() const
returns the minimum rectangle size
Definition: DragRectangleMouseHandler.h:117
utils::Point m_curr
current mouse-position while dragging
Definition: DragRectangleMouseHandler.h:77
core::Color4D m_outer
color that is used for everything outside the rectangle
Definition: DragRectangleMouseHandler.h:84
core::Color4D m_edge
edge color for the defined rectangle
Definition: DragRectangleMouseHandler.h:82
int m_minDim
minimum rectangle size
Definition: DragRectangleMouseHandler.h:78
Extended Image visualization widget, with a drawing state machine interface.
Definition: DrawWidget.h:142
utils::Rect m_rect
last defined rectangle
Definition: DragRectangleMouseHandler.h:79
MouseEvent Handler.
Definition: MouseHandler.h:92
core::Color4D m_fill
fill color for the defined rectangle
Definition: DragRectangleMouseHandler.h:83
#define ICLQt_API
Definition: CompatMacros.h:178
Point class of the ICL used e.g. for the Images ROI offset.
Definition: Point.h:58
void setMinDim(int minDim)
sets the minimum rectangle size
Definition: DragRectangleMouseHandler.h:114
Provided by interface MouseGrabber.
Definition: MouseEvent.h:86
core::Color4D m_fillWhileDrag
fill color for the dragged rectangle
Definition: DragRectangleMouseHandler.h:87
core::Color4D m_edgeWhileDrag
edge color for the dragged rectangle
Definition: DragRectangleMouseHandler.h:86
Interface for objects, that can be locked using an internal mutex.
Definition: Lockable.h:41
Rectangle class of the ICL used e.g. for the Images ROI-rect.
Definition: Rect.h:95
Special MouseHandler implementation that allows for dragging a Rectangle.
Definition: DragRectangleMouseHandler.h:74