![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
#include <swmmnodepropertyadapter.h>
Public Types | |
| enum | NodeKind { Junction = 0 , Outfall = 1 , Storage = 2 , Divider = 3 , VirtualJunction = 4 , InletJunction = 5 } |
| enum | OutfallType { FREE = 0 , NORMAL = 1 , FIXED = 2 , TIDAL = 3 , TIMESERIES = 4 } |
| enum | DividerType { CUTOFF = 0 , OVERFLOW_ = 1 , TABULAR = 2 , WEIR = 3 } |
| enum | FlapGate { NO = 0 , YES = 1 } |
| enum | InletPlacement { AUTOMATIC = 0 , ON_GRADE = 1 , ON_SAG = 2 } |
| enum | StorageShape { Tabular = 0 , Functional = 1 , Cylindrical = 2 , Conical = 3 , Paraboloid = 4 , Pyramidal = 5 } |
Signals | |
| void | changed () |
| void | renameRequested (const QString &oldName, const QString &newName) |
| void | coordChangeRequested (double newX, double newY) |
| void | displayLabelsChanged () |
Protected Member Functions | |
| int | nodeIdx () const |
| void | writeInletUsage (const std::function< bool(SWMM_InletUsage &)> &mutate) |
Protected Attributes | |
| SWMM_Engine | m_engine |
| QString | m_name |
| SWMMModelLayer * | m_layer = nullptr |
| DB.4c — for compound-cell pickers. | |
| QUuid | m_statsSourceId |
| openswmmvis::OutputStatsRegistry * | m_statsRegistry = nullptr |
Properties | |
| QString | name |
| NodeKind | nodeKind |
| double | invertElev |
| QString | tag |
| double | xCoord |
| double | yCoord |
Base node adapter — exposes only the attributes that ALL node types share (per the SWMM5 .inp [JUNCTIONS]/[OUTFALLS]/[STORAGE]/ [DIVIDERS] sections in InpWriter.cpp). Type-specific Q_PROPERTYs live on subclasses below so the Property Browser doesn't show inapplicable properties (e.g. outfalls won't show dividerType).
All accessors live on the base — subclasses just declare the Q_PROPERTYs they want exposed. Public getters/setters that aren't listed as Q_PROPERTY on the subclass simply don't appear in its metaObject, so QPropertyModel ignores them.
Round-4 follow-up 2026-05-12 — type-safe enums declared with Q_ENUM so QPropertyModel renders the key name ("CUTOFF", "FREE", etc.) instead of the raw integer. Values mirror SWMM_NodeType / SWMM_OutfallType / SWMM_DividerType + a yes/no boolean wrapped for flap-gate. Subclasses inherit these via metaObject() — no need to redeclare.
Junction/Outfall/Storage/Divider match SWMM_NodeType ordinals; the GUI presents VirtualJunction as a distinct kind even though the engine stores it as a JUNCTION with the is_virtual flag set.
An inlet junction is a virtual junction that additionally carries the is_inlet flag and one [INLET_USAGE] row, so nodeKind() tests it FIRST.
| Enumerator | |
|---|---|
| Junction | |
| Outfall | |
| Storage | |
| Divider | |
| VirtualJunction | |
| InletJunction | |
Storage geometry form — ordinals match the engine's SWMM_StorageShape (and the legacy solver's enum StorageType), so the int round-trips through swmm_node_get/set_storage_shape unchanged.
swmm_node_set_storage_curve).swmm_node_set_storage_functional).swmm_node_set_storage_geometry), from which the engine derives its internal area coefficients. See storageshapegeom.h for what L/W/Z mean per shape — they differ, which is why the row labels are generic. | Enumerator | |
|---|---|
| Tabular | |
| Functional | |
| Cylindrical | |
| Conical | |
| Paraboloid | |
| Pyramidal | |
| SWMMNodePropertyAdapter::SWMMNodePropertyAdapter | ( | SWMM_Engine | engine, |
| QString | name, | ||
| QObject * | parent = nullptr |
||
| ) |
| engine | Engine handle (non-null). |
| name | Node id (must already exist on the engine). |
| QString SWMMNodePropertyAdapter::approachStreet | ( | ) | const |
Read-only: the name of the upstream STREET conduit's street section, i.e. the gutter the inlet sits in. Empty when not resolvable.
| DataObjectRef SWMMNodePropertyAdapter::captureNodeRef | ( | ) | const |
|
signal |
Slice DB — emitted when setXCoord() or setYCoord() is called with a value distinct from the current coord pair. The attribute panel connects this to SWMMModelLayer::applyNodeMove, which writes the engine + rebuilds the scene cache + bumps link bboxes + repaints. A direct swmm_spatial_set_node_coord would update the engine but leave the cached scene coords stale until the next full geometry rebuild. The signal carries the full pair so the panel doesn't have to re-read the other coord.
| double SWMMNodePropertyAdapter::crownElev | ( | ) | const |
| int SWMMNodePropertyAdapter::degree | ( | ) | const |
| double SWMMNodePropertyAdapter::depressionHeight | ( | ) | const |
| double SWMMNodePropertyAdapter::depressionWidth | ( | ) | const |
| QString SWMMNodePropertyAdapter::displayLabelFor | ( | const QString & | property | ) | const |
Maps a Q_PROPERTY identifier (e.g. "maxDepth") to a human-readable column-0 label (e.g. "Max Depth (ft)") with unit suffixes pulled live from UnitSystem::instance(). Q_INVOKABLE so QPropertyModel can pick it up generically without taking a SWMM-specific dependency. Returns an empty string for unknown property names — the model then falls back to the raw identifier.
|
signal |
Emitted whenever the active unit system changes, so the Property Browser can refresh column-0 labels (e.g. swap "(ft)" → "(m)") without rebuilding the property tree.
| SWMMNodePropertyAdapter::DividerType SWMMNodePropertyAdapter::dividerType | ( | ) | const |
| NodeCompoundEditRef SWMMNodePropertyAdapter::dwfRef | ( | ) | const |
| double SWMMNodePropertyAdapter::flowRestriction | ( | ) | const |
| double SWMMNodePropertyAdapter::fullVolume | ( | ) | const |
| NodeCompoundEditRef SWMMNodePropertyAdapter::groundwaterSourcesRef | ( | ) | const |
AQUIFER_GROUNDWATER_EXCHANGE plan G5 — read-only navigation row listing the subcatchments that discharge groundwater to this node ("from S1, S3" / "(none)"); the button opens GroundwaterExchangeDialog for the picked subcatchment.
| NodeCompoundEditRef SWMMNodePropertyAdapter::inflowsRef | ( | ) | const |
| double SWMMNodePropertyAdapter::initialDepth | ( | ) | const |
| InitialQualityEditRef SWMMNodePropertyAdapter::initialQualityRef | ( | ) | const |
Initial-quality UI round — per-element [INITIAL_QUALITY] overrides row. Same compound-ref pattern; the InitialQualityEditButton editor opens InitialQualityDialog scoped to this node.
| DataObjectRef SWMMNodePropertyAdapter::inletDesignRef | ( | ) | const |
| double SWMMNodePropertyAdapter::invertElev | ( | ) | const |
| double SWMMNodePropertyAdapter::maxDepth | ( | ) | const |
|
inline |
|
inline |
|
protected |
| SWMMNodePropertyAdapter::NodeKind SWMMNodePropertyAdapter::nodeKind | ( | ) | const |
| int SWMMNodePropertyAdapter::numInlets | ( | ) | const |
| SWMMNodePropertyAdapter::FlapGate SWMMNodePropertyAdapter::outfallFlapGate | ( | ) | const |
| double SWMMNodePropertyAdapter::outfallStage | ( | ) | const |
| DataObjectRef SWMMNodePropertyAdapter::outfallTidalCurveRef | ( | ) | const |
| DataObjectRef SWMMNodePropertyAdapter::outfallTimeseriesRef | ( | ) | const |
| SWMMNodePropertyAdapter::OutfallType SWMMNodePropertyAdapter::outfallType | ( | ) | const |
| double SWMMNodePropertyAdapter::pctClogged | ( | ) | const |
| SWMMNodePropertyAdapter::InletPlacement SWMMNodePropertyAdapter::placement | ( | ) | const |
| double SWMMNodePropertyAdapter::pondedArea | ( | ) | const |
| NodeCompoundEditRef SWMMNodePropertyAdapter::rdiiRef | ( | ) | const |
|
inlineslot |
Round-4 follow-up 2026-05-12 — force the Property Browser to re-query. Used when the table view edits the same object externally; emitting changed() triggers QPropertyModel to re-read every property (each getter round-trips to the engine, so values stay authoritative).
|
signal |
Emitted when setName() is called with a non-empty, non-duplicate name. The attribute panel connects this to SWMMModelLayer::applyRename().
| double SWMMNodePropertyAdapter::rimDepth | ( | ) | const |
Rendering-only rim (ground) depth above the invert; 0 = unset. Exposed as the "Max Depth, Display" row on virtual junctions, whose real max depth is the derived pipe crown. Never read by the solver — see swmm_node_get_rim_depth().
| double SWMMNodePropertyAdapter::seepRate | ( | ) | const |
|
slot |
|
slot |
|
slot |
|
slot |
|
inlineslot |
|
slot |
|
inlineslot |
|
inlineslot |
Compound-ref write slots — the cell's NodeCompoundEditButton invokes these via the delegate's setModelData round-trip after the dialog closes. The actual engine mutations already happened inside the dialog (swmm_*_add/remove/set), so these are no-ops except for emitting changed() so the property tree (and the attribute table) re-reads its summary. Their existence is what flips QMetaProperty::isWritable() to true, which is what QVariantPropertyItem checks to mark the cell editable — without these, the cell never enters edit mode and the registered NodeCompoundEditButton creator never fires.
|
slot |
|
inlineslot |
|
slot |
|
slot |
|
slot |
|
inline |
DB.4c — set the model layer the compound-edit pickers can call back into to create new TS / patterns / UHs. Optional.
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
inlineslot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
inlineslot |
|
inlineslot |
|
slot |
|
slot |
| double SWMMNodePropertyAdapter::statMaxDepth | ( | ) | const |
| double SWMMNodePropertyAdapter::statMaxOverflow | ( | ) | const |
|
inlineslot |
| double SWMMNodePropertyAdapter::statTimeFlooded | ( | ) | const |
| double SWMMNodePropertyAdapter::statVolFlooded | ( | ) | const |
| double SWMMNodePropertyAdapter::storageCoeffA | ( | ) | const |
| double SWMMNodePropertyAdapter::storageConstC | ( | ) | const |
| DataObjectRef SWMMNodePropertyAdapter::storageCurveRef | ( | ) | const |
| double SWMMNodePropertyAdapter::storageExpB | ( | ) | const |
| double SWMMNodePropertyAdapter::storageParam1 | ( | ) | const |
| double SWMMNodePropertyAdapter::storageParam2 | ( | ) | const |
| double SWMMNodePropertyAdapter::storageParam3 | ( | ) | const |
| SWMMNodePropertyAdapter::StorageShape SWMMNodePropertyAdapter::storageShape | ( | ) | const |
| double SWMMNodePropertyAdapter::surchargeDepth | ( | ) | const |
| QString SWMMNodePropertyAdapter::tag | ( | ) | const |
| NodeCompoundEditRef SWMMNodePropertyAdapter::treatmentRef | ( | ) | const |
|
inlineslot |
Called by PropertiesPanel after applyRename() succeeds so the adapter's stored name matches the engine's new name.
| UserFlagsEditRef SWMMNodePropertyAdapter::userFlagsRef | ( | ) | const |
Phase 4 of docs/USER_FLAGS_UI_PLAN_2026-06-03.md — per-object user-flag assignments row. Same compound-ref pattern as the accessors above; the UserFlagsEditButton editor opens UserFlagValuesDialog. Requires setModelLayer() for the shared UserFlagsModel; without a layer the cell disables gracefully.
|
protected |
Read-modify-write of this node's SWMM_InletUsage row as ONE undoable step (SetInletUsageCommand via SWMMModelLayer::pushInletUsageEdit). mutate receives the current row — or an engine-default one when the node has none yet — and returns false to cancel the write (a no-op edit, or a name that did not resolve). Requires a bound model layer; without one it does nothing.
| double SWMMNodePropertyAdapter::xCoord | ( | ) | const |
| double SWMMNodePropertyAdapter::yCoord | ( | ) | const |
|
protected |
|
protected |
DB.4c — for compound-cell pickers.
|
protected |
|
protected |
|
protected |
Slice QA.2 — stats-source dispatch state. Null UUID = use the editing engine's ambient stats; non-null = read from the SWMMResultsLayer that the registry maps the UUID to.
|
readwrite |
|
readwrite |
|
read |
|
readwrite |
Free-form [TAGS] label (DB.3 engine surface). Editable text; index-keyed in the engine, so survives a rename.
|
readwrite |
|
readwrite |