Skip to content
Permalink
Browse files

Concat successive if

  • Loading branch information
lbartoletti committed Oct 3, 2017
1 parent 30d9ad8 commit de80f44e868d1e085b1b28a4c64e7ccc1c5329e7
@@ -35,13 +35,10 @@ void QgsMapToolCircle2Points::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{
mPoints.append( mapPoint );

if ( !mPoints.isEmpty() )
if ( !mPoints.isEmpty() && !mTempRubberBand )
{
if ( !mTempRubberBand )
{
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
}
else if ( e->button() == Qt::RightButton )
@@ -36,13 +36,10 @@ void QgsMapToolCircle3Points::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
if ( mPoints.size() < 2 )
mPoints.append( mapPoint );

if ( !mPoints.isEmpty() )
if ( !mPoints.isEmpty() && !mTempRubberBand )
{
if ( !mTempRubberBand )
{
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
}
else if ( e->button() == Qt::RightButton )
@@ -35,14 +35,12 @@ void QgsMapToolCircleCenterPoint::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{
mPoints.append( mapPoint );

if ( !mPoints.isEmpty() )
if ( !mPoints.isEmpty() && !mTempRubberBand )
{
if ( !mTempRubberBand )
{
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}

}
else if ( e->button() == Qt::RightButton )
{
@@ -38,13 +38,10 @@ void QgsMapToolEllipseCenter2Points::cadCanvasReleaseEvent( QgsMapMouseEvent *e
if ( mPoints.size() < 2 )
mPoints.append( mapPoint );

if ( !mPoints.isEmpty() )
if ( !mPoints.isEmpty() && !mTempRubberBand )
{
if ( !mTempRubberBand )
{
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
}
else if ( e->button() == Qt::RightButton )
@@ -35,13 +35,10 @@ void QgsMapToolEllipseCenterPoint::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{
mPoints.append( mapPoint );

if ( !mPoints.isEmpty() )
if ( !mPoints.isEmpty() && !mTempRubberBand )
{
if ( !mTempRubberBand )
{
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
}
else if ( e->button() == Qt::RightButton )
@@ -35,13 +35,10 @@ void QgsMapToolEllipseExtent::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{
mPoints.append( mapPoint );

if ( !mPoints.isEmpty() )
if ( !mPoints.isEmpty() && !mTempRubberBand )
{
if ( !mTempRubberBand )
{
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
}
else if ( e->button() == Qt::RightButton )
@@ -36,13 +36,10 @@ void QgsMapToolEllipseFoci::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{
mPoints.append( mapPoint );

if ( !mPoints.isEmpty() )
if ( !mPoints.isEmpty() && !mTempRubberBand )
{
if ( !mTempRubberBand )
{
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
}
else if ( e->button() == Qt::RightButton )
@@ -38,14 +38,12 @@ void QgsMapToolRectangle3Points::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
if ( mPoints.size() < 2 )
mPoints.append( mapPoint );

if ( !mPoints.isEmpty() )
if ( !mPoints.isEmpty() && !mTempRubberBand )
{
if ( !mTempRubberBand )
{
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}

}
else if ( e->button() == Qt::RightButton )
{
@@ -37,14 +37,12 @@ void QgsMapToolRectangleCenter::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{
mPoints.append( mapPoint );

if ( !mPoints.isEmpty() )
if ( !mPoints.isEmpty() && !mTempRubberBand )
{
if ( !mTempRubberBand )
{
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}

}
else if ( e->button() == Qt::RightButton )
{
@@ -36,14 +36,12 @@ void QgsMapToolRectangleExtent::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{
mPoints.append( mapPoint );

if ( !mPoints.isEmpty() )
if ( !mPoints.isEmpty() && !mTempRubberBand )
{
if ( !mTempRubberBand )
{
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}

}
else if ( e->button() == Qt::RightButton )
{
@@ -41,14 +41,12 @@ void QgsMapToolSquareCenter::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
{
mPoints.append( mapPoint );

if ( !mPoints.isEmpty() )
if ( !mPoints.isEmpty() && !mTempRubberBand )
{
if ( !mTempRubberBand )
{
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}
mTempRubberBand = createGeometryRubberBand( ( mode() == CapturePolygon ) ? QgsWkbTypes::PolygonGeometry : QgsWkbTypes::LineGeometry, true );
mTempRubberBand->show();
}

}
else if ( e->button() == Qt::RightButton )
{

0 comments on commit de80f44

Please sign in to comment.
You can’t perform that action at this time.