QGIS API Documentation  2.99.0-Master (d55fa22)
Public Member Functions | Protected Member Functions | List of all members
QgsMapCanvasSnappingUtils Class Reference

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>

Inheritance diagram for QgsMapCanvasSnappingUtils:
Inheritance graph
[legend]

Public Member Functions

 QgsMapCanvasSnappingUtils (QgsMapCanvas *canvas, QObject *parent=nullptr)
 
- Public Member Functions inherited from QgsSnappingUtils
 QgsSnappingUtils (QObject *parent=0)
 
 ~QgsSnappingUtils ()
 
QgsSnappingConfig config () const
 The snapping configuration controls the behavior of this object. More...
 
QgsVectorLayercurrentLayer () const
 The current layer used if mode is SnapCurrentLayer. More...
 
QString dump ()
 Get extra information about the instance. More...
 
IndexingStrategy indexingStrategy () const
 Find out which strategy is used for indexing - by default hybrid indexing is used. More...
 
QList< LayerConfiglayers () const
 Query layers used for snapping. More...
 
QgsPointLocatorlocatorForLayer (QgsVectorLayer *vl)
 Get a point locator for the given layer. If such locator does not exist, it will be created. More...
 
QgsMapSettings mapSettings () const
 
void setCurrentLayer (QgsVectorLayer *layer)
 Set current layer so that if mode is SnapCurrentLayer we know which layer to use. More...
 
void setIndexingStrategy (IndexingStrategy strategy)
 Set a strategy for indexing geometry data - determines how fast and memory consuming the data structures will be. More...
 
void setMapSettings (const QgsMapSettings &settings)
 Assign current map settings to the utils - used for conversion between screen coords to map coords. More...
 
QgsPointLocator::Match snapToCurrentLayer (QPoint point, int type, QgsPointLocator::MatchFilter *filter=nullptr)
 Snap to current layer. More...
 
QgsPointLocator::Match snapToMap (QPoint point, QgsPointLocator::MatchFilter *filter=nullptr)
 Snap to map according to the current configuration (mode). Optional filter allows discarding unwanted matches. More...
 
QgsPointLocator::Match snapToMap (const QgsPoint &pointMap, QgsPointLocator::MatchFilter *filter=nullptr)
 

Protected Member Functions

virtual void prepareIndexProgress (int index) override
 Called when finished indexing a layer. When index == count the indexing is complete. More...
 
virtual void prepareIndexStarting (int count) override
 Called when starting to index - can be overridden and e.g. progress dialog can be provided. More...
 

Additional Inherited Members

- Public Types inherited from QgsSnappingUtils
enum  IndexingStrategy { IndexAlwaysFull, IndexNeverFull, IndexHybrid, IndexExtent }
 
enum  SnapToMapMode { SnapCurrentLayer, SnapAllLayers, SnapAdvanced }
 modes for "snap to background" More...
 
- Public Slots inherited from QgsSnappingUtils
void setConfig (const QgsSnappingConfig &snappingConfig)
 The snapping configuration controls the behavior of this object. More...
 
void toggleEnabled ()
 Toggles the state of snapping. More...
 
- Signals inherited from QgsSnappingUtils
void configChanged (const QgsSnappingConfig &snappingConfig)
 Emitted when the snapping settings object changes. More...
 
- Properties inherited from QgsSnappingUtils
QgsSnappingConfig config
 

Detailed Description

Snapping utils instance that is connected to a canvas and updates the configuration (map settings + current layer) whenever that is changed in the canvas.

Since
QGIS 2.8

Definition at line 30 of file qgsmapcanvassnappingutils.h.

Constructor & Destructor Documentation

◆ QgsMapCanvasSnappingUtils()

QgsMapCanvasSnappingUtils::QgsMapCanvasSnappingUtils ( QgsMapCanvas canvas,
QObject *  parent = nullptr 
)

Definition at line 23 of file qgsmapcanvassnappingutils.cpp.

Member Function Documentation

◆ prepareIndexProgress()

void QgsMapCanvasSnappingUtils::prepareIndexProgress ( int  index)
overrideprotectedvirtual

Called when finished indexing a layer. When index == count the indexing is complete.

Reimplemented from QgsSnappingUtils.

Definition at line 53 of file qgsmapcanvassnappingutils.cpp.

◆ prepareIndexStarting()

void QgsMapCanvasSnappingUtils::prepareIndexStarting ( int  count)
overrideprotectedvirtual

Called when starting to index - can be overridden and e.g. progress dialog can be provided.

Reimplemented from QgsSnappingUtils.

Definition at line 46 of file qgsmapcanvassnappingutils.cpp.


The documentation for this class was generated from the following files: