QGIS API Documentation  2.14.0-Essen
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 );
66  int snapToBackgroundLayers( QPoint p, QList<QgsSnappingResult>& results, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
67 
68  // @note not available in python bindings
69  int snapToBackgroundLayers( const QgsPoint& point, QList<QgsSnappingResult>& results, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
70 
71  void setMapCanvas( QgsMapCanvas* canvas );
72 
73  private:
75  QgsMapCanvas* mMapCanvas;
77  QgsSnapper* mSnapper;
78 
80  QgsMapCanvasSnapper& operator=( const QgsMapCanvasSnapper& rh );
81 };
82 
83 #endif
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:105
SnappingType
Snap to vertex, to segment or both.
Definition: qgssnapper.h:66
A class that allows advanced snapping operations on a set of vector layers.
Definition: qgssnapper.h:62
A class to represent a point.
Definition: qgspoint.h:65
This class reads the snapping properties from the current project and configures a QgsSnapper to perf...