/
qgsmaptoolcapture.sip.in
202 lines (139 loc) · 4.35 KB
/
qgsmaptoolcapture.sip.in
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmaptoolcapture.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMapToolCapture : QgsMapToolAdvancedDigitizing
{
%TypeHeaderCode
#include "qgsmaptoolcapture.h"
%End
public:
enum CaptureMode
{
CaptureNone,
CapturePoint,
CaptureLine,
CapturePolygon
};
QgsMapToolCapture( QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget, CaptureMode mode );
%Docstring
constructor
%End
~QgsMapToolCapture();
virtual void activate();
virtual void deactivate();
CaptureMode mode() const;
%Docstring
The capture mode
:return: Capture mode
%End
int addCurve( QgsCurve *c );
%Docstring
Adds a whole curve (e.g. circularstring) to the captured geometry. Curve must be in map CRS
%End
void clearCurve( );
%Docstring
Clear capture curve.
.. versionadded:: 3.0
%End
const QgsCompoundCurve *captureCurve() const;
%Docstring
Get the capture curve
:return: Capture curve
%End
QList<QgsPointLocator::Match> snappingMatches() const;
%Docstring
Return a list of matches for each point on the captureCurve.
.. versionadded:: 3.0
%End
virtual void cadCanvasMoveEvent( QgsMapMouseEvent *e );
virtual void keyPressEvent( QKeyEvent *e );
%Docstring
Intercept key events like Esc or Del to delete the last point
:param e: key event
%End
void deleteTempRubberBand();
%Docstring
Clean a temporary rubberband
%End
virtual void clean();
%Docstring
convenient method to clean members
%End
protected:
int nextPoint( const QgsPoint &mapPoint, QgsPoint &layerPoint );
int nextPoint( QPoint p, QgsPoint &layerPoint, QgsPoint &mapPoint );
int fetchLayerPoint( const QgsPointLocator::Match &match, QgsPoint &layerPoint );
QgsPoint mapPoint( const QgsMapMouseEvent &e ) const;
%Docstring
Creates a QgsPoint with ZM support if necessary (according to the
WkbType of the current layer). If the point is snapped, then the Z
value is took from the snapped point.
:param e: A mouse event
:return: a point with ZM support if necessary
.. versionadded:: 3.0
%End
QgsPoint mapPoint( const QgsPointXY &point ) const;
%Docstring
Creates a QgsPoint with ZM support if necessary (according to the
WkbType of the current layer).
:param point: A point in 2D
:return: a point with ZM support if necessary
.. versionadded:: 3.0
%End
int addVertex( const QgsPointXY &point );
int addVertex( const QgsPointXY &mapPoint, const QgsPointLocator::Match &match );
%Docstring
Variant to supply more information in the case of snapping
:param mapPoint: The vertex to add in map coordinates
:param match: Data about the snapping match. Can be an invalid match, if point not snapped.
.. versionadded:: 2.14
%End
void undo();
%Docstring
Removes the last vertex from mRubberBand and mCaptureList
%End
void startCapturing();
%Docstring
Start capturing
%End
bool isCapturing() const;
%Docstring
Are we currently capturing?
:return: Is the tool in capture mode?
%End
int size();
%Docstring
Number of points digitized
:return: Number of points
%End
QVector<QgsPointXY> points() const;
%Docstring
List of digitized points
:return: List of points
%End
void setPoints( const QVector<QgsPointXY> &pointList );
%Docstring
Set the points on which to work
:param pointList: A list of points
%End
void closePolygon();
%Docstring
Close an open polygon
%End
protected slots:
void stopCapturing();
%Docstring
Stop capturing
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmaptoolcapture.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/