Navigation Menu

Skip to content

Commit

Permalink
Improve snapping API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed May 2, 2016
1 parent 6173539 commit 875edb0
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions src/core/qgspointlocator.h
Expand Up @@ -72,13 +72,16 @@ class CORE_EXPORT QgsPointLocator : public QObject
//! @note added in QGIS 2.14
void setExtent( const QgsRectangle* extent );

/**
* The type of a snap result or the filter type for a snap request.
*/
enum Type
{
Invalid = 0,
Vertex = 1,
Edge = 2,
Area = 4,
All = Vertex | Edge | Area
Invalid = 0, //!< Invalid
Vertex = 1, //!< Snapped to a vertex. Can be a vertex of the geometry or an intersection.
Edge = 2, //!< Snapped to an edge
Area = 4, //!< Snapped to an area
All = Vertex | Edge | Area //!< Conmbination of vertex, edge and area
};

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

//! reference vector layer
/**
* The vector layer where the snap occurred.
* Will be null if the snap happened on an intersection.
*/
QgsVectorLayer* layer() const { return mLayer; }

/**
* The id of the feature to which the snapped geometry belongs.
*/
QgsFeatureId featureId() const { return mFid; }

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

0 comments on commit 875edb0

Please sign in to comment.