![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Water-surface bridging for the 2D longitudinal profile. More...
#include "plot/meshprofilesampler.h"#include <QVector>#include <cmath>#include <functional>#include <limits>Go to the source code of this file.
Namespaces | |
| namespace | MeshProfileInterp |
Functions | |
| QVector< double > | MeshProfileInterp::bridgedTops (const QVector< MeshProfileSampler::Sample > &s, const std::function< double(const MeshProfileSampler::Sample &)> &topElev) |
| Compute the per-sample water-surface elevation to paint for one wet-band pass, with shallow-film rendering and dry-gap bridging. | |
| bool | MeshProfileInterp::shorelineIntercept (const QVector< MeshProfileSampler::Sample > &s, const QVector< double > &top, int runFirst, int runLast, bool trailing, double *outChainage, double *outElev) |
| Shoreline intercept just outside one end of a wet run — the exact chainage where the (wet-side-extrapolated) water surface crosses the piecewise-linear ground between the run's boundary sample and its adjacent dry sample. | |
Variables | |
| constexpr double | MeshProfileInterp::kFilm = 1e-6 |
Water-surface bridging for the 2D longitudinal profile.
The mesh profile sampler produces a continuous, barycentric-
interpolated sample series, but partially-wet / dry saddle cells
break the painted water surface into disconnected runs. This helper
turns a raw per-sample surface into a "paint top" series that:
(a) renders genuinely-wet-but-very-shallow films (depth just under
the layer's hydraulic dry threshold) instead of dropping them;
(b) bridges dry gaps that lie between two wet runs with a smooth,
no-upstream-flow-constrained water surface.
Bridging is restricted to TRUE NO-DATA gaps: with the free-surface
extrapolation fix a shoreline tapers to its sub-cell bed intercept
and is no longer a gap, so a gap whose samples all carry a valid η
(Sample::cellHasSurface) is genuinely dry ground — two pools
separated by a dry crest stay split, each flat at its own level,
instead of being joined by a chainage-linear ramp. Only a gap
containing at least one no-surface sample (a cell with no valid η
anywhere in its vertex stars) may still be bridged.
Direction signal: the painter carries no per-sample velocity, so the
most robust available signal is the two bracketing wet-surface
elevations themselves. Linear interpolation in chainage between them
is monotonic, so the bridged surface never rises above the upstream
(higher) end — water cannot pool higher downstream than its source.
Where the bed rises above the interpolated surface (a dry crest) the
sample stays dry, splitting the gap, so water never flows "uphill"
over a hill. An off-mesh (NaN ground) sample inside a gap blocks
bridging across it, preserving a genuine off-mesh gap.
Header-only so the painter and the unit test share one implementation.