QGIS API Documentation 3.41.0-Master (25ec5511245)
|
Snapping utils instance that is connected to a canvas and updates the configuration (map settings + current layer) whenever that is changed in the canvas. More...
#include <qgsmapcanvassnappingutils.h>
Public Member Functions | |
QgsMapCanvasSnappingUtils (QgsMapCanvas *canvas, QObject *parent=nullptr) | |
Construct map canvas snapping utils object. | |
Public Member Functions inherited from QgsSnappingUtils | |
QgsSnappingUtils (QObject *parent=nullptr, bool enableSnappingForInvisibleFeature=true) | |
Constructor for QgsSnappingUtils. | |
~QgsSnappingUtils () override | |
void | addExtraSnapLayer (QgsVectorLayer *vl) |
Supply an extra snapping layer (typically a memory layer). | |
QgsSnappingConfig | config () const |
The snapping configuration controls the behavior of this object. | |
QgsVectorLayer * | currentLayer () const |
The current layer used if mode is SnapCurrentLayer. | |
QString | dump () |
Gets extra information about the instance. | |
QSet< QgsVectorLayer * > | getExtraSnapLayers () |
Returns the list of extra snapping layers. | |
IndexingStrategy | indexingStrategy () const |
Find out which strategy is used for indexing - by default hybrid indexing is used. | |
QList< QgsSnappingUtils::LayerConfig > | layers () const |
Query layers used for snapping. | |
QgsPointLocator * | locatorForLayer (QgsVectorLayer *vl) |
Gets a point locator for the given layer. | |
QgsMapSettings | mapSettings () const |
void | removeExtraSnapLayer (QgsVectorLayer *vl) |
Removes an extra snapping layer. | |
void | setCurrentLayer (QgsVectorLayer *layer) |
Sets current layer so that if mode is SnapCurrentLayer we know which layer to use. | |
void | setEnableSnappingForInvisibleFeature (bool enable) |
Set if invisible features must be snapped or not. | |
void | setIndexingStrategy (IndexingStrategy strategy) |
Sets a strategy for indexing geometry data - determines how fast and memory consuming the data structures will be. | |
void | setMapSettings (const QgsMapSettings &settings) |
Assign current map settings to the utils - used for conversion between screen coords to map coords. | |
QgsPointLocator::Match | snapToCurrentLayer (QPoint point, QgsPointLocator::Types type, QgsPointLocator::MatchFilter *filter=nullptr) |
Snap to current layer. | |
QgsPointLocator::Match | snapToMap (const QgsPointXY &pointMap, QgsPointLocator::MatchFilter *filter=nullptr, bool relaxed=false) |
Snap to map according to the current configuration. | |
QgsPointLocator::Match | snapToMap (QPoint point, QgsPointLocator::MatchFilter *filter=nullptr, bool relaxed=false) |
Snap to map according to the current configuration. | |
Protected Member Functions | |
void | prepareIndexProgress (int index) override |
Called when finished indexing a layer with snapToMap. When index == count the indexing is complete. | |
void | prepareIndexStarting (int count) override |
Called when starting to index with snapToMap - can be overridden and e.g. progress dialog can be provided. | |
Protected Member Functions inherited from QgsSnappingUtils | |
void | clearAllLocators () |
Deletes all existing locators (e.g. when destination CRS has changed and we need to reindex) | |
Additional Inherited Members | |
Public Types inherited from QgsSnappingUtils | |
enum | IndexingStrategy { IndexAlwaysFull , IndexNeverFull , IndexHybrid , IndexExtent } |
Public Slots inherited from QgsSnappingUtils | |
void | setConfig (const QgsSnappingConfig &snappingConfig) |
The snapping configuration controls the behavior of this object. | |
void | toggleEnabled () |
Toggles the state of snapping. | |
Signals inherited from QgsSnappingUtils | |
void | configChanged (const QgsSnappingConfig &snappingConfig) |
Emitted when the snapping settings object changes. | |
Properties inherited from QgsSnappingUtils | |
QgsSnappingConfig | config |
Snapping utils instance that is connected to a canvas and updates the configuration (map settings + current layer) whenever that is changed in the canvas.
Definition at line 32 of file qgsmapcanvassnappingutils.h.
QgsMapCanvasSnappingUtils::QgsMapCanvasSnappingUtils | ( | QgsMapCanvas * | canvas, |
QObject * | parent = nullptr |
||
) |
Construct map canvas snapping utils object.
canvas | map canvas |
parent | parent object if false it will block until indexing is done |
Definition at line 26 of file qgsmapcanvassnappingutils.cpp.
|
overrideprotectedvirtual |
Called when finished indexing a layer with snapToMap. When index == count the indexing is complete.
Reimplemented from QgsSnappingUtils.
Definition at line 71 of file qgsmapcanvassnappingutils.cpp.
|
overrideprotectedvirtual |
Called when starting to index with snapToMap - can be overridden and e.g. progress dialog can be provided.
Reimplemented from QgsSnappingUtils.
Definition at line 64 of file qgsmapcanvassnappingutils.cpp.