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::ui::GraduatedRendererBinding Class Referencefinal

Bridges the editor's ClassificationScheme onto a 1D per-kind GraduatedRenderer without changing the renderer's JSON. More...

#include <classificationbindings.h>

Inheritance diagram for openswmmvis::ui::GraduatedRendererBinding:
Collaboration diagram for openswmmvis::ui::GraduatedRendererBinding:

Public Types

using RendererGetter = std::function< OpenSWMM::Render::GraduatedRenderer *()>
 
using RendererInstaller = std::function< void(std::unique_ptr< OpenSWMM::Render::IFeatureRenderer >)>
 
using AttributeList = std::function< QVector< QPair< QString, QString > >()>
 
using RangeModeGate = std::function< bool()>
 

Public Member Functions

 GraduatedRendererBinding (RendererGetter getRenderer, RendererInstaller installRenderer, AttributeList attributeList, RangeModeGate rangeModesEnabled)
 
void resync ()
 
OpenSWMM::Render::ClassificationScheme scheme () const override
 
void setScheme (const OpenSWMM::Render::ClassificationScheme &s) override
 
QVector< doublesampleValues () const override
 
void autoClassify () override
 
QPair< double, doubledataRange () const override
 
QVector< doublecomputedEdges () const override
 
bool supportsContinuousMode () const override
 
bool supportsRangeModes () const override
 
bool supportsCustomRange () const override
 
QVector< QPair< QString, QString > > availableAttributes () const override
 
QString attribute () const override
 
void setAttribute (const QString &name) override
 
- Public Member Functions inherited from openswmmvis::ui::IClassificationBinding
virtual ~IClassificationBinding ()=default
 

Detailed Description

Bridges the editor's ClassificationScheme onto a 1D per-kind GraduatedRenderer without changing the renderer's JSON.

The host (KindRendererPanel) supplies three closures: fetch the live renderer, install a replacement (its existing three-way Rule/model/results dispatch), and sample the layer's values. The binding caches a scheme mirror so setScheme can push only the deltas — preserving today's behaviour where, e.g., changing the class count never resets the ramp.

Member Typedef Documentation

◆ AttributeList

using openswmmvis::ui::GraduatedRendererBinding::AttributeList = std::function<QVector<QPair<QString, QString> >()>

◆ RangeModeGate

Whether the animation range-mode row applies right now — depends on host type AND the currently selected attribute's dynamism, so it is a closure re-queried on each refresh rather than a fixed flag.

◆ RendererGetter

◆ RendererInstaller

Constructor & Destructor Documentation

◆ GraduatedRendererBinding()

openswmmvis::ui::GraduatedRendererBinding::GraduatedRendererBinding ( RendererGetter  getRenderer,
RendererInstaller  installRenderer,
AttributeList  attributeList,
RangeModeGate  rangeModesEnabled 
)
Here is the call graph for this function:

Member Function Documentation

◆ attribute()

QString openswmmvis::ui::GraduatedRendererBinding::attribute ( ) const
overridevirtual

Reimplemented from openswmmvis::ui::IClassificationBinding.

Here is the call graph for this function:

◆ autoClassify()

void openswmmvis::ui::GraduatedRendererBinding::autoClassify ( )
overridevirtual

Force a re-derive of class edges from current data, even when the scheme config is unchanged (the data itself may have changed). The default re-pushes the current scheme through the change channel; the GraduatedRendererBinding clears the renderer's cached breaks so the layer re-classifies against fresh samples.

Reimplemented from openswmmvis::ui::IClassificationBinding.

Here is the call graph for this function:

◆ availableAttributes()

QVector< QPair< QString, QString > > openswmmvis::ui::GraduatedRendererBinding::availableAttributes ( ) const
overridevirtual

Attribute picker is shown only when this returns a non-empty list. Pairs of (displayName, canonicalName).

Reimplemented from openswmmvis::ui::IClassificationBinding.

◆ computedEdges()

QVector< double > openswmmvis::ui::GraduatedRendererBinding::computedEdges ( ) const
overridevirtual

The model's authoritative class edges (N+1 ascending, endpoints included) when it already holds them — e.g. a GraduatedRenderer's data-derived lastBreaks. Returning empty (the default) tells the editor to recompute edges itself via ClassificationScheme::levelEdges over dataRange() + sampleValues(). Lets the 1D table mirror the map's exact breaks without re-running the layer's sample gathering.

Reimplemented from openswmmvis::ui::IClassificationBinding.

Here is the call graph for this function:

◆ dataRange()

QPair< double, double > openswmmvis::ui::GraduatedRendererBinding::dataRange ( ) const
overridevirtual

Outer data range the scheme classifies over (e.g. [dryDepth, maxDepth] or a field's min/max).

Implements openswmmvis::ui::IClassificationBinding.

Here is the call graph for this function:

◆ resync()

void openswmmvis::ui::GraduatedRendererBinding::resync ( )

Re-read the cached scheme from the live renderer. Call after the host's refreshFromModel / Cancel rollback so the editor reflects the renderer again.

Here is the caller graph for this function:

◆ sampleValues()

QVector< double > openswmmvis::ui::GraduatedRendererBinding::sampleValues ( ) const
inlineoverridevirtual

Values feeding Quantile / Jenks / StdDev auto-classification. Large sources should decimate. Empty is legal (the editor degrades to equal spacing).

Implements openswmmvis::ui::IClassificationBinding.

◆ scheme()

OpenSWMM::Render::ClassificationScheme openswmmvis::ui::GraduatedRendererBinding::scheme ( ) const
inlineoverridevirtual

◆ setAttribute()

void openswmmvis::ui::GraduatedRendererBinding::setAttribute ( const QString &  name)
overridevirtual

Reimplemented from openswmmvis::ui::IClassificationBinding.

Here is the call graph for this function:

◆ setScheme()

void openswmmvis::ui::GraduatedRendererBinding::setScheme ( const OpenSWMM::Render::ClassificationScheme )
overridevirtual

MUST route through the model's normal change channel (renderer install / bag setter) so every view repaints.

Implements openswmmvis::ui::IClassificationBinding.

Here is the call graph for this function:

◆ supportsContinuousMode()

bool openswmmvis::ui::GraduatedRendererBinding::supportsContinuousMode ( ) const
inlineoverridevirtual

Continuous/Classified toggle is offered only when true. 1D graduated symbols are always classified → false; depth fill → true.

Reimplemented from openswmmvis::ui::IClassificationBinding.

◆ supportsCustomRange()

bool openswmmvis::ui::GraduatedRendererBinding::supportsCustomRange ( ) const
inlineoverridevirtual

"Use custom range" checkbox + min/max is offered only when true — the static / 2D idiom (no animation range modes). Mutually exclusive with supportsRangeModes() in the editor (range modes win).

Reimplemented from openswmmvis::ui::IClassificationBinding.

◆ supportsRangeModes()

bool openswmmvis::ui::GraduatedRendererBinding::supportsRangeModes ( ) const
inlineoverridevirtual

Animation range-mode row (Fixed over run / Per-frame / Fixed user) is offered only when true — the 1D-results idiom, where FixedUser reveals the min/max sub-row.

Reimplemented from openswmmvis::ui::IClassificationBinding.


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