-
-
Notifications
You must be signed in to change notification settings - Fork 3k
/
qgsmaptoolcircle2tangentspoint.h
56 lines (44 loc) · 2.04 KB
/
qgsmaptoolcircle2tangentspoint.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
/***************************************************************************
qgsmaptoolcircle2tangentspoint.h - map tool for adding circle
from 2 tangents and a point
---------------------
begin : July 2017
copyright : (C) 2017 by Loïc Bartoletti
email : lbartoletti at tuxfamily dot org
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSMAPTOOLCIRCLE2TANGENTSPOINT_H
#define QGSMAPTOOLCIRCLE2TANGENTSPOINT_H
#include "qgspointlocator.h"
#include "qgsmaptooladdcircle.h"
#include "qspinbox.h"
class QSpinBox;
class QgsMapToolCircle2TangentsPoint: public QgsMapToolAddCircle
{
Q_OBJECT
public:
QgsMapToolCircle2TangentsPoint( QgsMapToolCapture *parentTool, QgsMapCanvas *canvas, CaptureMode mode = CaptureLine );
~QgsMapToolCircle2TangentsPoint() override;
void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
void cadCanvasMoveEvent( QgsMapMouseEvent *e ) override;
public slots:
void radiusSpinBoxChanged( int radius );
private:
//! Compute 4 possible centers
void getPossibleCenter();
//! (re-)create the spin box to enter the radius of the circle
void createRadiusSpinBox();
//! delete the spin box to enter the radius of the circle, if it exists
void deleteRadiusSpinBox();
QSpinBox *mRadiusSpinBox = nullptr;
int mRadius = 0;
QVector<QgsPointXY> mCenters;
QVector<QgsGeometryRubberBand *> mRubberBands;
};
#endif // QGSMAPTOOLCIRCLE2TANGENTSPOINT_H