Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[tracing curves] (cleanup & test)
  • Loading branch information
olivierdalang committed May 14, 2020
1 parent 936cc21 commit 784ddd9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/gui/qgsmaptoolcapture.cpp
Expand Up @@ -23,7 +23,6 @@
#include "qgsmapcanvas.h"
#include "qgsmapcanvastracer.h"
#include "qgsmapmouseevent.h"
#include "qgsogrutils.h"
#include "qgspolygon.h"
#include "qgsrubberband.h"
#include "qgssnapindicator.h"
Expand Down
11 changes: 4 additions & 7 deletions tests/src/app/testqgsmaptooladdfeatureline.cpp
Expand Up @@ -302,7 +302,6 @@ void TestQgsMapToolAddFeatureLine::testTracing()
mEnableTracingAction->setChecked( false );
}


void TestQgsMapToolAddFeatureLine::testTracingWithOffset()
{
TestQgsMapToolAdvancedDigitizingUtils utils( mCaptureTool );
Expand Down Expand Up @@ -381,7 +380,6 @@ void TestQgsMapToolAddFeatureLine::testTracingWithOffset()
mEnableTracingAction->setChecked( false );
}


void TestQgsMapToolAddFeatureLine::testTracingWithConvertToCurves()
{
TestQgsMapToolAdvancedDigitizingUtils utils( mCaptureTool );
Expand All @@ -403,8 +401,8 @@ void TestQgsMapToolAddFeatureLine::testTracingWithConvertToCurves()
QgsFeatureId newFid1 = utils.newFeatureId( oldFids );

const QgsAbstractGeometry *g = mLayerLineCurved->getFeature( newFid1 ).geometry().constGet();
QCOMPARE( g->vertexAt( QgsVertexId( 0, 0, 0 ) ), QgsPointXY( 6, 1 ) );
QCOMPARE( g->vertexAt( QgsVertexId( 0, 0, g->vertexCount() - 1 ) ), QgsPointXY( 7, 1 ) );
QCOMPARE( g->vertexAt( QgsVertexId( 0, 0, 0 ) ), QgsPoint( 6, 1 ) );
QCOMPARE( g->vertexAt( QgsVertexId( 0, 0, g->vertexCount() - 1 ) ), QgsPoint( 7, 1 ) );
QVERIFY( g->vertexCount() > 3 ); // a segmentized arc has (much) more than 3 points

mLayerLineCurved->undoStack()->undo();
Expand All @@ -420,8 +418,8 @@ void TestQgsMapToolAddFeatureLine::testTracingWithConvertToCurves()
QgsFeatureId newFid2 = utils.newFeatureId( oldFids );

g = mLayerLineCurved->getFeature( newFid2 ).geometry().constGet();
QCOMPARE( g->vertexAt( QgsVertexId( 0, 0, 0 ) ), QgsPointXY( 6, 1 ) );
QCOMPARE( g->vertexAt( QgsVertexId( 0, 0, g->vertexCount() - 1 ) ), QgsPointXY( 7, 1 ) );
QCOMPARE( g->vertexAt( QgsVertexId( 0, 0, 0 ) ), QgsPoint( 6, 1 ) );
QCOMPARE( g->vertexAt( QgsVertexId( 0, 0, g->vertexCount() - 1 ) ), QgsPoint( 7, 1 ) );
QVERIFY( g->vertexCount() == 3 ); // a true arc is composed of 3 vertices

mLayerLineCurved->undoStack()->undo();
Expand All @@ -432,7 +430,6 @@ void TestQgsMapToolAddFeatureLine::testTracingWithConvertToCurves()
mEnableTracingAction->setChecked( false );
}


void TestQgsMapToolAddFeatureLine::testZ()
{
TestQgsMapToolAdvancedDigitizingUtils utils( mCaptureTool );
Expand Down

0 comments on commit 784ddd9

Please sign in to comment.