QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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=0)
- Public Member Functions inherited from QgsSnappingUtils
 QgsSnappingUtils (QObject *parent=0)
 ~QgsSnappingUtils ()
QgsVectorLayercurrentLayer () const
void defaultSettings (int &type, double &tolerance, QgsTolerance::UnitType &unit)
 query options used when the mode is snap to current layer
IndexingStrategy indexingStrategy () const
 Find out which strategy is used for indexing - by default hybrid indexing is used.
QList< LayerConfiglayers () const
 Query layers used for snapping.
QgsPointLocatorlocatorForLayer (QgsVectorLayer *vl)
 get a point locator for the given layer.
const QgsMapSettingsmapSettings () const
void setCurrentLayer (QgsVectorLayer *layer)
 set current layer so that if mode is SnapCurrentLayer we know which layer to use
void setDefaultSettings (int type, double tolerance, QgsTolerance::UnitType unit)
 configure options used when the mode is snap to current layer
void setIndexingStrategy (IndexingStrategy strategy)
 Set a strategy for indexing geometry data - determines how fast and memory consuming the data structures will be.
void setLayers (const QList< LayerConfig > &layers)
 Set layers which will be used for snapping.
void setMapSettings (const QgsMapSettings &settings)
 assign current map settings to the utils - used for conversion between screen coords to map coords
void setSnapOnIntersections (bool enabled)
 Set whether to consider intersections of nearby segments for snapping.
void setSnapToMapMode (SnapToMapMode mode)
 Set how the snapping to map is done.
bool snapOnIntersections () const
 Query whether to consider intersections of nearby segments for snapping.
QgsPointLocator::Match snapToCurrentLayer (const QPoint &point, int type, QgsPointLocator::MatchFilter *filter=0)
 snap to current layer
QgsPointLocator::Match snapToMap (const QPoint &point, QgsPointLocator::MatchFilter *filter=0)
 snap to map according to the current configuration (mode).
QgsPointLocator::Match snapToMap (const QgsPoint &pointMap, QgsPointLocator::MatchFilter *filter=0)
SnapToMapMode snapToMapMode () const
 Find out how the snapping to map is done.

Protected Member Functions

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

Additional Inherited Members

- Public Types inherited from QgsSnappingUtils
enum  IndexingStrategy { IndexAlwaysFull, IndexNeverFull, IndexHybrid }
enum  SnapToMapMode { SnapCurrentLayer, SnapAllLayers, SnapAdvanced }
 modes for "snap to background" More...
- Public Slots inherited from QgsSnappingUtils
void readConfigFromProject ()
 Read snapping configuration from the project.

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 14 of file qgsmapcanvassnappingutils.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file qgsmapcanvassnappingutils.cpp.

Member Function Documentation

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 39 of file qgsmapcanvassnappingutils.cpp.

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 32 of file qgsmapcanvassnappingutils.cpp.


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