Skip to content

Commit 8aeffdb

Browse files
committedSep 10, 2017
Reduce debugging noise when using curved geometries
1 parent 1b588c8 commit 8aeffdb

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed
 

‎src/core/geometry/qgscircularstring.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,6 @@ QgsLineString *QgsCircularString::curveToLine( double tolerance, SegmentationTol
354354
QgsPointSequence points;
355355
int nPoints = numPoints();
356356

357-
QgsDebugMsg( QString( "curveToLine input: %1" ) .arg( asWkt( 2 ) ) );
358357
for ( int i = 0; i < ( nPoints - 2 ) ; i += 2 )
359358
{
360359
QgsGeometryUtils::segmentizeArc( pointN( i ), pointN( i + 1 ), pointN( i + 2 ), points, tolerance, toleranceType, is3D(), isMeasure() );

‎src/core/geometry/qgsgeometryutils.cpp

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,8 @@ void QgsGeometryUtils::segmentizeArc( const QgsPoint &p1, const QgsPoint &p2, co
658658
double centerY = 0;
659659
circleCenterRadius( circlePoint1, circlePoint2, circlePoint3, radius, centerX, centerY );
660660

661-
QgsDebugMsg( QString( "Center: POINT(%1 %2) - Radius: %3 - Reversed: %4" )
662-
.arg( centerX ) .arg( centerY ) .arg( radius ) .arg( reversed ) );
663-
664661
if ( circlePoint1 != circlePoint3 && ( radius < 0 || qgsDoubleNear( segSide, 0.0 ) ) ) //points are colinear
665662
{
666-
QgsDebugMsg( QString( "Collinear curve" ) );
667663
points.append( p1 );
668664
points.append( p2 );
669665
points.append( p3 );
@@ -676,34 +672,23 @@ void QgsGeometryUtils::segmentizeArc( const QgsPoint &p1, const QgsPoint &p2, co
676672
double halfAngle = std::acos( -tolerance / radius + 1 );
677673
increment = 2 * halfAngle;
678674
}
679-
QgsDebugMsg( QString( "Increment: %1" ).arg( increment ) );
680675

681676
//angles of pt1, pt2, pt3
682677
double a1 = std::atan2( circlePoint1.y() - centerY, circlePoint1.x() - centerX );
683678
double a2 = std::atan2( circlePoint2.y() - centerY, circlePoint2.x() - centerX );
684679
double a3 = std::atan2( circlePoint3.y() - centerY, circlePoint3.x() - centerX );
685680

686-
QgsDebugMsg( QString( "a1:%1 (%4) a2:%2 (%5) a3:%3 (%6)" )
687-
.arg( a1 ).arg( a2 ).arg( a3 )
688-
.arg( a1 * 180 / M_PI ).arg( a2 * 180 / M_PI ).arg( a3 * 180 / M_PI )
689-
);
690-
691681
// Make segmentation symmetric
692682
const bool symmetric = true;
693683
if ( symmetric )
694684
{
695685
double angle = a3 - a1;
696686
if ( angle < 0 ) angle += M_PI * 2;
697-
QgsDebugMsg( QString( "total angle: %1 (%2)" )
698-
.arg( angle ) .arg( angle * 180 / M_PI )
699-
);
700687

701688
/* Number of segments in output */
702689
int segs = ceil( angle / increment );
703690
/* Tweak increment to be regular for all the arc */
704691
increment = angle / segs;
705-
706-
QgsDebugMsg( QString( "symmetric adjusted increment:%1" ) .arg( increment ) );
707692
}
708693

709694
/* Adjust a3 up so we can increment from a1 to a3 cleanly */
@@ -712,11 +697,6 @@ void QgsGeometryUtils::segmentizeArc( const QgsPoint &p1, const QgsPoint &p2, co
712697
if ( a2 < a1 )
713698
a2 += 2.0 * M_PI;
714699

715-
QgsDebugMsg( QString( "ADJUSTED - a1:%1 (%4) a2:%2 (%5) a3:%3 (%6)" )
716-
.arg( a1 ).arg( a2 ).arg( a3 )
717-
.arg( a1 * 180 / M_PI ).arg( a2 * 180 / M_PI ).arg( a3 * 180 / M_PI )
718-
);
719-
720700
double x, y;
721701
double z = 0;
722702
double m = 0;
@@ -731,12 +711,6 @@ void QgsGeometryUtils::segmentizeArc( const QgsPoint &p1, const QgsPoint &p2, co
731711
if ( hasM )
732712
pointWkbType = QgsWkbTypes::addM( pointWkbType );
733713

734-
QgsDebugMsg( QString( "a1:%1 (%2), a3:%3 (%4), inc:%5" )
735-
. arg( a1 ). arg( a1 * 180 / M_PI )
736-
. arg( a3 ). arg( a3 * 180 / M_PI )
737-
. arg( increment )
738-
);
739-
740714
// As we're adding the last point in any case, we'll avoid
741715
// including a point which is at less than 1% increment distance
742716
// from it (may happen to find them due to numbers approximation).
@@ -745,11 +719,8 @@ void QgsGeometryUtils::segmentizeArc( const QgsPoint &p1, const QgsPoint &p2, co
745719
// from requested MaxAngle and less for MaxError.
746720
double tolError = increment / 100;
747721
double stopAngle = a3 - tolError;
748-
QgsDebugMsg( QString( "stopAngle: %1 (%2)" ) . arg( stopAngle ) .arg( stopAngle * 180 / M_PI ) );
749722
for ( double angle = a1 + increment; angle < stopAngle; angle += increment )
750723
{
751-
QgsDebugMsg( QString( "SA - %1 (%2)" ) . arg( angle ) .arg( angle * 180 / M_PI ) );
752-
753724
x = centerX + radius * std::cos( angle );
754725
y = centerY + radius * std::sin( angle );
755726

@@ -762,11 +733,9 @@ void QgsGeometryUtils::segmentizeArc( const QgsPoint &p1, const QgsPoint &p2, co
762733
m = interpolateArcValue( angle, a1, a2, a3, circlePoint1.m(), circlePoint2.m(), circlePoint3.m() );
763734
}
764735

765-
QgsDebugMsg( QString( " -> POINT(%1 %2)" ) . arg( x ) .arg( y ) );
766736
stringPoints.insert( stringPoints.size(), QgsPoint( pointWkbType, x, y, z, m ) );
767737
}
768738
}
769-
QgsDebugMsg( QString( " appending last point -> POINT(%1 %2)" ) . arg( circlePoint3.x() ) .arg( circlePoint3.y() ) );
770739
stringPoints.insert( stringPoints.size(), circlePoint3 );
771740

772741
// TODO: check if or implement QgsPointSequence directly taking an iterator to append

0 commit comments

Comments
 (0)
Please sign in to comment.