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

Classes

struct  BranchLink
 One link incident to a path node, described from that node's point of view. More...
 
struct  Diagnostic
 Returned from validate() to flag malformed inputs without triggering exceptions. Empty error means "OK". More...
 
struct  LinkStatic
 Time-invariant per-link properties. Only links present on the chosen path are populated. Indices in PathStatic::links are 0..N-1 where N == PathStatic::nodes.size() - 1, and link[i] joins node[i] → node[i+1] in path-traversal order (which may differ from the underlying model link's intrinsic from/to direction when the router operated in undirected mode). More...
 
struct  NodeStatic
 Time-invariant per-node properties needed by the profile plot. The "rim" elevation is always invertElev + maxDepth — terrain DEMs only override the ground line drawn behind the manhole glyph (see PathStatic::terrainSamples), never the rim itself. More...
 
struct  PathStatic
 A fully-resolved profile path: ordered nodes, joining links, and cumulative chainage from nodes[0] to each subsequent node. chainage.size() == nodes.size() and chainage[0] == 0.0. More...
 
struct  SourceDerived
 Output of compute(): per-source HGL/EGL series and per-node envelope min/max. Sized to match the input SourceSeries. More...
 
struct  SourceSeries
 Pre-fetched per-source time-series. One instance per SWMMResultsLayer that the user wants to overlay on the plot. More...
 

Enumerations

enum class  NodeKind {
  Junction = 0 ,
  Outfall ,
  Storage ,
  Divider ,
  VirtualJunction
}
 Topology category for the manhole-glyph picker in ProfilePlotWidget. Maps 1:1 to the relevant SWMMModelLayer::Category values; kept as a self-contained enum so this header has no model-layer dependency. More...
 
enum class  LinkKind {
  Conduit = 0 ,
  Pump ,
  Orifice ,
  Weir ,
  Outlet
}
 Connector category for the conduit-vs-glyph render branch in ProfilePlotWidget. More...
 
enum class  OutputKind {
  HGL = 0 ,
  EGL ,
  WaterSurface ,
  MaxHGL ,
  MaxEGL ,
  MinHGL ,
  MinEGL ,
  MaxWaterSurface ,
  MinWaterSurface
}
 Which elevation-axis quantity a profile series represents. Every option resolves to an elevation (ft or m) so all series can share the y-axis. Used by the multi-output/multi-model overlay: each series in the profile is (resultsLayer × OutputKind). More...
 

Functions

QVector< doublecomputeChainage (const QVector< LinkStatic > &links)
 Computes cumulative chainage from the first node. chainage[0] = 0.0, chainage[i] = chainage[i-1] + links[i-1].length. Returns the populated array — does not mutate path.
 
double groundElev (const NodeStatic &n)
 Returns the ground elevation at node i along the path. Equivalent to nodes[i].invertElev + nodes[i].maxDepth.
 
double conduitInvertUpstream (const PathStatic &path, int linkIdx)
 Returns the conduit-invert elevation at the upstream end of link i along the path: nodes[i].invertElev + links[i].offset1.
 
double conduitInvertDownstream (const PathStatic &path, int linkIdx)
 Symmetric to conduitInvertUpstream for the downstream end: nodes[i+1].invertElev + links[i].offset2.
 
double velocityHead (const PathStatic &path, const SourceSeries &src, int nodeIdx, int period, double gravity)
 Velocity-head at node nodeIdx for the given source at period p, using the path-direction convention: head node uses downstream velocity only, tail node uses upstream only, interior nodes average the two incident links. Returns 0.0 if velocity data is missing or the period is out of range. Uses |v|.
 
double eglAtPeriod (const PathStatic &path, const SourceSeries &src, int nodeIdx, int period, double gravity)
 Convenience: EGL at node nodeIdx, period p = HGL(nodeIdx, p) + velocityHead(nodeIdx, p, g).
 
Diagnostic validate (const PathStatic &path, const SourceSeries &src)
 Sanity-checks a PathStatic + SourceSeries pair before compute(). Catches: empty path (< 2 nodes), links-count mismatch (must be nodes-1), mismatched series array sizes vs path size, zero report step on a non-empty series, etc.
 
SourceDerived compute (const PathStatic &path, const SourceSeries &src, double gravity)
 Builds per-node HGL/EGL time-series and per-node envelope min/max for a single source. Assumes the input has passed validate(). Returns an empty SourceDerived on validation failure.
 
bool appendPeriods (const PathStatic &path, const SourceSeries &src, double gravity, SourceDerived &derived)
 Live results: extend a SourceDerived built over the first derived.hglByPeriod.size() periods of src with the periods src has gained since. src must be the full (grown) series. Appends one period-major row per new period and updates the running envelopes; the result is identical to compute() over the whole series (both use accumulatePeriod). Returns false and leaves derived untouched when src does not validate, has fewer periods than derived, or derived is not a compute() of this path. A no-op success when nothing was appended.
 
void accumulatePeriod (const PathStatic &path, const SourceSeries &src, int p, double gravity, SourceDerived &out)
 The per-period kernel shared by compute() and appendPeriods(): fills period p's rows of out (which must already be sized and NaN-filled for p) and folds the values into the envelopes.
 

Variables

constexpr double kGravityFps2 = 32.174
 Standard gravitational acceleration in the two unit systems SWMM supports. Caller passes whichever applies to its .out file.
 
constexpr double kGravityMps2 = 9.80665
 
constexpr double kNoBearing = 1.0e9
 

Enumeration Type Documentation

◆ LinkKind

enum class ProfileBuilder::LinkKind
strong

Connector category for the conduit-vs-glyph render branch in ProfilePlotWidget.

Enumerator
Conduit 
Pump 
Orifice 
Weir 
Outlet 

◆ NodeKind

enum class ProfileBuilder::NodeKind
strong

Topology category for the manhole-glyph picker in ProfilePlotWidget. Maps 1:1 to the relevant SWMMModelLayer::Category values; kept as a self-contained enum so this header has no model-layer dependency.

Enumerator
Junction 
Outfall 
Storage 
Divider 
VirtualJunction 

Virtual junction — a computational break point inside a conduit, not a structure. It contributes a rim elevation to the ground line but gets no manhole shaft and no glyph: the pipe (and the soil above it) runs through it unbroken.

◆ OutputKind

enum class ProfileBuilder::OutputKind
strong

Which elevation-axis quantity a profile series represents. Every option resolves to an elevation (ft or m) so all series can share the y-axis. Used by the multi-output/multi-model overlay: each series in the profile is (resultsLayer × OutputKind).

Mapping to ProfileBuilder::SourceDerived arrays:

  • HGL → hglByPeriod (animated, per period)
  • EGL → eglByPeriod (animated, per period)
  • WaterSurface → waterSurfaceByPeriod (invert + nodeDepth)
  • MaxHGL → maxHgl (envelope, time-invariant)
  • MaxEGL → maxEgl
  • MinHGL → minHgl
  • MinEGL → minEgl
  • MaxWaterSurface / MinWaterSurface → maxWaterSurface / minWaterSurface
Enumerator
HGL 
EGL 
WaterSurface 
MaxHGL 
MaxEGL 
MinHGL 
MinEGL 
MaxWaterSurface 
MinWaterSurface 

Function Documentation

◆ accumulatePeriod()

void ProfileBuilder::accumulatePeriod ( const PathStatic path,
const SourceSeries src,
int  p,
double  gravity,
SourceDerived out 
)

The per-period kernel shared by compute() and appendPeriods(): fills period p's rows of out (which must already be sized and NaN-filled for p) and folds the values into the envelopes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendPeriods()

bool ProfileBuilder::appendPeriods ( const PathStatic path,
const SourceSeries src,
double  gravity,
SourceDerived derived 
)

Live results: extend a SourceDerived built over the first derived.hglByPeriod.size() periods of src with the periods src has gained since. src must be the full (grown) series. Appends one period-major row per new period and updates the running envelopes; the result is identical to compute() over the whole series (both use accumulatePeriod). Returns false and leaves derived untouched when src does not validate, has fewer periods than derived, or derived is not a compute() of this path. A no-op success when nothing was appended.

Here is the call graph for this function:

◆ compute()

SourceDerived ProfileBuilder::compute ( const PathStatic path,
const SourceSeries src,
double  gravity 
)

Builds per-node HGL/EGL time-series and per-node envelope min/max for a single source. Assumes the input has passed validate(). Returns an empty SourceDerived on validation failure.

Here is the call graph for this function:

◆ computeChainage()

QVector< double > ProfileBuilder::computeChainage ( const QVector< LinkStatic > &  links)

Computes cumulative chainage from the first node. chainage[0] = 0.0, chainage[i] = chainage[i-1] + links[i-1].length. Returns the populated array — does not mutate path.

Here is the caller graph for this function:

◆ conduitInvertDownstream()

double ProfileBuilder::conduitInvertDownstream ( const PathStatic path,
int  linkIdx 
)

Symmetric to conduitInvertUpstream for the downstream end: nodes[i+1].invertElev + links[i].offset2.

◆ conduitInvertUpstream()

double ProfileBuilder::conduitInvertUpstream ( const PathStatic path,
int  linkIdx 
)

Returns the conduit-invert elevation at the upstream end of link i along the path: nodes[i].invertElev + links[i].offset1.

◆ eglAtPeriod()

double ProfileBuilder::eglAtPeriod ( const PathStatic path,
const SourceSeries src,
int  nodeIdx,
int  period,
double  gravity 
)

Convenience: EGL at node nodeIdx, period p = HGL(nodeIdx, p) + velocityHead(nodeIdx, p, g).

Here is the call graph for this function:

◆ groundElev()

double ProfileBuilder::groundElev ( const NodeStatic n)

Returns the ground elevation at node i along the path. Equivalent to nodes[i].invertElev + nodes[i].maxDepth.

Here is the caller graph for this function:

◆ validate()

Diagnostic ProfileBuilder::validate ( const PathStatic path,
const SourceSeries src 
)

Sanity-checks a PathStatic + SourceSeries pair before compute(). Catches: empty path (< 2 nodes), links-count mismatch (must be nodes-1), mismatched series array sizes vs path size, zero report step on a non-empty series, etc.

Here is the caller graph for this function:

◆ velocityHead()

double ProfileBuilder::velocityHead ( const PathStatic path,
const SourceSeries src,
int  nodeIdx,
int  period,
double  gravity 
)

Velocity-head at node nodeIdx for the given source at period p, using the path-direction convention: head node uses downstream velocity only, tail node uses upstream only, interior nodes average the two incident links. Returns 0.0 if velocity data is missing or the period is out of range. Uses |v|.

Here is the caller graph for this function:

Variable Documentation

◆ kGravityFps2

constexpr double ProfileBuilder::kGravityFps2 = 32.174
inlineconstexpr

Standard gravitational acceleration in the two unit systems SWMM supports. Caller passes whichever applies to its .out file.

ft / s² — US flow units.

◆ kGravityMps2

constexpr double ProfileBuilder::kGravityMps2 = 9.80665
inlineconstexpr

m / s² — SI flow units.

◆ kNoBearing

constexpr double ProfileBuilder::kNoBearing = 1.0e9
inlineconstexpr

Sentinel for BranchLink::bearingRad when a link's plan geometry is degenerate and no honest bearing exists. Outside [-pi, pi], so a renderer that forgets to check draws nothing sensible rather than a plausible-but- wrong north spoke.