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.cpp File Reference

Pure-logic half of ProfileNetworkAdapter — graph build and path materialization from explicit POD inputs. Live-model glue lives in profilenetworkadapter_model.cpp so unit tests can link this file without pulling in the SWMM engine library. More...

#include "plot/profilenetworkadapter.h"
#include <cmath>
#include <algorithm>
Include dependency graph for profilenetworkadapter.cpp:

Namespaces

namespace  ProfileNetworkAdapter
 

Functions

ProfileRouter::Graph ProfileNetworkAdapter::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, kMinConduitWeight); all other link kinds receive nonConduitWeight (a small fixed value so pumps/weirs/orifices are traversable without dominating conduit-length routing). See Slice BC's Phase 8.7.1 notes.
 
void ProfileNetworkAdapter::swapForReversed (PathLinkInfo &link)
 Swaps the offset1 / offset2 fields of link in-place when the path traverses the underlying model link backward. Reduces boilerplate in callers building PathLinkInfo lists.
 
ProfileBuilder::NodeKind ProfileNetworkAdapter::toNodeKind (int swmmNodeType, bool isVirtual)
 Maps an engine node type code (0=junction, 1=outfall, 2=storage, 3=divider) plus the virtual-junction flag to a NodeKind.
 
double ProfileNetworkAdapter::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 and its rendering rim depth.
 
ProfileBuilder::PathStatic ProfileNetworkAdapter::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-link static data. nodes must have length routerPath.nodes.size(); links must have length routerPath.edges.size().
 
double ProfileNetworkAdapter::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), increasing CLOCKWISE, in radians on (-pi, pi].
 

Variables

constexpr double ProfileNetworkAdapter::kMinConduitWeight = 0.01
 

Detailed Description

Pure-logic half of ProfileNetworkAdapter — graph build and path materialization from explicit POD inputs. Live-model glue lives in profilenetworkadapter_model.cpp so unit tests can link this file without pulling in the SWMM engine library.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026