|
| static XsectSampler | fromShape (int shape, double geom1, double geom2, double geom3, double geom4, bool si) |
| |
| static XsectSampler | fromLink (SWMM_Engine engine, int linkIdx) |
| |
| static XsectSampler | fromTransect (const QVector< double > &stations, const QVector< double > &elevations, double xLeftBank, double xRightBank, double nLeft, double nChannel, double nRight, double lengthFactor, bool si) |
| |
| static XsectSampler | fromStreet (double width, double curbHeight, double slope, double roughness, double gutterDepression, double gutterWidth, int sides, double backWidth, double backSlope, double backRoughness, bool si) |
| |
| static XsectSampler | fromCurve (double yFull, const QVector< double > &normDepths, const QVector< double > &normWidths, bool si) |
| |
Owning handle on one standalone SWMM cross-section.
Move-only (the engine handle is not refcounted). A default-constructed or failed sampler is !isValid() and every query returns a zeroed result, so callers can build one unconditionally and let the empty state fall through to the widget's "no geometry" message.
| QPolygonF openswmmvis::sectionview::XsectSampler::outline |
( |
int |
samples = 240 | ) |
const |
Closed outline polygon of the section, in section coordinates.
The polygon is centred on x = 0 with y measured UP from the invert (y = 0 at the invert, y = yFull at the crown / top of bank), i.e. the natural coordinate system for a section drawing — the painter flips Y.
Built by sampling half-width over samples + 1 depths and mirroring, so it reproduces the engine's own geometry for every shape, including the tabulated ones. The ladder is cosine-spaced, not uniform: width changes fastest at the invert and the crown, so that is where the points need to be (a uniform ladder makes circular pipes look faceted top and bottom).
- Parameters
-
| samples | Depth intervals; more samples smooth curved crowns. Clamped to [8, 512]. The default is generous because a section is drawn once per selection, not per frame. |
- Returns
- An empty polygon when the sampler is invalid or the section has no geometry (SWMM_XSECT_DUMMY, or a degenerate depth).