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 Namespace Reference

Classes

struct  LinkInfo
 Just enough about each link to weight it in the routing graph. engineLinkIdx is round-tripped through the Edge::linkId field so callers can later resolve which model link a path traverses. More...
 
struct  NodeInfo
 Per-node static data needed to materialize a PathStatic. More...
 
struct  PathLinkInfo
 Per-link static data needed to materialize a PathStatic. maxDepth is the conduit cross-section primary dimension (e.g. circular pipe diameter) — used for the conduit-crown line in the renderer; 0 for non-conduits. More...
 

Functions

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, 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.
 
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-link static data. nodes must have length routerPath.nodes.size(); links must have length routerPath.edges.size().
 
void 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 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 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.
 
ProfileRouter::Graph buildGraphFromModel (SWMMModelLayer *model, double nonConduitWeight=1.0)
 Convenience overload — pulls links from a live SWMMModelLayer and forwards to buildGraph().
 
ProfileBuilder::PathStatic buildPathStaticFromModel (SWMMModelLayer *model, const ProfileRouter::Path &routerPath)
 Convenience overload — materializes a PathStatic by querying the engine for each node's invert/maxDepth and each link's offsets/ cross-section. Path orientation is derived from routerPath.nodes.
 
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), increasing CLOCKWISE, in radians on (-pi, pi].
 
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 (marked onPath).
 
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 the rare callers that don't want to pull <openswmm_nodes.h> themselves.
 
int findLinkIndex (SWMMModelLayer *model, const QString &name)
 Resolves an engine link index by name; returns -1 if not found.
 

Variables

constexpr double kMinConduitWeight = 0.01
 

Function Documentation

◆ bearingFromPoints()

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].

Note the argument order into atan2 is (dx, dy), not the usual (dy, dx) — that is what rotates the zero from +x to +y and flips the sense to clockwise. Returns ProfileBuilder::kNoBearing when the two points coincide, so a caller never publishes a north spoke it did not measure.

◆ buildGraph()

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.

Parameters
nodeCountTotal node count (= max(fromNode, toNode) + 1 if you let buildGraph infer; pass an explicit count to be defensive).
linksEach contributes one Edge. Invalid endpoint indices are silently skipped.
nonConduitWeightFixed weight assigned to non-conduit links.
Here is the caller graph for this function:

◆ buildGraphFromModel()

ProfileRouter::Graph ProfileNetworkAdapter::buildGraphFromModel ( SWMMModelLayer model,
double  nonConduitWeight = 1.0 
)

Convenience overload — pulls links from a live SWMMModelLayer and forwards to buildGraph().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildPathStatic()

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().

Each entry in links should already carry the correct offset1 / offset2 / maxDepth / kind / reversed orientation for the path-traversal direction (which may differ from the model link's intrinsic from→to direction when the router used Options::undirected). The caller is responsible for that orientation; see swapForReversed() for a helper.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ buildPathStaticFromModel()

ProfileBuilder::PathStatic ProfileNetworkAdapter::buildPathStaticFromModel ( SWMMModelLayer model,
const ProfileRouter::Path routerPath 
)

Convenience overload — materializes a PathStatic by querying the engine for each node's invert/maxDepth and each link's offsets/ cross-section. Path orientation is derived from routerPath.nodes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ collectNodeBranches()

void ProfileNetworkAdapter::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 (marked onPath).

Separated from buildPathStaticFromModel() so a caller that only wants the hydraulic profile can skip the geometry work, and so the incidence pass can be exercised on its own. One pass over the model's links; nothing is written when model has no engine.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findLinkIndex()

int ProfileNetworkAdapter::findLinkIndex ( SWMMModelLayer model,
const QString &  name 
)

Resolves an engine link index by name; returns -1 if not found.

Here is the call graph for this function:

◆ findNodeIndex()

int ProfileNetworkAdapter::findNodeIndex ( SWMMModelLayer model,
const QString &  name 
)

Resolves an engine node index by name; returns -1 if not found. Wrapper around swmm_node_index for the rare callers that don't want to pull <openswmm_nodes.h> themselves.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ renderRimDepth()

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.

A virtual junction's max depth is derived — always the shared pipe crown — so drawing the ground at invert + maxDepth sinks the terrain into the pipe at every break point. When the model supplies a rim depth (the optional [VIRTUAL_JUNCTIONS] MaxDepth, 0 = unset) that value wins. Every other node type keeps its max depth.

Here is the caller graph for this function:

◆ swapForReversed()

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.

◆ toNodeKind()

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.

Virtual junctions are JUNCTION-typed on the engine — the flag is the only thing separating them — and the profile draws them as pipe rather than as a structure.

Here is the caller graph for this function:

Variable Documentation

◆ kMinConduitWeight

constexpr double ProfileNetworkAdapter::kMinConduitWeight = 0.01
constexpr