QGIS API Documentation 3.99.0-Master (26c88405ac0)
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 };
59 Q_DECLARE_FLAGS( FloaterItems, FloaterItem )
60 Q_FLAG( FloaterItem )
61
62
63
70
76 bool active();
77
85
86 public slots:
87
95 void setActive( bool active );
96
104 void setItemVisibility( const QgsAdvancedDigitizingFloater::FloaterItem &item, bool visible );
105
106 private slots:
107
108 void changeX( const QString &text );
109 void changeY( const QString &text );
110 void changeZ( const QString &text );
111 void changeM( const QString &text );
112 void changeCommonAngleSnapping( double angle );
113 void changeDistance( const QString &text );
114 void changeAngle( const QString &text );
115 void changeBearing( const QString &text );
116 void changeLockX( bool locked );
117 void changeLockY( bool locked );
118 void changeLockZ( bool locked );
119 void changeLockM( bool locked );
120 void changeLockDistance( bool locked );
121 void changeLockAngle( bool locked );
122 void changeRelativeX( bool relative );
123 void changeRelativeY( bool relative );
124 void changeRelativeZ( bool relative );
125 void changeRelativeM( bool relative );
126 // void changeRelativeDistance( bool relative ); // doesn't happen
127 void changeRelativeAngle( bool relative );
128 void focusOnX();
129 void focusOnY();
130 void focusOnZ();
131 void focusOnM();
132 void focusOnAngle();
133 void focusOnDistance();
134 void enabledChangedX( bool enabled );
135 void enabledChangedY( bool enabled );
136 void enabledChangedZ( bool enabled );
137 void enabledChangedM( bool enabled );
138 void enabledChangedAngle( bool enabled );
139 void enabledChangedDistance( bool enabled );
140 void enabledCommonAngleSnapping( bool enabled );
141 void enabledChangedBearing( bool enabled );
142
143 private:
145 QgsMapCanvas *mMapCanvas = nullptr;
146
148 QPointer<QgsAdvancedDigitizingDockWidget> mCadDockWidget;
149
154 bool eventFilter( QObject *obj, QEvent *event ) override SIP_FORCE;
155
160 void updatePos( const QPoint &pos );
161
165 void hideIfDisabled();
166
168 bool mActive = false;
169
170 FloaterItems mItemsVisibility;
171};
172
173#endif // QGSADVANCEDDIGITIZINGFLOATER_H
A dockable widget used to handle the CAD tools on top of a selection of map tools.
QgsAdvancedDigitizingFloater(QgsMapCanvas *canvas, QgsAdvancedDigitizingDockWidget *cadDockWidget)
Create an advanced digitizing floater widget.
void setItemVisibility(const QgsAdvancedDigitizingFloater::FloaterItem &item, bool visible)
Set whether the floater item should be visible or not.
bool itemVisibility(const QgsAdvancedDigitizingFloater::FloaterItem &item) const
Returns true if the floater item visibility setting is enabled.
void setActive(bool active)
Set whether the floater should be active or not.
bool active()
Whether the floater is active or not.
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