Skip to content

Commit 47ae05f

Browse files
committedJan 12, 2016
Merge pull request #2595 from SebDieBln/ImproveDigitizingTools
Improve digitizing tools for circular strings
2 parents 3febba2 + e45603a commit 47ae05f

7 files changed

+162
-118
lines changed
 

‎src/app/qgsmaptooladdcircularstring.cpp

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ QgsMapToolAddCircularString::QgsMapToolAddCircularString( QgsMapToolCapture* par
2828
: QgsMapToolCapture( canvas, QgisApp::instance()->cadDockWidget(), mode )
2929
, mParentTool( parentTool )
3030
, mRubberBand( nullptr )
31+
, mTempRubberBand( nullptr )
3132
, mShowCenterPointRubberBand( false )
3233
, mCenterPointRubberBand( nullptr )
3334
{
@@ -41,6 +42,7 @@ QgsMapToolAddCircularString::QgsMapToolAddCircularString( QgsMapCanvas* canvas )
4142
: QgsMapToolCapture( canvas, QgisApp::instance()->cadDockWidget() )
4243
, mParentTool( nullptr )
4344
, mRubberBand( nullptr )
45+
, mTempRubberBand( nullptr )
4446
, mShowCenterPointRubberBand( false )
4547
, mCenterPointRubberBand( nullptr )
4648
{
@@ -53,6 +55,7 @@ QgsMapToolAddCircularString::QgsMapToolAddCircularString( QgsMapCanvas* canvas )
5355
QgsMapToolAddCircularString::~QgsMapToolAddCircularString()
5456
{
5557
delete mRubberBand;
58+
delete mTempRubberBand;
5659
removeCenterPointRubberBand();
5760
}
5861

@@ -80,9 +83,20 @@ void QgsMapToolAddCircularString::keyPressEvent( QKeyEvent* e )
8083
if ( e && e->key() == Qt::Key_R )
8184
{
8285
mShowCenterPointRubberBand = true;
83-
8486
createCenterPointRubberBand();
8587
}
88+
89+
if ( e && e->key() == Qt::Key_Escape )
90+
{
91+
mPoints.clear();
92+
delete mRubberBand;
93+
mRubberBand = nullptr;
94+
delete mTempRubberBand;
95+
mTempRubberBand = nullptr;
96+
removeCenterPointRubberBand();
97+
if ( mParentTool )
98+
mParentTool->keyPressEvent( e );
99+
}
86100
}
87101

88102
void QgsMapToolAddCircularString::keyReleaseEvent( QKeyEvent* e )
@@ -117,6 +131,8 @@ void QgsMapToolAddCircularString::deactivate()
117131
mPoints.clear();
118132
delete mRubberBand;
119133
mRubberBand = nullptr;
134+
delete mTempRubberBand;
135+
mTempRubberBand = nullptr;
120136
removeCenterPointRubberBand();
121137
QgsMapToolCapture::deactivate();
122138
}
@@ -126,6 +142,32 @@ void QgsMapToolAddCircularString::activate()
126142
if ( mParentTool )
127143
{
128144
mParentTool->deleteTempRubberBand();
145+
if ( mPoints.isEmpty() )
146+
{
147+
// if the parent tool has a curve, use its last point as the first point in this curve
148+
const QgsCompoundCurveV2* compoundCurve = mParentTool->captureCurve();
149+
if ( compoundCurve && compoundCurve->nCurves() > 0 )
150+
{
151+
const QgsCurveV2* curve = compoundCurve->curveAt( compoundCurve->nCurves() - 1 );
152+
if ( curve )
153+
{
154+
//mParentTool->captureCurve() is in layer coordinates, but we need map coordinates
155+
QgsPointV2 endPointLayerCoord = curve->endPoint();
156+
QgsPoint mapPoint = toMapCoordinates( mCanvas->currentLayer(), QgsPoint( endPointLayerCoord.x(), endPointLayerCoord.y() ) );
157+
mPoints.append( QgsPointV2( mapPoint ) );
158+
if ( !mTempRubberBand )
159+
{
160+
mTempRubberBand = createGeometryRubberBand(( mode() == CapturePolygon ) ? QGis::Polygon : QGis::Line, true );
161+
mTempRubberBand->show();
162+
}
163+
QgsCircularStringV2* c = new QgsCircularStringV2();
164+
QList< QgsPointV2 > rubberBandPoints = mPoints;
165+
rubberBandPoints.append( QgsPointV2( mapPoint ) );
166+
c->setPoints( rubberBandPoints );
167+
mTempRubberBand->setGeometry( c );
168+
}
169+
}
170+
}
129171
}
130172
QgsMapToolCapture::activate();
131173
}
@@ -140,15 +182,12 @@ void QgsMapToolAddCircularString::createCenterPointRubberBand()
140182
mCenterPointRubberBand = createGeometryRubberBand( QGis::Polygon );
141183
mCenterPointRubberBand->show();
142184

143-
if ( mRubberBand )
185+
if ( mTempRubberBand )
144186
{
145-
const QgsAbstractGeometryV2* rubberBandGeom = mRubberBand->geometry();
187+
const QgsAbstractGeometryV2* rubberBandGeom = mTempRubberBand->geometry();
146188
if ( rubberBandGeom )
147189
{
148-
QgsVertexId idx;
149-
idx.part = 0;
150-
idx.ring = 0;
151-
idx.vertex = mPoints.size();
190+
QgsVertexId idx( 0, 0, 2 );
152191
QgsPointV2 pt = rubberBandGeom->vertexAt( idx );
153192
updateCenterPointRubberBand( pt );
154193
}
@@ -175,17 +214,17 @@ void QgsMapToolAddCircularString::updateCenterPointRubberBand( const QgsPointV2&
175214
csPoints.append( pt );
176215
cs->setPoints( csPoints );
177216

178-
double centerX, centerY;
217+
QgsPointV2 center;
179218
double radius;
180-
QgsGeometryUtils::circleCenterRadius( csPoints.at( 0 ), csPoints.at( 1 ), csPoints.at( 2 ), radius, centerX, centerY );
219+
QgsGeometryUtils::circleCenterRadius( csPoints.at( 0 ), csPoints.at( 1 ), csPoints.at( 2 ), radius, center.rx(), center.ry() );
181220

182221
QgsLineStringV2* segment1 = new QgsLineStringV2();
183-
segment1->addVertex( QgsPointV2( centerX, centerY ) );
222+
segment1->addVertex( center );
184223
segment1->addVertex( csPoints.at( 0 ) );
185224

186225
QgsLineStringV2* segment2 = new QgsLineStringV2();
187226
segment2->addVertex( csPoints.at( 2 ) );
188-
segment2->addVertex( QgsPointV2( centerX, centerY ) );
227+
segment2->addVertex( center );
189228

190229
QgsCompoundCurveV2* cc = new QgsCompoundCurveV2();
191230
cc->addCurve( segment1 );

‎src/app/qgsmaptooladdcircularstring.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,16 @@ class QgsMapToolAddCircularString: public QgsMapToolCapture
4040
protected:
4141
explicit QgsMapToolAddCircularString( QgsMapCanvas* canvas ); //forbidden
4242

43+
/** The parent map tool, e.g. the add feature tool.
44+
* Completed circular strings will be added to this tool by calling its addCurve() method.
45+
* */
4346
QgsMapToolCapture* mParentTool;
4447
/** Circular string points (in map coordinates)*/
4548
QList< QgsPointV2 > mPoints;
49+
//! The rubberband to show the already completed circular strings
4650
QgsGeometryRubberBand* mRubberBand;
51+
//! The rubberband to show the circular string currently working on
52+
QgsGeometryRubberBand* mTempRubberBand;
4753

4854
//center point rubber band
4955
bool mShowCenterPointRubberBand;

‎src/app/qgsmaptoolcircularstringcurvepoint.cpp

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,31 @@ QgsMapToolCircularStringCurvePoint::~QgsMapToolCircularStringCurvePoint()
3333

3434
void QgsMapToolCircularStringCurvePoint::cadCanvasReleaseEvent( QgsMapMouseEvent* e )
3535
{
36-
QgsPointV2 mapPoint( e->mapPoint().x(), e->mapPoint().y() );
36+
QgsPointV2 mapPoint( e->mapPoint() );
3737

3838
if ( e->button() == Qt::LeftButton )
3939
{
40-
if ( mPoints.size() < 1 ) //connection to vertex of previous line segment needed?
41-
{
42-
const QgsCompoundCurveV2* compoundCurve = mParentTool->captureCurve();
43-
if ( compoundCurve )
44-
{
45-
if ( compoundCurve->nCurves() > 0 )
46-
{
47-
const QgsCurveV2* curve = compoundCurve->curveAt( compoundCurve->nCurves() - 1 );
48-
if ( curve )
49-
{
50-
//mParentTool->captureCurve() is in layer coordinates, but we need map coordinates
51-
QgsPointV2 endPointLayerCoord = curve->endPoint();
52-
QgsPoint mapPoint = toMapCoordinates( mCanvas->currentLayer(), QgsPoint( endPointLayerCoord.x(), endPointLayerCoord.y() ) );
53-
mPoints.append( QgsPointV2( mapPoint.x(), mapPoint.y() ) );
54-
}
55-
}
56-
}
57-
}
5840
mPoints.append( mapPoint );
5941
if ( !mCenterPointRubberBand && mShowCenterPointRubberBand )
6042
{
6143
createCenterPointRubberBand();
6244
}
6345

64-
if ( mPoints.size() >= 1 )
46+
if ( !mPoints.isEmpty() )
47+
{
48+
if ( !mTempRubberBand )
49+
{
50+
mTempRubberBand = createGeometryRubberBand(( mode() == CapturePolygon ) ? QGis::Polygon : QGis::Line, true );
51+
mTempRubberBand->show();
52+
}
53+
54+
QgsCircularStringV2* c = new QgsCircularStringV2();
55+
QList< QgsPointV2 > rubberBandPoints = mPoints.mid( mPoints.size() - 1 - ( mPoints.size() + 1 ) % 2 );
56+
rubberBandPoints.append( mapPoint );
57+
c->setPoints( rubberBandPoints );
58+
mTempRubberBand->setGeometry( c );
59+
}
60+
if ( mPoints.size() > 1 && mPoints.size() % 2 )
6561
{
6662
if ( !mRubberBand )
6763
{
@@ -74,9 +70,6 @@ void QgsMapToolCircularStringCurvePoint::cadCanvasReleaseEvent( QgsMapMouseEvent
7470
rubberBandPoints.append( mapPoint );
7571
c->setPoints( rubberBandPoints );
7672
mRubberBand->setGeometry( c );
77-
}
78-
if (( mPoints.size() ) % 2 == 1 )
79-
{
8073
removeCenterPointRubberBand();
8174
}
8275
}
@@ -92,14 +85,11 @@ void QgsMapToolCircularStringCurvePoint::cadCanvasReleaseEvent( QgsMapMouseEvent
9285

9386
void QgsMapToolCircularStringCurvePoint::cadCanvasMoveEvent( QgsMapMouseEvent* e )
9487
{
95-
QgsPointV2 mapPoint( e->mapPoint().x(), e->mapPoint().y() );
96-
QgsVertexId idx;
97-
idx.part = 0;
98-
idx.ring = 0;
99-
idx.vertex = mPoints.size();
100-
if ( mRubberBand )
88+
QgsPointV2 mapPoint( e->mapPoint() );
89+
QgsVertexId idx( 0, 0, 1 + ( mPoints.size() + 1 ) % 2 );
90+
if ( mTempRubberBand )
10191
{
102-
mRubberBand->moveVertex( idx, mapPoint );
92+
mTempRubberBand->moveVertex( idx, mapPoint );
10393
updateCenterPointRubberBand( mapPoint );
10494
}
10595
}

‎src/app/qgsmaptoolcircularstringradius.cpp

Lines changed: 71 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@
2727

2828
QgsMapToolCircularStringRadius::QgsMapToolCircularStringRadius( QgsMapToolCapture* parentTool, QgsMapCanvas* canvas, CaptureMode mode )
2929
: QgsMapToolAddCircularString( parentTool, canvas, mode ),
30-
mTemporaryEndPointX( 0.0 ),
31-
mTemporaryEndPointY( 0.0 ),
32-
mRadiusMode( false ),
30+
mTemporaryEndPoint( QgsPointV2() ),
3331
mRadius( 0.0 ),
3432
mRadiusSpinBox( nullptr )
3533
{
@@ -41,73 +39,56 @@ QgsMapToolCircularStringRadius::~QgsMapToolCircularStringRadius()
4139

4240
}
4341

42+
void QgsMapToolCircularStringRadius::deactivate()
43+
{
44+
deleteRadiusSpinBox();
45+
QgsMapToolAddCircularString::deactivate();
46+
}
47+
4448
void QgsMapToolCircularStringRadius::cadCanvasReleaseEvent( QgsMapMouseEvent* e )
4549
{
46-
QgsPointV2 mapPoint( e->mapPoint().x(), e->mapPoint().y() );
50+
QgsPointV2 mapPoint( e->mapPoint() );
4751

4852
if ( e->button() == Qt::LeftButton )
4953
{
5054
if ( mPoints.isEmpty() )
5155
{
52-
//get first point from parent tool if there. Todo: move to upper class
53-
const QgsCompoundCurveV2* compoundCurve = mParentTool->captureCurve();
54-
if ( compoundCurve && compoundCurve->nCurves() > 0 )
55-
{
56-
const QgsCurveV2* curve = compoundCurve->curveAt( compoundCurve->nCurves() - 1 );
57-
if ( curve )
58-
{
59-
//mParentTool->captureCurve() is in layer coordinates, but we need map coordinates
60-
QgsPointV2 endPointLayerCoord = curve->endPoint();
61-
QgsPoint mapPoint = toMapCoordinates( mCanvas->currentLayer(), QgsPoint( endPointLayerCoord.x(), endPointLayerCoord.y() ) );
62-
mPoints.append( QgsPointV2( mapPoint.x(), mapPoint.y() ) );
63-
}
64-
}
65-
else
66-
{
67-
mPoints.append( mapPoint );
68-
return;
69-
}
56+
mPoints.append( mapPoint );
7057
}
71-
72-
if ( mPoints.size() % 2 == 1 )
58+
else
7359
{
74-
if ( !mRadiusMode )
60+
if ( mPoints.size() % 2 )
7561
{
76-
delete mRubberBand;
77-
mRubberBand = nullptr;
78-
mTemporaryEndPointX = mapPoint.x();
79-
mTemporaryEndPointY = mapPoint.y();
80-
mRadiusMode = true;
62+
mTemporaryEndPoint = mapPoint;
8163

8264
//initial radius is distance( tempPoint - mPoints.last ) / 2.0
83-
double minRadius = sqrt( QgsGeometryUtils::sqrDistance2D( mPoints.last(), QgsPointV2( mTemporaryEndPointX, mTemporaryEndPointY ) ) ) / 2.0;
65+
double minRadius = sqrt( QgsGeometryUtils::sqrDistance2D( mPoints.last(), mTemporaryEndPoint ) ) / 2.0;
8466
mRadius = minRadius + minRadius / 10.0;
85-
recalculateCircularString();
86-
createRadiusSpinBox();
87-
if ( mRadiusSpinBox )
67+
68+
QgsPointV2 result;
69+
if ( QgsGeometryUtils::segmentMidPoint( mPoints.last(), mTemporaryEndPoint, result, mRadius, QgsPointV2( mapPoint.x(), mapPoint.y() ) ) )
8870
{
89-
mRadiusSpinBox->setMinimum( minRadius );
71+
mPoints.append( result );
72+
createRadiusSpinBox();
73+
if ( mRadiusSpinBox )
74+
{
75+
mRadiusSpinBox->setMinimum( minRadius );
76+
}
9077
}
9178
}
9279
else
9380
{
94-
QgsPointV2 result;
95-
if ( QgsGeometryUtils::segmentMidPoint( mPoints.last(), QgsPointV2( mTemporaryEndPointX, mTemporaryEndPointY ), result, mRadius, QgsPointV2( mapPoint.x(), mapPoint.y() ) ) )
96-
{
97-
mPoints.append( result );
98-
mPoints.append( QgsPointV2( mTemporaryEndPointX, mTemporaryEndPointY ) );
99-
}
100-
mRadiusMode = false;
81+
mPoints.append( mTemporaryEndPoint );
10182
deleteRadiusSpinBox();
10283
}
103-
}
104-
else
105-
{
106-
//can we get there?
84+
recalculateRubberBand();
85+
recalculateTempRubberBand( e->mapPoint() );
10786
}
10887
}
10988
else if ( e->button() == Qt::RightButton )
11089
{
90+
if ( !( mPoints.size() % 2 ) )
91+
mPoints.removeLast();
11192
deactivate();
11293
if ( mParentTool )
11394
{
@@ -118,33 +99,55 @@ void QgsMapToolCircularStringRadius::cadCanvasReleaseEvent( QgsMapMouseEvent* e
11899

119100
void QgsMapToolCircularStringRadius::cadCanvasMoveEvent( QgsMapMouseEvent* e )
120101
{
121-
if ( !mPoints.isEmpty() && mRadiusMode )
102+
if ( !mPoints.isEmpty() )
122103
{
123-
mLastMouseMapPos.setX( e->mapPoint().x() );
124-
mLastMouseMapPos.setY( e->mapPoint().y() );
125-
recalculateCircularString();
104+
recalculateTempRubberBand( e->mapPoint() );
105+
updateCenterPointRubberBand( mTemporaryEndPoint );
126106
}
127107
}
128108

129-
void QgsMapToolCircularStringRadius::recalculateCircularString()
109+
void QgsMapToolCircularStringRadius::recalculateRubberBand()
130110
{
131-
//new midpoint on circle segment
132-
QgsPointV2 midPoint;
133-
if ( !QgsGeometryUtils::segmentMidPoint( mPoints.last(), QgsPointV2( mTemporaryEndPointX, mTemporaryEndPointY ), midPoint, mRadius,
134-
mLastMouseMapPos ) )
111+
if ( mPoints.size() >= 3 )
135112
{
136-
return;
113+
QgsCircularStringV2* cString = new QgsCircularStringV2();
114+
int rubberBandSize = mPoints.size() - ( mPoints.size() + 1 ) % 2;
115+
cString->setPoints( mPoints.mid( 0, rubberBandSize ) );
116+
delete mRubberBand;
117+
mRubberBand = createGeometryRubberBand(( mode() == CapturePolygon ) ? QGis::Polygon : QGis::Line );
118+
mRubberBand->setGeometry( cString );
119+
mRubberBand->show();
137120
}
121+
}
138122

139-
QList<QgsPointV2> rubberBandPoints = mPoints;
140-
rubberBandPoints.append( midPoint );
141-
rubberBandPoints.append( QgsPointV2( mTemporaryEndPointX, mTemporaryEndPointY ) );
123+
void QgsMapToolCircularStringRadius::recalculateTempRubberBand( const QgsPoint& mousePosition )
124+
{
125+
QList<QgsPointV2> rubberBandPoints;
126+
if ( !( mPoints.size() % 2 ) )
127+
{
128+
//recalculate midpoint on circle segment
129+
QgsPointV2 midPoint;
130+
if ( !QgsGeometryUtils::segmentMidPoint( mPoints.at( mPoints.size() - 2 ), mTemporaryEndPoint, midPoint, mRadius,
131+
QgsPointV2( mousePosition ) ) )
132+
{
133+
return;
134+
}
135+
mPoints.replace( mPoints.size() - 1, midPoint );
136+
rubberBandPoints.append( mPoints.at( mPoints.size() - 2 ) );
137+
rubberBandPoints.append( mPoints.last() );
138+
rubberBandPoints.append( mTemporaryEndPoint );
139+
}
140+
else
141+
{
142+
rubberBandPoints.append( mPoints.last() );
143+
rubberBandPoints.append( QgsPointV2( mousePosition ) );
144+
}
142145
QgsCircularStringV2* cString = new QgsCircularStringV2();
143146
cString->setPoints( rubberBandPoints );
144-
delete mRubberBand;
145-
mRubberBand = createGeometryRubberBand(( mode() == CapturePolygon ) ? QGis::Polygon : QGis::Line );
146-
mRubberBand->setGeometry( cString );
147-
mRubberBand->show();
147+
delete mTempRubberBand;
148+
mTempRubberBand = createGeometryRubberBand(( mode() == CapturePolygon ) ? QGis::Polygon : QGis::Line, true );
149+
mTempRubberBand->setGeometry( cString );
150+
mTempRubberBand->show();
148151
}
149152

150153
void QgsMapToolCircularStringRadius::createRadiusSpinBox()
@@ -162,17 +165,16 @@ void QgsMapToolCircularStringRadius::createRadiusSpinBox()
162165

163166
void QgsMapToolCircularStringRadius::deleteRadiusSpinBox()
164167
{
165-
if ( !mRadiusSpinBox )
168+
if ( mRadiusSpinBox )
166169
{
167-
return;
170+
QgisApp::instance()->statusBar()->removeWidget( mRadiusSpinBox );
171+
delete mRadiusSpinBox;
172+
mRadiusSpinBox = nullptr;
168173
}
169-
QgisApp::instance()->statusBar()->removeWidget( mRadiusSpinBox );
170-
delete mRadiusSpinBox;
171-
mRadiusSpinBox = nullptr;
172174
}
173175

174176
void QgsMapToolCircularStringRadius::updateRadiusFromSpinBox( double radius )
175177
{
176178
mRadius = radius;
177-
recalculateCircularString();
179+
recalculateTempRubberBand( toMapCoordinates( mCanvas->mouseLastXY() ).toQPointF() );
178180
}

‎src/app/qgsmaptoolcircularstringradius.h

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,23 @@ class QgsMapToolCircularStringRadius: public QgsMapToolAddCircularString
3131

3232
virtual void cadCanvasReleaseEvent( QgsMapMouseEvent* e ) override;
3333
virtual void cadCanvasMoveEvent( QgsMapMouseEvent* e ) override;
34+
virtual void deactivate() override;
3435

3536
private slots:
3637
void updateRadiusFromSpinBox( double radius );
3738

3839
private:
39-
double mTemporaryEndPointX;
40-
double mTemporaryEndPointY;
41-
bool mRadiusMode;
40+
QgsPointV2 mTemporaryEndPoint;
4241
double mRadius;
43-
QgsPointV2 mLastMouseMapPos;
4442
QDoubleSpinBox* mRadiusSpinBox;
4543

46-
//recalculate circular string and rubber band depending on mRadius/mLeft and endpoints
47-
void recalculateCircularString();
44+
//! recalculate the rubberband
45+
void recalculateRubberBand();
46+
//! recalculate the temporary rubberband using the given mouse position
47+
void recalculateTempRubberBand( const QgsPoint& mousePosition );
48+
//! (re-)create the spin box to enter the radius
4849
void createRadiusSpinBox();
50+
//! delete the spin box to enter the radius, if it exists
4951
void deleteRadiusSpinBox();
5052
};
5153

‎src/gui/qgsmaptooledit.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,19 @@ int QgsMapToolEdit::addTopologicalPoints( const QList<QgsPoint>& geom )
9797
return 0;
9898
}
9999

100-
QgsGeometryRubberBand* QgsMapToolEdit::createGeometryRubberBand( QGis::GeometryType geometryType ) const
100+
QgsGeometryRubberBand* QgsMapToolEdit::createGeometryRubberBand( QGis::GeometryType geometryType, bool alternativeBand ) const
101101
{
102102
QSettings settings;
103103
QgsGeometryRubberBand* rb = new QgsGeometryRubberBand( mCanvas, geometryType );
104104
QColor color( settings.value( "/qgis/digitizing/line_color_red", 255 ).toInt(),
105105
settings.value( "/qgis/digitizing/line_color_green", 0 ).toInt(),
106106
settings.value( "/qgis/digitizing/line_color_blue", 0 ).toInt() );
107107
double myAlpha = settings.value( "/qgis/digitizing/line_color_alpha", 200 ).toInt() / 255.0 ;
108+
if ( alternativeBand )
109+
{
110+
myAlpha = myAlpha * settings.value( "/qgis/digitizing/line_color_alpha_scale", 0.75 ).toDouble();
111+
rb->setLineStyle( Qt::DotLine );
112+
}
108113
color.setAlphaF( myAlpha );
109114
rb->setOutlineColor( color );
110115
rb->setFillColor( color );

‎src/gui/qgsmaptooledit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class GUI_EXPORT QgsMapToolEdit: public QgsMapTool
4949
*/
5050
QgsRubberBand* createRubberBand( QGis::GeometryType geometryType = QGis::Line, bool alternativeBand = false );
5151

52-
QgsGeometryRubberBand* createGeometryRubberBand( QGis::GeometryType geometryType = QGis::Line ) const;
52+
QgsGeometryRubberBand* createGeometryRubberBand( QGis::GeometryType geometryType = QGis::Line , bool alternativeBand = false ) const;
5353

5454
/** Returns the current vector layer of the map canvas or 0*/
5555
QgsVectorLayer* currentVectorLayer();

0 commit comments

Comments
 (0)
Please sign in to comment.