QGIS/src/app/qgsmaptoolcircle2tangentspoint.h
2017-12-16 07:54:03 +01:00

57 lines
2.0 KiB
C++

/***************************************************************************
qgsmaptoolcircle2tangentspoint.h - map tool for adding circle
from 2 tangents and a point
---------------------
begin : July 2017
copyright : (C) 2017 by Loïc Bartoletti
email : lbartoletti at tuxfamily dot org
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSMAPTOOLCIRCLE2TANGENTSPOINT_H
#define QGSMAPTOOLCIRCLE2TANGENTSPOINT_H
#include "qgspointlocator.h"
#include "qgsmaptooladdcircle.h"
#include "qspinbox.h"
class QSpinBox;
class QgsMapToolCircle2TangentsPoint: public QgsMapToolAddCircle
{
Q_OBJECT
public:
QgsMapToolCircle2TangentsPoint( QgsMapToolCapture *parentTool, QgsMapCanvas *canvas, CaptureMode mode = CaptureLine );
~QgsMapToolCircle2TangentsPoint() override;
void cadCanvasReleaseEvent( QgsMapMouseEvent *e ) override;
void cadCanvasMoveEvent( QgsMapMouseEvent *e ) override;
public slots:
void radiusSpinBoxChanged( int radius );
private:
//! Compute 4 possible centers
void getPossibleCenter();
//! (re-)create the spin box to enter the radius of the circle
void createRadiusSpinBox();
//! delete the spin box to enter the radius of the circle, if it exists
void deleteRadiusSpinBox();
QSpinBox *mRadiusSpinBox = nullptr;
int mRadius = 0;
QVector<QgsPointXY> mCenters;
QVector<QgsGeometryRubberBand *> mRubberBands;
};
#endif // QGSMAPTOOLCIRCLE2TANGENTSPOINT_H