-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtr_select_box.h
72 lines (61 loc) · 1.76 KB
/
tr_select_box.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/******************************************************************
*
* @short basic class for Trafalgar drawing area
*
* project: Trafalgar/GUI
*
* modul: tr_select_box.h
* @version 0.2
*
* system: UNIX/LINUX
* compiler: gcc
*
* @author Schmid Hubert (C)2020-2022
*
* beginning: 09.2020
*
* history:
*/
/******************************************************************/
/* The trafalgar package is free software. You may redistribute it
* and/or modify it under the terms of the GNU General Public License as
* published by the Free Software foundation; either version 2, or (at your
* option) any later version.
*
* The GNU trafalgar package is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with the GNU plotutils package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin St., Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef TR_SELECT_BOX_H
#define TR_SELECT_BOX_H
#include <tr_zoom_map.h>
#include <QtWidgets/qrubberband.h>
class SelectBox : public QRubberBand
{
Q_OBJECT
private:
QPoint m_start;
QPoint m_next;
QRubberBand::Shape m_shape;
bool m_rubber;
public:
SelectBox(QWidget * parent = nullptr);
void setFirst(const QPoint pt, bool rshow);
void setSecond(const QPoint pt, bool rshow);
void setHide();
void draw(QPainter *p);
const QRect & getRect() const;
QPoint & getStart();
QPoint & getNext();
bool isRubber();
QPoint diff();
int getManhattanLength();
void setZoomRect(TrZoomMap & zoom_ref);
};
#endif // TR_SELECT_BOX_H