SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
featurelayerpanel.h
Go to the documentation of this file.
1
23#ifndef FEATURELAYERPANEL_H
24#define FEATURELAYERPANEL_H
25
26#include <QPointer>
27#include <QWidget>
28
29class QCheckBox;
30class QComboBox;
31class QDoubleSpinBox;
32class QLabel;
33class QListWidget;
34class QPushButton;
35class QSpinBox;
36class QTableWidget;
37class QToolButton;
38
39class FeatureLayer;
40class MapCanvas;
41
42namespace openswmmvis::ui {
43
44class FeatureLayerPanel : public QWidget
45{
46 Q_OBJECT
47
48public:
49 explicit FeatureLayerPanel(QWidget *parent = nullptr);
50
53 [[nodiscard]] MapCanvas *canvas() const { return m_canvas.data(); }
54
56 [[nodiscard]] FeatureLayer *activeLayer() const { return m_active.data(); }
57
58public slots:
61 void refreshLayerList();
63 void selectLayer(FeatureLayer *layer);
64
65signals:
74 void message(const QString &text);
75
76private slots:
77 void onLayerRowChanged(int row);
78 void onAddField();
79 void onRemoveField();
80 void onResampleZ();
81 void onZPolicyEdited();
82 void onRemoveLayer();
83
84 // ----- Feature grid ---------------------------------------------------
86 void refreshFeatureTable();
88 void onFeatureCellChanged(int row, int column);
90 void onFeatureSelectionChanged();
92 void onFeatureSelectionChangedFromLayer();
94 void onDeleteSelectedFeatureRows();
95 void onFeatureTableContextMenu(const QPoint &pos);
96
97 // ----- Vertex grid ----------------------------------------------------
99 void refreshVertexTable();
101 void onVertexCellChanged(int row, int column);
102
103private:
104 void buildUi();
106 void refreshDetails();
107 void refreshStatus();
109 void bindActiveLayer(FeatureLayer *layer);
110 void populateZSourceLayers();
111 [[nodiscard]] bool zEditsSuppressed() const { return m_suppressZEdits; }
112
113 QPointer<MapCanvas> m_canvas;
114 QPointer<FeatureLayer> m_active;
115
116 // Layers
117 QListWidget *m_layerList = nullptr;
118 QPushButton *m_newBtn = nullptr;
119 QPushButton *m_importBtn = nullptr;
120 QPushButton *m_exportBtn = nullptr;
121 QPushButton *m_removeBtn = nullptr;
122
123 // Schema
124 QTableWidget *m_fieldTable = nullptr;
125 QPushButton *m_addFieldBtn = nullptr;
126 QPushButton *m_removeFieldBtn = nullptr;
127
128 // Feature grid — the rows are features, not columns. Read-only until the
129 // layer is in an edit session; Delete and the context menu remove rows.
130 QTableWidget *m_featureTable = nullptr;
131 QPushButton *m_deleteFeatBtn = nullptr;
132 QLabel *m_featHintLabel = nullptr;
135 bool m_suppressFeatureEdits = false;
136
137 // Vertex grid — the coordinates of the ONE selected feature, one row per
138 // vertex. Each row carries its (part, ring, index) address, so interior
139 // rings and multi-part geometries are reachable; ring 0 is the exterior.
140 // Editable on the same terms as the feature grid: an open edit session.
141 QTableWidget *m_vertexTable = nullptr;
142 QLabel *m_vertexHintLabel = nullptr;
144 bool m_suppressVertexEdits = false;
150 bool m_vertexEditInFlight = false;
154 qint64 m_vertexFeatureId = -1;
155
156 // Z
157 QComboBox *m_zSourceCombo = nullptr;
158 QComboBox *m_zLayerCombo = nullptr;
159 QSpinBox *m_zBandSpin = nullptr;
160 QDoubleSpinBox *m_zConstantSpin = nullptr;
161 QDoubleSpinBox *m_zScaleSpin = nullptr;
162 QDoubleSpinBox *m_zDensifySpin = nullptr;
163 QCheckBox *m_zResampleBox = nullptr;
164 QPushButton *m_resampleBtn = nullptr;
165
166 QLabel *m_statusLabel = nullptr;
167
170 bool m_suppressZEdits = false;
171};
172
173} // namespace openswmmvis::ui
174
175#endif // FEATURELAYERPANEL_H
An editable, GeoPackage-backed vector layer.
Definition featurelayer.h:127
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
Definition featurelayerpanel.h:45
void importRequested(FeatureLayer *into)
void selectLayer(FeatureLayer *layer)
Select layer if it is in the list.
Definition featurelayerpanel.cpp:413
void message(const QString &text)
A non-fatal message for the status bar.
FeatureLayer * activeLayer() const
The layer the drawing / editing tools should write into.
Definition featurelayerpanel.h:56
void activeLayerChanged(FeatureLayer *layer)
The edit target changed; the tools re-target on this.
void setCanvas(MapCanvas *canvas)
Bind to canvas. Passing nullptr detaches and clears.
Definition featurelayerpanel.cpp:365
void newLayerRequested()
The user asked to create a layer. The host owns the dialog and the project-GeoPackage path,...
void exportRequested(FeatureLayer *layer)
MapCanvas * canvas() const
Definition featurelayerpanel.h:53
void refreshLayerList()
Re-read the layer list from the canvas, preserving the selection where the layer still exists.
Definition featurelayerpanel.cpp:383
Definition openswmmvislayer.h:43
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
int pos
Definition queryparser.cpp:36
QString text
Definition queryparser.cpp:35