Skip to content

Commit 875edb0

Browse files
committed
Improve snapping API documentation
1 parent 6173539 commit 875edb0

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/core/qgspointlocator.h

+15-6
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,16 @@ class CORE_EXPORT QgsPointLocator : public QObject
7272
//! @note added in QGIS 2.14
7373
void setExtent( const QgsRectangle* extent );
7474

75+
/**
76+
* The type of a snap result or the filter type for a snap request.
77+
*/
7578
enum Type
7679
{
77-
Invalid = 0,
78-
Vertex = 1,
79-
Edge = 2,
80-
Area = 4,
81-
All = Vertex | Edge | Area
80+
Invalid = 0, //!< Invalid
81+
Vertex = 1, //!< Snapped to a vertex. Can be a vertex of the geometry or an intersection.
82+
Edge = 2, //!< Snapped to an edge
83+
Area = 4, //!< Snapped to an area
84+
All = Vertex | Edge | Area //!< Conmbination of vertex, edge and area
8285
};
8386

8487
Q_DECLARE_FLAGS( Types, Type )
@@ -125,9 +128,15 @@ class CORE_EXPORT QgsPointLocator : public QObject
125128
//! for vertex / edge match (first vertex of the edge)
126129
int vertexIndex() const { return mVertexIndex; }
127130

128-
//! reference vector layer
131+
/**
132+
* The vector layer where the snap occurred.
133+
* Will be null if the snap happened on an intersection.
134+
*/
129135
QgsVectorLayer* layer() const { return mLayer; }
130136

137+
/**
138+
* The id of the feature to which the snapped geometry belongs.
139+
*/
131140
QgsFeatureId featureId() const { return mFid; }
132141

133142
//! Only for a valid edge match - obtain endpoints of the edge

0 commit comments

Comments
 (0)