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
openswmmvis::plot::ComparisonPlotModel Class Reference

Model layer for the Comparison Plot Dialog. More...

#include <comparisonplotmodel.h>

Inheritance diagram for openswmmvis::plot::ComparisonPlotModel:
Collaboration diagram for openswmmvis::plot::ComparisonPlotModel:

Signals

void runSourceAdded (int runIndex)
 
void runSourceRemoved (int runIndex)
 
void baselineChanged (int runIndex)
 
void seriesAdded (int seriesIndex)
 
void seriesRemoved (int seriesIndex)
 
void styleChanged (int seriesIndex)
 
void rowsChanged ()
 
void animationTimeChanged (QDateTime t)
 
void pairsChanged ()
 Phase 5 — the 1v1 pair list changed (add/remove/clear or reindex after a series removal).
 

Public Member Functions

 ComparisonPlotModel (QObject *parent=nullptr)
 
 ~ComparisonPlotModel () override
 
int addRunSource (RunSource src)
 Append a run. Returns the new run's index.
 
void removeRunSource (int runIndex)
 Remove a run by index. All SeriesSpec entries referencing the removed run are dropped first; remaining specs have their runIndex shifted down where appropriate.
 
int runSourceCount () const noexcept
 
const RunSourcerunSource (int i) const
 
RunSourcerunSource (int i)
 
int findRunByLayer (const IRunLayer *layer) const
 Find run by IRunLayer pointer; -1 if not found.
 
void setBaseline (int runIndex)
 Mark a run as baseline. -1 clears the baseline.
 
int baselineRunIndex () const noexcept
 
int addSeries (SeriesSpec spec)
 Append a series spec. Auto-assigns a default style cycle if spec.style is the default-constructed style. Returns the series index.
 
void removeSeries (int seriesIndex)
 Remove a series.
 
void updateStyle (int seriesIndex, const SeriesStyle &style)
 Update a series' style. Emits styleChanged.
 
void updateLegendOverride (int seriesIndex, const QString &legendOverride)
 Update a series' legend override (spec-level — wins over the auto-generated "run — object (attr)" label). Empty restores the auto label. Emits styleChanged so chart rows relabel.
 
int seriesCount () const noexcept
 
const SeriesSpecspec (int i) const
 
SeriesSpecspec (int i)
 
const QVector< SeriesSpec > & specs () const noexcept
 
int addPair (ComparisonPair pair)
 Append a pair. Rejects (returns -1) invalid/duplicate pairs, self-pairs, and pairs whose series target different attributes. Emits pairsChanged on success.
 
void removePair (int pairIndex)
 Remove a pair by index. Emits pairsChanged.
 
void clearPairs ()
 Drop all pairs (back to auto mode). Emits pairsChanged when the list was non-empty.
 
const QVector< ComparisonPair > & pairs () const noexcept
 
const QVector< AttributeRow > & rows () const noexcept
 Distinct attributes present in the spec list, ordered by the order each attribute was first added.
 
void rebuildRows ()
 Force re-derivation of rows(). Called automatically after add/remove; exposed so views can refresh after a runSource yields a new periodCount during live mode.
 
void resolveSeries (int seriesIndex, SeriesData &out) const
 Resolve a single series. Convenience wrapper over the RunSource layer's IRunLayer::getSeriesAt.
 
QDateTime animationTime () const noexcept
 Current animation time. Invalid when nothing is playing.
 
void setAnimationTime (QDateTime t)
 Slot for AnimationController::currentTimeChanged. Emits animationTimeChanged for views to update the dashed cursor line.
 

Detailed Description

Model layer for the Comparison Plot Dialog.

Lifecycle:

  • Construct empty; dialog adds RunSource(s) via addRunSource.
  • Add series via addSeries. Row layout updates and signal fires.
  • Mark baseline via setBaseline(runIndex).
  • View subscribes to seriesAdded / seriesRemoved / styleChanged / baselineChanged / runSourceAdded / runSourceRemoved / animationTimeChanged and re-lays-out incrementally.

Constructor & Destructor Documentation

◆ ComparisonPlotModel()

openswmmvis::plot::ComparisonPlotModel::ComparisonPlotModel ( QObject *  parent = nullptr)
explicit

◆ ~ComparisonPlotModel()

openswmmvis::plot::ComparisonPlotModel::~ComparisonPlotModel ( )
overridedefault

Member Function Documentation

◆ addPair()

int openswmmvis::plot::ComparisonPlotModel::addPair ( ComparisonPair  pair)

Append a pair. Rejects (returns -1) invalid/duplicate pairs, self-pairs, and pairs whose series target different attributes. Emits pairsChanged on success.

Here is the call graph for this function:

◆ addRunSource()

int openswmmvis::plot::ComparisonPlotModel::addRunSource ( RunSource  src)

Append a run. Returns the new run's index.

Here is the call graph for this function:

◆ addSeries()

int openswmmvis::plot::ComparisonPlotModel::addSeries ( SeriesSpec  spec)

Append a series spec. Auto-assigns a default style cycle if spec.style is the default-constructed style. Returns the series index.

Here is the call graph for this function:

◆ animationTime()

QDateTime openswmmvis::plot::ComparisonPlotModel::animationTime ( ) const
inlinenoexcept

Current animation time. Invalid when nothing is playing.

◆ animationTimeChanged

void openswmmvis::plot::ComparisonPlotModel::animationTimeChanged ( QDateTime  t)
signal
Here is the caller graph for this function:

◆ baselineChanged

void openswmmvis::plot::ComparisonPlotModel::baselineChanged ( int  runIndex)
signal
Here is the caller graph for this function:

◆ baselineRunIndex()

int openswmmvis::plot::ComparisonPlotModel::baselineRunIndex ( ) const
inlinenoexcept

◆ clearPairs()

void openswmmvis::plot::ComparisonPlotModel::clearPairs ( )

Drop all pairs (back to auto mode). Emits pairsChanged when the list was non-empty.

Here is the call graph for this function:

◆ findRunByLayer()

int openswmmvis::plot::ComparisonPlotModel::findRunByLayer ( const IRunLayer layer) const

Find run by IRunLayer pointer; -1 if not found.

◆ pairs()

const QVector< ComparisonPair > & openswmmvis::plot::ComparisonPlotModel::pairs ( ) const
inlinenoexcept

◆ pairsChanged

void openswmmvis::plot::ComparisonPlotModel::pairsChanged ( )
signal

Phase 5 — the 1v1 pair list changed (add/remove/clear or reindex after a series removal).

Here is the caller graph for this function:

◆ rebuildRows()

void openswmmvis::plot::ComparisonPlotModel::rebuildRows ( )

Force re-derivation of rows(). Called automatically after add/remove; exposed so views can refresh after a runSource yields a new periodCount during live mode.

Here is the call graph for this function:

◆ removePair()

void openswmmvis::plot::ComparisonPlotModel::removePair ( int  pairIndex)

Remove a pair by index. Emits pairsChanged.

Here is the call graph for this function:

◆ removeRunSource()

void openswmmvis::plot::ComparisonPlotModel::removeRunSource ( int  runIndex)

Remove a run by index. All SeriesSpec entries referencing the removed run are dropped first; remaining specs have their runIndex shifted down where appropriate.

Here is the call graph for this function:

◆ removeSeries()

void openswmmvis::plot::ComparisonPlotModel::removeSeries ( int  seriesIndex)

Remove a series.

Here is the call graph for this function:

◆ resolveSeries()

void openswmmvis::plot::ComparisonPlotModel::resolveSeries ( int  seriesIndex,
SeriesData out 
) const

Resolve a single series. Convenience wrapper over the RunSource layer's IRunLayer::getSeriesAt.

Here is the call graph for this function:

◆ rows()

const QVector< AttributeRow > & openswmmvis::plot::ComparisonPlotModel::rows ( ) const
inlinenoexcept

Distinct attributes present in the spec list, ordered by the order each attribute was first added.

◆ rowsChanged

void openswmmvis::plot::ComparisonPlotModel::rowsChanged ( )
signal
Here is the caller graph for this function:

◆ runSource() [1/2]

RunSource & openswmmvis::plot::ComparisonPlotModel::runSource ( int  i)
inline

◆ runSource() [2/2]

const RunSource & openswmmvis::plot::ComparisonPlotModel::runSource ( int  i) const
inline

◆ runSourceAdded

void openswmmvis::plot::ComparisonPlotModel::runSourceAdded ( int  runIndex)
signal
Here is the caller graph for this function:

◆ runSourceCount()

int openswmmvis::plot::ComparisonPlotModel::runSourceCount ( ) const
inlinenoexcept

◆ runSourceRemoved

void openswmmvis::plot::ComparisonPlotModel::runSourceRemoved ( int  runIndex)
signal
Here is the caller graph for this function:

◆ seriesAdded

void openswmmvis::plot::ComparisonPlotModel::seriesAdded ( int  seriesIndex)
signal
Here is the caller graph for this function:

◆ seriesCount()

int openswmmvis::plot::ComparisonPlotModel::seriesCount ( ) const
inlinenoexcept

◆ seriesRemoved

void openswmmvis::plot::ComparisonPlotModel::seriesRemoved ( int  seriesIndex)
signal
Here is the caller graph for this function:

◆ setAnimationTime()

void openswmmvis::plot::ComparisonPlotModel::setAnimationTime ( QDateTime  t)

Slot for AnimationController::currentTimeChanged. Emits animationTimeChanged for views to update the dashed cursor line.

Here is the call graph for this function:

◆ setBaseline()

void openswmmvis::plot::ComparisonPlotModel::setBaseline ( int  runIndex)

Mark a run as baseline. -1 clears the baseline.

Here is the call graph for this function:

◆ spec() [1/2]

SeriesSpec & openswmmvis::plot::ComparisonPlotModel::spec ( int  i)
inline

◆ spec() [2/2]

const SeriesSpec & openswmmvis::plot::ComparisonPlotModel::spec ( int  i) const
inline
Here is the caller graph for this function:

◆ specs()

const QVector< SeriesSpec > & openswmmvis::plot::ComparisonPlotModel::specs ( ) const
inlinenoexcept

◆ styleChanged

void openswmmvis::plot::ComparisonPlotModel::styleChanged ( int  seriesIndex)
signal
Here is the caller graph for this function:

◆ updateLegendOverride()

void openswmmvis::plot::ComparisonPlotModel::updateLegendOverride ( int  seriesIndex,
const QString &  legendOverride 
)

Update a series' legend override (spec-level — wins over the auto-generated "run — object (attr)" label). Empty restores the auto label. Emits styleChanged so chart rows relabel.

Here is the call graph for this function:

◆ updateStyle()

void openswmmvis::plot::ComparisonPlotModel::updateStyle ( int  seriesIndex,
const SeriesStyle style 
)

Update a series' style. Emits styleChanged.

Here is the call graph for this function:

The documentation for this class was generated from the following files: