QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsmapcanvassnapper.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsmapcanvassnapper.h
3  ---------------------
4  begin : June 21, 2007
5  copyright : (C) 2007 by Marco Hugentobler
6  email : marco dot hugentobler at karto dot baug dot ethz dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSMAPCANVASSNAPPER_H
19 #define QGSMAPCANVASSNAPPER_H
20 
21 #include <QList>
22 #include "qgssnapper.h"
23 
24 class QgsMapCanvas;
25 class QPoint;
26 
33 class GUI_EXPORT QgsMapCanvasSnapper
34 {
35  public:
39 
41 
43 
56  int snapToCurrentLayer( QPoint p, QList<QgsSnappingResult>& results, QgsSnapper::SnappingType snap_to, double snappingTol = -1, const QList<QgsPoint>& excludePoints = QList<QgsPoint>(), bool allResutInTolerance = false );
57 
67  int snapToBackgroundLayers( QPoint p, QList<QgsSnappingResult>& results, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
68 
69  // @note not available in python bindings
70  int snapToBackgroundLayers( const QgsPoint& point, QList<QgsSnappingResult>& results, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
71 
72  void setMapCanvas( QgsMapCanvas* canvas );
73 
74  private:
76  QgsMapCanvas* mMapCanvas;
78  QgsSnapper* mSnapper;
79 
81  QgsMapCanvasSnapper& operator=( const QgsMapCanvasSnapper& rh );
82 };
83 
84 #endif
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:109
SnappingType
Snap to vertex, to segment or both.
Definition: qgssnapper.h:67
A class that allows advanced snapping operations on a set of vector layers.
Definition: qgssnapper.h:63
A class to represent a point.
Definition: qgspoint.h:117
This class reads the snapping properties from the current project and configures a QgsSnapper to perf...