Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improve documentation for QgsGeometry::closestVertex
  • Loading branch information
nyalldawson committed Apr 6, 2016
1 parent 5247673 commit 3a1f6c4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions python/core/geometry/qgsgeometry.sip
Expand Up @@ -171,8 +171,17 @@ class QgsGeometry

/**
* Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target point
* and the indices of the vertices before/after. The vertices before/after are -1 if not present
*/
* and the indices of the vertices before and after the closest vertex.
* @param point point to search for
* @param atVertex will be set to the vertex index of the closest found vertex
* @param beforeVertex will be set to the vertex index of the previous vertex from the closest one. Will be set to -1 if
* not present.
* @param afterVertex will be set to the vertex index of the next vertex after the closest one. Will be set to -1 if
* not present.
* @param sqrDist will be set to the square distance between the closest vertex and the specified point
* @returns closest point in geometry
*/
//TODO QGIS 3.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex
QgsPoint closestVertex( const QgsPoint& point, int& atVertex /Out/, int& beforeVertex /Out/, int& afterVertex /Out/, double& sqrDist /Out/ ) const;

/**
Expand Down
13 changes: 11 additions & 2 deletions src/core/geometry/qgsgeometry.h
Expand Up @@ -213,8 +213,17 @@ class CORE_EXPORT QgsGeometry

/**
* Returns the vertex closest to the given point, the corresponding vertex index, squared distance snap point / target point
* and the indices of the vertices before/after. The vertices before/after are -1 if not present
*/
* and the indices of the vertices before and after the closest vertex.
* @param point point to search for
* @param atVertex will be set to the vertex index of the closest found vertex
* @param beforeVertex will be set to the vertex index of the previous vertex from the closest one. Will be set to -1 if
* not present.
* @param afterVertex will be set to the vertex index of the next vertex after the closest one. Will be set to -1 if
* not present.
* @param sqrDist will be set to the square distance between the closest vertex and the specified point
* @returns closest point in geometry
*/
//TODO QGIS 3.0 - rename beforeVertex to previousVertex, afterVertex to nextVertex
QgsPoint closestVertex( const QgsPoint& point, int& atVertex, int& beforeVertex, int& afterVertex, double& sqrDist ) const;

/**
Expand Down

0 comments on commit 3a1f6c4

Please sign in to comment.