24#ifndef OPENSWMMVIS_SECTIONVIEW_XSECTSAMPLER_H
25#define OPENSWMMVIS_SECTIONVIEW_XSECTSAMPLER_H
30#include <openswmm/engine/openswmm_engine.h>
31#include <openswmm/engine/openswmm_links.h>
73 double geom2,
double geom3,
74 double geom4,
bool si);
91 const QVector<double> &stations,
const QVector<double> &elevations,
92 double xLeftBank,
double xRightBank,
93 double nLeft,
double nChannel,
double nRight,
94 double lengthFactor,
bool si);
98 double width,
double curbHeight,
double slope,
double roughness,
99 double gutterDepression,
double gutterWidth,
int sides,
100 double backWidth,
double backSlope,
double backRoughness,
bool si);
105 double yFull,
const QVector<double> &normDepths,
106 const QVector<double> &normWidths,
bool si);
110 [[nodiscard]]
bool isValid() const noexcept {
return m_handle !=
nullptr; }
113 [[nodiscard]]
int shape()
const;
119 [[nodiscard]] QVector<double>
widthsAtDepths(
const QVector<double> &depths)
const;
140 [[nodiscard]] QPolygonF
outline(
int samples = 240)
const;
143 explicit XsectSampler(
void *handle) noexcept : m_handle(handle) {}
144 void reset() noexcept;
146 void *m_handle =
nullptr;
161 int streetIdx,
bool si);
175 int shape,
double g1,
double g2,
176 double g3,
double g4,
bool si);
196 double g1,
double g2,
double g3,
double g4,
197 bool si,
bool *outOpenTop =
nullptr);
Owning handle on one standalone SWMM cross-section.
Definition xsectsampler.h:57
XsectSampler & operator=(XsectSampler &&other) noexcept
Definition xsectsampler.cpp:41
QPolygonF outline(int samples=240) const
Closed outline polygon of the section, in section coordinates.
Definition xsectsampler.cpp:176
int shape() const
Definition xsectsampler.cpp:138
QVector< double > widthsAtDepths(const QVector< double > &depths) const
Definition xsectsampler.cpp:161
XsectSampler(const XsectSampler &)=delete
XsectFullProps fullProps() const
Definition xsectsampler.cpp:146
static XsectSampler fromLink(SWMM_Engine engine, int linkIdx)
Definition xsectsampler.cpp:72
XsectSampler & operator=(const XsectSampler &)=delete
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)
Definition xsectsampler.cpp:103
static XsectSampler fromCurve(double yFull, const QVector< double > &normDepths, const QVector< double > &normWidths, bool si)
Definition xsectsampler.cpp:119
static XsectSampler fromShape(int shape, double geom1, double geom2, double geom3, double geom4, bool si)
Definition xsectsampler.cpp:62
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)
Definition xsectsampler.cpp:84
bool isValid() const noexcept
Definition xsectsampler.h:110
~XsectSampler()
Definition xsectsampler.cpp:31
Definition aquifereditordialog.h:41
XsectSampler samplerFromStreetIndex(SWMM_Engine engine, int streetIdx, bool si)
Sampler for the street at streetIdx, built from [STREETS].
Definition xsectsampler.cpp:228
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.
Definition xsectsampler.cpp:248
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).
Definition xsectsampler.cpp:267
void * SWMM_Engine
Definition objectdefaultsapplier.h:19
Definition xsectsampler.h:37
double sFull
Section factor when full.
Definition xsectsampler.h:42
double aMax
Area of maximum flow.
Definition xsectsampler.h:43
double aFull
Area when full.
Definition xsectsampler.h:39
double yFull
Full depth.
Definition xsectsampler.h:38
double rFull
Hydraulic radius when full.
Definition xsectsampler.h:40
bool open
True for an open channel.
Definition xsectsampler.h:44
double wMax
Width at the widest point.
Definition xsectsampler.h:41