Skip to content

Class QfSnappingResult

ClassList > QfSnappingResult

Public Types

Type Name
enum Type

Public Properties

Type Name
property bool isValid
property QgsPoint point

Public Functions

Type Name
QfSnappingResult ()
construct invalid match
QfSnappingResult (Type t, QgsVectorLayer * vl, QgsFeatureId fid, double dist, const QgsPoint & pt, int vertexIndex=0, const QgsPoint * edgePoints=nullptr)
QfSnappingResult (const QgsPointLocator::Match & match)
double distance () const
void edgePoints (QgsPoint & pt1, QgsPoint & pt2) const
Only for a valid edge match - obtain endpoints of the edge.
QgsFeatureId featureId () const
bool hasArea () const
bool hasEdge () const
bool hasVertex () const
bool isValid () const
QgsVectorLayer * layer () const
bool operator!= (const QfSnappingResult & other) const
bool operator== (const QfSnappingResult & other) const
QgsPoint point () const
void setPoint (const QgsPoint point)
to set the point individually (e.g. after emmiting Z)
Type type () const
int vertexIndex () const
for vertex / edge match (first vertex of the edge)

Public Types Documentation

enum Type

enum QfSnappingResult::Type {
    Invalid = 0,
    Vertex = 1,
    Edge = 2,
    Area = 4,
    All = Vertex | Edge | Area
};

The type of a snap result or the filter type for a snap request.


Public Properties Documentation

property isValid [1/2]

bool QfSnappingResult::isValid;

property point [1/2]

QgsPoint QfSnappingResult::point;

Public Functions Documentation

function QfSnappingResult [1/3]

construct invalid match

QfSnappingResult::QfSnappingResult () 


function QfSnappingResult [2/3]

QfSnappingResult::QfSnappingResult (
    Type t,
    QgsVectorLayer * vl,
    QgsFeatureId fid,
    double dist,
    const QgsPoint & pt,
    int vertexIndex=0,
    const QgsPoint * edgePoints=nullptr
) 

function QfSnappingResult [3/3]

explicit QfSnappingResult::QfSnappingResult (
    const QgsPointLocator::Match & match
) 

function distance

double QfSnappingResult::distance () const

for vertex / edge match units depending on what class returns it (geom.cache: layer units, map canvas snapper: dest crs units)


function edgePoints

Only for a valid edge match - obtain endpoints of the edge.

void QfSnappingResult::edgePoints (
    QgsPoint & pt1,
    QgsPoint & pt2
) const


function featureId

QgsFeatureId QfSnappingResult::featureId () const

The id of the feature to which the snapped geometry belongs.


function hasArea

bool QfSnappingResult::hasArea () const

function hasEdge

bool QfSnappingResult::hasEdge () const

function hasVertex

bool QfSnappingResult::hasVertex () const

function isValid [2/2]

bool QfSnappingResult::isValid () const

function layer

QgsVectorLayer * QfSnappingResult::layer () const

The vector layer where the snap occurred. Will be null if the snap happened on an intersection.


function operator!=

inline bool QfSnappingResult::operator!= (
    const QfSnappingResult & other
) const

function operator==

bool QfSnappingResult::operator== (
    const QfSnappingResult & other
) const

function point [2/2]

QgsPoint QfSnappingResult::point () const

for vertex / edge match coords depending on what class returns it (geom.cache: layer coords, map canvas snapper: dest coords)


function setPoint

to set the point individually (e.g. after emmiting Z)

void QfSnappingResult::setPoint (
    const QgsPoint point
) 


function type

Type QfSnappingResult::type () const

function vertexIndex

for vertex / edge match (first vertex of the edge)

int QfSnappingResult::vertexIndex () const



The documentation for this class was generated from the following file src/core/qfsnappingresult.h