![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine model. More...
#include <swmmmodellayer.h>
Classes | |
| class | BulkEdit |
| struct | InletConnector |
| struct | NewProjectSpec |
| Everything a blank untitled project needs — the in-memory replacement for the synthetic temp .inp File → New used to write. More... | |
| struct | PickResult |
Tool-facing click-pick result. valid is false when no feature was hit within tolerance of the canvas-CRS click point. cat and soaIndex give the typed SoA position so tools can reach the underlying geometry without a second name → index lookup. name is the SWMM object id (matches selection-bus SWMMObjectRef::name). More... | |
| struct | SelectedElement |
| One selected element: its name plus a bitmask of the kinds (kKind*) the selection applies to. SWMM names are per-type namespaces — a rain gage and a subcatchment may legally share a name — so selection must carry the kind or a click on one lights up both. Order is preserved (the profile tool seeds its start/end nodes from shift-click order). More... | |
Public Slots | |
| void | markEdited () |
| Records that the engine now holds edits not yet on disk. | |
Signals | |
| void | modelFilePathChanged (const QString &path) |
| void | showNodesChanged (bool show) |
| void | showLinksChanged (bool show) |
| void | showSubcatchmentsChanged (bool show) |
| void | showRainGagesChanged (bool show) |
| void | showLabelsChanged (bool show) |
| void | selectionChanged (const QStringList &selectedNames) |
| void | modelLoaded () |
| void | modelLoadError (const QString &errorMessage) |
| void | rendererChanged () |
| Slice BI Phase 8.13.6.5 — emitted when setRenderer() swaps the renderer pointer. | |
| void | optionsChanged (const QStringList &keys) |
Emitted after any OPTIONS key has been written to the engine (via setOption() — the single entry point used by the SimulationOptionsDialog's Apply / OK). Carries the list of keys that changed in this batch so observers can decide whether the change is relevant. | |
| void | categoryOrderChanged () |
| void | geometryChanged () |
| void | attributeChanged (const QString &objectName) |
| void | qsgRenderKindsChanged (QsgKinds kinds) |
| void | hydrographChanged (const QString &uhName) |
| void | controlRulesChanged (const QString &ruleName) |
| void | transectChanged (const QString &transectName) |
| void | dataObjectsChanged () |
| void | modelEdited () |
Signals inherited from OpenSWMMVisLayer | |
| void | nameChanged (const QString &newName) |
| void | layerTypeChanged (OpenSWMMVisLayerType newType) |
| void | visibilityChanged (bool visible) |
| void | opacityChanged (double opacity) |
| void | srsChanged (SpatialReferenceSystem *newSRS) |
| void | extentChanged (const MapExtent &newExtent) |
| void | childrenChanged () |
| void | repaintRequested () |
| void | temporalSpecChanged (const OpenSWMM::Render::TemporalSpec &spec) |
| void | maskSpecChanged (const OpenSWMM::Render::MaskSpec &spec) |
| void | auxStorageSpecChanged (const OpenSWMM::Render::AuxiliaryStorageSpec &spec) |
| void | joinsChanged (const QVector< OpenSWMM::Render::JoinSpec > &joins) |
| void | diagramSpecChanged (const OpenSWMM::Render::DiagramSpec &spec) |
| void | labelConfigChanged () |
Public Member Functions | |
| SWMMModelLayer (const QString &modelFilePath, OpenSWMMVisWorkspace *parent=nullptr) | |
| ~SWMMModelLayer () override | |
| QString | modelFilePath () const |
| void | setModelFilePath (const QString &path) |
| QString | sourceDescription () const override |
| Human-readable source of this layer: a file path, a service URL, or a description for in-memory / derived layers. | |
| QVector< QPair< QString, QString > > | extendedMetadata () const override |
| Ordered key→value pairs of TYPE-SPECIFIC metadata, rendered by the Metadata tab below the common block the dialog builds itself. | |
| SWMM_Engine | engine () const |
| bool | crsAssigned () const noexcept |
| Whether the layer's CRS was ASSIGNED — read from the .inp's [OPTIONS] CRS, or set after load by the user (CRS picker, Simulation Options, canvas reprojection, .oswp restore) — as opposed to auto-derived on open from [MAP] UNITS or the preferences default. Only an assigned CRS is written back to the .inp on save; a model that carried none must stay that way. | |
| bool | loadModel (QList< QString > &warnings, QList< QString > &errors) |
| Loads (or reloads) the SWMM input file and rebuilds geometry caches. | |
| void | buildFromEngine (SWMM_Engine engine, qint64 *soaMsOut=nullptr, qint64 *geomMsOut=nullptr) |
| Populate the SoA arrays + geometry caches from engine. | |
| bool | adoptOpenEngine (SWMM_Engine engine, QList< QString > &warnings, QList< QString > &errors, qint64 openMs=-1, qint64 soaMs=0, qint64 geomMs=0) |
| Adopt an engine whose geometry was already built by buildFromEngine(). GUI-thread only: assigns the engine, syncs units, resolves the CRS, and emits the load signals. | |
| void | closeEngine () |
| bool | adoptNewEngine (const NewProjectSpec &spec, QList< QString > &warnings, QList< QString > &errors) |
| In-memory sibling of the loadModel path: createBlankEngine → buildFromEngine → adoptOpenEngine, all synchronous (a blank engine build is instant, so no worker hop). The layer keeps its empty modelFilePath until the first Save As. | |
| bool | showNodes () const |
| void | setShowNodes (bool show) |
| bool | showLinks () const |
| void | setShowLinks (bool show) |
| bool | showSubcatchments () const |
| void | setShowSubcatchments (bool show) |
| bool | showRainGages () const |
| void | setShowRainGages (bool show) |
| bool | showLabels () const |
| void | setShowLabels (bool show) |
| void | setLabelConfig (const OpenSWMM::Render::LabelConfig &cfg) override |
| Slice X.18 — full label configuration. | |
| QsgKinds | qsgRenderKinds () const noexcept |
| void | setQsgRenderKinds (QsgKinds kinds) |
| bool | qsgOwnsKind (QsgKind k) const noexcept |
| bool | glRenderingEnabled () const noexcept |
| void | setGlRenderingEnabled (bool on) |
| bool | isObjectVisible (const QString &name) const |
| Per-object visibility flag. Names present in m_hiddenObjects are skipped by populateScene. The Object Browser drives this state: a leaf checkbox is the only source of truth for an individual object; group-header toggles apply in bulk to every child but do not add a separate gate — after a group toggle the children's states fully determine visibility, and subsequent per-leaf toggles don't back-propagate to the header. | |
| bool | isObjectVisible (const QString &name, Category c) const |
Typed variant — visibility of the object of category c named name. SWMM names are per-type namespaces (a rain gage and a subcatchment may legally share a name), so the Object Browser uses this to read leaf check states without one kind's toggle bleeding into a same-named other kind. | |
| void | setObjectVisible (const QString &name, bool visible) |
| void | setObjectsVisible (const QList< QString > &names, bool visible) |
Batch form — apply the same visibility to every name in names with a single repaintRequested emission. Used by the group-header checkbox so toggling a category of 1000+ objects causes only one canvas refresh. | |
| QSet< QString > | hiddenObjects () const |
| Names currently hidden via per-object toggles. Used by the Object Browser to seed leaf-row check states on refresh. | |
| double | maxMarkerHalfBoundPx () const |
| Largest rendered marker half-bound across every SWMM element type, in PIXELS. Callers use this as a floor for the Select tool's pixel tolerance so clicks landing inside the visible glyph always hit, regardless of the user's tolerance preference. For a square Storage glyph the half-bound is half-width * sqrt(2) (diagonal); for circular Junctions it's the radius; polygons and polylines return 0 (they're handled by bbox / segment- distance tests inside identifyAt, which don't need the floor). | |
| int | categoryCount (Category c) const |
| Number of objects in the given category. O(1). | |
| QString | objectNameAt (Category c, int row) const |
| Object name at (category, row). O(1) — reads through the per-category index buckets populated in buildGeometryCache. Returns an empty string if the indices are out of range. | |
| int | soaIndexAt (Category c, int row) const |
SoA index at (category, row) — the index objectNameAt resolves the name from, and therefore also the ENGINE index for that object. Returns -1 when out of range. | |
| int | dataObjectCount (DataCategory c) const |
Slice BM.0 — number of non-spatial data objects in c. Returns 0 when the engine handle is null or when the underlying swmm_<type>_count call fails. | |
| QString | dataObjectNameAt (DataCategory c, int row) const |
| Slice BM.0 — name of a non-spatial data object at (category, row), or an empty string when out of range. | |
| QString | suggestUniqueDataObjectName (DataCategory c) const |
Slice DA.3 — suggest a unique default name for the next new data object of c. Scans existing names and returns the smallest positive integer n such that <Prefix><n> is not already in use (case-insensitive). | |
| QStringList | tableIdsOfType (int tableType) const |
List the engine's table ids whose type matches tableType (Slice DA.4.3). | |
| bool | createDataObject (DataCategory c, const QString &name, const QVariantMap &options, QString *outError=nullptr) |
| Create a new data object on the engine (DB.4b). | |
| Qt::CheckState | categoryCheckState (Category c) const |
| Aggregate check state for a category: Checked when every member is visible, Unchecked when every member is hidden, PartiallyChecked otherwise. O(1) — derived from the per-category hidden-count counter that setObjectVisibleAt / setCategoryVisible / setObjectVisible all maintain. | |
| void | setObjectVisibleAt (Category c, int row, bool visible) |
| Toggle visibility for a single leaf referenced by (category, row). Updates m_hiddenObjects plus the category hidden count and emits repaintRequested() on change. Preferred over setObjectVisible(name, …) when the caller already knows the category — avoids the name→(cat,row) lookup on the hot path of QTreeView::setData(). | |
| void | setCategoryVisible (Category c, bool visible) |
| Bulk-toggle every member of a category. Used by the group-header checkbox in the Object Browser; emits a single repaintRequested() regardless of how many objects the category contains. | |
| qreal | categoryOpacity (Category c) const |
| Per-kind (sub-layer) opacity in [0,1], applied on top of the layer opacity. Lets the user fade, say, Conduits independently of Junctions via the layer-tree Opacity column. Default 1.0. The painter multiplies each feature's alpha by this; setting it flags a rebuild + repaint. | |
| void | setCategoryOpacity (Category c, qreal opacity) |
| bool | findObjectLocation (const QString &name, Category *cat, int *row) const |
Locate an object by name, returning true and writing cat + row on success. O(1) hash lookup against the m_objectLocation map built at cache time. Used by the SelectionManager → tree model bridge to convert SWMMObjectRef into a QModelIndex without rescanning the SoA. | |
| QVector< Category > | categoryOrder () const |
| User-configurable display order of categories in the Object Browser. Defaults to the enum sequence at load time; Slice T.2's drag-and-drop rewrites the vector and the tree model re-renders in the new order. | |
| void | setCategoryOrder (const QVector< Category > &order) |
| void | setObjectOrder (Category cat, const QVector< int > &soaIndices) |
Install a user-defined display order for the given category. soaIndices is a permutation of the underlying SoA indices for the category (m_nodes for CatJunctions / Outfalls / Storage / Dividers; m_links for CatConduits / Pumps / Orifices / Weirs / Outlets; direct m_catchments / m_gages for the area categories). Size and membership must match exactly, otherwise the call is rejected (defensive: a malformed vector would silently drop or duplicate objects). | |
| void | clearObjectOrder (Category cat) |
| QVector< int > | objectOrder (Category cat) const |
| QVector< int > | defaultObjectOrder (Category cat) const |
| SWMMElementSymbol | junctionSymbol () const |
| void | setJunctionSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | outfallSymbol () const |
| void | setOutfallSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | storageSymbol () const |
| void | setStorageSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | dividerSymbol () const |
| void | setDividerSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | virtualJunctionSymbol () const |
| void | setVirtualJunctionSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | inletJunctionSymbol () const |
| void | setInletJunctionSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | inletConnectorSymbol () const |
| void | setInletConnectorSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | conduitSymbol () const |
| void | setConduitSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | pumpSymbol () const |
| void | setPumpSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | orificeSymbol () const |
| void | setOrificeSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | weirSymbol () const |
| void | setWeirSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | outletSymbol () const |
| void | setOutletSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | subcatchmentSymbol () const |
| void | setSubcatchmentSymbol (const SWMMElementSymbol &s) |
| SWMMElementSymbol | rainGageSymbol () const |
| void | setRainGageSymbol (const SWMMElementSymbol &s) |
| std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > | styleSubjects () override |
| SwmmElementSymbolAdapter * | elementSymbolAdapter (const QString &routingId) |
| The layer's persistent per-kind symbol adapter for a subject routing id ("model.junctions" … "model.virtualjunctions"). Lazily constructed on first request, parented to the layer, resynced from the live struct on every fetch. Returns nullptr for unknown ids. | |
| quint64 | editRevision () const |
| OpenSWMM::Render::IFeatureRenderer * | renderer () const override |
| The IFeatureRenderer for this layer. | |
| void | setRenderer (std::unique_ptr< OpenSWMM::Render::IFeatureRenderer > r) override |
| Replaces the current renderer. | |
| OpenSWMM::Render::IFeatureRenderer * | kindRenderer (Category c) const |
| void | setKindRenderer (Category c, std::unique_ptr< OpenSWMM::Render::IFeatureRenderer > r) |
| void | resetKindRendererToDefaults (Category c) |
| QList< OpenSWMM::Render::LegendSymbolItem > | legendSymbolItems () const |
| bool | supportsClassEdit (OpenSWMM::Render::ClassEditKind kind) const |
| QColor | colorForClass (const QString &classKey) const |
| void | setColorForClass (const QString &classKey, const QColor &color) |
| qreal | sizeForClass (const QString &classKey) const |
| void | setSizeForClass (const QString &classKey, qreal size) |
| OpenSWMM::Render::RuleList * | ruleList () override |
| const OpenSWMM::Render::RuleList * | ruleList () const override |
| QVector< OpenSWMM::Render::AttributeField > | availableAttributes (OpenSWMMVis::SwmmCategory cat) const override |
| bool | linkArrowsEnabled (Category c) const |
| void | setLinkArrowsEnabled (Category c, bool enabled) |
| double | linkArrowSize (Category c) const |
| void | setLinkArrowSize (Category c, double pixels) |
| double | linkArrowWidth (Category c) const |
| void | setLinkArrowWidth (Category c, double pixels) |
| QColor | linkArrowColor (Category c) const |
| void | setLinkArrowColor (Category c, const QColor &col) |
| bool | linkArrowOnlyWhenFlowPos (Category c) const |
| void | setLinkArrowOnlyWhenFlowPos (Category c, bool onlyPos) |
| double | linkFlow (int linkIdx) const |
| bool | kindUsesOverrides (Category c) const |
| QColor | featureColor (Category c, int idx) const |
| double | featureSize (Category c, int idx) const |
| int | featureShape (Category c, int idx) const |
| double | featureOffset (Category c, int idx) const |
| bool | kindHasAnyOffset (Category c) const |
| void | rebuildKindFeatureColors (Category c) |
| void | classifyGraduatedIfNeeded (Category c, OpenSWMM::Render::GraduatedRenderer *g) |
| QStringList | selectedElementNames () const |
| Returns the names of currently selected network elements. | |
| const QVector< SelectedElement > & | selectedElements () const |
| Typed selection — canonical form. Each entry names WHICH kind is selected, so same-named objects of other kinds stay unselected. | |
| void | setSelectedElements (const QVector< SelectedElement > &sel) |
| Replaces the selection with typed entries (kind-exact). | |
| void | setSelectedElementNames (const QStringList &names) |
| Selects network elements by name (replaces prior selection). Legacy name-only form: each name selects EVERY kind bearing it. Prefer setSelectedElements() when the caller knows the kind. | |
| void | clearSelection () |
| QVariantMap | identifyAt (double mapX, double mapY, const SpatialReferenceSystem *canvasSRS, double tolerance=1e-6) const |
| Returns attributes of the network element closest to the map point. | |
| QVariantMap | identifyAt (double mapX, double mapY, double tolerance=1e-6) const |
| Convenience overload — no CRS needed. | |
| QVariantMap | identifyByName (const QString &name, quint8 kindMask=kKindAll) const |
| Identify an object by name (instead of by map coordinates). | |
| class MapExtent | objectExtent (const QString &name) const |
| Layer-CRS bounding box of a cached object by name. | |
| QStringList | nodesInRect (double canvasMinX, double canvasMinY, double canvasMaxX, double canvasMaxY) const |
| Names of all nodes (any type) whose layer-CRS coordinates fall inside the rectangle given in canvas CRS. The inverse CRS transform is applied internally, matching the CRS-aware behaviour of identifyAt. Hidden objects are excluded. O(log N + k) via the internal KD-tree; rebuilt lazily after any coordinate-mutating operation (applyNodeMove / applyNodeAdd / rollbackTailNodeAdd). | |
| bool | snapNearestPoint (double mapX, double mapY, double mapRadius, QPointF &outPt, std::optional< QPointF > excludePos=std::nullopt) const |
| Nearest-neighbor snap query for vertex editing. | |
| QStringList | gagesInRect (double canvasMinX, double canvasMinY, double canvasMaxX, double canvasMaxY) const |
| Names of all rain gages whose coordinates fall inside the canvas-CRS rectangle. Same semantics as nodesInRect. | |
| QStringList | linksInRect (double canvasMinX, double canvasMinY, double canvasMaxX, double canvasMaxY) const |
| Names of all links whose polyline bbox overlaps the canvas-CRS rectangle. Backed by a per-link bbox cache (built in buildGeometryCache, kept fresh on every coord-mutating edit). Hidden objects excluded. | |
| QStringList | subcatchmentsInRect (double canvasMinX, double canvasMinY, double canvasMaxX, double canvasMaxY) const |
Names of all subcatchments whose polygon bbox overlaps the canvas-CRS rectangle. Same caching pattern as linksInRect. | |
| QStringList | nodesInPolygon (const QPolygonF &canvasPoly) const |
| QStringList | gagesInPolygon (const QPolygonF &canvasPoly) const |
| QStringList | linksInPolygon (const QPolygonF &canvasPoly) const |
| QStringList | subcatchmentsInPolygon (const QPolygonF &canvasPoly) const |
| void | populateScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override |
| Creates / updates QGraphicsItems representing this layer in the scene. | |
| void | depopulateScene (QGraphicsScene *scene) override |
| Removes all QGraphicsItems belonging to this layer from the scene. | |
| void | refreshScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override |
| Smart scene refresh — updates existing items instead of destroying and recreating. | |
| void | onCanvasCRSChanged (const SpatialReferenceSystem *newCanvasSRS) override |
| Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform caches. | |
| void | reloadGeometry () |
| Re-read every node / link / subcatchment coordinate from the engine and rebuild the geometry cache + extent. | |
| bool | transformCanvasToLayer (double cx, double cy, double &lx, double &ly) const |
| Reverse-transform a canvas-CRS coordinate into the layer's native CRS. | |
| QPolygonF | polygonCanvasToLayer (const QPolygonF &poly) const |
| Transform every vertex of a canvas-CRS polygon into layer CRS. | |
| bool | transformLayerToCanvas (double lx, double ly, double &cx, double &cy) const |
| Forward-transform a layer-CRS coordinate into the canvas CRS. | |
| int | objectTypeFor (const QString &name) const |
Classify a name into its SWMM object class via O(1) lookup against m_objectLocation. | |
| int | nodeIndex (const QString &name) const |
| Returns the cache index of the node with the given name, or -1 if none matches. | |
| int | linkIndex (const QString &name) const |
| Returns the cache index of the link with the given name, or -1 if none matches. | |
| bool | cachedNodeCoord (int idx, double *x, double *y) const |
| Cached layer-CRS coordinate of a node by index. | |
| bool | elementPosition (const QString &name, double *x, double *y) const |
| Layer-CRS position of any named element (node, gage, or link midpoint) by object name. | |
| QVector< QPointF > | cachedLinkPolyline (int idx) const |
| Cached layer-CRS polyline of a link by index, including the endpoint coordinates of its from/to nodes. | |
| QVector< QPointF > | cachedLinkInteriorVertices (int idx) const |
| Cached interior-only polyline of a link (endpoints stripped). | |
| int | renderLinkCount () const |
| Number of links the render-facing scene-coordinate arrays currently describe. | |
| bool | renderLinkHidden (int idx) const |
The hidden flag the renderers read for link idx — what actually decides whether the base link pass emits it. | |
| QVector< QPointF > | cachedSubcatchVertices (int idx) const |
Cached layer-CRS polygon of a subcatchment by index. Vertex order matches the .inp [Polygons] section. Returns empty when idx is out of range or the subcatchment has no polygon (engine permits coordinate-less subcatchments). | |
| int | cachedSubcatchCount () const |
Number of subcatchments cached. Equivalent to categoryCount(CatSubcatchments) but provided alongside cachedSubcatchVertices for direct iteration. | |
| int | cachedNodeCount () const |
| Cached top-level object counts (all node/link kinds summed). Convenience for load-summary logging. | |
| int | cachedLinkCount () const |
| int | cachedGageCount () const |
| bool | cachedGageCoord (int idx, double *x, double *y) const |
| A rain gage's coordinate AS THE ENGINE STORES IT. | |
| quint64 | geomRevision () const |
| QString | getOption (const QByteArray &key, const QString &fallback={}) const |
Read a single SWMM OPTIONS key from the engine. Returns the fallback when the engine has no value for the key or the engine isn't open. | |
| bool | setOption (const QByteArray &key, const QString &value) |
Write a single SWMM OPTIONS key. On success emits optionsChanged({key}). Returns true on success, false if the engine isn't open or rejected the value. | |
| int | setOptions (const QMap< QByteArray, QString > &values) |
Batch write — applies a set of key/value pairs, then emits optionsChanged(changedKeys) once. Returns the number of keys the engine accepted. | |
| double | engineLinkLength (int linkIdx) const |
| Returns the conduit length recorded in the engine, or -1 if the link is not a conduit / is out of range. | |
| double | polylineLengthInModelUnits (const QVector< QPointF > &vertices) const |
| Compute polyline length in the SWMM model's expected linear unit (feet for US-customary FLOW_UNITS — CFS/GPM/MGD; metres for SI — CMS/LPS/MLD). | |
| bool | isConduit (int linkIdx) const |
Returns true when the link at linkIdx is a conduit (the only link type whose length is stored as an independent geometry value and is therefore eligible for auto-length). | |
| PickResult | pickAt (double sceneX, double sceneY, double tolerance) const |
| bool | previewNodeMove (int idx, double newX, double newY) |
| bool | previewGageMove (int idx, double newX, double newY) |
| QVector< int > | linksAttachedToNode (int nodeIdx) const |
| Indices of links whose from/to endpoint is the given node. | |
| int | linkEndForNode (int linkIdx, int nodeIdx) const |
Which end of a link is attached to nodeIdx: 0 = from, 1 = to, or -1 if the node is not an endpoint of the link. | |
| int | linkFromNodeIdx (int linkIdx) const |
| int | linkToNodeIdx (int linkIdx) const |
| bool | applyNodeMove (int idx, double newX, double newY) |
| Apply a new coordinate to a node: engine + cache + attached link endpoint updates. Does not push an undo command — the caller (tool or MoveNodeCommand) is responsible for that. | |
| bool | applyLinkLength (int linkIdx, double length) |
| Write the conduit length for a link. No-op if the link is not a conduit. | |
| void | convertLinkOffsets (bool toElevation, bool convertValues) |
| Apply the user's answer to legacy UpdateOffsets' "convert all
link offsets?" prompt after LINK_OFFSETS has been flipped. | |
| bool | applyLinkXsect (int linkIdx, int shape, double g1, double g2, double g3, double g4) |
Slice SC.1 — Write a cross-section to a link via swmm_link_set_xsect. Emits attributeChanged(linkName) on success so the Map symbology + Attribute Table + Property Browser refresh in one tick. Returns false on engine error (e.g., bad shape code or geom param out of range). | |
| bool | applyLinkBarrels (int linkIdx, int barrels) |
Slice SC.1 — Write the parallel-barrels count. Emits attributeChanged on success. | |
| bool | applyLinkCulvertCode (int linkIdx, int code) |
Slice SC.1 — Write the FHWA culvert chart code (0 = none). Emits attributeChanged on success. | |
| bool | applyNodeConvert (const QString &name, int newNodeType, QStringList *outCleared=nullptr, QStringList *outWarnings=nullptr, QString *outError=nullptr) |
Convert node name to newNodeType (SWMM_NodeType value) via swmm_node_convert. The engine preserves common props (invert, depths, coordinates), clears old-type-specific fields and applies new-type defaults. On success the cached SoA nodeType and category buckets are updated and repaintRequested() + geometryChanged() + attributeChanged() are emitted so map symbology, Object Browser, Attribute Table, and Property Browser all refresh in one tick. | |
| bool | applyLinkConvert (const QString &name, int newLinkType, QStringList *outCleared=nullptr, QStringList *outWarnings=nullptr, QString *outError=nullptr) |
Convert link name to newLinkType (SWMM_LinkType value) via swmm_link_convert. Endpoints, offsets, and interior vertices are preserved by the engine. Same cache update and signal contract as applyNodeConvert(). | |
| bool | applyLinkFlip (int linkIdx) |
Reverse link linkIdx: the upstream node becomes the downstream node and vice versa, leaving the physical link unchanged. | |
| bool | nodeIsVirtual (int soaIdx) const |
True when cached node soaIdx is a virtual junction. | |
| bool | applySetVirtual (const QString &name, bool makeVirtual, QString *outError=nullptr) |
Set or clear a node's virtual-junction flag via swmm_node_set_virtual (full engine validation). On a violated usage rule outError receives the actionable message from virtualJunctionRuleText(). | |
| bool | applyInsertVirtualJunction (const QString &linkName, double t, const QString &newNodeName, const QString &newLinkName, int *outNodeIdx=nullptr, int *outLinkIdx=nullptr, QString *outError=nullptr) |
Split conduit linkName at normalized polyline position t, inserting a virtual junction, via swmm_conduit_split. The original conduit keeps its name/upstream end; the new conduit newLinkName carries the remainder. Caches for the node, both conduits and the scene arrays are synchronized incrementally. | |
| bool | applyFuseVirtualJunction (const QString &nodeName, QString *outError=nullptr) |
Re-fuse the two conduits of virtual junction nodeName into one via swmm_virtual_junction_fuse (upstream conduit's name survives; the node coordinate becomes an interior vertex unless collinear; the downstream conduit and node are deleted). | |
| bool | applyInsertJunctionSplit (const QString &linkName, double t, const QString &newNodeName, const QString &newLinkName, int *outNodeIdx=nullptr, int *outLinkIdx=nullptr, QString *outError=nullptr) |
Split conduit linkName at t inserting a PLAIN junction, via swmm_conduit_split with make_virtual = 0. Identical to applyInsertVirtualJunction except that no virtual-junction rule validation runs, so this is the split available to models that do not route with DYNWAVE (virtual junctions require it — rule 619). | |
| bool | applyFuseJunctionSplit (const QString &nodeName, QString *outError=nullptr) |
| Inverse of applyInsertJunctionSplit — re-fuses the conduit pair and deletes the junction. | |
| bool | nodeIsInlet (int soaIdx) const |
True when cached node soaIdx is an inlet junction. An inlet junction is also a virtual junction, so callers that branch on both must test this one FIRST. | |
| bool | engineSupportsInletJunctions () const |
| Tri-state capability probe, cached for the layer's lifetime: true when the bound engine exposes the inlet-junction surface. Callers hide the add tool / Convert-To entries / usage page when this is false. | |
| bool | inletUsageFor (int hostKind, int hostIdx, SWMM_InletUsage *out) const |
Read the inlet-usage row hosted by (hostKind, hostIdx). | |
| bool | applySetInletUsage (const SWMM_InletUsage &usage, QString *outError=nullptr) |
Create or replace the usage row for usage's host via swmm_inlet_usage_set. Emits attributeChanged for the host object + repaintRequested (the connector overlay follows). | |
| bool | applyRemoveInletUsage (int hostKind, int hostIdx, QString *outError=nullptr) |
Remove the usage row hosted by (hostKind, hostIdx). A missing row is a successful no-op. | |
| bool | applySetInlet (const QString &name, bool makeInlet, QString *outError=nullptr) |
Set or clear a node's inlet-junction flag via swmm_node_set_inlet. Clearing leaves the node a virtual junction and drops its usage row (engine contract). | |
| bool | applyInsertInletJunction (const QString &linkName, double t, const QString &newNodeName, const QString &newLinkName, const QString &inletId, const QString &captureNode, int *outNodeIdx=nullptr, int *outLinkIdx=nullptr, QString *outError=nullptr) |
Split STREET conduit linkName at t, inserting an inlet junction wired to inletId / captureNode, via swmm_conduit_split_inlet (atomic engine-side). Cache sync is identical to applyInsertVirtualJunction. | |
| bool | applyFuseInletJunction (const QString &nodeName, QString *outError=nullptr) |
Inverse of applyInsertInletJunction — drops the usage row and re-fuses the conduit pair (swmm_inlet_junction_fuse). | |
| const QVector< InletConnector > & | inletConnectors () const |
| The connector overlay geometry, rebuilt on demand when the usage rows or the geometry changed. Empty when the engine has no usage rows or predates the inlet-usage API. | |
| void | setEditCanvas (MapCanvas *canvas) |
| Bind the canvas whose undo stack mediated edits push onto. | |
| MapCanvas * | editCanvas () const |
| bool | pushInletUsageEdit (const SWMM_InletUsage &usage) |
| Apply one inlet-usage row as a single undoable step. Pushes a SetInletUsageCommand on the edit canvas's stack when one is bound; falls back to applySetInletUsage() otherwise. | |
| bool | pushInletUsageRemoval (int hostKind, int hostIdx) |
| Undoable counterpart of applyRemoveInletUsage(). | |
| bool | applyLinkInteriorVertices (int linkIdx, const QVector< QPointF > &interior) |
| Apply interior vertices to a link: engine + cache, rebuilding the cached polyline from the node endpoints + new interior. | |
| bool | applySubcatchVertices (int idx, const QVector< QPointF > &vertices) |
| Replace a subcatchment's polygon vertices: engine + cache. Recomputes the centroid as the vertex average. | |
| bool | applySubcatchArea (int idx, double areaInModelUnits) |
| bool | applySubcatchSetGage (int idx, const QString &gageName) |
| Assign a rain gage to a subcatchment: engine + change notification. | |
| bool | applyNodeAdd (const QString &name, int nodeType, double x, double y, int *outIdx=nullptr) |
| Add a new node: engine + cache. Engine must be OPENED. | |
| bool | rollbackTailNodeAdd (const QString &name) |
| Undo an add by removing the tail entry of the node cache. | |
| bool | applyLinkAdd (const QString &name, int linkType, const QString &fromNodeName, const QString &toNodeName, const QVector< QPointF > &interiorVertices, int *outIdx=nullptr) |
| Add a new link: engine + cache. | |
| bool | rollbackTailLinkAdd (const QString &name) |
| bool | applyGageMove (int idx, double newX, double newY) |
Move a rain gage: engine [SYMBOLS] coordinate + cached scene point, in lockstep (a bare swmm_spatial_set_gage_coord would leave the canvas stale until the next geometry rebuild). The rain-gage twin of applyNodeMove; gages carry no attached links, so there is no bbox pass. | |
| bool | applyGageAdd (const QString &name, double x, double y, int *outIdx=nullptr) |
| bool | rollbackTailGageAdd (const QString &name) |
| bool | applySubcatchAdd (const QString &name, const QVector< QPointF > &polygon, int *outIdx=nullptr) |
| bool | rollbackTailSubcatchAdd (const QString &name) |
| bool | applyRename (const QString &oldName, const QString &newName, quint8 kindHint=kKindAll) |
| Rename any network element (node, link, subcatchment, or gage). | |
| void | beginBulkEdit () |
| void | endBulkEdit () |
| bool | bulkEditActive () const |
| bool | applyNodeDelete (const QString &name, QStringList *cascadeLinkNames=nullptr) |
| Delete a node, cascade-deleting all attached links. | |
| bool | applyLinkDelete (const QString &name) |
| bool | applyGageDelete (const QString &name) |
| bool | applySubcatchDelete (const QString &name) |
| bool | applyDeleteMany (const QStringList &nodeNames, const QStringList &linkNames, const QStringList &subcatchNames, const QStringList &gageNames, QStringList *cascadeLinkNames=nullptr) |
| Batch deletion (perf-plan Phase A2): one swmm_*_delete_many engine call per kind, one order-preserving SoA sweep per vector. | |
| bool | applyHydrographAddGroup (const QString &name, const QString &gageName, int initialResponse) |
| bool | applyHydrographRemoveGroup (const QString &name) |
| bool | applyHydrographRenameGroup (const QString &oldName, const QString &newName) |
| bool | applyHydrographSetGage (const QString &name, const QString &gageName) |
| bool | applyHydrographSetRtk (const QString &name, int month, int response, double r, double t, double k) |
| bool | applyHydrographSetIa (const QString &name, int month, int response, double dmax, double drecov, double dinit) |
| bool | applyHydrographRemoveEntry (const QString &name, int month, int response) |
| bool | applyHydrographClearMonths (const QString &name) |
| bool | applyRdiiDecaySet (const QString &name, int response, double k_dep, double k_0, double k_T, double T_ref, double theta_rec, double T_freeze, bool snowOn=false, double snow_T=1.0, double snow_ddf=0.0) |
| bool | applyRdiiDecayRemove (const QString &name, int response) |
| HydrographGroupListModel * | hydrographGroupListModel () |
| HydrographRtkTableModel * | hydrographRtkModel () |
| HydrographIaTableModel * | hydrographIaModel () |
| HydrographDecayTableModel * | hydrographDecayModel () |
| QObject * | ensureTimeseriesRegistry () |
| QObject * | ensurePatternRegistry () |
| QObject * | ensureCurveRegistry () |
| bool | applyControlRuleAdd (const QString &name, const QString &body, QString *outError=nullptr) |
Append a new control rule. body should already include the RULE <name> header (matching the engine's storage format); the apply helper does not synthesise one. Returns false if the engine is closed, name is empty, or the registry already holds it. | |
| bool | applyControlRuleReplace (const QString &name, const QString &newBody, QString *outError=nullptr) |
| Replace the body of an existing rule (typically the user- edited text from the code editor). Routes through the snapshot+clear +re-add round-trip so the engine's rule order is preserved. | |
| bool | applyControlRuleRename (const QString &oldName, const QString &newName, QString *outError=nullptr) |
Rename oldName to newName. Rewrites the RULE <name> header on the target slot's body so the engine round-trip preserves the rename. Refuses on duplicate (case-insensitive) or empty newName. | |
| bool | applyControlRuleRemove (const QString &name, QString *outError=nullptr) |
Drop the rule with name from the engine + registry. Returns false if not found. | |
| QObject * | ensureControlRuleRegistry () |
Lazy accessor for the project-scoped ControlRuleRegistry. Lifetime is bound to the layer; the registry is constructed on first call and loadFromEngine is invoked so the providers mirror the engine's current rule list. Returned as a QObject* to keep this header free of the controls include; callers downcast to openswmmvis::controls::ControlRuleRegistry*. | |
| bool | applyTransectAdd (const QString &name, QString *outError=nullptr) |
| Create a new transect. Refuses on duplicate or empty name. | |
| bool | applyTransectRename (const QString &oldName, const QString &newName, QString *outError=nullptr) |
| Rename. Refuses on duplicate (case-insensitive) or empty. | |
| bool | applyTransectRemove (const QString &name, QString *outError=nullptr) |
| Remove a transect by name. | |
| bool | applyTransectSetComments (const QString &name, const QString &comments) |
| bool | applyTransectSetRoughness (const QString &name, double nLeft, double nRight, double nChannel) |
| bool | applyTransectSetBankStations (const QString &name, double xLeft, double xRight) |
| bool | applyTransectSetEncroachmentStations (const QString &name, double xLeft, double xRight) |
| bool | applyTransectSetModifiers (const QString &name, double stationMul, double elevOffset, double meander) |
| bool | applyTransectSetStations (const QString &name, const QVector< QPair< double, double > > &stations) |
| Snapshot-and-rewrite the full station list. | |
| QObject * | ensureTransectRegistry () |
| Lazy accessor for the project-scoped TransectRegistry. | |
| QObject * | ensureStreetRegistry () |
| Lazy accessor for the project-scoped StreetRegistry. | |
| QObject * | ensurePollutantRegistry () |
| Lazy accessor for the project-scoped PollutantRegistry. | |
| QObject * | ensureLandUseRegistry () |
| Lazy accessor for the project-scoped LandUseRegistry. | |
| QObject * | ensureAquiferRegistry () |
| Lazy accessor for the project-scoped AquiferRegistry. | |
| QObject * | ensureSnowpackRegistry () |
| Lazy accessor for the project-scoped SnowpackRegistry. | |
| QObject * | ensureInletRegistry () |
| Lazy accessor for the project-scoped InletRegistry. | |
| QObject * | ensureLidControlRegistry () |
| Lazy accessor for the project-scoped LidControlRegistry. | |
| openswmmvis::ui::UserFlagsModel * | ensureUserFlagsModel () |
| Lazy accessor for the project-scoped UserFlagsModel. Returns nullptr if the engine isn't open. | |
| void | invalidateDataObjectCache () |
Public Member Functions inherited from OpenSWMMVisLayer | |
| OpenSWMMVisLayer (OpenSWMMVisWorkspace *parent) | |
| OpenSWMMVisLayer (const QString &name="Unlabeled Layer", OpenSWMMVisWorkspace *parent=nullptr) | |
| virtual | ~OpenSWMMVisLayer () |
| QString | layerId () const |
| Returns the layer's immutable unique identifier (UUID). | |
| QString | name () const |
| Returns the user-visible name of this layer. | |
| void | setName (const QString &name) |
| Sets the user-visible name. | |
| OpenSWMMVisLayerType | layerType () const |
| Returns the layer type discriminator. | |
| bool | isVisible () const |
| Returns true when this layer should be drawn. | |
| void | setVisible (bool visible) |
| Shows or hides this layer. | |
| double | opacity () const |
| Returns the layer opacity in the range [0.0, 1.0]. 0.0 = fully transparent; 1.0 = fully opaque. | |
| void | setOpacity (double opacity) |
| Sets the layer opacity. Values are clamped to [0.0, 1.0]. | |
| SpatialReferenceSystem * | srs () const |
| Returns the spatial reference system for this layer, or nullptr if the layer has no known CRS. | |
| void | setSRS (SpatialReferenceSystem *srs, bool ownsSRS=false) |
| Sets (or replaces) the CRS for this layer. | |
| QString | crsDescription () const |
| Returns a human-readable summary of this layer's CRS for display in the Properties window. | |
| MapExtent | extent () const |
| Returns the layer extent in the layer's own CRS. | |
| void | setExtent (const MapExtent &extent) |
| Sets the layer spatial extent (in the layer's CRS). | |
| virtual bool | isRasterLayer () const |
| Returns true for layers that render into a raster buffer (WMS, WMTS, GISRaster) rather than populating QGraphicsItems. | |
| virtual bool | isBasemapLayer () const |
| Returns true for world-spanning basemap layers (XYZ tile providers, WMS/WMTS services covering the whole world) that should NOT be included when computing the data-driven full extent. | |
| virtual void | render (QPainter *painter, const MapExtent &extent, const QSize &imageSize, const SpatialReferenceSystem *srs) |
Renders this layer's content directly into painter. | |
| virtual void | fetchCache (const MapExtent &extent, const QSize &viewportSize, const SpatialReferenceSystem *srs) |
| Triggers any asynchronous (or synchronous) tile/data fetch needed to populate this layer's internal cache for the given view state. | |
| void | setViewportSize (int w, int h) |
| Called by MapCanvas before refreshScene so layers can request the correct pixel dimensions for tile/image requests. | |
| int | viewportWidth () const |
| int | viewportHeight () const |
| QVector< OpenSWMMVisLayer * > | children () const |
| Returns the ordered list of child layers. | |
| double | layerZValue () const |
| Returns the z-value base assigned to this layer by the canvas. Items within the layer should use z-values relative to this. | |
| void | setLayerZValue (double z) |
| Called by the canvas to set this layer's z-value band. | |
| const OpenSWMM::Render::TemporalSpec & | temporalSpec () const |
| void | setTemporalSpec (const OpenSWMM::Render::TemporalSpec &spec) |
| const OpenSWMM::Render::LabelConfig & | labelConfig () const |
| const OpenSWMM::Render::MaskSpec & | maskSpec () const |
| void | setMaskSpec (const OpenSWMM::Render::MaskSpec &spec) |
| const OpenSWMM::Render::AuxiliaryStorageSpec & | auxStorageSpec () const |
| void | setAuxStorageSpec (const OpenSWMM::Render::AuxiliaryStorageSpec &spec) |
| const QVector< OpenSWMM::Render::JoinSpec > & | joins () const |
| void | setJoins (const QVector< OpenSWMM::Render::JoinSpec > &joins) |
| const OpenSWMM::Render::DiagramSpec & | diagramSpec () const |
| void | setDiagramSpec (const OpenSWMM::Render::DiagramSpec &spec) |
| OpenSWMMVisWorkspace * | workspace () const |
| void | setBasicAuth (const QString &username, const QString &password) |
| Sets HTTP Basic authentication for all subsequent network requests. | |
| void | setHttpHeaders (const BasemapHttpHeaders &headers) |
| Sets arbitrary extra HTTP headers applied to every request. | |
| BasemapHttpHeaders | httpHeaders () const |
Public Member Functions inherited from OpenSWMM::Render::IAttributeProvider | |
| virtual | ~IAttributeProvider ()=default |
Static Public Member Functions | |
| static SWMM_Engine | openEngineForPath (const QString &path, QString *errorDetail, qint64 *openMs=nullptr) |
| Create + open an engine for path (worker-thread safe). | |
| static SWMM_Engine | createBlankEngine (const NewProjectSpec &spec, QString *errorDetail) |
Create a blank BUILDING-state engine (swmm_engine_new) and stamp the spec's defaults on it via the options C API — no file involved. Never calls swmm_finalize_model (validation needs ≥ 1 node + outfall, which a blank project has not got). | |
| static QString | kindKey (Category c) |
| static quint8 | kindBitForCategory (Category c) noexcept |
| static QString | virtualJunctionRuleText (int engineErrorCode) |
| Actionable text for a virtual-junction / inlet-junction rule code (609..621 VJ, 623..635 inlet). | |
Static Public Attributes | |
| static constexpr Category | CatJunctions = OpenSWMMVis::CatJunctions |
| static constexpr Category | CatOutfalls = OpenSWMMVis::CatOutfalls |
| static constexpr Category | CatStorage = OpenSWMMVis::CatStorage |
| static constexpr Category | CatDividers = OpenSWMMVis::CatDividers |
| static constexpr Category | CatConduits = OpenSWMMVis::CatConduits |
| static constexpr Category | CatPumps = OpenSWMMVis::CatPumps |
| static constexpr Category | CatOrifices = OpenSWMMVis::CatOrifices |
| static constexpr Category | CatWeirs = OpenSWMMVis::CatWeirs |
| static constexpr Category | CatOutlets = OpenSWMMVis::CatOutlets |
| static constexpr Category | CatSubcatchments = OpenSWMMVis::CatSubcatchments |
| static constexpr Category | CatRainGages = OpenSWMMVis::CatRainGages |
| static constexpr Category | NumCategories = OpenSWMMVis::NumCategories |
| static constexpr quint8 | kKindNode = 0x01 |
| static constexpr quint8 | kKindLink = 0x02 |
| static constexpr quint8 | kKindCatch = 0x04 |
| static constexpr quint8 | kKindGage = 0x08 |
| static constexpr quint8 | kKindAll = 0x0F |
Properties | |
| QString | modelFilePath |
| bool | showNodes |
| bool | showLinks |
| bool | showSubcatchments |
| bool | showRainGages |
| bool | showLabels |
Properties inherited from OpenSWMMVisLayer | |
| QString | Name |
| bool | Visible |
| double | Opacity |
| QString | LayerId |
| OpenSWMMVisLayerType | LayerType |
| QVector< OpenSWMMVisLayer * > | Children |
| QString | CRS |
Friends | |
| class | SWMMLayerItem |
| class | SWMMLayerQSGRenderer |
Additional Inherited Members | |
Protected Member Functions inherited from OpenSWMMVisLayer | |
| bool | addChild (OpenSWMMVisLayer *child) |
| bool | removeChild (OpenSWMMVisLayer *child) |
| void | setLayerType (OpenSWMMVisLayerType type) |
Protected Attributes inherited from OpenSWMMVisLayer | |
| QByteArray | m_authHeader |
| "Basic <base64>" or empty | |
| BasemapHttpHeaders | m_httpHeaders |
| arbitrary headers (incl. "referer") | |
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine model.
The layer uses the coordinate frame of the OpenSWMMEngine model as its native CRS. When the canvas CRS differs, coordinates are reprojected using GDAL's OGRCoordinateTransformation.
The layer also provides:
The SWMM-element Category enum.
Definition moved to \c include/layers/swmm_category.h so leaf tests + sublayer headers can depend on the enum alone without pulling in the full layer's engine + Qt GUI dependency graph. Re-exported here as a member alias so existing call-sites (`SWMMModelLayer::Category`, `SWMMModelLayer::CatJunctions`, …) continue to compile unchanged.
Slice BM.0 — non-spatial data-object categories surfaced below the spatial section in the Object Browser. Keyed independently from Category to keep the existing tree logic untouched.
Each enum value maps 1:1 to an engine swmm_<type>_count
swmm_<type>_id accessor pair (see dataObjectCount / dataObjectNameAt). Curves and Time Series both come out of the unified engine tables array — they are partitioned on the GUI side via swmm_table_get_type. | enum SWMMModelLayer::QsgKind : quint8 |
Per-kind QSG render scope. Each flag means "this kind's GEOMETRY is drawn by the QSG (GPU) overlay; the CPU SWMMLayerItem must NOT draw it". Symmetrically, the QSG renderer (SWMMLayerQSGRenderer) uploads empty geometry for any kind NOT in the scope, so a kind's geometry is drawn by exactly one pipeline.
EXCEPTION — text labels. Labels are ALWAYS painted by the CPU pass (SWMMLayerItem's label block, deliberately not gated on these flags); the QSG renderer has no text pipeline. This hybrid is the documented contract (LAYER_STYLING_LABELING_PLAN_2026-08-16) — see the doc comment atop swmmlayerqsgrenderer.cpp before changing it.
Progressive migration: nodes go QSG first, then links, then catchments. Default is empty — i.e. everything stays on the CPU path, the QSG overlay never runs, and behaviour matches the legacy renderer.
Slice §QSG-1 (2026-05-26) — replaces the previous bool glRenderingEnabled which was an all-or-nothing gate.
| Enumerator | |
|---|---|
| QsgNone | |
| QsgNodes | Junctions / outfalls / storage / dividers. |
| QsgLinks | Conduits / pumps / orifices / weirs / outlets. |
| QsgCatch | Subcatchments (polygons + outlet lines). |
| QsgGages | Rain gages. |
|
explicit |
|
override |
| bool SWMMModelLayer::adoptNewEngine | ( | const NewProjectSpec & | spec, |
| QList< QString > & | warnings, | ||
| QList< QString > & | errors | ||
| ) |
In-memory sibling of the loadModel path: createBlankEngine → buildFromEngine → adoptOpenEngine, all synchronous (a blank engine build is instant, so no worker hop). The layer keeps its empty modelFilePath until the first Save As.
| bool SWMMModelLayer::adoptOpenEngine | ( | SWMM_Engine | engine, |
| QList< QString > & | warnings, | ||
| QList< QString > & | errors, | ||
| qint64 | openMs = -1, |
||
| qint64 | soaMs = 0, |
||
| qint64 | geomMs = 0 |
||
| ) |
Adopt an engine whose geometry was already built by buildFromEngine(). GUI-thread only: assigns the engine, syncs units, resolves the CRS, and emits the load signals.
| openMs/soaMs/geomMs | Phase timings folded into the load telemetry (openMs = engine open; soaMs/geomMs = the worker-side build). |
| bool SWMMModelLayer::applyControlRuleAdd | ( | const QString & | name, |
| const QString & | body, | ||
| QString * | outError = nullptr |
||
| ) |
Append a new control rule. body should already include the RULE <name> header (matching the engine's storage format); the apply helper does not synthesise one. Returns false if the engine is closed, name is empty, or the registry already holds it.
| bool SWMMModelLayer::applyControlRuleRemove | ( | const QString & | name, |
| QString * | outError = nullptr |
||
| ) |
Drop the rule with name from the engine + registry. Returns false if not found.
| bool SWMMModelLayer::applyControlRuleRename | ( | const QString & | oldName, |
| const QString & | newName, | ||
| QString * | outError = nullptr |
||
| ) |
Rename oldName to newName. Rewrites the RULE <name> header on the target slot's body so the engine round-trip preserves the rename. Refuses on duplicate (case-insensitive) or empty newName.
| bool SWMMModelLayer::applyControlRuleReplace | ( | const QString & | name, |
| const QString & | newBody, | ||
| QString * | outError = nullptr |
||
| ) |
Replace the body of an existing rule (typically the user- edited text from the code editor). Routes through the snapshot+clear +re-add round-trip so the engine's rule order is preserved.
| bool SWMMModelLayer::applyDeleteMany | ( | const QStringList & | nodeNames, |
| const QStringList & | linkNames, | ||
| const QStringList & | subcatchNames, | ||
| const QStringList & | gageNames, | ||
| QStringList * | cascadeLinkNames = nullptr |
||
| ) |
Batch deletion (perf-plan Phase A2): one swmm_*_delete_many engine call per kind, one order-preserving SoA sweep per vector.
Replaces K per-object deletes whose dominant cost was the engine's per-delete name-index rehash plus K O(N) removeAt calls. Nodes delete first (cascading their links); link names are resolved AFTER that batch, so a selected link the cascade already removed is skipped, matching the per-object path. Opens its own nestable BulkEdit scope — inside a BulkEditCommand it joins the outer scope; called bare it supplies the single rebuild+repaint itself.
| [out] | cascadeLinkNames | Names of links the node batch cascaded. |
| bool SWMMModelLayer::applyFuseInletJunction | ( | const QString & | nodeName, |
| QString * | outError = nullptr |
||
| ) |
Inverse of applyInsertInletJunction — drops the usage row and re-fuses the conduit pair (swmm_inlet_junction_fuse).
| bool SWMMModelLayer::applyFuseJunctionSplit | ( | const QString & | nodeName, |
| QString * | outError = nullptr |
||
| ) |
Inverse of applyInsertJunctionSplit — re-fuses the conduit pair and deletes the junction.
Both the engine (vj_fuse) and applyFuseVirtualJunction guard the fuse on the virtual flag, so this flags the node virtual just long enough to reuse that exact inverse, then fuses. The transient flag never persists: on success the node is deleted, and on failure the flag is rolled back. Safe because a fresh split leaves an identical-cross-section, zero-offset through pair (VJ rules 609/611/613 pass) and the DYNWAVE rule 619 is enforced only at parse time, never on edit.
| bool SWMMModelLayer::applyFuseVirtualJunction | ( | const QString & | nodeName, |
| QString * | outError = nullptr |
||
| ) |
Re-fuse the two conduits of virtual junction nodeName into one via swmm_virtual_junction_fuse (upstream conduit's name survives; the node coordinate becomes an interior vertex unless collinear; the downstream conduit and node are deleted).
| bool SWMMModelLayer::applyGageAdd | ( | const QString & | name, |
| double | x, | ||
| double | y, | ||
| int * | outIdx = nullptr |
||
| ) |
Add a rain gage: engine + cache.
| bool SWMMModelLayer::applyGageDelete | ( | const QString & | name | ) |
Delete a rain gage.
Move a rain gage: engine [SYMBOLS] coordinate + cached scene point, in lockstep (a bare swmm_spatial_set_gage_coord would leave the canvas stale until the next geometry rebuild). The rain-gage twin of applyNodeMove; gages carry no attached links, so there is no bbox pass.
| idx | Cache/engine gage index. |
| newX,newY | New coordinate in the layer CRS. |
| bool SWMMModelLayer::applyHydrographAddGroup | ( | const QString & | name, |
| const QString & | gageName, | ||
| int | initialResponse | ||
| ) |
Create a new UH group with a gage assignment and one initial response row keyed at month=-1 (ALL). Mirrors the existing NewDataObjectDialog(Hydrographs) seed flow but folded into the model layer so a single hydrographChanged() fires.
| bool SWMMModelLayer::applyHydrographClearMonths | ( | const QString & | name | ) |
Bulk-clear every per-month parameter row for a group, preserving any existing month=-1 (ALL) row. Used by the editor when switching from per-season to ALL.
| bool SWMMModelLayer::applyHydrographRemoveEntry | ( | const QString & | name, |
| int | month, | ||
| int | response | ||
| ) |
Remove one (group, month, response) parameter row. Idempotent.
| bool SWMMModelLayer::applyHydrographRemoveGroup | ( | const QString & | name | ) |
Remove a UH group: parameter rows, gage assignment, [RDII_DECAY] rows, and any [RDII] node assignments referencing it.
| bool SWMMModelLayer::applyHydrographRenameGroup | ( | const QString & | oldName, |
| const QString & | newName | ||
| ) |
Rename a UH group; walks all four engine containers (entries, gage_assignments, rdii_decay, rdii_assigns). Rejects empty / duplicate names.
| bool SWMMModelLayer::applyHydrographSetGage | ( | const QString & | name, |
| const QString & | gageName | ||
| ) |
Set, replace, or clear the rain gage assigned to a UH group. Pass an empty string to clear an existing assignment.
| bool SWMMModelLayer::applyHydrographSetIa | ( | const QString & | name, |
| int | month, | ||
| int | response, | ||
| double | dmax, | ||
| double | drecov, | ||
| double | dinit | ||
| ) |
Upsert linear-IA (dmax, drecov, dinit) for one (group, month, response) row.
| bool SWMMModelLayer::applyHydrographSetRtk | ( | const QString & | name, |
| int | month, | ||
| int | response, | ||
| double | r, | ||
| double | t, | ||
| double | k | ||
| ) |
Upsert R/T/K for one (group, month, response) row.
| bool SWMMModelLayer::applyInsertInletJunction | ( | const QString & | linkName, |
| double | t, | ||
| const QString & | newNodeName, | ||
| const QString & | newLinkName, | ||
| const QString & | inletId, | ||
| const QString & | captureNode, | ||
| int * | outNodeIdx = nullptr, |
||
| int * | outLinkIdx = nullptr, |
||
| QString * | outError = nullptr |
||
| ) |
Split STREET conduit linkName at t, inserting an inlet junction wired to inletId / captureNode, via swmm_conduit_split_inlet (atomic engine-side). Cache sync is identical to applyInsertVirtualJunction.
| bool SWMMModelLayer::applyInsertJunctionSplit | ( | const QString & | linkName, |
| double | t, | ||
| const QString & | newNodeName, | ||
| const QString & | newLinkName, | ||
| int * | outNodeIdx = nullptr, |
||
| int * | outLinkIdx = nullptr, |
||
| QString * | outError = nullptr |
||
| ) |
Split conduit linkName at t inserting a PLAIN junction, via swmm_conduit_split with make_virtual = 0. Identical to applyInsertVirtualJunction except that no virtual-junction rule validation runs, so this is the split available to models that do not route with DYNWAVE (virtual junctions require it — rule 619).
| bool SWMMModelLayer::applyInsertVirtualJunction | ( | const QString & | linkName, |
| double | t, | ||
| const QString & | newNodeName, | ||
| const QString & | newLinkName, | ||
| int * | outNodeIdx = nullptr, |
||
| int * | outLinkIdx = nullptr, |
||
| QString * | outError = nullptr |
||
| ) |
Split conduit linkName at normalized polyline position t, inserting a virtual junction, via swmm_conduit_split. The original conduit keeps its name/upstream end; the new conduit newLinkName carries the remainder. Caches for the node, both conduits and the scene arrays are synchronized incrementally.
| [out] | outNodeIdx | Engine/cache index of the inserted node. |
| [out] | outLinkIdx | Engine/cache index of the new conduit. |
| bool SWMMModelLayer::applyLinkAdd | ( | const QString & | name, |
| int | linkType, | ||
| const QString & | fromNodeName, | ||
| const QString & | toNodeName, | ||
| const QVector< QPointF > & | interiorVertices, | ||
| int * | outIdx = nullptr |
||
| ) |
Add a new link: engine + cache.
| name | Unique identifier. | |
| linkType | 0=Conduit, 1=Pump, 2=Orifice, 3=Weir, 4=Outlet. | |
| fromNodeName | From-node name (must already exist). | |
| toNodeName | To-node name (must already exist). | |
| interiorVertices | Interior (non-endpoint) polyline points. | |
| [out] | outIdx | Link index on success. |
| bool SWMMModelLayer::applyLinkBarrels | ( | int | linkIdx, |
| int | barrels | ||
| ) |
Slice SC.1 — Write the parallel-barrels count. Emits attributeChanged on success.
| bool SWMMModelLayer::applyLinkConvert | ( | const QString & | name, |
| int | newLinkType, | ||
| QStringList * | outCleared = nullptr, |
||
| QStringList * | outWarnings = nullptr, |
||
| QString * | outError = nullptr |
||
| ) |
Convert link name to newLinkType (SWMM_LinkType value) via swmm_link_convert. Endpoints, offsets, and interior vertices are preserved by the engine. Same cache update and signal contract as applyNodeConvert().
| bool SWMMModelLayer::applyLinkCulvertCode | ( | int | linkIdx, |
| int | code | ||
| ) |
Slice SC.1 — Write the FHWA culvert chart code (0 = none). Emits attributeChanged on success.
| bool SWMMModelLayer::applyLinkDelete | ( | const QString & | name | ) |
Delete a single link.
| bool SWMMModelLayer::applyLinkFlip | ( | int | linkIdx | ) |
Reverse link linkIdx: the upstream node becomes the downstream node and vice versa, leaving the physical link unchanged.
Swaps node1/node2 via swmm_link_set_nodes, reverses the interior vertices (the engine stores them upstream→downstream, so without this the drawn polyline zig-zags), and — for conduits only — swaps the two end-attached value pairs, offset_up/ offset_dn and the entry/exit loss coefficients, so the invert profile and head losses stay exactly where they were. Mirrors the engine's own adverse-slope reversal in PostParseResolver, minus the parse-time-derived direction and conduit slope (recomputed on the next engine open, and not exposed by any C API). Non-conduits carry a single crest offset in offset_up with offset_dn unused, so nothing is swapped for them.
Self-inverse: flipping twice restores the original state, which is what lets FlipLinkCommand use one call for redo and undo. Emits the applyLinkInteriorVertices() signal set (repaint + modelEdited) plus attributeChanged() for the From/To cells.
| bool SWMMModelLayer::applyLinkInteriorVertices | ( | int | linkIdx, |
| const QVector< QPointF > & | interior | ||
| ) |
Apply interior vertices to a link: engine + cache, rebuilding the cached polyline from the node endpoints + new interior.
| bool SWMMModelLayer::applyLinkLength | ( | int | linkIdx, |
| double | length | ||
| ) |
Write the conduit length for a link. No-op if the link is not a conduit.
| bool SWMMModelLayer::applyLinkXsect | ( | int | linkIdx, |
| int | shape, | ||
| double | g1, | ||
| double | g2, | ||
| double | g3, | ||
| double | g4 | ||
| ) |
Slice SC.1 — Write a cross-section to a link via swmm_link_set_xsect. Emits attributeChanged(linkName) on success so the Map symbology + Attribute Table + Property Browser refresh in one tick. Returns false on engine error (e.g., bad shape code or geom param out of range).
| bool SWMMModelLayer::applyNodeAdd | ( | const QString & | name, |
| int | nodeType, | ||
| double | x, | ||
| double | y, | ||
| int * | outIdx = nullptr |
||
| ) |
Add a new node: engine + cache. Engine must be OPENED.
| name | Unique null-terminated node identifier. | |
| nodeType | 0=Junction, 1=Outfall, 2=Storage, 3=Divider (matches SWMM_NodeType). | |
| x,y | Initial coordinate in the layer CRS. | |
| [out] | outIdx | Newly assigned node index on success. |
outIdx is -1. | bool SWMMModelLayer::applyNodeConvert | ( | const QString & | name, |
| int | newNodeType, | ||
| QStringList * | outCleared = nullptr, |
||
| QStringList * | outWarnings = nullptr, |
||
| QString * | outError = nullptr |
||
| ) |
Convert node name to newNodeType (SWMM_NodeType value) via swmm_node_convert. The engine preserves common props (invert, depths, coordinates), clears old-type-specific fields and applies new-type defaults. On success the cached SoA nodeType and category buckets are updated and repaintRequested() + geometryChanged() + attributeChanged() are emitted so map symbology, Object Browser, Attribute Table, and Property Browser all refresh in one tick.
| [out] | outCleared | Engine-reported cleared field names. |
| [out] | outWarnings | Engine-reported topology warnings. |
| [out] | outError | Human-readable failure reason. |
| bool SWMMModelLayer::applyNodeDelete | ( | const QString & | name, |
| QStringList * | cascadeLinkNames = nullptr |
||
| ) |
Delete a node, cascade-deleting all attached links.
Identifies cascade links before deletion so the caller can snapshot them. Modifies engine state + all caches.
| name | Node to delete. | |
| [out] | cascadeLinkNames | Names of links deleted as cascade. |
Apply a new coordinate to a node: engine + cache + attached link endpoint updates. Does not push an undo command — the caller (tool or MoveNodeCommand) is responsible for that.
| idx | Cache/engine node index. |
| newX,newY | New coordinate in the layer CRS. |
Emits repaintRequested() on success.
| bool SWMMModelLayer::applyRdiiDecayRemove | ( | const QString & | name, |
| int | response | ||
| ) |
Remove the [RDII_DECAY] row for a (group, response) pair. Idempotent. In the GUI's MVC layer this is the "untick Active" path.
| bool SWMMModelLayer::applyRdiiDecaySet | ( | const QString & | name, |
| int | response, | ||
| double | k_dep, | ||
| double | k_0, | ||
| double | k_T, | ||
| double | T_ref, | ||
| double | theta_rec, | ||
| double | T_freeze, | ||
| bool | snowOn = false, |
||
| double | snow_T = 1.0, |
||
| double | snow_ddf = 0.0 |
||
| ) |
Upsert one [RDII_DECAY] row for a (group, response) pair. The last three arguments configure the optional degree-day snow model (snowOn=false leaves the row snow-free).
| bool SWMMModelLayer::applyRemoveInletUsage | ( | int | hostKind, |
| int | hostIdx, | ||
| QString * | outError = nullptr |
||
| ) |
Remove the usage row hosted by (hostKind, hostIdx). A missing row is a successful no-op.
| bool SWMMModelLayer::applyRename | ( | const QString & | oldName, |
| const QString & | newName, | ||
| quint8 | kindHint = kKindAll |
||
| ) |
Rename any network element (node, link, subcatchment, or gage).
Calls the appropriate engine rename function, updates all GUI caches (geometry cache name, selection set, object-location map), and emits repaintRequested() + geometryChanged().
| oldName | Current name of the element. |
| newName | Desired new name (must not already exist). |
| kindHint | SWMM names are per-type namespaces, so oldName may match more than one kind at once (e.g. a rain gage and a subcatchment both named "S1"). Pass exactly one of kKindNode/kKindLink/kKindGage/kKindCatch when the caller knows which kind it means — every UI call site does, since a rename is always initiated from a kind-specific editor/row. The default, kKindAll, means "caller doesn't know" and falls back to a best-effort guess (node, then link, then gage, then catchment — first match wins), matching this method's pre-existing behaviour for any not-yet-migrated caller. |
kindHint, when given), newName is empty, newName is already in use, or the engine rejects the rename. | bool SWMMModelLayer::applySetInlet | ( | const QString & | name, |
| bool | makeInlet, | ||
| QString * | outError = nullptr |
||
| ) |
Set or clear a node's inlet-junction flag via swmm_node_set_inlet. Clearing leaves the node a virtual junction and drops its usage row (engine contract).
| bool SWMMModelLayer::applySetInletUsage | ( | const SWMM_InletUsage & | usage, |
| QString * | outError = nullptr |
||
| ) |
Create or replace the usage row for usage's host via swmm_inlet_usage_set. Emits attributeChanged for the host object + repaintRequested (the connector overlay follows).
| bool SWMMModelLayer::applySetVirtual | ( | const QString & | name, |
| bool | makeVirtual, | ||
| QString * | outError = nullptr |
||
| ) |
Set or clear a node's virtual-junction flag via swmm_node_set_virtual (full engine validation). On a violated usage rule outError receives the actionable message from virtualJunctionRuleText().
| bool SWMMModelLayer::applySubcatchAdd | ( | const QString & | name, |
| const QVector< QPointF > & | polygon, | ||
| int * | outIdx = nullptr |
||
| ) |
Add a subcatchment polygon: engine + cache.
| bool SWMMModelLayer::applySubcatchArea | ( | int | idx, |
| double | areaInModelUnits | ||
| ) |
| bool SWMMModelLayer::applySubcatchDelete | ( | const QString & | name | ) |
Delete a subcatchment.
| bool SWMMModelLayer::applySubcatchSetGage | ( | int | idx, |
| const QString & | gageName | ||
| ) |
Assign a rain gage to a subcatchment: engine + change notification.
Mirrors applyHydrographSetGage. Until this existed the only write paths were the property adapter and the attribute table, both calling swmm_subcatch_set_gage directly and emitting only their own local edit signal — which is why a bulk assignment had no way to refresh every view. Routing through the layer emits attributeChanged + modelEdited like every other mediated edit.
| idx | Zero-based subcatchment index. |
| gageName | Rain gage identifier. Must name an existing gage; an empty string is rejected, since SWMM requires a gage. |
| bool SWMMModelLayer::applySubcatchVertices | ( | int | idx, |
| const QVector< QPointF > & | vertices | ||
| ) |
Replace a subcatchment's polygon vertices: engine + cache. Recomputes the centroid as the vertex average.
| bool SWMMModelLayer::applyTransectAdd | ( | const QString & | name, |
| QString * | outError = nullptr |
||
| ) |
Create a new transect. Refuses on duplicate or empty name.
| bool SWMMModelLayer::applyTransectRemove | ( | const QString & | name, |
| QString * | outError = nullptr |
||
| ) |
Remove a transect by name.
| bool SWMMModelLayer::applyTransectRename | ( | const QString & | oldName, |
| const QString & | newName, | ||
| QString * | outError = nullptr |
||
| ) |
Rename. Refuses on duplicate (case-insensitive) or empty.
| bool SWMMModelLayer::applyTransectSetBankStations | ( | const QString & | name, |
| double | xLeft, | ||
| double | xRight | ||
| ) |
| bool SWMMModelLayer::applyTransectSetComments | ( | const QString & | name, |
| const QString & | comments | ||
| ) |
| bool SWMMModelLayer::applyTransectSetEncroachmentStations | ( | const QString & | name, |
| double | xLeft, | ||
| double | xRight | ||
| ) |
| bool SWMMModelLayer::applyTransectSetModifiers | ( | const QString & | name, |
| double | stationMul, | ||
| double | elevOffset, | ||
| double | meander | ||
| ) |
| bool SWMMModelLayer::applyTransectSetRoughness | ( | const QString & | name, |
| double | nLeft, | ||
| double | nRight, | ||
| double | nChannel | ||
| ) |
| bool SWMMModelLayer::applyTransectSetStations | ( | const QString & | name, |
| const QVector< QPair< double, double > > & | stations | ||
| ) |
Snapshot-and-rewrite the full station list.
|
signal |
Emitted after a single object's attribute is mutated (e.g. conduit length or subcatchment area recalculated from geometry). The attribute table and property browser connect to this signal so they can refresh just the affected row/adapter without a full model rebuild.
|
overridevirtual |
Available themeable fields for cat. Empty list is a valid answer — means the layer doesn't surface per-feature attributes on this category (e.g. SWMMModelLayer::CatRainGages has no per- feature engine fields).
Order = preferred picker order. Callers should NOT re-sort.
Implements OpenSWMM::Render::IAttributeProvider.
| void SWMMModelLayer::beginBulkEdit | ( | ) |
Open a bulk-edit scope. Nestable; only the outermost pair does work. Prefer the BulkEdit guard.
| void SWMMModelLayer::buildFromEngine | ( | SWMM_Engine | engine, |
| qint64 * | soaMsOut = nullptr, |
||
| qint64 * | geomMsOut = nullptr |
||
| ) |
Populate the SoA arrays + geometry caches from engine.
The heavy half of a model open — per-object SoA copy + buildGeometryCache (KD-trees, bboxes, scene coords). Pure data work: reads the engine C-API and writes plain member arrays, with no QObject creation, signals, or singleton access, so it is safe to run in a QtConcurrent worker. Does NOT assign m_engine (ownership stays with the caller until adoptOpenEngine).
The layer MUST NOT be painted while this runs (its scene arrays are being resized/filled) — callers keep it non-visible until adoptOpenEngine.
| soaMsOut/geomMsOut | Optional out: SoA-copy / geometry-cache ms. |
|
inline |
True while a bulk-edit scope is open. The applyXxxAdd/Delete helpers consult this to skip their per-object derived work.
A rain gage's coordinate AS THE ENGINE STORES IT.
Deliberately NOT the cached m_gages position. A gage with no [SYMBOLS] row arrives at (0,0), and buildGeometryCache() relocates such gages to the mean of every model vertex so they do not stack on the origin — a display convenience that invents a coordinate. Any spatial computation (Thiessen cells, interpolation weights) must see the engine's own value, because several un-located gages would otherwise all land on one fabricated point and quietly dominate the result.
| idx | Zero-based gage index. |
idx is out of range or no engine is attached. A returned (0,0) means "un-located" and callers should exclude the gage rather than use it. | int SWMMModelLayer::cachedGageCount | ( | ) | const |
| int SWMMModelLayer::cachedLinkCount | ( | ) | const |
| QVector< QPointF > SWMMModelLayer::cachedLinkInteriorVertices | ( | int | idx | ) | const |
Cached interior-only polyline of a link (endpoints stripped).
The engine's set_link_vertices API writes interior points only; this helper returns the corresponding subsection of the cached polyline for round-trip edits.
| QVector< QPointF > SWMMModelLayer::cachedLinkPolyline | ( | int | idx | ) | const |
Cached layer-CRS polyline of a link by index, including the endpoint coordinates of its from/to nodes.
Cached layer-CRS coordinate of a node by index.
| int SWMMModelLayer::cachedNodeCount | ( | ) | const |
Cached top-level object counts (all node/link kinds summed). Convenience for load-summary logging.
| int SWMMModelLayer::cachedSubcatchCount | ( | ) | const |
Number of subcatchments cached. Equivalent to categoryCount(CatSubcatchments) but provided alongside cachedSubcatchVertices for direct iteration.
| QVector< QPointF > SWMMModelLayer::cachedSubcatchVertices | ( | int | idx | ) | const |
Cached layer-CRS polygon of a subcatchment by index. Vertex order matches the .inp [Polygons] section. Returns empty when idx is out of range or the subcatchment has no polygon (engine permits coordinate-less subcatchments).
| Qt::CheckState SWMMModelLayer::categoryCheckState | ( | Category | c | ) | const |
Aggregate check state for a category: Checked when every member is visible, Unchecked when every member is hidden, PartiallyChecked otherwise. O(1) — derived from the per-category hidden-count counter that setObjectVisibleAt / setCategoryVisible / setObjectVisible all maintain.
| int SWMMModelLayer::categoryCount | ( | Category | c | ) | const |
Number of objects in the given category. O(1).
| qreal SWMMModelLayer::categoryOpacity | ( | Category | c | ) | const |
Per-kind (sub-layer) opacity in [0,1], applied on top of the layer opacity. Lets the user fade, say, Conduits independently of Junctions via the layer-tree Opacity column. Default 1.0. The painter multiplies each feature's alpha by this; setting it flags a rebuild + repaint.
| QVector< SWMMModelLayer::Category > SWMMModelLayer::categoryOrder | ( | ) | const |
User-configurable display order of categories in the Object Browser. Defaults to the enum sequence at load time; Slice T.2's drag-and-drop rewrites the vector and the tree model re-renders in the new order.
Only the display order changes — categoryCount() / objectNameAt() still take the enum category so all existing call sites keep working.
|
signal |
Emitted when setCategoryOrder() accepts a new vector. The Object Browser tree model listens and reshapes without recomputing the per-category hidden counts (category membership didn't change, only the display order).
| void SWMMModelLayer::classifyGraduatedIfNeeded | ( | Category | c, |
| OpenSWMM::Render::GraduatedRenderer * | g | ||
| ) |
Data-derive a GraduatedRenderer's breaks + value range for kind c when they are not yet set (empty breaks). Gathers the renderer's classifyAttribute() across this kind's features (static model fields via identifyByName) and calls GraduatedRenderer::classifyIfNeeded. Shared by rebuildKindFeatureColors (paint cache) and the Rule→layer rendererReplaced handler (editor reads the Rule's renderer) so both see the same data-derived classification. No-op when already classified, the attribute is empty, or it isn't a static field.
| void SWMMModelLayer::clearObjectOrder | ( | Category | cat | ) |
Drop the user override for this category; display falls back to the default per-category index bucket.
| void SWMMModelLayer::clearSelection | ( | ) |
| void SWMMModelLayer::closeEngine | ( | ) |
Close and destroy the engine, clearing all geometry caches.
| QColor SWMMModelLayer::colorForClass | ( | const QString & | classKey | ) | const |
| SWMMElementSymbol SWMMModelLayer::conduitSymbol | ( | ) | const |
|
signal |
Slice BR Phase 6.8.1 — emitted whenever any [CONTROLS] mutation lands in the engine via one of the applyControlRule* helpers. The argument is the rule name affected, or empty for "rebuild everything" (rename / remove / clear). The list-model + SWMMControlRulePropertyAdapter
| void SWMMModelLayer::convertLinkOffsets | ( | bool | toElevation, |
| bool | convertValues | ||
| ) |
Apply the user's answer to legacy UpdateOffsets' "convert all link offsets?" prompt after LINK_OFFSETS has been flipped.
The engine stores offsets as depths in BOTH modes (the parser normalises elevations; the .inp writer re-adds the invert), so:
geometryChanged() once when values were touched. | toElevation | The mode just switched TO. |
| convertValues | The prompt answer (true = Yes). |
|
static |
Create a blank BUILDING-state engine (swmm_engine_new) and stamp the spec's defaults on it via the options C API — no file involved. Never calls swmm_finalize_model (validation needs ≥ 1 node + outfall, which a blank project has not got).
| bool SWMMModelLayer::createDataObject | ( | DataCategory | c, |
| const QString & | name, | ||
| const QVariantMap & | options, | ||
| QString * | outError = nullptr |
||
| ) |
Create a new data object on the engine (DB.4b).
Moves the per-DataCategory engine-commit switch out of ObjectBrowserPanel::addNewDataObject so callers OTHER than the Object Browser (e.g. the picker buttons in NodeCompoundEditDialog) can create new TS / patterns / UH groups inline without dispatching upward.
The options map matches the keys produced by NewDataObjectDialog::getNew(...) — e.g. "patternType", "curveType", "lidType", "units", "inletType", "skeleton", "rainGage", "response".
On success this method does NOT emit a refresh signal or update Object Browser selection — callers that own those flows (the panel) layer those side effects on top.
| c | Data-object category to create. |
| name | Name for the new object (caller-supplied, typically from suggestUniqueDataObjectName). |
| options | Per-category creation options (see above). |
| outError | If non-null, populated with an error message on failure (empty on success). |
|
inlinenoexcept |
Whether the layer's CRS was ASSIGNED — read from the .inp's [OPTIONS] CRS, or set after load by the user (CRS picker, Simulation Options, canvas reprojection, .oswp restore) — as opposed to auto-derived on open from [MAP] UNITS or the preferences default. Only an assigned CRS is written back to the .inp on save; a model that carried none must stay that way.
| int SWMMModelLayer::dataObjectCount | ( | DataCategory | c | ) | const |
Slice BM.0 — number of non-spatial data objects in c. Returns 0 when the engine handle is null or when the underlying swmm_<type>_count call fails.
Curves and Time Series share the engine's unified tables array, so their counts are produced by walking the table list and filtering on swmm_table_get_type. All other categories map directly to a dedicated count accessor.
| QString SWMMModelLayer::dataObjectNameAt | ( | DataCategory | c, |
| int | row | ||
| ) | const |
Slice BM.0 — name of a non-spatial data object at (category, row), or an empty string when out of range.
|
signal |
Emitted whenever the SET of non-spatial data objects changes — a provider added / removed / renamed in any of the typed registries (time series, curves, patterns, transects, …) or an engine-side create via createDataObject(). Registry mutations fire at dialog submit time, which may be BEFORE the registry's deferred saveToEngine() flush — dataObjectCount()/dataObjectNameAt() are registry-preferred so subscribers see staged objects immediately. The Object Browser tree model and Attribute Table listen here; this is the data-object counterpart of geometryChanged().
| QVector< int > SWMMModelLayer::defaultObjectOrder | ( | Category | cat | ) | const |
Default SoA permutation for a category (visible-row → SoA index) when NO user override is installed. Used by the tree model's drag-drop handler as the starting point for a drag on a category that hasn't been reordered before.
|
overridevirtual |
Removes all QGraphicsItems belonging to this layer from the scene.
Reimplemented from OpenSWMMVisLayer.
| SWMMElementSymbol SWMMModelLayer::dividerSymbol | ( | ) | const |
| MapCanvas * SWMMModelLayer::editCanvas | ( | ) | const |
|
inline |
Data-edit epoch — bumped on every modelEdited / attributeChanged. Consumers (label text cache) compare against their stored value to detect stale derived data.
Layer-CRS position of any named element (node, gage, or link midpoint) by object name.
Uses the internal name→SoA hash for O(1) lookup. For links the midpoint of the cached polyline is returned.
| SwmmElementSymbolAdapter * SWMMModelLayer::elementSymbolAdapter | ( | const QString & | routingId | ) |
The layer's persistent per-kind symbol adapter for a subject routing id ("model.junctions" … "model.virtualjunctions"). Lazily constructed on first request, parented to the layer, resynced from the live struct on every fetch. Returns nullptr for unknown ids.
| void SWMMModelLayer::endBulkEdit | ( | ) |
Close a bulk-edit scope. On the outermost close, rebuilds every derived cache once and emits repaintRequested() + geometryChanged() exactly once — but only if a mutation actually occurred.
| SWMM_Engine SWMMModelLayer::engine | ( | ) | const |
Raw engine handle — valid only after a successful loadModel().
| double SWMMModelLayer::engineLinkLength | ( | int | linkIdx | ) | const |
Returns the conduit length recorded in the engine, or -1 if the link is not a conduit / is out of range.
| bool SWMMModelLayer::engineSupportsInletJunctions | ( | ) | const |
Tri-state capability probe, cached for the layer's lifetime: true when the bound engine exposes the inlet-junction surface. Callers hide the add tool / Convert-To entries / usage page when this is false.
| QObject * SWMMModelLayer::ensureAquiferRegistry | ( | ) |
Lazy accessor for the project-scoped AquiferRegistry.
| QObject * SWMMModelLayer::ensureControlRuleRegistry | ( | ) |
Lazy accessor for the project-scoped ControlRuleRegistry. Lifetime is bound to the layer; the registry is constructed on first call and loadFromEngine is invoked so the providers mirror the engine's current rule list. Returned as a QObject* to keep this header free of the controls include; callers downcast to openswmmvis::controls::ControlRuleRegistry*.
| QObject * SWMMModelLayer::ensureCurveRegistry | ( | ) |
Same lazy-init pattern, for the CurveRegistry.
| QObject * SWMMModelLayer::ensureInletRegistry | ( | ) |
Lazy accessor for the project-scoped InletRegistry.
| QObject * SWMMModelLayer::ensureLandUseRegistry | ( | ) |
Lazy accessor for the project-scoped LandUseRegistry.
| QObject * SWMMModelLayer::ensureLidControlRegistry | ( | ) |
Lazy accessor for the project-scoped LidControlRegistry.
| QObject * SWMMModelLayer::ensurePatternRegistry | ( | ) |
Same lazy-init pattern as ensureTimeseriesRegistry, for the PatternRegistry.
| QObject * SWMMModelLayer::ensurePollutantRegistry | ( | ) |
Lazy accessor for the project-scoped PollutantRegistry.
| QObject * SWMMModelLayer::ensureSnowpackRegistry | ( | ) |
Lazy accessor for the project-scoped SnowpackRegistry.
| QObject * SWMMModelLayer::ensureStreetRegistry | ( | ) |
Lazy accessor for the project-scoped StreetRegistry.
| QObject * SWMMModelLayer::ensureTimeseriesRegistry | ( | ) |
Lazy-init / re-use the TimeseriesRegistry scoped to the current engine handle. Returns nullptr if the engine isn't open. Returned as a QObject* to keep this header free of the timeseries include; callers downcast to openswmmvis::timeseries::TimeseriesRegistry*. Shared across every UI that mutates time series so all views (Object Browser, NodeCompoundEditDialog pickers, …) see the same provider instances.
| QObject * SWMMModelLayer::ensureTransectRegistry | ( | ) |
Lazy accessor for the project-scoped TransectRegistry.
| openswmmvis::ui::UserFlagsModel * SWMMModelLayer::ensureUserFlagsModel | ( | ) |
Lazy accessor for the project-scoped UserFlagsModel. Returns nullptr if the engine isn't open.
|
overridevirtual |
Ordered key→value pairs of TYPE-SPECIFIC metadata, rendered by the Metadata tab below the common block the dialog builds itself.
Default empty. Subclasses add only what is unique to them (e.g. a mesh: vertices / cells / edges / elevation range). QVector<QPair> preserves insertion order without a new type.
Reimplemented from OpenSWMMVisLayer.
| QColor SWMMModelLayer::featureColor | ( | Category | c, |
| int | idx | ||
| ) | const |
Returns the cached per-feature colour for one feature in kind c, or an invalid QColor when no override exists. The painter uses this for the per-feature paint path. Index is the SoA index (matches the order categoryCount / objectNameAt use).
Slice Z.5b-paint-graduated — per-feature line OFFSET override (pixels). Returns 0.0 when no offset is configured for this feature; positive = right of forward direction, negative = left. The paint host (SWMMLayerItem) reads this per visible link when the kind uses Graduated/Categorized renderers; the fast SingleSymbol path reads the kind's first symbol layer directly (via lineOffsetForKindRenderer).
| int SWMMModelLayer::featureShape | ( | Category | c, |
| int | idx | ||
| ) | const |
M3 — per-feature marker shape sampled from the renderer (Categorized / Rule-based). Returns the MarkerShape as int, or -1 when the renderer has no per-feature shape override (use the kind's base shape).
Slice BI Phase 8.13.43-α — per-feature SIZE override (pixels). Returns a negative sentinel (-1.0) when no override exists for this feature; positive values are absolute pixel sizes (the painter scales the kind's static glyph radius by size / static).
| bool SWMMModelLayer::findObjectLocation | ( | const QString & | name, |
| Category * | cat, | ||
| int * | row | ||
| ) | const |
Locate an object by name, returning true and writing cat + row on success. O(1) hash lookup against the m_objectLocation map built at cache time. Used by the SelectionManager → tree model bridge to convert SWMMObjectRef into a QModelIndex without rescanning the SoA.
| QStringList SWMMModelLayer::gagesInPolygon | ( | const QPolygonF & | canvasPoly | ) | const |
| QStringList SWMMModelLayer::gagesInRect | ( | double | canvasMinX, |
| double | canvasMinY, | ||
| double | canvasMaxX, | ||
| double | canvasMaxY | ||
| ) | const |
Names of all rain gages whose coordinates fall inside the canvas-CRS rectangle. Same semantics as nodesInRect.
|
signal |
Emitted whenever the set of elements changes — an add, remove, or rollback of any node / link / gage / subcatchment. Panels that show element lists (Object Browser, Attribute Table) connect to this signal and call refresh() so their views stay in sync without polling.
|
inline |
Monotonically increasing counter, bumped at the end of every rebuildSceneCoords() call. Renderers can compare against a cached value to cheaply detect whether scene geometry has changed without storing a pointer or connecting a signal.
| QString SWMMModelLayer::getOption | ( | const QByteArray & | key, |
| const QString & | fallback = {} |
||
| ) | const |
Read a single SWMM OPTIONS key from the engine. Returns the fallback when the engine has no value for the key or the engine isn't open.
Kept as a layer method (rather than going direct to swmm_options_get) so the SimulationOptionsDialog sees a single model object rather than a mix of engine + layer APIs, and so the optionsChanged() signal stays a single pipe.
|
inlinenoexcept |
Back-compat shim — keeps the old all-or-nothing API working while callers (mapcanvas.cpp, swmmlayeritem.cpp, tests) are migrated to the per-kind flags. setGlRenderingEnabled(true) is equivalent to enabling every QSG kind.
|
inline |
Names currently hidden via per-object toggles. Used by the Object Browser to seed leaf-row check states on refresh.
|
signal |
Slice BS Phase 6.9.2 — emitted whenever any [HYDROGRAPHS] / [RDII_DECAY] / [RDII] mutation lands in the engine via one of the applyHydrograph* / applyRdiiDecay* helpers. Empty uhName means "rebuild everything" (used by rename, since the old name disappears). All hydrograph models listen here and refresh; consumer UIs (Object Browser, property panel, NodeCompoundEditDialog picker, etc.) bind to those models and never poll the engine directly.
| HydrographDecayTableModel * SWMMModelLayer::hydrographDecayModel | ( | ) |
Shared QAbstractTableModel for one group's [RDII_DECAY] grid (3 rows × 8 cols). Call setContext() to rebind. Season-agnostic — there is no month dimension in the engine model.
| HydrographGroupListModel * SWMMModelLayer::hydrographGroupListModel | ( | ) |
Shared QAbstractListModel of UH group names. Lazily constructed; one per layer. Re-emits modelReset() on hydrographChanged("").
| HydrographIaTableModel * SWMMModelLayer::hydrographIaModel | ( | ) |
Shared QAbstractTableModel for one (group, month) linear-IA grid (3 rows × 4 cols). Call setContext() to rebind.
| HydrographRtkTableModel * SWMMModelLayer::hydrographRtkModel | ( | ) |
Shared QAbstractTableModel for one (group, month) R/T/K grid (3 rows × 4 cols). Call setContext() to rebind.
| QVariantMap SWMMModelLayer::identifyAt | ( | double | mapX, |
| double | mapY, | ||
| const SpatialReferenceSystem * | canvasSRS, | ||
| double | tolerance = 1e-6 |
||
| ) | const |
Returns attributes of the network element closest to the map point.
| mapX | X in canvas CRS. |
| mapY | Y in canvas CRS. |
| canvasSRS | Canvas CRS (may be nullptr). |
| tolerance | Search radius in map units. |
Convenience overload — no CRS needed.
| QVariantMap SWMMModelLayer::identifyByName | ( | const QString & | name, |
| quint8 | kindMask = kKindAll |
||
| ) | const |
Identify an object by name (instead of by map coordinates).
Used by panels that already know the object reference and just need its attribute map (Object Browser → PropertiesPanel). Returns an empty map if the name doesn't match any cached node / link / subcatchment / gage.
| kindMask | kKind* bits limiting which kinds may match. SWMM names are per-type namespaces (a gage and a subcatchment may legally share a name), and the default kKindAll resolves collisions by the legacy precedence node → link → catchment → gage — so a caller that KNOWS the kind (e.g. the Attribute Table, scoped to one category) must pass it or a shadowed gage/catchment reads the wrong object's map. |
| const QVector< SWMMModelLayer::InletConnector > & SWMMModelLayer::inletConnectors | ( | ) | const |
The connector overlay geometry, rebuilt on demand when the usage rows or the geometry changed. Empty when the engine has no usage rows or predates the inlet-usage API.
| SWMMElementSymbol SWMMModelLayer::inletConnectorSymbol | ( | ) | const |
Dashed host → capture-node connector overlay (§3.2). Category-less: it draws no features of its own, only the relation lines.
| SWMMElementSymbol SWMMModelLayer::inletJunctionSymbol | ( | ) | const |
Inlet junctions — same CatJunctions bucket as virtual junctions (D-G1), distinct glyph.
| bool SWMMModelLayer::inletUsageFor | ( | int | hostKind, |
| int | hostIdx, | ||
| SWMM_InletUsage * | out | ||
| ) | const |
Read the inlet-usage row hosted by (hostKind, hostIdx).
| hostKind | SWMM_INLET_HOST_LINK (0) or SWMM_INLET_HOST_NODE (1). |
out untouched).
|
inline |
Invalidate the cached engine-table partition (curves vs. time series). External mutators (e.g. CurveRegistry / TimeseriesRegistry during INP import) call this so the next Object Browser refresh picks up the new entries.
| bool SWMMModelLayer::isConduit | ( | int | linkIdx | ) | const |
Returns true when the link at linkIdx is a conduit (the only link type whose length is stored as an independent geometry value and is therefore eligible for auto-length).
| bool SWMMModelLayer::isObjectVisible | ( | const QString & | name | ) | const |
Per-object visibility flag. Names present in m_hiddenObjects are skipped by populateScene. The Object Browser drives this state: a leaf checkbox is the only source of truth for an individual object; group-header toggles apply in bulk to every child but do not add a separate gate — after a group toggle the children's states fully determine visibility, and subsequent per-leaf toggles don't back-propagate to the header.
| bool SWMMModelLayer::isObjectVisible | ( | const QString & | name, |
| Category | c | ||
| ) | const |
Typed variant — visibility of the object of category c named name. SWMM names are per-type namespaces (a rain gage and a subcatchment may legally share a name), so the Object Browser uses this to read leaf check states without one kind's toggle bleeding into a same-named other kind.
| SWMMElementSymbol SWMMModelLayer::junctionSymbol | ( | ) | const |
|
staticnoexcept |
Category → kind bit (kKindNode/Link/Gage/Catch) mapping. Public so callers that only know a Category (e.g. SWMMAttributeTableModel, which is scoped to one category per table) can pass the right kindHint to applyRename() without re-deriving the same mapping.
| bool SWMMModelLayer::kindHasAnyOffset | ( | Category | c | ) | const |
True when any feature in kind c has a non-zero offset override. The painter consults this to decide whether to take the per-feature slow path; when false the kind keeps its legacy fast path.
|
static |
Convenience: stable string key used for MultiKindRenderer keying
| OpenSWMM::Render::IFeatureRenderer * SWMMModelLayer::kindRenderer | ( | Category | c | ) | const |
Returns the renderer for one Category kind (never null).
| bool SWMMModelLayer::kindUsesOverrides | ( | Category | c | ) | const |
Slice BI Phase 8.13.6.4 — per-feature paint-loop refactor.
True when the kind's renderer is non-SingleSymbol (Graduated / Categorized / RuleBased) and the layer has pre-computed an override colour for every feature in this kind. The painter reads this flag to decide whether to use the legacy bucketed fast path (false, single pen+brush per kind) or the per- feature override path (true).
| QList< OpenSWMM::Render::LegendSymbolItem > SWMMModelLayer::legendSymbolItems | ( | ) | const |
| QColor SWMMModelLayer::linkArrowColor | ( | Category | c | ) | const |
| bool SWMMModelLayer::linkArrowOnlyWhenFlowPos | ( | Category | c | ) | const |
| bool SWMMModelLayer::linkArrowsEnabled | ( | Category | c | ) | const |
True if flow-direction arrows are enabled for the link kind.
Arrowhead width ACROSS the link, independent of its length.
| int SWMMModelLayer::linkEndForNode | ( | int | linkIdx, |
| int | nodeIdx | ||
| ) | const |
Which end of a link is attached to nodeIdx: 0 = from, 1 = to, or -1 if the node is not an endpoint of the link.
| double SWMMModelLayer::linkFlow | ( | int | linkIdx | ) | const |
Live link-flow accessor used by the painter's arrowOnlyWhenFlowPos short-circuit (Phase 8.13.8-α). Returns 0 when the engine handle is null or the index is out of range.
| int SWMMModelLayer::linkFromNodeIdx | ( | int | linkIdx | ) | const |
Returns the from-node (upstream) engine index for linkIdx, or -1.
| int SWMMModelLayer::linkIndex | ( | const QString & | name | ) | const |
Returns the cache index of the link with the given name, or -1 if none matches.
| QVector< int > SWMMModelLayer::linksAttachedToNode | ( | int | nodeIdx | ) | const |
Indices of links whose from/to endpoint is the given node.
| QStringList SWMMModelLayer::linksInPolygon | ( | const QPolygonF & | canvasPoly | ) | const |
| QStringList SWMMModelLayer::linksInRect | ( | double | canvasMinX, |
| double | canvasMinY, | ||
| double | canvasMaxX, | ||
| double | canvasMaxY | ||
| ) | const |
Names of all links whose polyline bbox overlaps the canvas-CRS rectangle. Backed by a per-link bbox cache (built in buildGeometryCache, kept fresh on every coord-mutating edit). Hidden objects excluded.
Avoids the O(N²) trap the rubber-band tool previously hit — every link iteration used to call linkIndex(name) (a linear name-scan of m_links) just to look up the polyline for a fresh bbox compute.
| int SWMMModelLayer::linkToNodeIdx | ( | int | linkIdx | ) | const |
Returns the to-node (downstream) engine index for linkIdx, or -1.
| bool SWMMModelLayer::loadModel | ( | QList< QString > & | warnings, |
| QList< QString > & | errors | ||
| ) |
Loads (or reloads) the SWMM input file and rebuilds geometry caches.
|
inlineslot |
Records that the engine now holds edits not yet on disk.
Emits modelEdited(). Provided as a slot so UI surfaces that write the engine outside the layer's own apply* API (the property browser, the attribute table, the curve / time series / pattern editors, the comprehensive object editors) can connect their own "edited" signals straight to it.
| double SWMMModelLayer::maxMarkerHalfBoundPx | ( | ) | const |
Largest rendered marker half-bound across every SWMM element type, in PIXELS. Callers use this as a floor for the Select tool's pixel tolerance so clicks landing inside the visible glyph always hit, regardless of the user's tolerance preference. For a square Storage glyph the half-bound is half-width * sqrt(2) (diagonal); for circular Junctions it's the radius; polygons and polylines return 0 (they're handled by bbox / segment- distance tests inside identifyAt, which don't need the floor).
|
signal |
Emitted whenever anything that belongs in the .inp has been written to the engine, so the in-memory model no longer matches the file on disk.
This is the dirty-tracking channel, deliberately separate from the view-refresh signals above: SWMMVisProjectWindow connects it to setHasChanges(true), and SWMMVis::onRunSimulation gates its pre-run auto-save on that flag. Emitting a refresh signal is NOT sufficient — vertex moves and provider content edits emit only repaintRequested() and provider-local signals — so any new engine-mutating path must also call markEdited().
Purely visual state (selection, zoom, symbology, layer order) must NOT emit this: on a large model a false positive costs a full .inp rewrite on the next run.
| QString SWMMModelLayer::modelFilePath | ( | ) | const |
|
signal |
|
signal |
|
signal |
| int SWMMModelLayer::nodeIndex | ( | const QString & | name | ) | const |
Returns the cache index of the node with the given name, or -1 if none matches.
|
inline |
True when cached node soaIdx is an inlet junction. An inlet junction is also a virtual junction, so callers that branch on both must test this one FIRST.
|
inline |
True when cached node soaIdx is a virtual junction.
| QStringList SWMMModelLayer::nodesInPolygon | ( | const QPolygonF & | canvasPoly | ) | const |
| QStringList SWMMModelLayer::nodesInRect | ( | double | canvasMinX, |
| double | canvasMinY, | ||
| double | canvasMaxX, | ||
| double | canvasMaxY | ||
| ) | const |
Names of all nodes (any type) whose layer-CRS coordinates fall inside the rectangle given in canvas CRS. The inverse CRS transform is applied internally, matching the CRS-aware behaviour of identifyAt. Hidden objects are excluded. O(log N + k) via the internal KD-tree; rebuilt lazily after any coordinate-mutating operation (applyNodeMove / applyNodeAdd / rollbackTailNodeAdd).
| MapExtent SWMMModelLayer::objectExtent | ( | const QString & | name | ) | const |
Layer-CRS bounding box of a cached object by name.
MapExtent if the name isn't known, or for a polygon/polyline with < 1 vertex. The canvas's zoom-to-object flow uses this so subcatchments and links frame their whole geometry instead of falling through the "needs X/Y" branch. | QString SWMMModelLayer::objectNameAt | ( | Category | c, |
| int | row | ||
| ) | const |
Object name at (category, row). O(1) — reads through the per-category index buckets populated in buildGeometryCache. Returns an empty string if the indices are out of range.
| QVector< int > SWMMModelLayer::objectOrder | ( | Category | cat | ) | const |
Read-only access to the current override for a category. Empty when no override is installed.
| int SWMMModelLayer::objectTypeFor | ( | const QString & | name | ) | const |
Classify a name into its SWMM object class via O(1) lookup against m_objectLocation.
Used by the SelectionManager bridge to translate the layer's name-only selection set into typed SWMMObjectRefs. Hot path on rubber-band selection (called once per selected name); must stay O(1) — do not regress to a linear SoA scan.
|
overridevirtual |
Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform caches.
| newCanvasSRS | The new canvas CRS. |
Reimplemented from OpenSWMMVisLayer.
|
static |
Create + open an engine for path (worker-thread safe).
Pure engine C-API calls — no QObject mutation, no signals — so it may run in a QtConcurrent worker while the GUI thread stays responsive. On failure returns nullptr and fills errorDetail with the engine's detailed diagnostic (section/line for parse errors).
| openMs | Optional out: elapsed open time in ms (for the load timing log adoptOpenEngine() emits). |
|
signal |
Emitted after any OPTIONS key has been written to the engine (via setOption() — the single entry point used by the SimulationOptionsDialog's Apply / OK). Carries the list of keys that changed in this batch so observers can decide whether the change is relevant.
Enables MVC-style live sync: the main-window Flow Units combo, the status-bar Offset-Mode checkbox, and any other UI mirroring engine state bind once and refresh through this signal instead of polling on tab-switch.
| SWMMElementSymbol SWMMModelLayer::orificeSymbol | ( | ) | const |
| SWMMElementSymbol SWMMModelLayer::outfallSymbol | ( | ) | const |
| SWMMElementSymbol SWMMModelLayer::outletSymbol | ( | ) | const |
Outlets now have a real symbol channel (previously aliased the conduit symbol). NOTE: the link PEN for outlets still comes from the preferences "outlet" pen (paint parity decision — see linkPenForType in swmmlayeritem.cpp); this struct drives flow arrows, labels, renderer seeding and persistence.
| SWMMModelLayer::PickResult SWMMModelLayer::pickAt | ( | double | sceneX, |
| double | sceneY, | ||
| double | tolerance | ||
| ) | const |
Tiered click-pick in the same priority order as identifyAt (nodes + gages first, then links at 1/3 tolerance, then subcatchments via point-in-polygon). Returns the typed hit so MoveNode / EditVertex / Select-tool right-click don't need to go through scene->items() + dynamic_cast on retiring NodeGraphicsItem / LinkGraphicsItem placeholders.
sceneX sceneY are in canvas CRS (the same coordinate system the Select tool's selectAtPoint passes to identifyAt). tolerance is also in canvas CRS units; the layer inverts through its m_transform as needed.
| QPolygonF SWMMModelLayer::polygonCanvasToLayer | ( | const QPolygonF & | poly | ) | const |
Transform every vertex of a canvas-CRS polygon into layer CRS.
Helper for the *InPolygon queries so the point-in-polygon test runs in the same coordinate frame as the cached feature coordinates. Uses transformCanvasToLayer per vertex.
| double SWMMModelLayer::polylineLengthInModelUnits | ( | const QVector< QPointF > & | vertices | ) | const |
Compute polyline length in the SWMM model's expected linear unit (feet for US-customary FLOW_UNITS — CFS/GPM/MGD; metres for SI — CMS/LPS/MLD).
Used by the auto-length code path to convert canvas/layer-CRS coordinates into the unit the engine writes into [CONDUITS]:
linearUnitsToMetres() → metres, then to feet if not SI.
|
overridevirtual |
Creates / updates QGraphicsItems representing this layer in the scene.
Derived classes override this to add their items to the scene. Items should be created in scene coordinates (= map CRS coordinates) after reprojecting from the layer's native CRS.
Called by the MapCanvas when:
| scene | The shared OpenSWMMVisScene to add items to. |
| canvasExtent | Visible extent in canvas-CRS coordinates. |
| canvasSRS | The CRS currently used by the MapCanvas. |
Implements OpenSWMMVisLayer.
Rain-gage twin of previewNodeMove: rewrite the gage's cached map coord + scene point only (no engine write, no modelEdited) so the symbol follows the cursor during a drag. MoveGageCommand::redo commits the final position via applyGageMove on release. Gages have no attached links or outlet lines, so this is just the coord + scene-point rewrite and a repaint.
Live-preview a node move — mutates the cached SoA coord plus every attached link's endpoint, emits repaintRequested(), but does NOT write through to the engine. Called by MapToolMoveNode on every mouseMoveEvent during a drag; MoveNodeCommand::redo commits the final position via applyNodeMove when the drag is released. Returns false if the index is out of range or no node cache exists.
| SWMMElementSymbol SWMMModelLayer::pumpSymbol | ( | ) | const |
| bool SWMMModelLayer::pushInletUsageEdit | ( | const SWMM_InletUsage & | usage | ) |
Apply one inlet-usage row as a single undoable step. Pushes a SetInletUsageCommand on the edit canvas's stack when one is bound; falls back to applySetInletUsage() otherwise.
| bool SWMMModelLayer::pushInletUsageRemoval | ( | int | hostKind, |
| int | hostIdx | ||
| ) |
|
inlinenoexcept |
Convenience: does the QSG overlay own this kind (i.e. is the flag set)? Hot-path helpers in SWMMLayerItem use this to skip CPU painting, and SWMMLayerQSGRenderer uses the negation to short-circuit vertex uploads.
|
inlinenoexcept |
|
signal |
Slice §QSG-1 — fired whenever setQsgRenderKinds() flips one or more kinds. MapCanvas listens so it can short-circuit the per-frame QSG repaint+grab when the scope is empty, and the CPU SWMMLayerItem listens so it can force a repaint that re-evaluates its skip-kind branches.
| SWMMElementSymbol SWMMModelLayer::rainGageSymbol | ( | ) | const |
| void SWMMModelLayer::rebuildKindFeatureColors | ( | Category | c | ) |
Recomputes the per-feature colour AND per-feature size override caches for one kind, by iterating every feature and calling kindRenderer(c)->symbolFor(featureRef, attrs). Called automatically from setKindRenderer when the new renderer is non-SingleSymbol or has data-defined size enabled.
|
overridevirtual |
Smart scene refresh — updates existing items instead of destroying and recreating.
Override in subclasses to provide efficient incremental updates. The default implementation calls depopulateScene() then populateScene(), which is backward-compatible but causes flicker for raster/tile layers.
Raster/WMS layers should override to keep persistent scene items and update them in-place. Vector layers should override to skip rebuilding when only the view extent has changed (items are already in scene coords).
Reimplemented from OpenSWMMVisLayer.
| void SWMMModelLayer::reloadGeometry | ( | ) |
Re-read every node / link / subcatchment coordinate from the engine and rebuild the geometry cache + extent.
Use after a coordinate-mutating operation (CRS reproject, bulk coordinate edit) so cached vertices match engine state.
|
overridevirtual |
The IFeatureRenderer for this layer.
Constructed eagerly so callers never have to null-check. v1 default is a SingleSymbolRenderer placeholder; the eventual default (paint-refactor sub-phase) is a MultiKindRenderer wrapping the 11 per-category symbols.
Reimplemented from OpenSWMMVisLayer.
|
signal |
Slice BI Phase 8.13.6.5 — emitted when setRenderer() swaps the renderer pointer.
|
inline |
Number of links the render-facing scene-coordinate arrays currently describe.
Test seam. m_linkVertexCount / m_linkVertexOffset are what SWMMLayerQSGRenderer walks when it draws links, and their size == m_links.size() invariant is otherwise observable only from inside that friend class — which is how a stale set survived a delete-everything undetected.
|
inline |
The hidden flag the renderers read for link idx — what actually decides whether the base link pass emits it.
Test seam, sibling of renderLinkCount(). The QSG base pass skips a link whose flag is set; a selected link is still drawn by the selection pass, which is why a wrongly-hidden link looks fine until it is deselected.
| void SWMMModelLayer::resetKindRendererToDefaults | ( | Category | c | ) |
Re-seed the per-kind renderer for c from the matching SWMMElementSymbol default (factory glyph). Equivalent to "Reset
Kind to Defaults" in the layer-tree context menu.
| bool SWMMModelLayer::rollbackTailGageAdd | ( | const QString & | name | ) |
Undo tail gage add (swmm_gage_delete on tail).
| bool SWMMModelLayer::rollbackTailLinkAdd | ( | const QString & | name | ) |
Undo tail link add (swmm_link_pop_last).
| bool SWMMModelLayer::rollbackTailNodeAdd | ( | const QString & | name | ) |
Undo an add by removing the tail entry of the node cache.
Only valid immediately after applyNodeAdd when the new node is still at the end of the node list. Used by AddNodeCommand::undo while the engine lacks a general-purpose swmm_node_remove. Returns false if the tail name doesn't match name.
| bool SWMMModelLayer::rollbackTailSubcatchAdd | ( | const QString & | name | ) |
Undo tail subcatch add (swmm_subcatch_delete on tail).
|
overridevirtual |
Reimplemented from OpenSWMMVisLayer.
|
overridevirtual |
Reimplemented from OpenSWMMVisLayer.
| QStringList SWMMModelLayer::selectedElementNames | ( | ) | const |
Returns the names of currently selected network elements.
|
inline |
Typed selection — canonical form. Each entry names WHICH kind is selected, so same-named objects of other kinds stay unselected.
|
signal |
| void SWMMModelLayer::setCategoryOpacity | ( | Category | c, |
| qreal | opacity | ||
| ) |
| void SWMMModelLayer::setCategoryOrder | ( | const QVector< Category > & | order | ) |
Replace the full category order. Rejects an input that doesn't cover every enum value exactly once (safety net so a malformed vector can't silently drop categories). Emits categoryOrderChanged on success; Object Browser reacts via modelReset.
| void SWMMModelLayer::setCategoryVisible | ( | Category | c, |
| bool | visible | ||
| ) |
Bulk-toggle every member of a category. Used by the group-header checkbox in the Object Browser; emits a single repaintRequested() regardless of how many objects the category contains.
| void SWMMModelLayer::setColorForClass | ( | const QString & | classKey, |
| const QColor & | color | ||
| ) |
| void SWMMModelLayer::setConduitSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setDividerSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setEditCanvas | ( | MapCanvas * | canvas | ) |
Bind the canvas whose undo stack mediated edits push onto.
Property adapters have no canvas of their own, but an inlet usage edit must be undoable exactly like the map-tool edits (MVC contract: one mutation = one MapCommand). The project window calls this once with its canvas; without it the layer still applies edits, just not undoably (headless tests).
Both are defined out-of-line: Qt 6's QPointer<T> instantiates a static_cast to/from QObject*, so it needs the COMPLETE MapCanvas — which this header only forward-declares (same reason as include/ui/panels/legenddock.h).
|
inline |
| void SWMMModelLayer::setInletConnectorSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setInletJunctionSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setJunctionSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setKindRenderer | ( | Category | c, |
| std::unique_ptr< OpenSWMM::Render::IFeatureRenderer > | r | ||
| ) |
Replaces the per-kind renderer for c. Takes ownership; null is rejected (silent no-op). When the new renderer is a SingleSymbol, the layer extracts colour/outline/size back to the legacy SWMMElementSymbol field for that kind so the existing paint loop reflects the change. Emits rendererChanged + repaintRequested.
|
overridevirtual |
Slice X.18 — full label configuration.
Supersedes the binary `showLabels` toggle: every layer that paints text labels now consults `labelConfig().enabled` AS WELL AS the legacy `showLabels` for backwards compatibility with .oswp files written by earlier builds. Setters keep the two in sync until the legacy flag is removed in a follow-up.
Reimplemented from OpenSWMMVisLayer.
| void SWMMModelLayer::setLinkArrowColor | ( | Category | c, |
| const QColor & | col | ||
| ) |
| void SWMMModelLayer::setLinkArrowOnlyWhenFlowPos | ( | Category | c, |
| bool | onlyPos | ||
| ) |
| void SWMMModelLayer::setLinkArrowsEnabled | ( | Category | c, |
| bool | enabled | ||
| ) |
Toggle flow-direction arrows for a link kind. Emits repaintRequested.
| void SWMMModelLayer::setModelFilePath | ( | const QString & | path | ) |
| void SWMMModelLayer::setObjectOrder | ( | Category | cat, |
| const QVector< int > & | soaIndices | ||
| ) |
Install a user-defined display order for the given category. soaIndices is a permutation of the underlying SoA indices for the category (m_nodes for CatJunctions / Outfalls / Storage / Dividers; m_links for CatConduits / Pumps / Orifices / Weirs / Outlets; direct m_catchments / m_gages for the area categories). Size and membership must match exactly, otherwise the call is rejected (defensive: a malformed vector would silently drop or duplicate objects).
After a successful call, categoryCount() is unchanged but objectNameAt(cat, row) follows the override. m_objectLocation is rewritten for this category so findObjectLocation() returns the new display row. Emits categoryOrderChanged() — the tree model resets and re-renders in the new order.
| void SWMMModelLayer::setObjectsVisible | ( | const QList< QString > & | names, |
| bool | visible | ||
| ) |
Batch form — apply the same visibility to every name in names with a single repaintRequested emission. Used by the group-header checkbox so toggling a category of 1000+ objects causes only one canvas refresh.
| void SWMMModelLayer::setObjectVisible | ( | const QString & | name, |
| bool | visible | ||
| ) |
| void SWMMModelLayer::setObjectVisibleAt | ( | Category | c, |
| int | row, | ||
| bool | visible | ||
| ) |
Toggle visibility for a single leaf referenced by (category, row). Updates m_hiddenObjects plus the category hidden count and emits repaintRequested() on change. Preferred over setObjectVisible(name, …) when the caller already knows the category — avoids the name→(cat,row) lookup on the hot path of QTreeView::setData().
| bool SWMMModelLayer::setOption | ( | const QByteArray & | key, |
| const QString & | value | ||
| ) |
Write a single SWMM OPTIONS key. On success emits optionsChanged({key}). Returns true on success, false if the engine isn't open or rejected the value.
Batch-apply should prefer setOptions(QMap) to emit a single multi-key signal per round-trip.
| int SWMMModelLayer::setOptions | ( | const QMap< QByteArray, QString > & | values | ) |
Batch write — applies a set of key/value pairs, then emits optionsChanged(changedKeys) once. Returns the number of keys the engine accepted.
| void SWMMModelLayer::setOrificeSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setOutfallSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setOutletSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setPumpSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setQsgRenderKinds | ( | QsgKinds | kinds | ) |
| void SWMMModelLayer::setRainGageSymbol | ( | const SWMMElementSymbol & | s | ) |
|
overridevirtual |
Replaces the current renderer.
The layer takes ownership. A null pointer is rejected (silent no-op) so renderer() never returns nullptr. Emits rendererChanged() when the pointer actually changes.
Reimplemented from OpenSWMMVisLayer.
| void SWMMModelLayer::setSelectedElementNames | ( | const QStringList & | names | ) |
Selects network elements by name (replaces prior selection). Legacy name-only form: each name selects EVERY kind bearing it. Prefer setSelectedElements() when the caller knows the kind.
| void SWMMModelLayer::setSelectedElements | ( | const QVector< SelectedElement > & | sel | ) |
Replaces the selection with typed entries (kind-exact).
| void SWMMModelLayer::setShowLabels | ( | bool | show | ) |
| void SWMMModelLayer::setShowLinks | ( | bool | show | ) |
| void SWMMModelLayer::setShowNodes | ( | bool | show | ) |
| void SWMMModelLayer::setShowRainGages | ( | bool | show | ) |
| void SWMMModelLayer::setShowSubcatchments | ( | bool | show | ) |
| void SWMMModelLayer::setSizeForClass | ( | const QString & | classKey, |
| qreal | size | ||
| ) |
| void SWMMModelLayer::setStorageSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setSubcatchmentSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setVirtualJunctionSymbol | ( | const SWMMElementSymbol & | s | ) |
| void SWMMModelLayer::setWeirSymbol | ( | const SWMMElementSymbol & | s | ) |
| bool SWMMModelLayer::showLabels | ( | ) | const |
|
signal |
| bool SWMMModelLayer::showLinks | ( | ) | const |
|
signal |
| bool SWMMModelLayer::showNodes | ( | ) | const |
|
signal |
| bool SWMMModelLayer::showRainGages | ( | ) | const |
|
signal |
| bool SWMMModelLayer::showSubcatchments | ( | ) | const |
|
signal |
| qreal SWMMModelLayer::sizeForClass | ( | const QString & | classKey | ) | const |
| bool SWMMModelLayer::snapNearestPoint | ( | double | mapX, |
| double | mapY, | ||
| double | mapRadius, | ||
| QPointF & | outPt, | ||
| std::optional< QPointF > | excludePos = std::nullopt |
||
| ) | const |
Nearest-neighbor snap query for vertex editing.
Searches for the closest node (via the KD-tree, O(log N)) and the closest link interior vertex (bbox-filtered linear scan) within mapRadius of (mapX, mapY). All coordinates are in layer CRS — the same system that MapTool::toMapCoords() and m_nodes[i].x/y use.
| [in] | mapX,mapY | Query point in layer CRS. |
| [in] | mapRadius | Search radius in layer CRS units. |
| [out] | outPt | Set to the nearest candidate when returning true. |
Find the nearest snap candidate (node, link interior vertex, or subcatchment polygon vertex) within mapRadius of (mapX, mapY). If excludePos is set the candidate at that exact position is skipped — pass the drag-start position to avoid self-snapping to the vertex being dragged while still snapping to every other vertex, including other vertices on the same object.
| int SWMMModelLayer::soaIndexAt | ( | Category | c, |
| int | row | ||
| ) | const |
SoA index at (category, row) — the index objectNameAt resolves the name from, and therefore also the ENGINE index for that object. Returns -1 when out of range.
The SoA-index == engine-index invariant holds because buildFromEngine() appends in engine order (0..count-1), adds append to the tail on both sides, and deletes remove the same slot from both. Existing code already depends on it: applyNodeDelete() feeds a swmm_node_index() result straight into m_nodes.removeAt(), and its cascade loop passes one integer to both swmm_link_get_from_node() and m_links[i]. See also applyLinkDelete / applyGageDelete / applySubcatchDelete.
Callers that want a row's engine index MUST use this and not a locally-written index lookup: this honours the intra-category ordering overrides (m_objectOrderOverrides) exactly as objectNameAt does, and a variant that forgets that branch returns a different object under a user-sorted category. Keep this function physically adjacent to objectNameAt so the two cannot drift.
|
overridevirtual |
Human-readable source of this layer: a file path, a service URL, or a description for in-memory / derived layers.
Default empty — the dialog shows "(none)". Concrete layers override to return their real origin (e.g. modelFilePath(), resultsFilePath(), serviceUrl(), or "(generated mesh)").
Reimplemented from OpenSWMMVisLayer.
| SWMMElementSymbol SWMMModelLayer::storageSymbol | ( | ) | const |
|
overridevirtual |
Slice U-4 — expose the 12 per-kind SWMMElementSymbol adapters as styleable subjects for the unified LayerStyleDialog.
Adapter-ownership refactor (LAYER_STYLING_LABELING_PLAN follow-up): the subject wrappers are fresh per call (cheap, non-owning), but the underlying SwmmElementSymbolAdapter QObjects are the layer's PERSISTENT set from elementSymbolAdapter() — one instance per kind for the layer's lifetime. Every UI surface (dialog subjects, SingleSymbolPanel, kind tree) edits the same adapter, which is what makes the dialog's Cancel snapshot/rollback authoritative and stops the per-open adapter leak.
Reimplemented from OpenSWMMVisLayer.
| QStringList SWMMModelLayer::subcatchmentsInPolygon | ( | const QPolygonF & | canvasPoly | ) | const |
| QStringList SWMMModelLayer::subcatchmentsInRect | ( | double | canvasMinX, |
| double | canvasMinY, | ||
| double | canvasMaxX, | ||
| double | canvasMaxY | ||
| ) | const |
Names of all subcatchments whose polygon bbox overlaps the canvas-CRS rectangle. Same caching pattern as linksInRect.
| SWMMElementSymbol SWMMModelLayer::subcatchmentSymbol | ( | ) | const |
| QString SWMMModelLayer::suggestUniqueDataObjectName | ( | DataCategory | c | ) | const |
Slice DA.3 — suggest a unique default name for the next new data object of c. Scans existing names and returns the smallest positive integer n such that <Prefix><n> is not already in use (case-insensitive).
Prefix per category: Curves → "Curve", TimeSeries → "TS", Patterns → "Pattern", LIDControls → "LID", Pollutants → "Pollut", LandUses → "LandUse", Aquifers → "Aquifer", Snowpacks → "Snowpack", Controls → "Rule", Transects → "Transect", Hydrographs → "UH", Streets → "Street", Inlets → "Inlet".
Modern affordance — legacy SWMM-GUI requires manual naming. Caller may overwrite in the New Data Object dialog.
| bool SWMMModelLayer::supportsClassEdit | ( | OpenSWMM::Render::ClassEditKind | kind | ) | const |
| QStringList SWMMModelLayer::tableIdsOfType | ( | int | tableType | ) | const |
List the engine's table ids whose type matches tableType (Slice DA.4.3).
Tables (time series + all 12 curve kinds) share one engine array, partitioned by swmm_table_get_type. Pickers need a filtered list — tidal curves only, time series only, etc. Centralised here so the pattern is reused across the new DataObjectPickerEditor and the existing NodeCompoundEditDialog::populateTimeSeriesCombo (which may be refactored to delegate here in a follow-up).
tableType codes (from openswmm_tables.h): 0 = TIMESERIES 1 = CURVE_STORAGE 2 = CURVE_DIVERSION 3 = CURVE_RATING 4 = CURVE_SHAPE 5 = CURVE_CONTROL 6 = CURVE_TIDAL 7..11 = CURVE_PUMP1..PUMP5
A tableType of -1 means "any non-timeseries table" (i.e. every curve kind).
|
signal |
Slice BQ Phase 6.7.4 — emitted whenever any [TRANSECTS] mutation lands via one of the applyTransect* helpers. Empty string means "rebuild everything" (rename / remove). All transect models subscribe here and refresh; consumer UIs (Object Browser, property panel, TransectEditorDialog) bind to those models.
| bool SWMMModelLayer::transformCanvasToLayer | ( | double | cx, |
| double | cy, | ||
| double & | lx, | ||
| double & | ly | ||
| ) | const |
Reverse-transform a canvas-CRS coordinate into the layer's native CRS.
Used by the status-bar cursor read-out so the displayed coordinate is in the user's data CRS even when the canvas renders via on-the-fly reprojection (e.g. geographic layer displayed in Web Mercator). When the layer CRS equals the canvas CRS (no forward transform), passes inputs through unchanged. The inverse transform is cached so per-mouse-move calls don't recreate a GDAL transformation object.
| bool SWMMModelLayer::transformLayerToCanvas | ( | double | lx, |
| double | ly, | ||
| double & | cx, | ||
| double & | cy | ||
| ) | const |
Forward-transform a layer-CRS coordinate into the canvas CRS.
Map tools collect mouse input in canvas CRS (via toMapCoords) but several helpers (e.g. snap, cachedNodeCoord) return coordinates in the layer's native CRS. When the two CRSes differ — typically because a basemap forces the canvas to Web Mercator while the SWMM model is in a different projection — tools need to round-trip those values back to canvas CRS so interactive rubber-band / snap-ring rendering stays aligned with what the user clicked. When the layer CRS equals the canvas CRS, this passes inputs through unchanged.
|
static |
Actionable text for a virtual-junction / inlet-junction rule code (609..621 VJ, 623..635 inlet).
| SWMMElementSymbol SWMMModelLayer::virtualJunctionSymbol | ( | ) | const |
| SWMMElementSymbol SWMMModelLayer::weirSymbol | ( | ) | const |
|
friend |
|
friend |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
Kind bits — one per SWMM object namespace. Names are NOT unique across kinds (generated models routinely pair every subcatchment with a same-named rain gage), so typed selection and hidden state carry a per-name bitmask of the kinds they apply to.
|
staticconstexpr |
|
read |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |
|
readwrite |