23#ifndef OPENSWMMVIS_PLOT_COMPARISONPLOTMODEL_H
24#define OPENSWMMVIS_PLOT_COMPARISONPLOTMODEL_H
40 std::shared_ptr<IRunLayer>
layer;
165 const QVector<SeriesSpec>&
specs() const noexcept {
return m_specs; }
182 const QVector<ComparisonPair>&
pairs() const noexcept {
return m_pairs; }
188 const QVector<AttributeRow>&
rows() const noexcept {
return m_rows; }
225 QVector<RunSource> m_runs;
226 QVector<SeriesSpec> m_specs;
227 QVector<AttributeRow> m_rows;
228 QVector<ComparisonPair> m_pairs;
229 int m_baselineIdx = -1;
230 QDateTime m_animTime;
237 bool fixupPairsAfterSeriesRemoval_(
int seriesIndex);
Per-project flow-units state + label helpers.
Definition unitsystem.h:28
Model layer for the Comparison Plot Dialog.
Definition comparisonplotmodel.h:118
void pairsChanged()
Phase 5 — the 1v1 pair list changed (add/remove/clear or reindex after a series removal).
void baselineChanged(int runIndex)
void resolveSeries(int seriesIndex, SeriesData &out) const
Resolve a single series. Convenience wrapper over the RunSource layer's IRunLayer::getSeriesAt.
Definition comparisonplotmodel.cpp:265
SeriesSpec & spec(int i)
Definition comparisonplotmodel.h:164
int addSeries(SeriesSpec spec)
Append a series spec. Auto-assigns a default style cycle if spec.style is the default-constructed sty...
Definition comparisonplotmodel.cpp:100
const QVector< ComparisonPair > & pairs() const noexcept
Definition comparisonplotmodel.h:182
void animationTimeChanged(QDateTime t)
const SeriesSpec & spec(int i) const
Definition comparisonplotmodel.h:163
void removeSeries(int seriesIndex)
Remove a series.
Definition comparisonplotmodel.cpp:119
void updateStyle(int seriesIndex, const SeriesStyle &style)
Update a series' style. Emits styleChanged.
Definition comparisonplotmodel.cpp:190
void clearPairs()
Drop all pairs (back to auto mode). Emits pairsChanged when the list was non-empty.
Definition comparisonplotmodel.cpp:166
int addPair(ComparisonPair pair)
Append a pair. Rejects (returns -1) invalid/duplicate pairs, self-pairs, and pairs whose series targe...
Definition comparisonplotmodel.cpp:136
QDateTime animationTime() const noexcept
Current animation time. Invalid when nothing is playing.
Definition comparisonplotmodel.h:204
int addRunSource(RunSource src)
Append a run. Returns the new run's index.
Definition comparisonplotmodel.cpp:25
int runSourceCount() const noexcept
Definition comparisonplotmodel.h:134
const QVector< AttributeRow > & rows() const noexcept
Distinct attributes present in the spec list, ordered by the order each attribute was first added.
Definition comparisonplotmodel.h:188
void updateLegendOverride(int seriesIndex, const QString &legendOverride)
Update a series' legend override (spec-level — wins over the auto-generated "run — object (attr)" lab...
Definition comparisonplotmodel.cpp:198
~ComparisonPlotModel() override
void removeRunSource(int runIndex)
Remove a run by index. All SeriesSpec entries referencing the removed run are dropped first; remainin...
Definition comparisonplotmodel.cpp:46
void styleChanged(int seriesIndex)
void removePair(int pairIndex)
Remove a pair by index. Emits pairsChanged.
Definition comparisonplotmodel.cpp:158
const RunSource & runSource(int i) const
Definition comparisonplotmodel.h:135
void runSourceRemoved(int runIndex)
void rebuildRows()
Force re-derivation of rows(). Called automatically after add/remove; exposed so views can refresh af...
Definition comparisonplotmodel.cpp:210
int findRunByLayer(const IRunLayer *layer) const
Find run by IRunLayer pointer; -1 if not found.
Definition comparisonplotmodel.cpp:79
void runSourceAdded(int runIndex)
RunSource & runSource(int i)
Definition comparisonplotmodel.h:136
void seriesAdded(int seriesIndex)
void seriesRemoved(int seriesIndex)
const QVector< SeriesSpec > & specs() const noexcept
Definition comparisonplotmodel.h:165
int baselineRunIndex() const noexcept
Definition comparisonplotmodel.h:143
void setBaseline(int runIndex)
Mark a run as baseline. -1 clears the baseline.
Definition comparisonplotmodel.cpp:90
void setAnimationTime(QDateTime t)
Slot for AnimationController::currentTimeChanged. Emits animationTimeChanged for views to update the ...
Definition comparisonplotmodel.cpp:296
int seriesCount() const noexcept
Definition comparisonplotmodel.h:162
Abstract source backing one comparison-plot run.
Definition irunlayer.h:171
size_t i
Definition contourjob.cpp:27
DiagramType t
Definition diagramspec.cpp:20
Slice BL — abstract "data-source" that the ComparisonPlotModel reads timeseries from.
Definition chartproperties.h:34
PlotAttribute
What a series plots. One row per attribute in the Nx2 grid.
Definition plotattribute.h:38
Slice BL — canonical enumeration of plottable result attributes.
int src
index into the caller's vector; -1 = new
Definition pslgminsize.cpp:152
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
Per-series rendering style for chart plots (comprehensive schema).
Derived aggregation for one chart row. The model recomputes these whenever the spec list changes; vie...
Definition comparisonplotmodel.h:81
QString unitsLabel
e.g. "ft", "m/s".
Definition comparisonplotmodel.h:91
double ymax
Definition comparisonplotmodel.h:89
PlotAttribute attribute
Definition comparisonplotmodel.h:82
double ymin
Definition comparisonplotmodel.h:88
QString species
Definition comparisonplotmodel.h:86
QVector< int > seriesIndices
Indices into ComparisonPlotModel::specs() that target this attr.
Definition comparisonplotmodel.h:87
UnitSystem unitSystem
Definition comparisonplotmodel.h:90
One user-configured 1v1 comparison: X-series vs Y-series (COMPARISON_PLOT_1V1_AND_TREE_PLAN Phase 5)....
Definition comparisonplotmodel.h:99
int xSeriesIndex
Index into specs() — scatter X values.
Definition comparisonplotmodel.h:100
bool operator==(const ComparisonPair &o) const noexcept
Definition comparisonplotmodel.h:103
int ySeriesIndex
Index into specs() — scatter Y values.
Definition comparisonplotmodel.h:101
Identifies what object a series is about. Kind is the discriminator; the active union member is impli...
Definition irunlayer.h:38
bool isValid() const noexcept
Definition irunlayer.h:69
One plottable result: a fixed attribute OR a species by name.
Definition resultdescriptor.h:39
static ResultDescriptor forAttribute(PlotAttribute a)
Definition resultdescriptor.h:65
static ResultDescriptor forSpecies(const QString &name)
Definition resultdescriptor.h:68
One loaded run in the plot — a 1D .out, an observed CSV, or a 2D mesh layer.
Definition comparisonplotmodel.h:39
SeriesStyle defaultStyle
Cycle position for series in this run.
Definition comparisonplotmodel.h:44
bool isTransient
True when owned by the dialog (loaded ad hoc).
Definition comparisonplotmodel.h:43
int cycleSeed
Internal: used to spread colours within the run.
Definition comparisonplotmodel.h:46
bool isBaseline
Anchor for the 1v1 scatter column.
Definition comparisonplotmodel.h:42
std::shared_ptr< IRunLayer > layer
The actual data source. May be owned by the dialog.
Definition comparisonplotmodel.h:40
QString label
Display label; defaults to layer->scenarioName().
Definition comparisonplotmodel.h:41
Result of one series resolution. Times are SWMM DateTime doubles (OLE-Automation epoch,...
Definition irunlayer.h:151
One chart series — points at a RunSource via index and identifies what to read from it.
Definition comparisonplotmodel.h:51
ResultDescriptor descriptor() const
Definition comparisonplotmodel.h:66
QString legendOverride
Empty = auto-generate from (run, ref, attr).
Definition comparisonplotmodel.h:62
SeriesStyle style
Definition comparisonplotmodel.h:61
PlotAttribute attribute
Definition comparisonplotmodel.h:54
ObjectRef objectRef
Definition comparisonplotmodel.h:53
int runIndex
Definition comparisonplotmodel.h:52
bool isValid() const noexcept
Definition comparisonplotmodel.h:72
QString species
Definition comparisonplotmodel.h:60
Aggregated rendering parameters for one chart series.
Definition seriesstyle.h:48