QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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=nullptr)
 
 ~QgsSnappingUtils ()
 
QgsVectorLayercurrentLayer () const
 The current layer used if mode is SnapCurrentLayer. More...
 
void defaultSettings (int &type, double &tolerance, QgsTolerance::UnitType &unit)
 Query options used when the mode is snap to current layer or to all layers. 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. More...
 
const QgsMapSettingsmapSettings () const
 
void setCurrentLayer (QgsVectorLayer *layer)
 Set current layer so that if mode is SnapCurrentLayer we know which layer to use. More...
 
void setDefaultSettings (int type, double tolerance, QgsTolerance::UnitType unit)
 Configure options used when the mode is snap to current layer or to all layers. 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 setLayers (const QList< LayerConfig > &layers)
 Set layers which will be used for snapping. More...
 
void setMapSettings (const QgsMapSettings &settings)
 Assign current map settings to the utils - used for conversion between screen coords to map coords. More...
 
void setSnapOnIntersections (bool enabled)
 Set whether to consider intersections of nearby segments for snapping. More...
 
void setSnapToMapMode (SnapToMapMode mode)
 Set how the snapping to map is done. More...
 
bool snapOnIntersections () const
 Query whether to consider intersections of nearby segments for snapping. 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). More...
 
QgsPointLocator::Match snapToMap (const QgsPoint &pointMap, QgsPointLocator::MatchFilter *filter=nullptr)
 
SnapToMapMode snapToMapMode () const
 Find out how the snapping to map is done. More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

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...
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

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 readConfigFromProject ()
 Read snapping configuration from the project. More...
 
- Signals inherited from QgsSnappingUtils
void configChanged ()
 Emitted when snapping configuration has been changed. More...
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

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.

Note
added in 2.8

Definition at line 29 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: