Skip to content
Permalink
Browse files

Improve snapping API documentation

  • Loading branch information
m-kuhn committed May 2, 2016
1 parent 6173539 commit 875edb0adccab7c4f49ec582c9e1c5ac6c2f4b0e
Showing with 15 additions and 6 deletions.
  1. +15 −6 src/core/qgspointlocator.h
@@ -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 )
@@ -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

0 comments on commit 875edb0

Please sign in to comment.
You can’t perform that action at this time.