@@ -658,12 +658,8 @@ void QgsGeometryUtils::segmentizeArc( const QgsPoint &p1, const QgsPoint &p2, co
658
658
double centerY = 0 ;
659
659
circleCenterRadius ( circlePoint1, circlePoint2, circlePoint3, radius, centerX, centerY );
660
660
661
- QgsDebugMsg ( QString ( " Center: POINT(%1 %2) - Radius: %3 - Reversed: %4" )
662
- .arg ( centerX ) .arg ( centerY ) .arg ( radius ) .arg ( reversed ) );
663
-
664
661
if ( circlePoint1 != circlePoint3 && ( radius < 0 || qgsDoubleNear ( segSide, 0.0 ) ) ) // points are colinear
665
662
{
666
- QgsDebugMsg ( QString ( " Collinear curve" ) );
667
663
points.append ( p1 );
668
664
points.append ( p2 );
669
665
points.append ( p3 );
@@ -676,34 +672,23 @@ void QgsGeometryUtils::segmentizeArc( const QgsPoint &p1, const QgsPoint &p2, co
676
672
double halfAngle = std::acos ( -tolerance / radius + 1 );
677
673
increment = 2 * halfAngle;
678
674
}
679
- QgsDebugMsg ( QString ( " Increment: %1" ).arg ( increment ) );
680
675
681
676
// angles of pt1, pt2, pt3
682
677
double a1 = std::atan2 ( circlePoint1.y () - centerY, circlePoint1.x () - centerX );
683
678
double a2 = std::atan2 ( circlePoint2.y () - centerY, circlePoint2.x () - centerX );
684
679
double a3 = std::atan2 ( circlePoint3.y () - centerY, circlePoint3.x () - centerX );
685
680
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
-
691
681
// Make segmentation symmetric
692
682
const bool symmetric = true ;
693
683
if ( symmetric )
694
684
{
695
685
double angle = a3 - a1;
696
686
if ( angle < 0 ) angle += M_PI * 2 ;
697
- QgsDebugMsg ( QString ( " total angle: %1 (%2)" )
698
- .arg ( angle ) .arg ( angle * 180 / M_PI )
699
- );
700
687
701
688
/* Number of segments in output */
702
689
int segs = ceil ( angle / increment );
703
690
/* Tweak increment to be regular for all the arc */
704
691
increment = angle / segs;
705
-
706
- QgsDebugMsg ( QString ( " symmetric adjusted increment:%1" ) .arg ( increment ) );
707
692
}
708
693
709
694
/* 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
712
697
if ( a2 < a1 )
713
698
a2 += 2.0 * M_PI;
714
699
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
-
720
700
double x, y;
721
701
double z = 0 ;
722
702
double m = 0 ;
@@ -731,12 +711,6 @@ void QgsGeometryUtils::segmentizeArc( const QgsPoint &p1, const QgsPoint &p2, co
731
711
if ( hasM )
732
712
pointWkbType = QgsWkbTypes::addM ( pointWkbType );
733
713
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
-
740
714
// As we're adding the last point in any case, we'll avoid
741
715
// including a point which is at less than 1% increment distance
742
716
// 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
745
719
// from requested MaxAngle and less for MaxError.
746
720
double tolError = increment / 100 ;
747
721
double stopAngle = a3 - tolError;
748
- QgsDebugMsg ( QString ( " stopAngle: %1 (%2)" ) . arg ( stopAngle ) .arg ( stopAngle * 180 / M_PI ) );
749
722
for ( double angle = a1 + increment; angle < stopAngle; angle += increment )
750
723
{
751
- QgsDebugMsg ( QString ( " SA - %1 (%2)" ) . arg ( angle ) .arg ( angle * 180 / M_PI ) );
752
-
753
724
x = centerX + radius * std::cos ( angle );
754
725
y = centerY + radius * std::sin ( angle );
755
726
@@ -762,11 +733,9 @@ void QgsGeometryUtils::segmentizeArc( const QgsPoint &p1, const QgsPoint &p2, co
762
733
m = interpolateArcValue ( angle, a1, a2, a3, circlePoint1.m (), circlePoint2.m (), circlePoint3.m () );
763
734
}
764
735
765
- QgsDebugMsg ( QString ( " -> POINT(%1 %2)" ) . arg ( x ) .arg ( y ) );
766
736
stringPoints.insert ( stringPoints.size (), QgsPoint ( pointWkbType, x, y, z, m ) );
767
737
}
768
738
}
769
- QgsDebugMsg ( QString ( " appending last point -> POINT(%1 %2)" ) . arg ( circlePoint3.x () ) .arg ( circlePoint3.y () ) );
770
739
stringPoints.insert ( stringPoints.size (), circlePoint3 );
771
740
772
741
// TODO: check if or implement QgsPointSequence directly taking an iterator to append
0 commit comments