QGIS API Documentation 3.41.0-Master (af5edcb665c)
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 <QWidget>
20#include <QString>
21
22#include "ui_qgsadvanceddigitizingfloaterbase.h"
24#include "qgis_gui.h"
25#include "qgis_sip.h"
26
27#include <QPointer>
28
29class QgsMapCanvas;
31
40class GUI_EXPORT QgsAdvancedDigitizingFloater : public QWidget, private Ui::QgsAdvancedDigitizingFloaterBase
41{
42 Q_OBJECT
43
44 public:
46 enum class FloaterItem : int SIP_ENUM_BASETYPE( IntFlag )
47 {
48 XCoordinate = 1 << 1,
49 YCoordinate = 1 << 2,
50 MCoordinate = 1 << 3,
51 ZCoordinate = 1 << 4,
52 Angle = 1 << 5,
53 CommonAngleSnapping = 1 << 6,
54 Distance = 1 << 7,
55 Bearing = 1 << 8,
56 };
57 Q_DECLARE_FLAGS( FloaterItems, FloaterItem )
58 Q_FLAG( FloaterItem )
59
60
61
68
74 bool active();
75
82 bool itemVisibility( const QgsAdvancedDigitizingFloater::FloaterItem &item ) const;
83
84 public slots:
85
93 void setActive( bool active );
94
102 void setItemVisibility( const QgsAdvancedDigitizingFloater::FloaterItem &item, bool visible );
103
104 private slots:
105
106 void changeX( const QString &text );
107 void changeY( const QString &text );
108 void changeZ( const QString &text );
109 void changeM( const QString &text );
110 void changeCommonAngleSnapping( double angle );
111 void changeDistance( const QString &text );
112 void changeAngle( const QString &text );
113 void changeBearing( const QString &text );
114 void changeLockX( bool locked );
115 void changeLockY( bool locked );
116 void changeLockZ( bool locked );
117 void changeLockM( bool locked );
118 void changeLockDistance( bool locked );
119 void changeLockAngle( bool locked );
120 void changeRelativeX( bool relative );
121 void changeRelativeY( bool relative );
122 void changeRelativeZ( bool relative );
123 void changeRelativeM( bool relative );
124 // void changeRelativeDistance( bool relative ); // doesn't happen
125 void changeRelativeAngle( bool relative );
126 void focusOnX();
127 void focusOnY();
128 void focusOnZ();
129 void focusOnM();
130 void focusOnAngle();
131 void focusOnDistance();
132 void enabledChangedX( bool enabled );
133 void enabledChangedY( bool enabled );
134 void enabledChangedZ( bool enabled );
135 void enabledChangedM( bool enabled );
136 void enabledChangedAngle( bool enabled );
137 void enabledChangedDistance( bool enabled );
138 void enabledCommonAngleSnapping( bool enabled );
139 void enabledChangedBearing( bool enabled );
140
141 private:
143 QgsMapCanvas *mMapCanvas = nullptr;
144
146 QPointer<QgsAdvancedDigitizingDockWidget> mCadDockWidget;
147
152 bool eventFilter( QObject *obj, QEvent *event ) override SIP_FORCE;
153
158 void updatePos( const QPoint &pos );
159
163 void hideIfDisabled();
164
166 bool mActive = false;
167
168 FloaterItems mItemsVisibility;
169};
170
171#endif // QGSADVANCEDDIGITIZINGFLOATER_H
The QgsAdvancedDigitizingDockWidget class is a dockable widget used to handle the CAD tools on top of...
The QgsAdvancedDigitizingFloater class is widget that floats next to the mouse pointer,...
Map canvas is a class for displaying all GIS data types on a canvas.
#define SIP_FORCE
Definition qgis_sip.h:131
#define SIP_ENUM_BASETYPE(type)
Definition qgis_sip.h:278