From 57bf9daaac6245b9f62e8ad01900b046210b381e Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Tue, 13 Jun 2017 15:59:32 +0200 Subject: [PATCH] Document semantic of SegmentationToleranceType .. and default of QgsCircularString::curveToLine [ci skip] --- python/core/geometry/qgsabstractgeometry.sip | 2 ++ python/core/geometry/qgscircularstring.sip | 5 ++++- src/core/geometry/qgsabstractgeometry.h | 6 ++++++ src/core/geometry/qgscircularstring.h | 6 +++++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/python/core/geometry/qgsabstractgeometry.sip b/python/core/geometry/qgsabstractgeometry.sip index 2dfb53db511..7518d15135f 100644 --- a/python/core/geometry/qgsabstractgeometry.sip +++ b/python/core/geometry/qgsabstractgeometry.sip @@ -59,7 +59,9 @@ class QgsAbstractGeometry enum SegmentationToleranceType { + MaximumAngle, + MaximumDifference }; diff --git a/python/core/geometry/qgscircularstring.sip b/python/core/geometry/qgscircularstring.sip index c62402cd726..57114614457 100644 --- a/python/core/geometry/qgscircularstring.sip +++ b/python/core/geometry/qgscircularstring.sip @@ -74,7 +74,10 @@ class QgsCircularString: QgsCurve Returns a new line string geometry corresponding to a segmentized approximation of the curve. \param tolerance segmentation tolerance - \param toleranceType maximum segmentation angle or maximum difference between approximation and curve* + \param toleranceType maximum segmentation angle or maximum difference between approximation and curve + + Uses a MaximumAngle tolerance of 1 degrees by default (360 + segments in a full circle) :rtype: QgsLineString %End diff --git a/src/core/geometry/qgsabstractgeometry.h b/src/core/geometry/qgsabstractgeometry.h index 591ce65594d..eb86bd23121 100644 --- a/src/core/geometry/qgsabstractgeometry.h +++ b/src/core/geometry/qgsabstractgeometry.h @@ -88,7 +88,13 @@ class CORE_EXPORT QgsAbstractGeometry //! Segmentation tolerance as maximum angle or maximum difference between approximation and circle enum SegmentationToleranceType { + + /** Maximum angle between generating radii (lines from arc center + * to output vertices) */ MaximumAngle = 0, + + /** Maximum distance between an arbitrary point on the original + * curve and closest point on its approximation. */ MaximumDifference }; diff --git a/src/core/geometry/qgscircularstring.h b/src/core/geometry/qgscircularstring.h index 8ee72c0f0f7..a97909d92a6 100644 --- a/src/core/geometry/qgscircularstring.h +++ b/src/core/geometry/qgscircularstring.h @@ -72,7 +72,11 @@ class CORE_EXPORT QgsCircularString: public QgsCurve /** Returns a new line string geometry corresponding to a segmentized approximation * of the curve. * \param tolerance segmentation tolerance - * \param toleranceType maximum segmentation angle or maximum difference between approximation and curve*/ + * \param toleranceType maximum segmentation angle or maximum difference between approximation and curve + * + * Uses a MaximumAngle tolerance of 1 degrees by default (360 + * segments in a full circle) + */ virtual QgsLineString *curveToLine( double tolerance = M_PI_2 / 90, SegmentationToleranceType toleranceType = MaximumAngle ) const override SIP_FACTORY; void draw( QPainter &p ) const override;