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
importfeaturelayerdialog.h
Go to the documentation of this file.
1
13#ifndef OPENSWMMVIS_UI_DIALOGS_IMPORT_IMPORTFEATURELAYERDIALOG_H
14#define OPENSWMMVIS_UI_DIALOGS_IMPORT_IMPORTFEATURELAYERDIALOG_H
15
18
19#include <QDialog>
20#include <QFutureWatcher>
21
22class QCheckBox;
23class QComboBox;
24class QDoubleSpinBox;
25class QGroupBox;
26class QLabel;
27class QLineEdit;
28class QPushButton;
29class QRadioButton;
30class QTableView;
31
32class GISVectorLayer;
33class MapCanvas;
34class SWMMModelLayer;
36
37namespace openswmmvis::import {
38
39class ImportMappingModel;
40class ImportPreviewModel;
41
42class ImportFeatureLayerDialog : public QDialog
43{
44 Q_OBJECT
45
46public:
47 explicit ImportFeatureLayerDialog(SWMMVisProjectWindow *projectWindow,
48 QWidget *parent = nullptr);
50
52 void setSourceLayer(GISVectorLayer *layer);
53
54protected:
55
56private slots:
57 void onKindChanged();
58 void onSourceLayerChanged();
59 void onMappingEdited();
60 void onPreview();
61 void onPreviewFinished();
62 void onImport();
63 void onSavePreset();
64 void onDeletePreset();
65 void onLoadPreset(int comboIndex);
66
67private:
68 struct PreviewResult {
69 ImportPlan plan;
70 QString error;
71 int featureCount = 0;
72 };
73
74 void buildUi();
75 void repopulateSourceCombo();
76 void refreshSourceInfo();
77 void refreshPresetCombo();
78 void syncOptionsIntoMapping();
79 void updateActionEnablement();
80 [[nodiscard]] TargetKind currentKind() const;
81 [[nodiscard]] GISVectorLayer *currentSourceLayer() const;
82 [[nodiscard]] QString presetSettingsGroup() const;
83
84 SWMMVisProjectWindow *m_projectWindow = nullptr;
85 MapCanvas *m_canvas = nullptr;
86 SWMMModelLayer *m_modelLayer = nullptr;
87
88 ImportMappingModel *m_mappingModel = nullptr;
89 ImportPreviewModel *m_previewModel = nullptr;
90
91 // Source group
92 QComboBox *m_sourceCombo = nullptr;
93 QCheckBox *m_selectedOnly = nullptr;
94 QLabel *m_sourceInfo = nullptr;
95
96 // Target group
97 QComboBox *m_kindCombo = nullptr;
98
99 // Mapping group
100 QTableView *m_mappingView = nullptr;
101 QPushButton *m_autoMatchBtn = nullptr;
102 QComboBox *m_presetCombo = nullptr;
103 QPushButton *m_presetSave = nullptr;
104 QPushButton *m_presetDelete = nullptr;
105 QLabel *m_validation = nullptr;
106
107 // Endpoint group (link kinds only)
108 QGroupBox *m_endpointGroup = nullptr;
109 QCheckBox *m_epFields = nullptr;
110 QCheckBox *m_epSnap = nullptr;
111 QDoubleSpinBox *m_epTolerance = nullptr;
112 QCheckBox *m_epAutoCreate = nullptr;
113 QLineEdit *m_epPrefix = nullptr;
114
115 // Conflict group
116 QRadioButton *m_conflictSkip = nullptr;
117 QRadioButton *m_conflictUpdate = nullptr;
118 QCheckBox *m_updateAttrs = nullptr;
119 QCheckBox *m_updateGeom = nullptr;
120
121 // Preview / results
122 QTableView *m_previewView = nullptr;
123 QLabel *m_summaryLabel = nullptr;
124 QPushButton *m_previewBtn = nullptr;
125 QPushButton *m_importBtn = nullptr;
126 QPushButton *m_closeBtn = nullptr;
127
128 QFutureWatcher<PreviewResult> m_previewWatcher;
129 bool m_previewRunning = false;
130 bool m_planIsCurrent = false;
131};
132
133} // namespace openswmmvis::import
134
135#endif // OPENSWMMVIS_UI_DIALOGS_IMPORT_IMPORTFEATURELAYERDIALOG_H
A map layer backed by a GDAL/OGR vector dataset.
Definition gisvectorlayer.h:103
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
Definition maptoolselectprofile.h:37
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine mo...
Definition swmmmodellayer.h:133
MDI sub-window owning a MapCanvas, SWMMModelLayer, and map tools.
Definition swmmvisprojectwindow.h:58
Definition importfeaturelayerdialog.h:43
~ImportFeatureLayerDialog() override
Definition importfeaturelayerdialog.cpp:80
void setSourceLayer(GISVectorLayer *layer)
Definition importfeaturelayerdialog.cpp:310
Definition importmappingmodel.h:30
Definition importpreviewmodel.h:22
Definition featurelayerimporter.h:39
TargetKind
Definition importtargetregistry.h:32
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
Definition importplan.h:43