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
profileattributesampler.h File Reference

Attribute-tracks feature — fetches an along-the-path profile of one generic result attribute (node depth / head / …, link flow / velocity / …) from an open .out file. More...

#include "plot/plotattribute.h"
#include "plot/profilebuilder.h"
#include <QVector>
Include dependency graph for profileattributesampler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ProfileAttributeSampler::AttributeProfile
 One attribute × one source, sampled along the whole path for the whole simulation. More...
 

Namespaces

namespace  ProfileAttributeSampler
 

Functions

bool ProfileAttributeSampler::isNodeAttribute (openswmmvis::plot::PlotAttribute attr)
 True for the six Node* attributes, false for everything else. Inline (header-only) so UI code and tests can classify attributes without linking the sampler's engine/results-layer dependency chain.
 
bool ProfileAttributeSampler::isTrackableAttribute (openswmmvis::plot::PlotAttribute attr)
 True when attr is one of the 11 attributes a track can show.
 
AttributeProfile ProfileAttributeSampler::fetch (SWMMResultsLayer *resultsLayer, const ProfileBuilder::PathStatic &path, openswmmvis::plot::PlotAttribute attr)
 Fetches the full-simulation profile of attr along path from resultsLayer's open output file.
 
AttributeProfile ProfileAttributeSampler::fetchSpecies (SWMMResultsLayer *resultsLayer, const ProfileBuilder::PathStatic &path, const QString &species, bool nodeScope)
 Species variant (Y2b-2 follow-up, amendment D-Y4): fetches the along-the-path profile of one species — a pollutant or the reserved water-age column — BY NAME, in node or link scope.
 

Detailed Description

Attribute-tracks feature — fetches an along-the-path profile of one generic result attribute (node depth / head / …, link flow / velocity / …) from an open .out file.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

Counterpart to ProfileSourceFetcher, which pulls the three hard-coded variables the HGL/EGL computation needs. This one is generic over PlotAttribute, reusing SwmmOutRunLayer::variableCodeFor as the single source of truth for the engine variable codes.

Same contracts as the rest of the profile pipeline:

  • arrays are addressed by PATH index, not engine index;
  • a path element the output file doesn't know leaves an EMPTY row (never a zero-filled one), so "no data" is distinguishable from 0.0;
  • short series (fewer periods than the longest source) are permitted — consumers render the frames that exist (LIVE_1D plan contract).

Thread-safety mirrors ProfileSourceFetcher::fetch — callable off the GUI thread as long as the layer outlives the call (callers pass QPointer- checked layers from a snapshot, exactly like rebindSources()).