Skip to content
Permalink
Browse files

[tracing curves] (cleanup & test)

  • Loading branch information
olivierdalang committed May 14, 2020
1 parent 936cc21 commit 784ddd9ea1d3eef0e9ece943828c9f00c2d35eb9
Showing with 4 additions and 8 deletions.
  1. +0 −1 src/gui/qgsmaptoolcapture.cpp
  2. +4 −7 tests/src/app/testqgsmaptooladdfeatureline.cpp
@@ -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"
@@ -302,7 +302,6 @@ void TestQgsMapToolAddFeatureLine::testTracing()
mEnableTracingAction->setChecked( false );
}


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


void TestQgsMapToolAddFeatureLine::testTracingWithConvertToCurves()
{
TestQgsMapToolAdvancedDigitizingUtils utils( mCaptureTool );
@@ -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();
@@ -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();
@@ -432,7 +430,6 @@ void TestQgsMapToolAddFeatureLine::testTracingWithConvertToCurves()
mEnableTracingAction->setChecked( false );
}


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

0 comments on commit 784ddd9

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