QGIS API Documentation  2.5.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 
54  int snapToCurrentLayer( const QPoint& p, QList<QgsSnappingResult>& results, QgsSnapper::SnappingType snap_to, double snappingTol = -1, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
63  int snapToBackgroundLayers( const QPoint& p, QList<QgsSnappingResult>& results, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
64 
65  void setMapCanvas( QgsMapCanvas* canvas );
66 
67  private:
69  QgsMapCanvas* mMapCanvas;
71  QgsSnapper* mSnapper;
72 };
73 
74 #endif
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:104
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
This class reads the snapping properties from the current project and configures a QgsSnapper to perf...
Definition: qgsmapcanvassnapper.h:33