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
plotattribute.h
Go to the documentation of this file.
1
21#ifndef OPENSWMMVIS_PLOT_PLOTATTRIBUTE_H
22#define OPENSWMMVIS_PLOT_PLOTATTRIBUTE_H
23
24#include <QString>
25#include <QVector>
26
27namespace openswmmvis::plot {
28
32enum class UnitSystem {
33 US,
34 SI
35};
36
38enum class PlotAttribute {
39 Unknown = 0,
40
41 // ----- 1D node variables (engine SWMM_OUT_NODE_*) -----------------------
42 NodeDepth = 1,
43 NodeHead = 2,
44 NodeVolume = 3,
46 NodeTotalInflow = 5,
47 NodeOverflow = 6,
48
49 // ----- 1D link variables (engine SWMM_OUT_LINK_*) -----------------------
50 LinkFlow = 7,
51 LinkDepth = 8,
52 LinkVelocity = 9,
53 LinkVolume = 10,
54 LinkCapacity = 11,
55
56 // ----- 1D subcatchment variables (engine SWMM_OUT_SUBCATCH_*) -----------
57 SubcatchRainfall = 12,
59 SubcatchEvap = 14,
60 SubcatchInfil = 15,
61 SubcatchRunoff = 16,
62
63 // ----- 2D mesh-cell variables (CF.3) -----------------------------------
64 // Separate from Node*/Link* on purpose; see file header.
65 Mesh2DDepth = 17,
66 Mesh2DHGL = 18,
68 Mesh2DVelocityX = 20,
69 Mesh2DVelocityY = 21,
70
71 // ----- System-wide variables (engine SWMM_OUT_SYS_*) -------------------
72 // Slice AT.2 — one global series per attribute per run. ObjectRef name
73 // is unused; ObjectRef::Kind::System is the discriminator.
75 SystemRainfall = 23,
76 SystemSnowDepth = 24,
77 SystemEvap = 25,
78 SystemInfil = 26,
79 SystemRunoff = 27,
80 SystemDwInflow = 28,
81 SystemGwInflow = 29,
82 SystemLatInflow = 30,
83 SystemFlooding = 31,
84 SystemOutflow = 32,
85 SystemStorage = 33,
86 SystemEvapTotal = 34,
87 SystemPET = 35,
88
89 // ----- 2D mesh-edge variables ------------------------------------------
90 // Both derive from the engine's single Mesh2_edge_flux dataset (volumetric
91 // F_e, m³/s). Flow is that value directly; unit-width flux is F_e ÷ edge length.
92 Mesh2DEdgeFlux = 36,
93 Mesh2DEdgeFlow = 37,
94
95 // ----- 2D mesh-cell rainfall (engine Mesh2_face_rainfall / _rain_cum) --
96 Mesh2DRainfall = 38,
97 Mesh2DRainVolume = 39,
98};
99
101QString labelFor(PlotAttribute a);
102
105
108
111
112// ---------------------------------------------------------------------------
113// Canonical plottable-attribute lists. Single source of truth for every UI
114// that enumerates attributes (AttributePickerMenu, PlotVariablePickerDialog,
115// the Comparison Plot "Add Series" menus, and the "All attributes" fan-out).
116// Order is presentation order. A kind-keyed dispatcher lives in irunlayer.h
117// (`attributesForKind`) — the nested ObjectRef::Kind can't be named here.
118// ---------------------------------------------------------------------------
119
121const QVector<PlotAttribute> &nodePlotAttributes();
122
124const QVector<PlotAttribute> &linkPlotAttributes();
125
127const QVector<PlotAttribute> &subcatchPlotAttributes();
128
131const QVector<PlotAttribute> &systemPlotAttributes();
132
134const QVector<PlotAttribute> &mesh2DCellPlotAttributes();
135
137const QVector<PlotAttribute> &mesh2DEdgePlotAttributes();
138
140const QVector<PlotAttribute> &mesh2DVertexPlotAttributes();
141
153
174
175} // namespace openswmmvis::plot
176
177#endif // OPENSWMMVIS_PLOT_PLOTATTRIBUTE_H
Per-project flow-units state + label helpers.
Definition unitsystem.h:28
int a
Definition meshquadmatch.cpp:46
Definition chartproperties.h:34
QString labelFor(PlotAttribute a)
Short human label, e.g. "Depth", "Flow", "Velocity |V|".
Definition plotattribute.cpp:101
bool isMesh2DAttribute(PlotAttribute a) noexcept
True iff the attribute is a 2D mesh-cell quantity (CF.3).
Definition plotattribute.h:143
const QVector< PlotAttribute > & mesh2DCellPlotAttributes()
The 7 per-2D-cell attributes, presentation order.
Definition plotattribute.cpp:69
QString labelWithUnits(PlotAttribute a, UnitSystem u)
Concatenation of labelFor(a) + "(" + unitsFor(a,u) + ")".
Definition plotattribute.cpp:219
const QVector< PlotAttribute > & mesh2DVertexPlotAttributes()
The 2 per-2D-vertex attributes (depth, HGL — interpolated).
Definition plotattribute.cpp:92
const QVector< PlotAttribute > & nodePlotAttributes()
The 6 per-node attributes, presentation order.
Definition plotattribute.cpp:11
PlotAttribute
What a series plots. One row per attribute in the Nx2 grid.
Definition plotattribute.h:38
@ Mesh2DHGL
m / ft — depth + z_bed (GUI-computed)
@ SystemFlooding
m³/s / ft³/s — SYS_FLOODING (total)
@ SystemSnowDepth
mm / in — SYS_SNOW_DEPTH (avg)
@ Mesh2DDepth
m / ft — water column over triangle
@ SystemGwInflow
m³/s / ft³/s — SYS_GW_INFLOW (total)
@ NodeDepth
m / ft — above invert
@ SystemEvapTotal
mm/d / in/d — SYS_EVAP_TOTAL (total rate)
@ Mesh2DEdgeFlux
m²/s / ft²/s — unit-width flux q = F_e / edge length
@ Mesh2DRainfall
mm/hr / in/hr — rainfall intensity applied to the cell
@ Mesh2DVelocityX
m/s / ft/s — projected map CRS, +east
@ NodeHead
m / ft — hydraulic head
@ SystemDwInflow
m³/s / ft³/s — SYS_DW_INFLOW (total)
@ Mesh2DRainVolume
m³ / ft³ — cumulative rainfall volume applied to the cell
@ SystemPET
mm/d / in/d — SYS_PET (potential ET)
@ SystemStorage
m³ / ft³ — SYS_STORAGE (total volume)
@ SystemInfil
mm/hr / in/hr — SYS_INFIL (avg rate)
@ SystemLatInflow
m³/s / ft³/s — SYS_LAT_INFLOW(total)
@ SystemRainfall
mm/hr / in/hr — SYS_RAINFALL (avg over subcatchments)
@ SystemOutflow
m³/s / ft³/s — SYS_OUTFLOW (total)
@ SystemEvap
mm/d / in/d — SYS_EVAP (avg rate)
@ SystemTemperature
°C / °F — SYS_TEMPERATURE
@ Mesh2DEdgeFlow
m³/s / ft³/s — volumetric flow Q across a mesh edge (= F_e)
@ Mesh2DVelocityY
m/s / ft/s — projected map CRS, +north
@ Mesh2DVelocityMag
m/s / ft/s — sqrt(Vx² + Vy²)
@ SystemRunoff
m³/s / ft³/s — SYS_RUNOFF (total)
@ LinkCapacity
dimensionless 0..1
const QVector< PlotAttribute > & mesh2DEdgePlotAttributes()
The 2 per-2D-edge attributes (flow, unit-width flux).
Definition plotattribute.cpp:83
UnitSystem unitSystemFromFlowUnits(int flowUnits)
Map an engine swmm_output_get_flow_units return value to UnitSystem.
Definition plotattribute.cpp:227
const QVector< PlotAttribute > & systemPlotAttributes()
The 14 system-wide attributes, presentation order (matches the long-standing system picker menu: Rain...
Definition plotattribute.cpp:48
@ US
ft, ft/s, ft³/s, ft³
@ SI
m, m/s, m³/s, m³
const QVector< PlotAttribute > & subcatchPlotAttributes()
The 5 per-subcatchment attributes, presentation order.
Definition plotattribute.cpp:36
const QVector< PlotAttribute > & linkPlotAttributes()
The 5 per-link attributes, presentation order.
Definition plotattribute.cpp:24
QString unitsFor(PlotAttribute a, UnitSystem u)
Unit string for the given attribute + unit system, e.g. "m", "ft³/s".
Definition plotattribute.cpp:148
bool isSystemAttribute(PlotAttribute a) noexcept
True iff the attribute is a system-wide quantity (Slice AT.2). System attributes resolve via swmm_out...
Definition plotattribute.h:157