50#ifndef OPENSWMMVIS_UI_DIALOGS_MESHATTRIBUTEASSIGNDIALOG_H
51#define OPENSWMMVIS_UI_DIALOGS_MESHATTRIBUTEASSIGNDIALOG_H
58#include <QFutureWatcher>
198 const QString &depthUnitLabel,
199 QWidget *
parent =
nullptr);
208 void onSourceChanged();
209 void onTargetChanged();
210 void onModeChanged();
211 void onSamplingChanged();
214 void onBrowseRaster();
215 void onCancelOrClose();
216 void onSampleFinished();
219 void onAddTargetRow();
220 void onRemoveTargetRow();
223 void onAddLookupRow();
224 void onRemoveLookupRow();
225 void onLoadLookupCsv();
226 void onSaveLookupCsv();
227 void onTwoKeyToggled();
230 void buildUi(
Source initialSource,
const QString &depthUnitLabel);
231 void buildTargetGroup(
const QString &depthUnitLabel);
232 void buildLookupGroup();
233 void populateLayerCombos();
234 void refreshVectorFields();
235 void updateButtons();
236 void setRunning(
bool running);
240 void fillParamCombo(QComboBox *combo,
const QString &depthUnitLabel)
const;
242 [[nodiscard]]
Mode currentMode()
const;
243 [[nodiscard]]
Sampling currentSampling()
const;
246 [[nodiscard]] QVector<int> scopeTriangles()
const;
249 [[nodiscard]] QVector<QPointF> centroidsFor(
const QVector<int> &tris)
const;
253 [[nodiscard]]
bool collectJob(
Job *job, QString *
err)
const;
256 void startSampling(
bool apply);
259 [[nodiscard]] QVector<QByteArray> collectTargetKeys()
const;
263 void setTargetRowSourceWidget(
int row);
269 void rebuildLookupColumns();
272 void maskLookupRow(
int row);
275 [[nodiscard]] QString summarise(
const SampleResult &r)
const;
287 QPointer<SWMM2DMeshLayer> m_mesh;
288 QPointer<MapCanvas> m_canvas;
289 QPointer<SelectionManager> m_selection;
291 QComboBox *m_modeCombo =
nullptr;
292 QComboBox *m_targetCombo =
nullptr;
293 QGroupBox *m_singleGroup =
nullptr;
294 QGroupBox *m_multiGroup =
nullptr;
295 QTableWidget *m_targetTable =
nullptr;
296 QPushButton *m_addTargetBtn =
nullptr;
297 QPushButton *m_delTargetBtn =
nullptr;
298 QGroupBox *m_lookupGroup =
nullptr;
299 QTableWidget *m_lookupTable =
nullptr;
300 QComboBox *m_key1Combo =
nullptr;
301 QComboBox *m_key2Combo =
nullptr;
302 QSpinBox *m_key1BandSpin =
nullptr;
303 QSpinBox *m_key2BandSpin =
nullptr;
304 QCheckBox *m_twoKeyCheck =
nullptr;
305 QLabel *m_key1Label =
nullptr;
306 QLabel *m_key2Label =
nullptr;
308 QRadioButton *m_srcRaster =
nullptr;
309 QRadioButton *m_srcVector =
nullptr;
310 QComboBox *m_rasterCombo =
nullptr;
311 QPushButton *m_browseBtn =
nullptr;
312 QSpinBox *m_bandSpin =
nullptr;
313 QDoubleSpinBox *m_scaleSpin =
nullptr;
314 QDoubleSpinBox *m_offsetSpin =
nullptr;
315 QComboBox *m_vectorCombo =
nullptr;
316 QComboBox *m_fieldCombo =
nullptr;
317 QCheckBox *m_selectedOnly =
nullptr;
319 QComboBox *m_samplingCombo =
nullptr;
320 QComboBox *m_nnVariantCombo =
nullptr;
321 QLabel *m_nnVariantLbl =
nullptr;
323 QRadioButton *m_writeOverrides =
nullptr;
324 QRadioButton *m_writeDefaults =
nullptr;
325 QCheckBox *m_keepInherited =
nullptr;
326 QGroupBox *m_writeGroup =
nullptr;
328 QRadioButton *m_scopeAll =
nullptr;
329 QRadioButton *m_scopeSelected =
nullptr;
330 QLabel *m_statusLbl =
nullptr;
331 QProgressBar *m_progress =
nullptr;
332 QPushButton *m_previewBtn =
nullptr;
333 QPushButton *m_applyBtn =
nullptr;
334 QPushButton *m_closeBtn =
nullptr;
337 QString m_browsedRasterPath;
340 QString m_depthUnitLabel;
350 bool m_applyPending =
false;
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
Definition maptoolselectprofile.h:37
Definition swmm2dmeshlayer.h:64
Owner of the canonical selection set for one SWMM project.
Definition selectionmanager.h:112
Variant
Definition naturalnbinterpolator.h:49
Definition meshattributeassigndialog.h:83
Source
Which source the dialog opens on.
Definition meshattributeassigndialog.h:88
void reject() override
Esc / Close / the window button. While a sampling pass is running this cancels it instead of closing,...
Definition meshattributeassigndialog.cpp:2096
Sampling
How one cell's source value is obtained.
Definition meshattributeassigndialog.h:98
@ NaturalNeighbour
Sibson / Laplace over scattered points.
@ OverlayAuto
Majority or area-weighted mean, by source type.
@ Centroid
Point sample at the cell centroid (original).
@ AreaWeightedMean
Mean over the cell's footprint (continuous).
@ Majority
Largest covering share wins (categorical).
Mode
What the assignment writes.
Definition meshattributeassigndialog.h:91
@ ClassifiedInfil
Key (or key pair) → a whole mesh::InfilRow.
@ SingleNumeric
One source value → one numeric cell parameter.
@ MultiNumeric
N source values → N numeric cell parameters.
WriteTarget
Where the assignment lands (GUI plan §3.4 "Write as", engine D-I3).
Definition meshattributeassigndialog.h:107
@ RegionDefaults
One [2D_INFILTRATION_DEFAULTS] row per region tag.
@ CellOverrides
Per-cell [2D_INFILTRATION] override rows.
DiagramType t
Definition diagramspec.cpp:20
QString err
Definition inpmeshwriter.cpp:575
Per-cell 2D infiltration: value types, tag/override resolution and method↔parameter masks.
Definition openswmmvislayer.h:43
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
An editable, reusable classified lookup table. Saved/loaded as CSV so an agency's standard table trav...
Definition meshinfil.h:238
Everything one sampling pass needs.
Definition meshattributeassigndialog.h:122
QStringList fields
Parallel to targetKeys (numeric modes).
Definition meshattributeassigndialog.h:149
QVector< int > bands
Parallel to targetKeys (numeric modes).
Definition meshattributeassigndialog.h:139
QString vectorFilterExpr
Definition meshattributeassigndialog.h:148
QVector< QPointF > triVerts
Definition meshattributeassigndialog.h:133
QString keyField2
Classified mode; "" = single key.
Definition meshattributeassigndialog.h:151
QSet< long long > selectedIds
Definition meshattributeassigndialog.h:153
double offset
Definition meshattributeassigndialog.h:143
mesh::InfilLookupTable table
Definition meshattributeassigndialog.h:161
QString rasterPath
Definition meshattributeassigndialog.h:138
QVector< int > triangles
Definition meshattributeassigndialog.h:131
Sampling sampling
Definition meshattributeassigndialog.h:125
QVector< QByteArray > targetKeys
Definition meshattributeassigndialog.h:156
Mode mode
Definition meshattributeassigndialog.h:123
double scale
Definition meshattributeassigndialog.h:142
QVector< double > targetMin
Parallel to targetKeys.
Definition meshattributeassigndialog.h:157
QString vectorLayerName
Definition meshattributeassigndialog.h:147
QString meshCrsWkt
Mesh layer CRS; "" = assume source CRS.
Definition meshattributeassigndialog.h:135
QString vectorPath
Definition meshattributeassigndialog.h:146
mesh::NaturalNeighbourInterpolator::Variant nnVariant
Definition meshattributeassigndialog.h:164
QString keyField1
Classified mode.
Definition meshattributeassigndialog.h:150
QVector< QPointF > centroids
Definition meshattributeassigndialog.h:132
Source source
Definition meshattributeassigndialog.h:124
int keyBand1
Classified mode: band supplying key 1.
Definition meshattributeassigndialog.h:140
QVector< double > targetMax
Parallel to targetKeys.
Definition meshattributeassigndialog.h:158
int keyBand2
Classified mode: 0 = single key.
Definition meshattributeassigndialog.h:141
bool filterBySelection
Definition meshattributeassigndialog.h:152
Outcome of one sampling pass over the in-scope cells.
Definition meshattributeassigndialog.h:170
QVector< int > triangles
Cells that received a value.
Definition meshattributeassigndialog.h:171
int skippedNoData
NoData / outside the source.
Definition meshattributeassigndialog.h:181
bool cancelled
Definition meshattributeassigndialog.h:186
QStringList keys
Definition meshattributeassigndialog.h:179
QVector< mesh::InfilRow > rows
Definition meshattributeassigndialog.h:176
int skippedRange
Outside the parameter's range.
Definition meshattributeassigndialog.h:183
int scanned
Cells considered.
Definition meshattributeassigndialog.h:185
QString error
Non-empty aborts the pass.
Definition meshattributeassigndialog.h:191
int skippedNonNumeric
Field value not a number.
Definition meshattributeassigndialog.h:182
QVector< QVector< double > > values
Definition meshattributeassigndialog.h:174
QString resolvedSampling
Definition meshattributeassigndialog.h:190
int unmatchedKeys
Classified: fell through to the fallback row.
Definition meshattributeassigndialog.h:184