![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Classes | |
| struct | AquiferDiagramInput |
| struct | DiagramArrow |
| struct | DiagramCircle |
| struct | DiagramDim |
| struct | DiagramGround |
| struct | DiagramLeader |
| struct | DiagramPoly |
| struct | DiagramPolyline |
| struct | DiagramSymbol |
| struct | DiagramUnits |
| struct | DiagramVegetation |
| struct | DiagramViewport |
| User zoom / pan applied on top of the automatic fit. More... | |
| struct | LidDiagramInput |
| struct | PlanInset |
| struct | PlanSpoke |
| struct | SectionDiagramModel |
| Everything one preview pane draws, in model units. More... | |
| class | SectionPreviewWidget |
| struct | XsectFullProps |
| class | XsectSampler |
| Owning handle on one standalone SWMM cross-section. More... | |
Enumerations | |
| enum class | LidLayer { Surface , Pavement , Soil , Storage , Drainmat } |
| enum class | LidType { BioCell = 0 , RainGarden = 1 , GreenRoof = 2 , InfilTrench = 3 , PermPavement = 4 , RainBarrel = 5 , RooftopDisconn = 6 , VegSwale = 7 } |
| enum class | DiagramRole { Conduit , Structure , Storage , Soil , Media , Gravel , Vegetation , Water , Muted , Accent } |
| enum class | DiagramTexture { None , Stipple , Gravel , Aggregate , Sand , Hatch , Lattice , Brick } |
| enum class | DiagramSymbolKind { Pump , FlapGate , ManholeCover , RatingBox } |
Functions | |
| QString | aquiferActiveCalloutPrefix () |
| QString | aquiferWarningCalloutPrefix () |
| SectionDiagramModel | buildAquiferDiagram (const AquiferDiagramInput &in) |
| Build the two-zone groundwater illustration for one aquifer. | |
| QVector< LidLayer > | lidLayersFor (LidType type) |
| bool | lidHasDrain (LidType type) |
| QString | lidLayerName (LidLayer layer) |
| SectionDiagramModel | buildLidLayerDiagram (const LidDiagramInput &in) |
| Build the layer-stack diagram for one LID control. | |
| void | paintSectionDiagram (QPainter &painter, const QRectF &target, const SectionDiagramModel &model, const QPalette &palette, const DiagramViewport &viewport={}, QRectF *fitRectOut=nullptr, double *achievedExaggerationOut=nullptr) |
Paint model into target using palette for all colours. | |
| QColor | diagramFillColor (DiagramRole role, const QPalette &palette) |
| QColor | diagramStrokeColor (DiagramRole role, const QPalette &palette) |
| double | profileMaxExaggeration () noexcept |
| SectionDiagramModel | buildLinkSection (SWMM_Engine engine, int linkIdx, const DiagramUnits &units) |
| True-shape cross-section of a link, with dimensions + elevations. | |
| SectionDiagramModel | buildLinkProfile (SWMM_Engine engine, int linkIdx, const DiagramUnits &units) |
| Longitudinal profile of a conduit between its two nodes. | |
| SectionDiagramModel | buildNodeProfile (SWMM_Engine engine, int nodeIdx, const DiagramUnits &units, int maxLinks=8) |
| Node profile: structure, rim, invert, and every connecting link drawn at its own invert offset, plus a plan-view inset of link headings. | |
| SectionDiagramModel | buildXsectEditorPreview (int shape, double geom1, double geom2, double geom3, double geom4, const DiagramUnits &units, int highlightOrdinal=0) |
| Live preview for the cross-section editor, built from uncommitted dialog values rather than from the engine's stored link. | |
| SectionDiagramModel | buildSamplerPreview (const XsectSampler &sampler, const QString &title, const QString &subtitle, const DiagramUnits &units) |
| Preview for an already-constructed sampler (tabulated shapes). | |
| QIcon | xsectShapeIcon (int shape, const QSize &size, const QPalette &palette) |
| Icon for a SWMM_XSectShape, rendered from engine geometry. | |
| void | nominalGeomsFor (int shape, double &geom1, double &geom2, double &geom3, double &geom4) |
Representative geom1..geom4 used to draw shape at unit depth. | |
| XsectSampler | samplerFromStreetIndex (SWMM_Engine engine, int streetIdx, bool si) |
Sampler for the street at streetIdx, built from [STREETS]. | |
| XsectSampler | samplerForLink (SWMM_Engine engine, int linkIdx, int shape, double g1, double g2, double g3, double g4, bool si) |
Sampler for a link's cross-section, given the values swmm_link_get_xsect reported for it. | |
| double | linkFullDepth (SWMM_Engine engine, int linkIdx, int shape, double g1, double g2, double g3, double g4, bool si, bool *outOpenTop=nullptr) |
| A link's true full depth (crown height above the invert). | |
|
strong |
Semantic fill/stroke roles. Resolved against the palette at paint time so the same model renders correctly in light and dark themes.
|
strong |
A schematic device glyph — the P&ID convention, where a pump is a symbol rather than a scaled machine.
These exist because the things they stand for have no drawable geometry in the model: a SWMM pump carries a curve and two depths, not a casing size, so anything drawn to scale would be invented. A fixed-size glyph says "pump here" without claiming a dimension.
|
strong |
Material pattern drawn INSIDE a filled polygon, on top of its flat colour.
This is what makes a LID layer stack read as engineered materials rather than as coloured bands: a soil layer that is stippled and a storage layer full of gravel outlines are distinguishable at a glance and in greyscale, which flat fills separated only by hue are not.
Patterns are generated procedurally from a fixed seed, so a given layer looks identical on every repaint — a texture that reshuffles as the panel resizes reads as noise, not as material.
|
strong |
|
strong |
| QString openswmmvis::sectionview::aquiferActiveCalloutPrefix | ( | ) |
Prefix put on the emphasised callout's text (the leader model carries no accent flag; dimension lines use their own accent).
| QString openswmmvis::sectionview::aquiferWarningCalloutPrefix | ( | ) |
Prefix put on each warning callout's text.
| SectionDiagramModel openswmmvis::sectionview::buildAquiferDiagram | ( | const AquiferDiagramInput & | in | ) |
Build the two-zone groundwater illustration for one aquifer.
The saturated zone is drawn to the thickness Egw − Ebot when Egw > Ebot; otherwise it collapses to a hatched "unknown" slab at the bottom. The unsaturated zone above it has no engine-known thickness (the surface is a subcatchment property), so it is drawn tall enough to hold the lower evaporation depth ETs and never thinner than a fraction of the saturated zone.
| SectionDiagramModel openswmmvis::sectionview::buildLidLayerDiagram | ( | const LidDiagramInput & | in | ) |
Build the layer-stack diagram for one LID control.
Layer boxes are proportional to their thickness where known, with a floor so a thin layer stays visible and an unknown layer still occupies a row.
| SectionDiagramModel openswmmvis::sectionview::buildLinkProfile | ( | SWMM_Engine | engine, |
| int | linkIdx, | ||
| const DiagramUnits & | units | ||
| ) |
Longitudinal profile of a conduit between its two nodes.
Shows both structures (rim → invert), the ground line, the sloping barrel drawn at its true crown/invert elevations including offsets, the upstream offset dimension, and length / slope along the barrel axis.
Uses independent axis scaling (uniformScale = false) — a 120 m reach at a 0.25 % slope is unreadable at true aspect.
| SectionDiagramModel openswmmvis::sectionview::buildLinkSection | ( | SWMM_Engine | engine, |
| int | linkIdx, | ||
| const DiagramUnits & | units | ||
| ) |
True-shape cross-section of a link, with dimensions + elevations.
Draws the section outline sampled from the engine, dimensions the full depth and max width, and leaders the invert / crown elevations taken from each end node's invert plus the link's offset at that end. A sloping run reports both ends ("100.00 / 98.00 ft"); a flat one collapses to a single value.
emptyText explains the gap (pump, DUMMY section, unresolvable tabulated geometry) when there is nothing to draw. | SectionDiagramModel openswmmvis::sectionview::buildNodeProfile | ( | SWMM_Engine | engine, |
| int | nodeIdx, | ||
| const DiagramUnits & | units, | ||
| int | maxLinks = 8 |
||
| ) |
Node profile: structure, rim, invert, and every connecting link drawn at its own invert offset, plus a plan-view inset of link headings.
Inbound links (the node is their to node) are stubbed to the left, outbound to the right. Links are ordered by invert so the drawing reads like a real manhole schedule.
| maxLinks | Cap on drawn connections; the footer notes any remainder. |
Half-width of the VOID at an elevation; the shell face is this + wall.
Ring following the silhouette between two elevations, padded outward by pad (0 for the void / the water body, wall for the shell). Emitted right side bottom→top then left side top→bottom, so the first and last points are the two bottom corners.
Sampled AT the silhouette's own breakpoints rather than on a uniform ladder: a fixed ladder rounded a manhole's corbel into a bottle neck and smeared a storage curve's knee, because it interpolates across the very vertices that carry the shape.
Half-width of the VOID at an elevation; the shell face is this + wall.
Ring following the silhouette between two elevations, padded outward by pad (0 for the void / the water body, wall for the shell). Emitted right side bottom→top then left side top→bottom, so the first and last points are the two bottom corners.
Sampled AT the silhouette's own breakpoints rather than on a uniform ladder: a fixed ladder rounded a manhole's corbel into a bottle neck and smeared a storage curve's knee, because it interpolates across the very vertices that carry the shape.
| SectionDiagramModel openswmmvis::sectionview::buildSamplerPreview | ( | const XsectSampler & | sampler, |
| const QString & | title, | ||
| const QString & | subtitle, | ||
| const DiagramUnits & | units | ||
| ) |
Preview for an already-constructed sampler (tabulated shapes).
Same drawing as buildXsectEditorPreview() minus the per-geom dimensions, which are meaningless for a transect / street / shape-curve section.
| SectionDiagramModel openswmmvis::sectionview::buildXsectEditorPreview | ( | int | shape, |
| double | geom1, | ||
| double | geom2, | ||
| double | geom3, | ||
| double | geom4, | ||
| const DiagramUnits & | units, | ||
| int | highlightOrdinal = 0 |
||
| ) |
Live preview for the cross-section editor, built from uncommitted dialog values rather than from the engine's stored link.
| shape | SWMM_XSectShape code. |
| geom1..geom4 | Current spin-box values. |
| units | Unit context. |
| highlightOrdinal | 1..4 to accent that geom's dimension line, 0 for none. |
IRREGULAR / STREET / CUSTOM carry an index in geom1 rather than a dimension; pass the resolved sampler through buildSamplerPreview() instead.
| QColor openswmmvis::sectionview::diagramFillColor | ( | DiagramRole | role, |
| const QPalette & | palette | ||
| ) |
Resolve a role to its fill colour (exposed for tests + the icon renderer).
| QColor openswmmvis::sectionview::diagramStrokeColor | ( | DiagramRole | role, |
| const QPalette & | palette | ||
| ) |
Resolve a role to its stroke colour.
| bool openswmmvis::sectionview::lidHasDrain | ( | LidType | type | ) |
True when type drains through an underdrain the user can configure.
| QString openswmmvis::sectionview::lidLayerName | ( | LidLayer | layer | ) |
Display name for a layer ("Surface", "Soil", …).
Layer stack for type, top to bottom.
| double openswmmvis::sectionview::linkFullDepth | ( | SWMM_Engine | engine, |
| int | linkIdx, | ||
| int | shape, | ||
| double | g1, | ||
| double | g2, | ||
| double | g3, | ||
| double | g4, | ||
| bool | si, | ||
| bool * | outOpenTop = nullptr |
||
| ) |
A link's true full depth (crown height above the invert).
Returns g1 directly for the shapes that report a depth there, and falls back to the sampler only for STREET / IRREGULAR / CUSTOM — so the common closed-pipe path costs nothing. Returns 0 when the geometry cannot be resolved (the caller then has no crown to draw).
| [out] | outOpenTop | When non-null, receives whether the section should be DRAWN with an open top. This is a presentation predicate, not the engine's hydraulic one: it is swmm_xsect_is_open() || shape == STREET. The engine deliberately classifies a street as closed (its isOpen whitelist omits STREET_XSECT), but a street drawn with a soffit line reads as a box culvert, which it is not. |
| void openswmmvis::sectionview::nominalGeomsFor | ( | int | shape, |
| double & | geom1, | ||
| double & | geom2, | ||
| double & | geom3, | ||
| double & | geom4 | ||
| ) |
Representative geom1..geom4 used to draw shape at unit depth.
Exposed so tests can assert every surfaced shape produces a valid engine handle — a shape whose nominal geoms are rejected would silently fall back to the placeholder tile.
| void openswmmvis::sectionview::paintSectionDiagram | ( | QPainter & | painter, |
| const QRectF & | target, | ||
| const SectionDiagramModel & | model, | ||
| const QPalette & | palette, | ||
| const DiagramViewport & | viewport = {}, |
||
| QRectF * | fitRectOut = nullptr, |
||
| double * | achievedExaggerationOut = nullptr |
||
| ) |
Paint model into target using palette for all colours.
Reserves margins for the title / footer and for leader landings, fits the model bounds into what remains, and declutters progressively as the target shrinks: leaders drop out first, then dimensions, then the footer — so a narrow dock still shows a correct (if bare) drawing rather than a pile of overlapping text.
The painter's state is saved and restored; no transform leaks out.
| fitRectOut | Optionally receives the pixel rect the model bounds were fitted into, BEFORE zoom/pan. A zooming host needs it to keep the point under the cursor stationary; reporting it beats recomputing it, because the fit reserves adaptive margins for leader and dimension text and a second copy of that logic would silently drift. Left untouched when the model is empty or too small to draw. |
| achievedExaggerationOut | Optionally receives the V:H ratio actually used (1.0 for a true-scale or uniform-scale drawing). Reporting it beats inferring it from rendered pixels — which is what tests would otherwise have to do, and what a zoom readout would need. |
|
noexcept |
Cap on the automatic vertical exaggeration of a link profile.
Exposed so the Section View dock can state it without hard-coding a second copy in its tooltip.
| XsectSampler openswmmvis::sectionview::samplerForLink | ( | SWMM_Engine | engine, |
| int | linkIdx, | ||
| int | shape, | ||
| double | g1, | ||
| double | g2, | ||
| double | g3, | ||
| double | g4, | ||
| bool | si | ||
| ) |
Sampler for a link's cross-section, given the values swmm_link_get_xsect reported for it.
geom1 is a TABLE INDEX, not a depth — the engine resolves the retained name back to an index for both (openswmm_links_impl.cpp, swmm_link_get_xsect). Callers must never use geom1 as a dimension for those two shapes; take the depth from fullProps().yFull instead, which is what linkFullDepth() does. Every other shape reports a real depth in geom1. | XsectSampler openswmmvis::sectionview::samplerFromStreetIndex | ( | SWMM_Engine | engine, |
| int | streetIdx, | ||
| bool | si | ||
| ) |
Sampler for the street at streetIdx, built from [STREETS].
Preferred over the link-derived handle because swmm_street_get_params reads stored input and therefore works in EVERY lifecycle state, whereas swmm_link_create_xsect needs resolved geometry and returns SWMM_ERR_LIFECYCLE while the model is still being edited.
| QIcon openswmmvis::sectionview::xsectShapeIcon | ( | int | shape, |
| const QSize & | size, | ||
| const QPalette & | palette | ||
| ) |
Icon for a SWMM_XSectShape, rendered from engine geometry.
Results are cached per (shape, size, palette-foreground) in QPixmapCache, so repopulating the palette on every dialog open is cheap.