Skip to content

Commit 35d0f57

Browse files
committed
Update documentation
1 parent d91bd45 commit 35d0f57

File tree

8 files changed

+64
-20
lines changed

8 files changed

+64
-20
lines changed

python/core/geometry/qgscircle.sip.in

+9-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ Constructs a circle by defining all the members.
4242
static QgsCircle from2Points( const QgsPoint &pt1, const QgsPoint &pt2 );
4343
%Docstring
4444
Constructs a circle by 2 points on the circle.
45-
The center point can have z and m values which are the result from the midpoint operation between ``pt1`` and ``pt2``.
45+
The center point can have m value which is the result from the midpoint
46+
operation between ``pt1`` and ``pt2``. Z dimension is also supported and
47+
is retrieved from the first 3D point amongst ``pt1`` and ``pt2``.
4648
The radius is calculated from the 2D distance between ``pt1`` and ``pt2``.
4749
The azimuth is the angle between ``pt1`` and ``pt2``.
4850

@@ -53,7 +55,9 @@ The azimuth is the angle between ``pt1`` and ``pt2``.
5355
static QgsCircle from3Points( const QgsPoint &pt1, const QgsPoint &pt2, const QgsPoint &pt3, double epsilon = 1E-8 );
5456
%Docstring
5557
Constructs a circle by 3 points on the circle.
56-
Z and m values are dropped for the center point.
58+
M value is dropped for the center point.
59+
Z dimension is supported and is retrieved from the first 3D point
60+
amongst ``pt1``, ``pt2`` and ``pt3``.
5761
The azimuth always takes the default value.
5862
If the points are colinear an empty circle is returned.
5963

@@ -106,7 +110,9 @@ The azimuth always takes the default value.
106110
static QgsCircle fromExtent( const QgsPoint &pt1, const QgsPoint &pt2 );
107111
%Docstring
108112
Constructs a circle by an extent (aka bounding box / :py:class:`QgsRectangle`).
109-
The center point can have z and m values which are the result from the midpoint operation between ``pt1`` and ``pt2``.
113+
The center point can have m value which is the result from the midpoint
114+
operation between ``pt1`` and ``pt2``. Z dimension is also supported and
115+
is retrieved from the first 3D point amongst ``pt1`` and ``pt2``.
110116
Axes are calculated from the 2D distance between ``pt1`` and ``pt2``.
111117
The azimuth always takes the default value.
112118

python/core/geometry/qgsellipse.sip.in

+12-4
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ Constructs an ellipse by defining all the members.
4747
static QgsEllipse fromFoci( const QgsPoint &pt1, const QgsPoint &pt2, const QgsPoint &pt3 );
4848
%Docstring
4949
Constructs an ellipse by foci (``pt1`` and ``pt2``) and a point ``pt3``.
50-
The center point can have z and m values which are the result from the midpoint operation between ``pt1`` and ``pt2``.
50+
The center point can have m value which is the result from the midpoint
51+
operation between ``pt1`` and ``pt2``. Z dimension is also supported and
52+
is retrieved from the first 3D point amongst ``pt1`` and ``pt2``.
5153
Axes are calculated from the 2D distance with the third point ``pt3``.
5254
The azimuth is the angle between ``pt1`` and ``pt2``.
5355

@@ -59,7 +61,9 @@ The azimuth is the angle between ``pt1`` and ``pt2``.
5961
static QgsEllipse fromExtent( const QgsPoint &pt1, const QgsPoint &pt2 );
6062
%Docstring
6163
Constructs an ellipse by an extent (aka bounding box / :py:class:`QgsRectangle`).
62-
The center point can have z and m values which are the result from the midpoint operation between ``pt1`` and ``pt2``.
64+
The center point can have m value which is the result from the midpoint
65+
operation between ``pt1`` and ``pt2``. Z dimension is also supported and
66+
is retrieved from the first 3D point amongst ``pt1`` and ``pt2``.
6367
Axes are calculated from the 2D distance between ``pt1`` and ``pt2``.
6468
The azimuth always takes the default value.
6569

@@ -70,7 +74,9 @@ The azimuth always takes the default value.
7074
static QgsEllipse fromCenterPoint( const QgsPoint &ptc, const QgsPoint &pt1 );
7175
%Docstring
7276
Constructs an ellipse by a center point and a another point.
73-
The center point keeps z and m values from ``ptc``.
77+
The center point keeps m value from ``ptc``. Z dimension is also
78+
supported and is retrieved from the first 3D point amongst ``ptc`` and
79+
``pt1``.
7480
Axes are calculated from the 2D distance between ``ptc`` and ``pt1``.
7581
The azimuth always takes the default value.
7682

@@ -81,7 +87,9 @@ The azimuth always takes the default value.
8187
static QgsEllipse fromCenter2Points( const QgsPoint &ptc, const QgsPoint &pt1, const QgsPoint &pt2 );
8288
%Docstring
8389
Constructs an ellipse by a central point and two other points.
84-
The center point keeps z and m values from ``ptc``.
90+
The center point keeps m value from ``ptc``. Z dimension is also
91+
supported and is retrieved from the first 3D point amongst ``ptc``,
92+
``pt1`` and ``pt2``.
8593
Axes are calculated from the 2D distance between ``ptc`` and ``pt1`` and ``pt2``.
8694
The azimuth is the angle between ``ptc`` and ``pt1``.
8795

python/core/geometry/qgsgeometryutils.sip.in

+8-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ Returns the squared distance between a point and a line.
8989

9090
static bool lineIntersection( const QgsPoint &p1, QgsVector v1, const QgsPoint &p2, QgsVector v2, QgsPoint &intersection /Out/ );
9191
%Docstring
92-
Compute the intersection between two lines
92+
Computes the intersection between two lines. Z dimension is
93+
supported and is retrieved from the first 3D point amongst ``p1`` and
94+
``p2``.
9395

9496
:param p1: Point on the first line
9597
:param v1: Direction vector of the first line
@@ -219,7 +221,9 @@ Calculates angle of a circular string part defined by pt1, pt2, pt3
219221

220222
static bool segmentMidPoint( const QgsPoint &p1, const QgsPoint &p2, QgsPoint &result /Out/, double radius, const QgsPoint &mousePos );
221223
%Docstring
222-
Calculates midpoint on circle passing through p1 and p2, closest to given coordinate
224+
Calculates midpoint on circle passing through p1 and p2, closest to
225+
given coordinate. Z dimension is supported and is retrieved from the
226+
first 3D point amongst ``p1`` and ``p2``.
223227
%End
224228

225229
static double circleTangentDirection( const QgsPoint &tangentPoint, const QgsPoint &cp1, const QgsPoint &cp2, const QgsPoint &cp3 );
@@ -397,6 +401,8 @@ A Z dimension is added to ``point`` if one of the point in the list
397401
:param point: The point to update with Z dimension and value.
398402

399403
:return: true if the point is updated, false otherwise
404+
405+
.. versionadded:: 3.0
400406
%End
401407

402408

python/core/geometry/qgstriangle.sip.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,8 @@ Example:
378378

379379
QgsPoint inscribedCenter() const;
380380
%Docstring
381-
Center of the inscribed circle of the triangle.
381+
Center of the inscribed circle of the triangle. Z dimension is
382+
supported and is retrieved from the first 3D point amongst vertexes.
382383

383384
:return: The center of the inscribed circle of the triangle.
384385
An empty point is returned for empty triangle.

src/core/geometry/qgscircle.h

+9-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ class CORE_EXPORT QgsCircle : public QgsEllipse
5454

5555
/**
5656
* Constructs a circle by 2 points on the circle.
57-
* The center point can have z and m values which are the result from the midpoint operation between \a pt1 and \a pt2.
57+
* The center point can have m value which is the result from the midpoint
58+
* operation between \a pt1 and \a pt2. Z dimension is also supported and
59+
* is retrieved from the first 3D point amongst \a pt1 and \a pt2.
5860
* The radius is calculated from the 2D distance between \a pt1 and \a pt2.
5961
* The azimuth is the angle between \a pt1 and \a pt2.
6062
* \param pt1 First point.
@@ -64,7 +66,9 @@ class CORE_EXPORT QgsCircle : public QgsEllipse
6466

6567
/**
6668
* Constructs a circle by 3 points on the circle.
67-
* Z and m values are dropped for the center point.
69+
* M value is dropped for the center point.
70+
* Z dimension is supported and is retrieved from the first 3D point
71+
* amongst \a pt1, \a pt2 and \a pt3.
6872
* The azimuth always takes the default value.
6973
* If the points are colinear an empty circle is returned.
7074
* \param pt1 First point.
@@ -113,7 +117,9 @@ class CORE_EXPORT QgsCircle : public QgsEllipse
113117

114118
/**
115119
* Constructs a circle by an extent (aka bounding box / QgsRectangle).
116-
* The center point can have z and m values which are the result from the midpoint operation between \a pt1 and \a pt2.
120+
* The center point can have m value which is the result from the midpoint
121+
* operation between \a pt1 and \a pt2. Z dimension is also supported and
122+
* is retrieved from the first 3D point amongst \a pt1 and \a pt2.
117123
* Axes are calculated from the 2D distance between \a pt1 and \a pt2.
118124
* The azimuth always takes the default value.
119125
* \param pt1 First corner.

src/core/geometry/qgsellipse.h

+12-4
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ class CORE_EXPORT QgsEllipse
5959

6060
/**
6161
* Constructs an ellipse by foci (\a pt1 and \a pt2) and a point \a pt3.
62-
* The center point can have z and m values which are the result from the midpoint operation between \a pt1 and \a pt2.
62+
* The center point can have m value which is the result from the midpoint
63+
* operation between \a pt1 and \a pt2. Z dimension is also supported and
64+
* is retrieved from the first 3D point amongst \a pt1 and \a pt2.
6365
* Axes are calculated from the 2D distance with the third point \a pt3.
6466
* The azimuth is the angle between \a pt1 and \a pt2.
6567
* \param pt1 First focus.
@@ -70,7 +72,9 @@ class CORE_EXPORT QgsEllipse
7072

7173
/**
7274
* Constructs an ellipse by an extent (aka bounding box / QgsRectangle).
73-
* The center point can have z and m values which are the result from the midpoint operation between \a pt1 and \a pt2.
75+
* The center point can have m value which is the result from the midpoint
76+
* operation between \a pt1 and \a pt2. Z dimension is also supported and
77+
* is retrieved from the first 3D point amongst \a pt1 and \a pt2.
7478
* Axes are calculated from the 2D distance between \a pt1 and \a pt2.
7579
* The azimuth always takes the default value.
7680
* \param pt1 First corner.
@@ -80,7 +84,9 @@ class CORE_EXPORT QgsEllipse
8084

8185
/**
8286
* Constructs an ellipse by a center point and a another point.
83-
* The center point keeps z and m values from \a ptc.
87+
* The center point keeps m value from \a ptc. Z dimension is also
88+
* supported and is retrieved from the first 3D point amongst \a ptc and
89+
* \a pt1.
8490
* Axes are calculated from the 2D distance between \a ptc and \a pt1.
8591
* The azimuth always takes the default value.
8692
* \param ptc Center point.
@@ -90,7 +96,9 @@ class CORE_EXPORT QgsEllipse
9096

9197
/**
9298
* Constructs an ellipse by a central point and two other points.
93-
* The center point keeps z and m values from \a ptc.
99+
* The center point keeps m value from \a ptc. Z dimension is also
100+
* supported and is retrieved from the first 3D point amongst \a ptc,
101+
* \a pt1 and \a pt2.
94102
* Axes are calculated from the 2D distance between \a ptc and \a pt1 and \a pt2.
95103
* The azimuth is the angle between \a ptc and \a pt1.
96104
* \param ptc Center point.

src/core/geometry/qgsgeometryutils.h

+10-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ class CORE_EXPORT QgsGeometryUtils
9090
static double sqrDistToLine( double ptX, double ptY, double x1, double y1, double x2, double y2, double &minDistX SIP_OUT, double &minDistY SIP_OUT, double epsilon );
9191

9292
/**
93-
* \brief Compute the intersection between two lines
93+
* Computes the intersection between two lines. Z dimension is
94+
* supported and is retrieved from the first 3D point amongst \a p1 and
95+
* \a p2.
9496
* \param p1 Point on the first line
9597
* \param v1 Direction vector of the first line
9698
* \param p2 Point on the second line
@@ -225,7 +227,11 @@ class CORE_EXPORT QgsGeometryUtils
225227
//! Calculates angle of a circular string part defined by pt1, pt2, pt3
226228
static double sweepAngle( double centerX, double centerY, double x1, double y1, double x2, double y2, double x3, double y3 );
227229

228-
//! Calculates midpoint on circle passing through p1 and p2, closest to given coordinate
230+
/**
231+
* Calculates midpoint on circle passing through p1 and p2, closest to
232+
* given coordinate. Z dimension is supported and is retrieved from the
233+
* first 3D point amongst \a p1 and \a p2.
234+
*/
229235
static bool segmentMidPoint( const QgsPoint &p1, const QgsPoint &p2, QgsPoint &result SIP_OUT, double radius, const QgsPoint &mousePos );
230236

231237
//! Calculates the direction angle of a circle tangent (clockwise from north in radians)
@@ -417,6 +423,8 @@ class CORE_EXPORT QgsGeometryUtils
417423
* \param points List of points in which a 3D point is searched.
418424
* \param point The point to update with Z dimension and value.
419425
* \returns true if the point is updated, false otherwise
426+
*
427+
* \since QGIS 3.0
420428
*/
421429
static bool setZValueFromPoints( const QgsPointSequence &points, QgsPoint &point );
422430

src/core/geometry/qgstriangle.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,8 @@ class CORE_EXPORT QgsTriangle : public QgsPolygon
351351
QgsCircle circumscribedCircle() const;
352352

353353
/**
354-
* Center of the inscribed circle of the triangle.
354+
* Center of the inscribed circle of the triangle. Z dimension is
355+
* supported and is retrieved from the first 3D point amongst vertexes.
355356
* \returns The center of the inscribed circle of the triangle.
356357
* An empty point is returned for empty triangle.
357358
* * Example:

0 commit comments

Comments
 (0)