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
inletprovider.h
Go to the documentation of this file.
1
21#ifndef OPENSWMMVIS_INLET_INLETPROVIDER_H
22#define OPENSWMMVIS_INLET_INLETPROVIDER_H
23
24#include <QObject>
25#include <QString>
26
28
30enum class InletType {
31 Grate = 0,
32 Curb = 1,
33 Combo = 2,
34 Slotted = 3,
35 DropGrate = 4,
36 DropCurb = 5,
37 Custom = 6,
38};
39
41enum class GrateType {
42 PBar50 = 0,
43 PBar50x100 = 1,
44 PBar30 = 2,
45 CurvedVane = 3,
46 TiltBar45 = 4,
47 TiltBar30 = 5,
48 Reticuline = 6,
49 Generic = 7,
50};
51
53enum class ThroatType {
54 Horizontal = 0,
55 Inclined = 1,
56 Vertical = 2,
57};
58
61enum class InletCurveKind {
62 None = 0,
63 Diversion = 1,
64 Rating = 2,
65};
66
70{
72
73 // GRATE / DROP_GRATE / COMBO
74 double grateLength = 2.0;
75 double grateWidth = 2.0;
77 double openArea = 0.8;
78 double splashVeloc = 0.0;
79
80 // CURB / DROP_CURB / COMBO
81 double curbLength = 2.0;
82 double curbHeight = 0.5;
84
85 // SLOTTED
86 double slotLength = 2.0;
87 double slotWidth = 0.2;
88
89 // CUSTOM
90 QString curveId;
92};
93
94class InletProvider : public QObject
95{
96 Q_OBJECT
97
98public:
99 explicit InletProvider(QString name, QObject *parent = nullptr);
100 ~InletProvider() override;
101
102 QString name() const noexcept { return m_name; }
103 QString comments() const { return m_comments; }
104
106 const InletDesignData &design() const noexcept { return m_design; }
107
108 InletType type() const noexcept { return m_design.type; }
109 double grateLength() const noexcept { return m_design.grateLength; }
110 double grateWidth() const noexcept { return m_design.grateWidth; }
111 GrateType grateType() const noexcept { return m_design.grateType; }
112 double openArea() const noexcept { return m_design.openArea; }
113 double splashVeloc() const noexcept { return m_design.splashVeloc; }
114 double curbLength() const noexcept { return m_design.curbLength; }
115 double curbHeight() const noexcept { return m_design.curbHeight; }
116 ThroatType throat() const noexcept { return m_design.throat; }
117 double slotLength() const noexcept { return m_design.slotLength; }
118 double slotWidth() const noexcept { return m_design.slotWidth; }
119 QString curveId() const { return m_design.curveId; }
120 InletCurveKind curveKind() const noexcept { return m_design.curveKind; }
121
122 void setName(QString newName);
123 void setComments(QString text);
124
127 void setDesign(const InletDesignData &d);
128
129 void setType(InletType v);
130 void setGrateLength(double v);
131 void setGrateWidth(double v);
133 void setOpenArea(double v);
134 void setSplashVeloc(double v);
135 void setCurbLength(double v);
136 void setCurbHeight(double v);
137 void setThroat(ThroatType v);
138 void setSlotLength(double v);
139 void setSlotWidth(double v);
140 void setCurveId(QString v);
142
143signals:
144 void nameChanged(QString prev, QString now);
147
148private:
149 QString m_name;
150 QString m_comments;
151 InletDesignData m_design;
152};
153
156bool operator==(const InletDesignData &a, const InletDesignData &b);
157inline bool operator!=(const InletDesignData &a, const InletDesignData &b)
158{ return !(a == b); }
159
163QString inletTypeLabel(InletType t);
164
168const char *inletTypeKeyword(InletType t);
169
171QString grateTypeLabel(GrateType t);
172
173} // namespace openswmmvis::inlet
174
175#endif // OPENSWMMVIS_INLET_INLETPROVIDER_H
Definition inletprovider.h:95
void setGrateType(GrateType v)
Definition inletprovider.cpp:123
double slotWidth() const noexcept
Definition inletprovider.h:118
const InletDesignData & design() const noexcept
Whole-design snapshot (undo + engine flush).
Definition inletprovider.h:106
void setDesign(const InletDesignData &d)
Replace every design field at once. Emits paramsChanged() once if anything actually changed.
Definition inletprovider.cpp:95
ThroatType throat() const noexcept
Definition inletprovider.h:116
QString curveId() const
Definition inletprovider.h:119
void setGrateLength(double v)
Definition inletprovider.cpp:109
void setSplashVeloc(double v)
Definition inletprovider.cpp:137
GrateType grateType() const noexcept
Definition inletprovider.h:111
double curbLength() const noexcept
Definition inletprovider.h:114
void setSlotWidth(double v)
Definition inletprovider.cpp:172
void setCurbHeight(double v)
Definition inletprovider.cpp:151
double curbHeight() const noexcept
Definition inletprovider.h:115
void setGrateWidth(double v)
Definition inletprovider.cpp:116
QString name() const noexcept
Definition inletprovider.h:102
double grateLength() const noexcept
Definition inletprovider.h:109
void setThroat(ThroatType v)
Definition inletprovider.cpp:158
double grateWidth() const noexcept
Definition inletprovider.h:110
double splashVeloc() const noexcept
Definition inletprovider.h:113
InletCurveKind curveKind() const noexcept
Definition inletprovider.h:120
void setSlotLength(double v)
Definition inletprovider.cpp:165
InletType type() const noexcept
Definition inletprovider.h:108
double slotLength() const noexcept
Definition inletprovider.h:117
void setCurbLength(double v)
Definition inletprovider.cpp:144
void setCurveId(QString v)
Definition inletprovider.cpp:179
void setType(InletType v)
Definition inletprovider.cpp:102
double openArea() const noexcept
Definition inletprovider.h:112
void setOpenArea(double v)
Definition inletprovider.cpp:130
void setCurveKind(InletCurveKind v)
Definition inletprovider.cpp:186
QString comments() const
Definition inletprovider.h:103
void setName(QString newName)
Definition inletprovider.cpp:80
void nameChanged(QString prev, QString now)
void setComments(QString text)
Definition inletprovider.cpp:88
DiagramType t
Definition diagramspec.cpp:20
int b
local residual indices, a < b
Definition meshquadmatch.cpp:46
int a
Definition meshquadmatch.cpp:46
Definition inletprovider.h:27
InletCurveKind
Custom-inlet capture-curve flavour. Values match SWMM_InletCurveKind.
Definition inletprovider.h:61
@ Diversion
captured flow vs approach flow
@ Rating
captured flow vs water depth
GrateType
Grate bar pattern (HEC-22). Values match SWMM_GrateType.
Definition inletprovider.h:41
QString inletTypeLabel(InletType t)
Legacy editor label for a type ("GRATE", "CURB OPENING", "COMBINATION", "SLOTTED DRAIN",...
Definition inletprovider.cpp:28
QString grateTypeLabel(GrateType t)
HEC-22 grate name ("P_BAR-50", "CURVED_VANE", "GENERIC", …).
Definition inletprovider.cpp:58
bool operator==(const InletDesignData &a, const InletDesignData &b)
Field-by-field equality — used by setDesign to suppress no-op notifications and by the undo commands ...
Definition inletprovider.cpp:11
bool operator!=(const InletDesignData &a, const InletDesignData &b)
Definition inletprovider.h:157
InletType
Inlet design type. Values match SWMM_InletType.
Definition inletprovider.h:30
const char * inletTypeKeyword(InletType t)
[INLETS] type keyword handed to swmm_inlet_add. A COMBINATION design is created as a GRATE and then p...
Definition inletprovider.cpp:42
ThroatType
Curb-opening throat orientation. Values match SWMM_ThroatType.
Definition inletprovider.h:53
QVector< int > v
pool vertex indices
Definition pslgminsize.cpp:159
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
QString text
Definition queryparser.cpp:35
Every parameter of one inlet design, mirroring SWMM_InletDesign. Snapshot type for the undo commands ...
Definition inletprovider.h:70
double openArea
GENERIC only, fraction (0,1].
Definition inletprovider.h:77
InletType type
Definition inletprovider.h:71
double grateLength
Definition inletprovider.h:74
double curbLength
Definition inletprovider.h:81
QString curveId
Definition inletprovider.h:90
GrateType grateType
Definition inletprovider.h:76
double slotLength
Definition inletprovider.h:86
InletCurveKind curveKind
Definition inletprovider.h:91
double curbHeight
Definition inletprovider.h:82
double grateWidth
Definition inletprovider.h:75
double splashVeloc
GENERIC only.
Definition inletprovider.h:78
ThroatType throat
Definition inletprovider.h:83
double slotWidth
Definition inletprovider.h:87