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::AttributePickerMenu Class Reference

#include <attributepickermenu.h>

Collaboration diagram for openswmmvis::ui::AttributePickerMenu:

Static Public Member Functions

static QMenu * createForObjectKind (openswmmvis::plot::ObjectRef::Kind kind, openswmmvis::plot::UnitSystem unitSystem, QWidget *parent=nullptr, const QStringList &speciesNames=QStringList())
 Build (and return) a menu of attributes valid for kind. Caller owns the returned menu (set its parent on construction or delete after exec).
 
static QVector< openswmmvis::plot::PlotAttributeexecForMeshKind (openswmmvis::plot::ObjectRef::Kind kind, const QPoint &globalPos, const openswmmvis::plot::IRunLayer *availability, const QString &unavailableTip=QString())
 Pop a "Plot time series" context menu for a 2D mesh kind at globalPos and return the attributes the user picked — one entry, or every enabled entry when "All attributes" was chosen. Entries availability can't serve (supportsAttribute false) are greyed out with unavailableTip as tooltip; pass nullptr to enable all. Empty on cancel. Blocks in QMenu::exec — call it from a mouse RELEASE handler, never while a button is still down.
 
static QMenu * createForSystem (openswmmvis::plot::UnitSystem unitSystem, QWidget *parent=nullptr)
 Build the system-attribute menu (14 entries). Each action's data() carries the PlotAttribute value.
 
static openswmmvis::plot::PlotAttribute attributeFrom (const QAction *action)
 Extract the chosen PlotAttribute from a picked action. Returns PlotAttribute::Unknown for the "All attributes" sentinel or when the action is null / unrelated.
 
static openswmmvis::plot::ResultDescriptor descriptorFrom (const QAction *action)
 Y2b-2 (amendment D-Y4): extract what the picked action plots — a fixed attribute or a species BY NAME. An INVALID descriptor means the "All attributes" sentinel (or a null action); callers fan out across the run's descriptor list.
 

Member Function Documentation

◆ attributeFrom()

PlotAttribute openswmmvis::ui::AttributePickerMenu::attributeFrom ( const QAction *  action)
static

Extract the chosen PlotAttribute from a picked action. Returns PlotAttribute::Unknown for the "All attributes" sentinel or when the action is null / unrelated.

Warning
Species actions ALSO read as Unknown here (their data is the species name, not an int) — callers offering species must use descriptorFrom, which tells the three cases apart.
Here is the caller graph for this function:

◆ createForObjectKind()

QMenu * openswmmvis::ui::AttributePickerMenu::createForObjectKind ( openswmmvis::plot::ObjectRef::Kind  kind,
openswmmvis::plot::UnitSystem  unitSystem,
QWidget *  parent = nullptr,
const QStringList &  speciesNames = QStringList() 
)
static

Build (and return) a menu of attributes valid for kind. Caller owns the returned menu (set its parent on construction or delete after exec).

Includes an All attributes trailing entry that, when chosen, carries PlotAttribute::Unknown as the action's data() — callers treat that as a request to add one series per attribute.

Mesh kinds (Mesh2DCell / Mesh2DEdge / Mesh2DVertex) get their fixed list from attributesForKind; the caller greys out entries the layer can't serve. Returns nullptr for Kind::Unknown or Kind::Observed (those don't use this picker).

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

◆ createForSystem()

QMenu * openswmmvis::ui::AttributePickerMenu::createForSystem ( openswmmvis::plot::UnitSystem  unitSystem,
QWidget *  parent = nullptr 
)
static

Build the system-attribute menu (14 entries). Each action's data() carries the PlotAttribute value.

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

◆ descriptorFrom()

openswmmvis::plot::ResultDescriptor openswmmvis::ui::AttributePickerMenu::descriptorFrom ( const QAction *  action)
static

Y2b-2 (amendment D-Y4): extract what the picked action plots — a fixed attribute or a species BY NAME. An INVALID descriptor means the "All attributes" sentinel (or a null action); callers fan out across the run's descriptor list.

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

◆ execForMeshKind()

QVector< PlotAttribute > openswmmvis::ui::AttributePickerMenu::execForMeshKind ( openswmmvis::plot::ObjectRef::Kind  kind,
const QPoint &  globalPos,
const openswmmvis::plot::IRunLayer availability,
const QString &  unavailableTip = QString() 
)
static

Pop a "Plot time series" context menu for a 2D mesh kind at globalPos and return the attributes the user picked — one entry, or every enabled entry when "All attributes" was chosen. Entries availability can't serve (supportsAttribute false) are greyed out with unavailableTip as tooltip; pass nullptr to enable all. Empty on cancel. Blocks in QMenu::exec — call it from a mouse RELEASE handler, never while a button is still down.

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

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