![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Classes | |
| struct | TraceResult |
| Result of an upstream / downstream network trace. More... | |
Functions | |
| QSet< SWMMObjectRef > | invert (SWMMModelLayer *model, const QSet< SWMMObjectRef > ¤t) |
| Invert the selection, scoped to a single category when the current selection is homogeneous. | |
| TraceResult | trace (SWMMModelLayer *model, const QSet< SWMMObjectRef > &seeds, bool upstream) |
All objects connected upstream (or downstream) of seeds. | |
| QSet< SWMMObjectRef > SelectionOps::invert | ( | SWMMModelLayer * | model, |
| const QSet< SWMMObjectRef > & | current | ||
| ) |
Invert the selection, scoped to a single category when the current selection is homogeneous.
"Category" here is the fine SWMMModelLayer::Category — Junctions, Outfalls, Storage, Dividers, Conduits, Pumps, Orifices, Weirs, Outlets, Subcatchments, Rain Gages. So inverting a selection of three junctions yields every other junction; a selection of a junction plus a conduit is mixed and inverts across all eleven categories.
Rules:
MeshVertex / MeshEdge / MeshCell) and non-spatial data refs (Curve / TimeSeries / …) are passed through unchanged: they neither participate in the homogeneity test nor get inverted.model is null or has no engine. | TraceResult SelectionOps::trace | ( | SWMMModelLayer * | model, |
| const QSet< SWMMObjectRef > & | seeds, | ||
| bool | upstream | ||
| ) |
All objects connected upstream (or downstream) of seeds.
Seeding: a selected node seeds itself; a selected link seeds both its endpoints; a selected subcatchment seeds itself when tracing upstream, and when tracing downstream contributes its outlet chain (each subcatchment hop is included in the result, and the terminal outlet node becomes a node seed). Mesh and data refs in seeds are ignored.
Traversal is a BFS over the directed link graph — reversed for upstream. A link is included when both endpoints land inside the visited node set.
Subcatchments: drainage runs subcatchment → node, so a subcatchment is always upstream of its outlet. Tracing upstream therefore pulls in every subcatchment draining to a visited node, plus — transitively — every subcatchment draining into one of those. Tracing downstream picks up subcatchments only along the outlet chain of a subcatchment seed. That asymmetry is physical, not an oversight.
Both BFS loops are visited-guarded, so a malformed subcatchment→subcatchment cycle terminates instead of hanging.