![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
#include "mesh/meshinfil.h"#include "mesh/naturalnbinterpolator.h"#include <QByteArray>#include <QDialog>#include <QFutureWatcher>#include <QPointF>#include <QPointer>#include <QSet>#include <QString>#include <QStringList>#include <QVector>Go to the source code of this file.
Classes | |
| class | openswmmvis::ui::MeshAttributeAssignDialog |
| struct | openswmmvis::ui::MeshAttributeAssignDialog::Job |
| Everything one sampling pass needs. More... | |
| struct | openswmmvis::ui::MeshAttributeAssignDialog::SampleResult |
| Outcome of one sampling pass over the in-scope cells. More... | |
Namespaces | |
| namespace | openswmmvis |
| namespace | openswmmvis::ui |
Assign per-cell 2D mesh parameters from a GIS source: a raster band or a vector layer's attribute field, mapped onto the mesh cells in one undoable step.
Complements the mesh-editing toolbar's cell editor — that prescribes one value to a hand-picked selection; this prescribes a spatially varying field to the whole mesh (or the current selection).
Four mapping modes (GUI plan §3.4, phase GG0e):
Sampling is orthogonal to the mode: cell centroid (point sample), area-weighted mean, majority (largest covering share), or natural neighbour. Overlay sampling is bound to the source's declared type — majority for categorical, area-weighted mean for continuous — with an explicit user override, because offering the wrong one silently produces plausible nonsense.
Numeric writes go through mesh::pushCellParamEdits and infiltration writes through mesh::pushCellInfilEdit, so the result lands on the same undo stack as every other cell edit and every view refreshes through the layer's attributeChanged signal. Multi-target and multi-row assignments are wrapped in a single QUndoStack macro so a whole assignment is one Ctrl+Z.
Sampling runs on a QtConcurrent worker guarded by a QFutureWatcher, exactly as MeshGenerationDialog does: the Job carries plain data only (no widgets, no layers, no GDAL handles) and the worker RE-OPENS every raster / vector source by path on its own thread, because GDAL/OGR handles must not cross threads. Nothing is written to the mesh until the worker has finished successfully, so cancelling mid-run leaves the mesh untouched.