1 /*************************************************************************** 2 qgsmaptooladdcircle.h - map tool for adding circle 3 --------------------- 4 begin : July 2017 5 copyright : (C) 2017 6 email : lbartoletti at tuxfamily dot org 7 *************************************************************************** 8 * * 9 * This program is free software; you can redistribute it and/or modify * 10 * it under the terms of the GNU General Public License as published by * 11 * the Free Software Foundation; either version 2 of the License, or * 12 * (at your option) any later version. * 13 * * 14 ***************************************************************************/ 15 16 #ifndef QGSMAPTOOLADDCIRCLE_H 17 #define QGSMAPTOOLADDCIRCLE_H 18 19 #include "qgsmaptooladdabstract.h" 20 #include "qgscircle.h" 21 #include "qgis_app.h" 22 23 struct EdgesOnlyFilter : public QgsPointLocator::MatchFilter 24 { acceptMatchEdgesOnlyFilter25 bool acceptMatch( const QgsPointLocator::Match &m ) override { return m.hasEdge(); } 26 }; 27 28 class APP_EXPORT QgsMapToolAddCircle: public QgsMapToolAddAbstract 29 { 30 Q_OBJECT 31 32 public: 33 QgsMapToolAddCircle( QgsMapToolCapture *parentTool, QgsMapCanvas *canvas, CaptureMode mode = CaptureLine ); 34 35 void deactivate() override; 36 void clean() override; 37 38 protected: 39 explicit QgsMapToolAddCircle( QgsMapCanvas *canvas ) = delete; //forbidden 40 41 //! Circle 42 QgsCircle mCircle; 43 44 }; 45 46 #endif // QGSMAPTOOLADDCIRCLE_H 47