Skip to content

Commit acebb97

Browse files
committedMar 29, 2017
Remove debugging output to track down travis failure
1 parent 102a90a commit acebb97

File tree

4 files changed

+4
-71
lines changed

4 files changed

+4
-71
lines changed
 

‎src/app/nodetool/qgsnodetool2.cpp

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,6 @@ void QgsNodeTool2::clearDragBands()
240240

241241
void QgsNodeTool2::cadCanvasPressEvent( QgsMapMouseEvent *e )
242242
{
243-
qDebug( "PRESS %d,%d", e->pos().x(), e->pos().y() );
244-
245243
setHighlightedNodes( QList<Vertex>() ); // reset selection
246244

247245
if ( e->button() == Qt::LeftButton )
@@ -266,8 +264,6 @@ void QgsNodeTool2::cadCanvasPressEvent( QgsMapMouseEvent *e )
266264

267265
void QgsNodeTool2::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
268266
{
269-
qDebug( "RELEASE %d,%d", e->pos().x(), e->pos().y() );
270-
271267
if ( mNewVertexFromDoubleClick )
272268
{
273269
QgsPointLocator::Match m( *mNewVertexFromDoubleClick );
@@ -314,25 +310,21 @@ void QgsNodeTool2::cadCanvasReleaseEvent( QgsMapMouseEvent *e )
314310
}
315311
else // selection rect is not being dragged
316312
{
317-
qDebug( "release: no selection rect!" );
318313
if ( e->button() == Qt::LeftButton )
319314
{
320315
// accepting action
321316
if ( mDraggingVertex )
322317
{
323318
QgsPointLocator::Match match = e->mapPointMatch();
324-
qDebug( "release: move vertex" );
325319
moveVertex( e->mapPoint(), &match );
326320
}
327321
else if ( mDraggingEdge )
328322
{
329323
// do not use e.mapPoint() as it may be snapped
330-
qDebug( "release: move edge" );
331324
moveEdge( toMapCoordinates( e->pos() ) );
332325
}
333326
else
334327
{
335-
qDebug( "release: start dragging" );
336328
startDragging( e );
337329
}
338330
}
@@ -474,14 +466,12 @@ QgsPointLocator::Match QgsNodeTool2::snapToEditableLayer( QgsMapMouseEvent *e )
474466
{
475467
QgsPoint mapPoint = toMapCoordinates( e->pos() );
476468
double tol = QgsTolerance::vertexSearchRadius( canvas()->mapSettings() );
477-
qDebug( "snap: pt %f,%f tol %f", mapPoint.x(), mapPoint.y(), tol );
478469

479470
QgsSnappingConfig config( QgsProject::instance() );
480471
config.setEnabled( true );
481472
config.setMode( QgsSnappingConfig::AdvancedConfiguration );
482473
config.setIntersectionSnapping( false ); // only snap to layers
483474

484-
qDebug( "canvas layers: %d", canvas()->layers().count() );
485475
Q_FOREACH ( QgsMapLayer *layer, canvas()->layers() )
486476
{
487477
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
@@ -490,7 +480,6 @@ QgsPointLocator::Match QgsNodeTool2::snapToEditableLayer( QgsMapMouseEvent *e )
490480

491481
config.setIndividualLayerSettings( vlayer, QgsSnappingConfig::IndividualLayerSettings(
492482
true, QgsSnappingConfig::VertexAndSegment, tol, QgsTolerance::ProjectUnits ) );
493-
qDebug( "will use layer %s tolerance %f", vlayer->name().toAscii().data(), tol );
494483
}
495484

496485
QgsSnappingUtils *snapUtils = canvas()->snappingUtils();
@@ -736,13 +725,11 @@ void QgsNodeTool2::startDragging( QgsMapMouseEvent *e )
736725
QgsPoint mapPoint = toMapCoordinates( e->pos() );
737726
if ( isNearEndpointMarker( mapPoint ) )
738727
{
739-
qDebug( "start drag at endpoint" );
740728
startDraggingAddVertexAtEndpoint( mapPoint );
741729
return;
742730
}
743731

744732
QgsPointLocator::Match m = snapToEditableLayer( e );
745-
qDebug( "match type: %d", m.type() );
746733
if ( !m.isValid() )
747734
return;
748735

@@ -752,7 +739,6 @@ void QgsNodeTool2::startDragging( QgsMapMouseEvent *e )
752739
// adding a new vertex instead of moving a vertex
753740
if ( m.hasEdge() )
754741
{
755-
qDebug( "dragging edge!" );
756742
// only start dragging if we are near edge center
757743
mapPoint = toMapCoordinates( e->pos() );
758744
bool isNearCenter = matchEdgeCenterTest( m, mapPoint );
@@ -763,7 +749,6 @@ void QgsNodeTool2::startDragging( QgsMapMouseEvent *e )
763749
}
764750
else // vertex
765751
{
766-
qDebug( "dragging vertex!" );
767752
startDraggingMoveVertex( e->mapPoint(), m );
768753
}
769754
}
@@ -1027,12 +1012,11 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::
10271012
stopDragging();
10281013

10291014
QgsPoint layerPoint = matchToLayerPoint( dragLayer, mapPoint, mapPointMatch );
1030-
qDebug( "layer pt: %f,%f", layerPoint.x(), layerPoint.y() );
10311015

10321016
QgsVertexId vid;
10331017
if ( !geom.vertexIdFromVertexNr( dragVertexId, vid ) )
10341018
{
1035-
qDebug( "invalid vertex index" );
1019+
QgsDebugMsg( "invalid vertex index" );
10361020
return;
10371021
}
10381022

@@ -1046,15 +1030,15 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::
10461030

10471031
if ( !geomTmp->insertVertex( vid, QgsPointV2( layerPoint ) ) )
10481032
{
1049-
qDebug( "append vertex failed!" );
1033+
QgsDebugMsg( "append vertex failed!" );
10501034
return;
10511035
}
10521036
}
10531037
else
10541038
{
10551039
if ( !geomTmp->moveVertex( vid, QgsPointV2( layerPoint ) ) )
10561040
{
1057-
qDebug( "move vertex failed!" );
1041+
QgsDebugMsg( "move vertex failed!" );
10581042
return;
10591043
}
10601044
}
@@ -1082,7 +1066,7 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::
10821066

10831067
if ( !topoGeom.moveVertex( point.x(), point.y(), topo.vertexId ) )
10841068
{
1085-
qDebug( "[topo] move vertex failed!" );
1069+
QgsDebugMsg( "[topo] move vertex failed!" );
10861070
continue;
10871071
}
10881072
edits[topo.layer][topo.fid] = topoGeom;
@@ -1092,8 +1076,6 @@ void QgsNodeTool2::moveVertex( const QgsPoint &mapPoint, const QgsPointLocator::
10921076

10931077
// TODO: add topological points: when moving vertex - if snapped to something
10941078

1095-
qDebug( "writing changes now" );
1096-
10971079
// do the changes to layers
10981080
QHash<QgsVectorLayer *, QHash<QgsFeatureId, QgsGeometry> >::iterator it = edits.begin();
10991081
for ( ; it != edits.end(); ++it )

‎src/core/qgspointlocator.cpp

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -104,29 +104,18 @@ class QgsPointLocator_VisitorNearestVertex : public IVisitor
104104
QgsGeometry *geom = mLocator->mGeoms.value( id );
105105
int vertexIndex, beforeVertex, afterVertex;
106106
double sqrDist;
107-
qDebug( "VISIT %s", geom->exportToWkt().toAscii().data() );
108107

109108
QgsPoint pt = geom->closestVertex( mSrcPoint, vertexIndex, beforeVertex, afterVertex, sqrDist );
110109
if ( sqrDist < 0 )
111-
{
112-
qDebug( "negative res!!!! (closestVertex)" );
113110
return; // probably empty geometry
114-
}
115111

116112
QgsPointLocator::Match m( QgsPointLocator::Vertex, mLocator->mLayer, id, sqrt( sqrDist ), pt, vertexIndex );
117-
qDebug( "closest vertex dist %f", sqrt( sqrDist ) );
118113
// in range queries the filter may reject some matches
119114
if ( mFilter && !mFilter->acceptMatch( m ) )
120-
{
121-
qDebug( "filtered out!!!!" );
122115
return;
123-
}
124116

125117
if ( !mBest.isValid() || m.distance() < mBest.distance() )
126-
{
127118
mBest = m;
128-
qDebug( "is best!" );
129-
}
130119
}
131120

132121
private:
@@ -685,7 +674,6 @@ bool QgsPointLocator::hasIndex() const
685674

686675
bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )
687676
{
688-
qDebug( "rebuild index" );
689677
destroyIndex();
690678

691679
QLinkedList<RTree::Data *> dataList;
@@ -712,15 +700,12 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )
712700
QgsDebugMsg( QString( "could not transform bounding box to map, skipping the snap filter (%1)" ).arg( e.what() ) );
713701
}
714702
}
715-
qDebug( "index extent %s", rect.toString().toAscii().data() );
716703
request.setFilterRect( rect );
717704
}
718705
QgsFeatureIterator fi = mLayer->getFeatures( request );
719706
int indexedCount = 0;
720707
while ( fi.nextFeature( f ) )
721708
{
722-
qDebug( "feature %d", ( int )f.id() );
723-
724709
if ( !f.hasGeometry() )
725710
continue;
726711

@@ -741,8 +726,6 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )
741726
}
742727
}
743728

744-
qDebug( "adding feature to index: %d %s", ( int )f.id(), f.geometry().boundingBox().toString().toAscii().data() );
745-
746729
SpatialIndex::Region r( rect2region( f.geometry().boundingBox() ) );
747730
dataList << new RTree::Data( 0, nullptr, r, f.id() );
748731

@@ -769,7 +752,6 @@ bool QgsPointLocator::rebuildIndex( int maxFeaturesToIndex )
769752

770753
if ( dataList.isEmpty() )
771754
{
772-
qDebug( "empty :(" );
773755
mIsEmptyLayer = true;
774756
return true; // no features
775757
}
@@ -860,28 +842,19 @@ void QgsPointLocator::onGeometryChanged( QgsFeatureId fid, const QgsGeometry &ge
860842

861843
QgsPointLocator::Match QgsPointLocator::nearestVertex( const QgsPoint &point, double tolerance, MatchFilter *filter )
862844
{
863-
qDebug( "nearestVertex %f,%f tol %f", point.x(), point.y(), tolerance );
864845
if ( !mRTree )
865846
{
866847
init();
867848
if ( !mRTree ) // still invalid?
868-
{
869-
qDebug( "!!!!!" );
870849
return Match();
871-
}
872850
}
873851

874852
Match m;
875853
QgsPointLocator_VisitorNearestVertex visitor( this, m, point, filter );
876854
QgsRectangle rect( point.x() - tolerance, point.y() - tolerance, point.x() + tolerance, point.y() + tolerance );
877-
qDebug( "search rect %s", rect.toString().toAscii().data() );
878855
mRTree->intersectsWithQuery( rect2region( rect ), visitor );
879-
qDebug( "nearestVertex res %d..%f", m.type(), m.distance() );
880856
if ( m.isValid() && m.distance() > tolerance )
881-
{
882-
qDebug( "outside!" );
883857
return Match(); // make sure that only match strictly within the tolerance is returned
884-
}
885858
return m;
886859
}
887860

‎src/core/qgssnappingutils.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,6 @@ static QgsPointLocator::Match _findClosestSegmentIntersection( const QgsPoint &p
166166

167167
static void _replaceIfBetter( QgsPointLocator::Match &mBest, const QgsPointLocator::Match &mNew, double maxDistance )
168168
{
169-
qDebug( "replace: old %d..%f / new %d..%f", mBest.type(), mBest.distance(), mNew.type(), mNew.distance() );
170169
// is other match relevant?
171170
if ( !mNew.isValid() || mNew.distance() > maxDistance )
172171
return;
@@ -180,7 +179,6 @@ static void _replaceIfBetter( QgsPointLocator::Match &mBest, const QgsPointLocat
180179
return;
181180

182181
mBest = mNew; // the other match is better!
183-
qDebug( "using it!" );
184182
}
185183

186184

@@ -212,7 +210,6 @@ QgsPointLocator::Match QgsSnappingUtils::snapToMap( const QgsPoint &pointMap, Qg
212210
{
213211
if ( !mMapSettings.hasValidSettings() || !mSnappingConfig.enabled() )
214212
{
215-
qDebug( "snapToMap invalid" );
216213
return QgsPointLocator::Match();
217214
}
218215

@@ -246,7 +243,6 @@ QgsPointLocator::Match QgsSnappingUtils::snapToMap( const QgsPoint &pointMap, Qg
246243
}
247244
else if ( mSnappingConfig.mode() == QgsSnappingConfig::AdvancedConfiguration )
248245
{
249-
qDebug( "snap to map advanced" );
250246
QList<LayerAndAreaOfInterest> layers;
251247
Q_FOREACH ( const LayerConfig &layerConfig, mLayers )
252248
{
@@ -261,11 +257,9 @@ QgsPointLocator::Match QgsSnappingUtils::snapToMap( const QgsPoint &pointMap, Qg
261257

262258
Q_FOREACH ( const LayerConfig &layerConfig, mLayers )
263259
{
264-
qDebug( "snap - layer - %s", layerConfig.layer->name().toAscii().data() );
265260
double tolerance = QgsTolerance::toleranceInProjectUnits( layerConfig.tolerance, layerConfig.layer, mMapSettings, layerConfig.unit );
266261
if ( QgsPointLocator *loc = locatorForLayerUsingStrategy( layerConfig.layer, pointMap, tolerance ) )
267262
{
268-
qDebug( "got locator" );
269263
_updateBestMatch( bestMatch, pointMap, loc, layerConfig.type, tolerance, filter );
270264

271265
if ( mSnappingConfig.intersectionSnapping() )
@@ -321,7 +315,6 @@ QgsPointLocator::Match QgsSnappingUtils::snapToMap( const QgsPoint &pointMap, Qg
321315

322316
void QgsSnappingUtils::prepareIndex( const QList<LayerAndAreaOfInterest> &layers )
323317
{
324-
qDebug( "prep index" );
325318
if ( mIsIndexing )
326319
return;
327320
mIsIndexing = true;
@@ -337,7 +330,6 @@ void QgsSnappingUtils::prepareIndex( const QList<LayerAndAreaOfInterest> &layers
337330
if ( !isIndexPrepared( vl, entry.second ) )
338331
layersToIndex << entry;
339332
}
340-
qDebug( "layers to index: %d", layersToIndex.count() );
341333
if ( !layersToIndex.isEmpty() )
342334
{
343335
// build indexes
@@ -407,11 +399,9 @@ void QgsSnappingUtils::prepareIndex( const QList<LayerAndAreaOfInterest> &layers
407399
loc->init();
408400

409401
QgsDebugMsg( QString( "Index init: %1 ms (%2)" ).arg( tt.elapsed() ).arg( vl->id() ) );
410-
qDebug( "Index init: %d ms (%s)", tt.elapsed(), vl->name().toAscii().data() );
411402
prepareIndexProgress( ++i );
412403
}
413404
QgsDebugMsg( QString( "Prepare index total: %1 ms" ).arg( t.elapsed() ) );
414-
qDebug( "Prepare index total: %d ms", t.elapsed() );
415405
}
416406
mIsIndexing = false;
417407
}

‎tests/src/app/testqgsnodetool.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ class TestQgsNodeTool : public QObject
6161
void testAddVertexAtEndpoint();
6262
void testDeleteVertex();
6363

64-
void undoChanged(); // TODO
65-
6664
private:
6765
QPoint mapToScreen( double mapX, double mapY )
6866
{
@@ -127,7 +125,6 @@ void TestQgsNodeTool::initTestCase()
127125

128126
mCanvas = new QgsMapCanvas();
129127

130-
qDebug( "canvas crs %s", mCanvas->mapSettings().destinationCrs().authid().toAscii().data() );
131128
mCanvas->setDestinationCrs( QgsCoordinateReferenceSystem( "EPSG:27700" ) );
132129

133130
mAdvancedDigitizingDockWidget = new QgsAdvancedDigitizingDockWidget( mCanvas );
@@ -176,8 +173,6 @@ void TestQgsNodeTool::initTestCase()
176173
QCOMPARE( mLayerPolygon->undoStack()->index(), 1 );
177174
QCOMPARE( mLayerPoint->undoStack()->index(), 1 );
178175

179-
connect( mLayerLine->undoStack(), &QUndoStack::indexChanged, this, &TestQgsNodeTool::undoChanged );
180-
181176
mCanvas->setFrameStyle( QFrame::NoFrame );
182177
mCanvas->resize( 512, 512 );
183178
mCanvas->setExtent( QgsRectangle( 0, 0, 8, 8 ) );
@@ -188,8 +183,6 @@ void TestQgsNodeTool::initTestCase()
188183

189184
mCanvas->setLayers( QList<QgsMapLayer *>() << mLayerLine << mLayerPolygon << mLayerPoint );
190185

191-
qDebug( "line layer extent: %s", mLayerLine->extent().toString().toAscii().data() );
192-
193186
// TODO: set up snapping
194187

195188
mCanvas->setSnappingUtils( new QgsMapCanvasSnappingUtils( mCanvas, this ) );
@@ -209,11 +202,6 @@ void TestQgsNodeTool::cleanupTestCase()
209202
QgsApplication::exitQgis();
210203
}
211204

212-
void TestQgsNodeTool::undoChanged()
213-
{
214-
qDebug( "UNDO CHANGED" );
215-
}
216-
217205
void TestQgsNodeTool::testMoveVertex()
218206
{
219207
QCOMPARE( mCanvas->mapSettings().outputSize(), QSize( 512, 512 ) );

0 commit comments

Comments
 (0)
Please sign in to comment.