Skip to content

Commit

Permalink
Document semantic of SegmentationToleranceType
Browse files Browse the repository at this point in the history
.. and default of QgsCircularString::curveToLine

[ci skip]
  • Loading branch information
strk committed Jun 21, 2017
1 parent a2e010c commit 57bf9da
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
2 changes: 2 additions & 0 deletions python/core/geometry/qgsabstractgeometry.sip
Expand Up @@ -59,7 +59,9 @@ class QgsAbstractGeometry

enum SegmentationToleranceType
{

MaximumAngle,

MaximumDifference
};

Expand Down
5 changes: 4 additions & 1 deletion python/core/geometry/qgscircularstring.sip
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions src/core/geometry/qgsabstractgeometry.h
Expand Up @@ -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
};

Expand Down
6 changes: 5 additions & 1 deletion src/core/geometry/qgscircularstring.h
Expand Up @@ -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;
Expand Down

0 comments on commit 57bf9da

Please sign in to comment.