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
profilenetworkadapter.h
Go to the documentation of this file.
1
25#ifndef PROFILE_NETWORK_ADAPTER_H
26#define PROFILE_NETWORK_ADAPTER_H
27
28#include "plot/profilebuilder.h"
29#include "plot/profilerouter.h"
30
31#include <QPointF>
32#include <QString>
33#include <QVector>
34
35class SWMMModelLayer;
36
38{
39
40// ---------------------------------------------------------------------------
41// Pure-logic input records — fed directly to the builders below.
42// ---------------------------------------------------------------------------
43
58
64{
65 int engineNodeIdx = -1;
66 QString name;
67 double invertElev = 0.0;
68 double maxDepth = 0.0;
69 double surchargeDepth = 0.0;
72 bool isInlet = false;
73};
74
83{
84 int engineLinkIdx = -1;
85 QString name;
86 double length = 0.0;
87 double offset1 = 0.0;
88 double offset2 = 0.0;
89 double maxDepth = 0.0;
90 double crestHeight = 0.0;
94 bool openTop = false;
95 bool isStreet = false;
97 bool reversed = false;
98};
99
100// ---------------------------------------------------------------------------
101// Pure-logic builders (unit-tested in tests/unit/test_profilenetworkadapter.cpp).
102// ---------------------------------------------------------------------------
103
118[[nodiscard]] ProfileRouter::Graph buildGraph(int nodeCount,
119 const QVector<LinkInfo> &links,
120 double nonConduitWeight = 1.0);
121
136 const ProfileRouter::Path &routerPath,
137 const QVector<NodeInfo> &nodes,
138 const QVector<PathLinkInfo> &links);
139
145void swapForReversed(PathLinkInfo &link);
146
155[[nodiscard]] ProfileBuilder::NodeKind toNodeKind(int swmmNodeType,
156 bool isVirtual);
157
168[[nodiscard]] double renderRimDepth(bool isVirtual, double maxDepth,
169 double rimDepth);
170
171// ---------------------------------------------------------------------------
172// Live-model glue (not unit-tested; manual / integration only).
173// ---------------------------------------------------------------------------
174
180 SWMMModelLayer *model,
181 double nonConduitWeight = 1.0);
182
190 SWMMModelLayer *model,
191 const ProfileRouter::Path &routerPath);
192
204[[nodiscard]] double bearingFromPoints(const QPointF &at, const QPointF &away);
205
216 const ProfileRouter::Path &routerPath,
218
224[[nodiscard]] int findNodeIndex(SWMMModelLayer *model, const QString &name);
225
229[[nodiscard]] int findLinkIndex(SWMMModelLayer *model, const QString &name);
230
231} // namespace ProfileNetworkAdapter
232
233#endif // PROFILE_NETWORK_ADAPTER_H
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine mo...
Definition swmmmodellayer.h:133
NodeKind
Topology category for the manhole-glyph picker in ProfilePlotWidget. Maps 1:1 to the relevant SWMMMod...
Definition profilebuilder.h:52
LinkKind
Connector category for the conduit-vs-glyph render branch in ProfilePlotWidget.
Definition profilebuilder.h:70
Definition profilenetworkadapter.h:38
ProfileBuilder::NodeKind toNodeKind(int swmmNodeType, bool isVirtual)
Maps an engine node type code (0=junction, 1=outfall, 2=storage, 3=divider) plus the virtual-junction...
Definition profilenetworkadapter.cpp:53
void swapForReversed(PathLinkInfo &link)
Swaps the offset1 / offset2 fields of link in-place when the path traverses the underlying model link...
Definition profilenetworkadapter.cpp:47
double renderRimDepth(bool isVirtual, double maxDepth, double rimDepth)
Picks the depth the profile should draw a node's ground/rim line at, given its hydraulic max depth an...
Definition profilenetworkadapter.cpp:66
double bearingFromPoints(const QPointF &at, const QPointF &away)
Map bearing of the direction at -> away, as the profile's plan rose measures it: 0 = +y (north),...
Definition profilenetworkadapter.cpp:112
int findNodeIndex(SWMMModelLayer *model, const QString &name)
Resolves an engine node index by name; returns -1 if not found. Wrapper around swmm_node_index for th...
Definition profilenetworkadapter_model.cpp:303
ProfileBuilder::PathStatic buildPathStatic(const ProfileRouter::Path &routerPath, const QVector< NodeInfo > &nodes, const QVector< PathLinkInfo > &links)
Materializes a ProfileBuilder::PathStatic from a router-emitted path plus pre-resolved per-node / per...
Definition profilenetworkadapter.cpp:71
void collectNodeBranches(SWMMModelLayer *model, const ProfileRouter::Path &routerPath, ProfileBuilder::PathStatic &path)
Fills PathStatic::nodes[i].branches with every link incident to each path node, path links included (...
Definition profilenetworkadapter_model.cpp:124
int findLinkIndex(SWMMModelLayer *model, const QString &name)
Resolves an engine link index by name; returns -1 if not found.
Definition profilenetworkadapter_model.cpp:312
ProfileRouter::Graph buildGraphFromModel(SWMMModelLayer *model, double nonConduitWeight=1.0)
Convenience overload — pulls links from a live SWMMModelLayer and forwards to buildGraph().
Definition profilenetworkadapter_model.cpp:64
ProfileRouter::Graph buildGraph(int nodeCount, const QVector< LinkInfo > &links, double nonConduitWeight=1.0)
Builds a directed routing graph from the given link list. Conduits receive weight = max(length,...
Definition profilenetworkadapter.cpp:25
ProfileBuilder::PathStatic buildPathStaticFromModel(SWMMModelLayer *model, const ProfileRouter::Path &routerPath)
Convenience overload — materializes a PathStatic by querying the engine for each node's invert/maxDep...
Definition profilenetworkadapter_model.cpp:195
Pure-logic data assembly for Slice BC's longitudinal profile plot: chainage, HGL/EGL time-series,...
QVector< int > nodes
Definition profilerouter.cpp:36
Path-routing primitives over an abstract weighted graph, used by Slice BC's profile-path picker.
int path
Definition pslgminsize.cpp:234
QString name
Definition sectionmodelbuilders.cpp:474
A fully-resolved profile path: ordered nodes, joining links, and cumulative chainage from nodes[0] to...
Definition profilebuilder.h:242
Per-node static data needed to materialize a PathStatic.
Definition profilenetworkadapter.h:64
ProfileBuilder::NodeKind kind
Definition profilenetworkadapter.h:70
QString name
Definition profilenetworkadapter.h:66
double surchargeDepth
Definition profilenetworkadapter.h:69
int engineNodeIdx
Definition profilenetworkadapter.h:65
double invertElev
Definition profilenetworkadapter.h:67
bool isInlet
Definition profilenetworkadapter.h:72
double maxDepth
Definition profilenetworkadapter.h:68
The input to ProfileRouter — nodes are 0..nodeCount-1, edges are directed by default and reinterprete...
Definition profilerouter.h:59
A single candidate path: ordered node sequence (length N+1) of engine node indices,...
Definition profilerouter.h:80