QGIS API Documentation 3.99.0-Master (1d785854362)
Loading...
Searching...
No Matches
qgsadvanceddigitizingfloater.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsadvanceddigitizingfloater.cpp - floater for CAD tools
3 ----------------------
4 begin : May 2019
5 copyright : (C) Olivier Dalang
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 QGSADVANCEDDIGITIZINGFLOATER
17#define QGSADVANCEDDIGITIZINGFLOATER
18
19#include "ui_qgsadvanceddigitizingfloaterbase.h"
20
21#include "qgis_gui.h"
22#include "qgis_sip.h"
24
25#include <QPointer>
26#include <QString>
27#include <QWidget>
28
29class QgsMapCanvas;
31
42class GUI_EXPORT QgsAdvancedDigitizingFloater : public QWidget, private Ui::QgsAdvancedDigitizingFloaterBase
43{
44 Q_OBJECT
45
46 public:
48 enum class FloaterItem : int SIP_ENUM_BASETYPE( IntFlag )
49 {
50 XCoordinate = 1 << 1,
51 YCoordinate = 1 << 2,
52 MCoordinate = 1 << 3,
53 ZCoordinate = 1 << 4,
54 Angle = 1 << 5,
55 CommonAngleSnapping = 1 << 6,
56 Distance = 1 << 7,
57 Bearing = 1 << 8,
58 Weight = 1 << 9,
59 Area = 1 << 10,
60 TotalLength = 1 << 11,
61 };
62 Q_DECLARE_FLAGS( FloaterItems, FloaterItem )
63 Q_FLAG( FloaterItem )
64
65
72
78 bool active();
79
87
97
104
105 public slots:
106
114 void setActive( bool active );
115
124
131
132 public slots:
138 void changeWeight( const QString &text );
139
145 void enabledChangedWeight( bool enabled );
146
151 void focusOnWeight();
152
153 private slots:
154
155 void changeX( const QString &text );
156 void changeY( const QString &text );
157 void changeZ( const QString &text );
158 void changeM( const QString &text );
159 void changeCommonAngleSnapping( double angle );
160 void changeDistance( const QString &text );
161 void changeAngle( const QString &text );
162 void changeBearing( const QString &text );
163 void changeArea( const QString &text );
164 void changeTotalLength( const QString &text );
165 void changeLockX( bool locked );
166 void changeLockY( bool locked );
167 void changeLockZ( bool locked );
168 void changeLockM( bool locked );
169 void changeLockDistance( bool locked );
170 void changeLockAngle( bool locked );
171 void changeRelativeX( bool relative );
172 void changeRelativeY( bool relative );
173 void changeRelativeZ( bool relative );
174 void changeRelativeM( bool relative );
175 // void changeRelativeDistance( bool relative ); // doesn't happen
176 void changeRelativeAngle( bool relative );
177 void focusOnX();
178 void focusOnY();
179 void focusOnZ();
180 void focusOnM();
181 void focusOnAngle();
182 void focusOnDistance();
183 void enabledChangedX( bool enabled );
184 void enabledChangedY( bool enabled );
185 void enabledChangedZ( bool enabled );
186 void enabledChangedM( bool enabled );
187 void enabledChangedAngle( bool enabled );
188 void enabledChangedDistance( bool enabled );
189 void enabledCommonAngleSnapping( bool enabled );
190 void enabledChangedBearing( bool enabled );
191
192 private:
194 QgsMapCanvas *mMapCanvas = nullptr;
195
197 QPointer<QgsAdvancedDigitizingDockWidget> mCadDockWidget;
198
203 bool eventFilter( QObject *obj, QEvent *event ) override SIP_FORCE;
204
209 void updatePos( const QPoint &pos );
210
214 void hideIfDisabled();
215
217 bool mActive = false;
218
219 FloaterItems mItemsVisibility;
220};
221
222#endif // QGSADVANCEDDIGITIZINGFLOATER_H
CadMeasurementDisplayType
Advanced digitizing measurement display types.
Definition qgis.h:4161
A dockable widget used to handle the CAD tools on top of a selection of map tools.
bool itemVisibility(QgsAdvancedDigitizingFloater::FloaterItem item) const
Returns true if the floater item visibility setting is enabled.
void setItemVisibility(QgsAdvancedDigitizingFloater::FloaterItem item, bool visible)
Set whether the floater item should be visible or not.
QgsAdvancedDigitizingFloater(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Create an advanced digitizing floater widget.
void setActive(bool active)
Set whether the floater should be active or not.
void setItemMeasurementType(QgsAdvancedDigitizingFloater::FloaterItem item, Qgis::CadMeasurementDisplayType type)
Set whether the measurement display type for a floater item.
void enabledChangedWeight(bool enabled)
Shows or hides the weight widget in the floater for NURBSCurve.
void focusOnWeight()
Requests focus on the weight input field for NURBSCurve.
void changeWeight(const QString &text)
Updates the weight value displayed in the floater for NURBSCurve.
static bool itemSupportsMeasurementType(QgsAdvancedDigitizingFloater::FloaterItem item)
Returns true if a floater item supports display in different Qgis::CadMeasurementDisplayType values.
bool active()
Whether the floater is active or not.
Qgis::CadMeasurementDisplayType itemMeasurementDisplayType(QgsAdvancedDigitizingFloater::FloaterItem item) const
Returns the measurement display type for a floater item.
Map canvas is a class for displaying all GIS data types on a canvas.
#define SIP_FORCE
Definition qgis_sip.h:139
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:275