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
xsectsampler.h File Reference

RAII wrapper over the engine's standalone cross-section API. More...

#include <QPolygonF>
#include <QVector>
#include <openswmm/engine/openswmm_engine.h>
#include <openswmm/engine/openswmm_links.h>
Include dependency graph for xsectsampler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openswmmvis::sectionview::XsectFullProps
 
class  openswmmvis::sectionview::XsectSampler
 Owning handle on one standalone SWMM cross-section. More...
 

Namespaces

namespace  openswmmvis
 
namespace  openswmmvis::sectionview
 

Functions

XsectSampler openswmmvis::sectionview::samplerFromStreetIndex (SWMM_Engine engine, int streetIdx, bool si)
 Sampler for the street at streetIdx, built from [STREETS].
 
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.
 
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).
 

Detailed Description

RAII wrapper over the engine's standalone cross-section API.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

Slice SP.1 (workplans/SECTION_PREVIEW_WORKPLAN.md).

The engine ships a complete geometry API in openswmm_xsect.h that the GUI had never consumed: an opaque SWMM_XSect handle plus width / area / hydraulic-radius queries. Sampling swmm_xsect_width_of_depth_array() over a depth ladder yields the exact outline the solver itself uses, for every SWMM_XSectShape — which is what the section-preview panels draw instead of the hand-drawn SVG thumbnails.

Shape numbering: openswmm_xsect.h takes and returns SWMM_XSectShape codes from openswmm_links.h — the SAME numbering space xsectshapegeom.h uses. There is no second numbering space and no mapping table. Still spell shape ids as SWMM_XSECT_* constants, never bare integers (see the drift warning on XsectShapeRow in ui/properties/xsectshapegeom.h).