31
31
#include < QMouseEvent>
32
32
#include < QSettings>
33
33
34
- QgsMapToolAddFeature::QgsMapToolAddFeature ( QgsMapCanvas* canvas, CaptureTool tool ): QgsMapToolCapture( canvas, tool )
34
+ QgsMapToolAddFeature::QgsMapToolAddFeature ( QgsMapCanvas* canvas, CaptureMode tool ): QgsMapToolCapture( canvas, tool )
35
35
{
36
36
37
37
}
@@ -85,7 +85,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
85
85
}
86
86
87
87
// POINT CAPTURING
88
- if ( mTool == CapturePoint )
88
+ if ( mCaptureMode == CapturePoint )
89
89
{
90
90
// check we only use this tool for point/multipoint layers
91
91
if ( vlayer->geometryType () != QGis::Point )
@@ -209,18 +209,18 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
209
209
}
210
210
211
211
}
212
- else if ( mTool == CaptureLine || mTool == CapturePolygon )
212
+ else if ( mCaptureMode == CaptureLine || mCaptureMode == CapturePolygon )
213
213
{
214
214
// check we only use the line tool for line/multiline layers
215
- if ( mTool == CaptureLine && vlayer->geometryType () != QGis::Line )
215
+ if ( mCaptureMode == CaptureLine && vlayer->geometryType () != QGis::Line )
216
216
{
217
217
QMessageBox::information ( 0 , tr ( " Wrong editing tool" ),
218
218
tr ( " Cannot apply the 'capture line' tool on this vector layer" ) );
219
219
return ;
220
220
}
221
221
222
222
// check we only use the polygon tool for polygon/multipolygon layers
223
- if ( mTool == CapturePolygon && vlayer->geometryType () != QGis::Polygon )
223
+ if ( mCaptureMode == CapturePolygon && vlayer->geometryType () != QGis::Polygon )
224
224
{
225
225
QMessageBox::information ( 0 , tr ( " Wrong editing tool" ),
226
226
tr ( " Cannot apply the 'capture polygon' tool on this vector layer" ) );
@@ -253,7 +253,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
253
253
mCapturing = FALSE ;
254
254
255
255
// lines: bail out if there are not at least two vertices
256
- if ( mTool == CaptureLine && mCaptureList .size () < 2 )
256
+ if ( mCaptureMode == CaptureLine && mCaptureList .size () < 2 )
257
257
{
258
258
delete mRubberBand ;
259
259
mRubberBand = NULL ;
@@ -262,7 +262,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
262
262
}
263
263
264
264
// polygons: bail out if there are not at least two vertices
265
- if ( mTool == CapturePolygon && mCaptureList .size () < 3 )
265
+ if ( mCaptureMode == CapturePolygon && mCaptureList .size () < 3 )
266
266
{
267
267
delete mRubberBand ;
268
268
mRubberBand = NULL ;
@@ -276,7 +276,7 @@ void QgsMapToolAddFeature::canvasReleaseEvent( QMouseEvent * e )
276
276
int size;
277
277
char end = QgsApplication::endian ();
278
278
279
- if ( mTool == CaptureLine )
279
+ if ( mCaptureMode == CaptureLine )
280
280
{
281
281
if ( layerWKBType == QGis::WKBLineString )
282
282
{
0 commit comments