![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
#include <QPair>#include <QPointF>#include <QString>#include <QVector>#include <utility>#include <vector>Go to the source code of this file.
Classes | |
| class | mesh::NaturalNeighbourInterpolator |
Namespaces | |
| namespace | mesh |
Natural-neighbour interpolation over a sparse set of scattered seed points (x, y, z). Used as an alternative to inverse-distance weighting for the no-DTM elevation fallback in the mesh generator: when no terrain raster is supplied, mesh-vertex z is interpolated from SWMM junction rim elevations and 3D feature-Z seeds.
The seeds are triangulated once with Shewchuk's Triangle (the same vendored library the MeshGenerator uses) to obtain a Delaunay triangulation + neighbour adjacency. Each query then performs a local insertion (Watson's method) to recover the natural neighbours of the query point and their weights:
Sibson — area-stealing coordinates: weight_i = (Voronoi area the query cell steals from neighbour i) / (total stolen area). C1-smooth. Laplace — non-Sibsonian "edge" coordinates: weight_i = (length of the Voronoi facet between query and neighbour i) / ||query - p_i||.
Natural-neighbour interpolation is only defined inside the convex hull of the seeds. interpolate() returns NaN outside the hull and on any degeneracy so the caller can fall back to IDW.
Thread-safety: interpolate() mutates a walk-start cache (m_lastTri), so a single instance is NOT safe for concurrent queries. It is, however, safe to build and query off the GUI thread (no Qt-widget access) — which is how the QtConcurrent mesh worker uses it, sequentially.