00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef QGSMAPCANVASSNAPPER_H
00019 #define QGSMAPCANVASSNAPPER_H
00020
00021 #include "qgssnapper.h"
00022 #include <QList>
00023
00024 class QgsMapCanvas;
00025 class QPoint;
00026 class QgsSnapper;
00027
00034 class GUI_EXPORT QgsMapCanvasSnapper
00035 {
00036 public:
00039 QgsMapCanvasSnapper( QgsMapCanvas* canvas );
00040
00041 QgsMapCanvasSnapper();
00042
00043 ~QgsMapCanvasSnapper();
00044
00055 int snapToCurrentLayer( const QPoint& p, QList<QgsSnappingResult>& results, QgsSnapper::SnappingType snap_to, double snappingTol = -1, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
00064 int snapToBackgroundLayers( const QPoint& p, QList<QgsSnappingResult>& results, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() );
00065
00066 void setMapCanvas( QgsMapCanvas* canvas );
00067
00068 private:
00070 QgsMapCanvas* mMapCanvas;
00072 QgsSnapper* mSnapper;
00073 };
00074
00075 #endif