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
MeshProfileInterp Namespace Reference

Functions

QVector< doublebridgedTops (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 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 kFilm = 1e-6
 

Function Documentation

◆ bridgedTops()

QVector< double > MeshProfileInterp::bridgedTops ( const QVector< MeshProfileSampler::Sample > &  s,
const std::function< double(const MeshProfileSampler::Sample &)> &  topElev 
)
inline

Compute the per-sample water-surface elevation to paint for one wet-band pass, with shallow-film rendering and dry-gap bridging.

Parameters
sOrdered profile samples (chainage / ground / depths).
topElevMaps a sample to its raw water-surface elevation (e.g. ground + depthNow, or ground + maxDepth).
Returns
Parallel array of "paint top" elevations; NaN where the sample is dry (off-mesh, at/under the bed, or an unbridged crest).

◆ shorelineIntercept()

bool MeshProfileInterp::shorelineIntercept ( const QVector< MeshProfileSampler::Sample > &  s,
const QVector< double > &  top,
int  runFirst,
int  runLast,
bool  trailing,
double outChainage,
double outElev 
)
inline

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.

CellSurfaceInterp tapers the depth FIELD to the sub-cell waterline, but the painted band could only end at the last sample that happened to be wet — up to one resample step short of the true shoreline, with a vertical cliff of height (WSE − ground). This helper closes that sub-sample gap at paint time so the band tapers to a point on the ground line (premature-truncation fix).

The surface is extended from the run's two boundary-most wet samples (flat for a single-sample run) and intersected with the ground segment toward the dry neighbour. An intercept exists only when the ground actually rises through the surface within that segment — a dry neighbour whose ground stays below the surface (a no-data termination, e.g. the split flank of an unbridged pool over a low bench) keeps its hard edge, as does an off-mesh (NaN ground) neighbour and a run ending at the data edge.

Parameters
sOrdered profile samples (chainage / ground).
topPaint-top series from bridgedTops(), parallel to s.
runFirstIndex of the run's first wet (non-NaN top) sample.
runLastIndex of the run's last wet sample.
trailingtrue → intercept past runLast; false → before runFirst.
outChainage,outElevThe intercept; written only on success. The elevation lies on the drawn ground segment by construction, so both the WSE polyline and the fill close exactly onto the ground line.
Returns
true when a physically meaningful intercept exists.

Variable Documentation

◆ kFilm

constexpr double MeshProfileInterp::kFilm = 1e-6
inlineconstexpr

Paint floor (m): a sample whose water surface sits more than this above the bed renders as water. Deliberately far below the layer's hydraulic dryDepth() (~1e-4 m) so genuinely-wet thin films still draw; truly zero/negative depth (surface at/under the bed) still reads as dry.