Skip to content
Permalink
Browse files

Minor fixes in intersection removal for the reshape tool

  • Loading branch information
Hugo Mercier
Hugo Mercier committed Apr 25, 2016
1 parent 44cccfc commit 181c0c4e12c6b16f69d1e77a545884f98fdf7a86
Showing with 8 additions and 6 deletions.
  1. +8 −6 src/app/qgsmaptoolreshape.cpp
@@ -103,19 +103,21 @@ void QgsMapToolReshape::cadCanvasReleaseEvent( QgsMapMouseEvent * e )
//avoid intersections on polygon layers
if ( vlayer->geometryType() == QGis::Polygon )
{

//ignore all current layer features as they should be reshaped too
QMap<QgsVectorLayer*, QSet<QgsFeatureId>> ignoreFeatures;
ignoreFeatures.insert( vlayer, vlayer->allFeatureIds() );

int avoidIntersectionsReturn = geom->avoidIntersections( ignoreFeatures );
if ( avoidIntersectionsReturn == 1 )
if ( geom->avoidIntersections( ignoreFeatures ) != 0 )
{
//not a polygon type. Impossible to get there
emit messageEmitted( tr( "An error was reported during intersection removal" ), QgsMessageBar::CRITICAL );
vlayer->destroyEditCommand();
stopCapturing();
return;
}
if ( geom->isGeosEmpty() ) //avoid intersection might have removed the whole geometry

if ( geom->isGeosEmpty() ) //intersection removal might have removed the whole geometry
{
emit messageEmitted( tr( "The feature cannot be reshaped because resulting geometry is empty" ), QgsMessageBar::CRITICAL );
emit messageEmitted( tr( "The feature cannot be reshaped because the resulting geometry is empty" ), QgsMessageBar::CRITICAL );
vlayer->destroyEditCommand();
stopCapturing();
return;

0 comments on commit 181c0c4

Please sign in to comment.