Quantum GIS API Documentation
1.7.4
|
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 "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