Quantum GIS API Documentation
1.8
|
00001 /*************************************************************************** 00002 qgsmapcanvassnapper.h 00003 --------------------- 00004 begin : June 21, 2007 00005 copyright : (C) 2007 by Marco Hugentobler 00006 email : marco dot hugentobler at karto dot baug dot ethz dot ch 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef QGSMAPCANVASSNAPPER_H 00019 #define QGSMAPCANVASSNAPPER_H 00020 00021 #include <QList> 00022 #include "qgssnapper.h" 00023 00024 class QgsMapCanvas; 00025 class QPoint; 00026 00033 class GUI_EXPORT QgsMapCanvasSnapper 00034 { 00035 public: 00038 QgsMapCanvasSnapper( QgsMapCanvas* canvas ); 00039 00040 QgsMapCanvasSnapper(); 00041 00042 ~QgsMapCanvasSnapper(); 00043 00054 int snapToCurrentLayer( const QPoint& p, QList<QgsSnappingResult>& results, QgsSnapper::SnappingType snap_to, double snappingTol = -1, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() ); 00063 int snapToBackgroundLayers( const QPoint& p, QList<QgsSnappingResult>& results, const QList<QgsPoint>& excludePoints = QList<QgsPoint>() ); 00064 00065 void setMapCanvas( QgsMapCanvas* canvas ); 00066 00067 private: 00069 QgsMapCanvas* mMapCanvas; 00071 QgsSnapper* mSnapper; 00072 }; 00073 00074 #endif