SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
SWMMModelLayer Class Reference

Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine model. More...

#include <swmmmodellayer.h>

Inheritance diagram for SWMMModelLayer:
Collaboration diagram for SWMMModelLayer:

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 Types

enum  DataCategory {
  DataCurves = 0 ,
  DataTimeSeries ,
  DataPatterns ,
  DataLIDControls ,
  DataPollutants ,
  DataLandUses ,
  DataAquifers ,
  DataSnowpacks ,
  DataControls ,
  DataTransects ,
  DataHydrographs ,
  DataStreets ,
  DataInlets ,
  NumDataCategories
}
 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. More...
 
enum  QsgKind : quint8 {
  QsgNone = 0x00 ,
  QsgNodes = 0x01 ,
  QsgLinks = 0x02 ,
  QsgCatch = 0x04 ,
  QsgGages = 0x08
}
 
using Category = OpenSWMMVis::SwmmCategory
 The SWMM-element Category enum.
 
- Public Types inherited from OpenSWMMVisLayer
enum  OpenSWMMVisLayerType {
  SWMMDefaultLayer = 0 ,
  SWMMModelLayer = 1 ,
  SWMMResultsLayer = 2 ,
  SWMMGISLayer = 3 ,
  SWMMVectorLayer = 4 ,
  SWMMRasterLayer = 5 ,
  SWMMImageryLayer = 6 ,
  SWMMTabularDataLayer = 7 ,
  SWMMTabularyTimeSeriesLayer = 8 ,
  SWMMSubProjectLayer = 9 ,
  SWMMWMSLayer = 10 ,
  SWMMWMTSLayer = 11 ,
  SWMM2DMeshLayer = 12 ,
  SWMM2DResultsLayer = 13 ,
  SWMMAnnotationLayer = 14 ,
  SWMMFeatureLayer = 15
}
 Discriminator for the concrete layer class. 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< CategorycategoryOrder () 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
 
SwmmElementSymbolAdapterelementSymbolAdapter (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::IFeatureRendererrenderer () const override
 The IFeatureRenderer for this layer.
 
void setRenderer (std::unique_ptr< OpenSWMM::Render::IFeatureRenderer > r) override
 Replaces the current renderer.
 
OpenSWMM::Render::IFeatureRendererkindRenderer (Category c) const
 
void setKindRenderer (Category c, std::unique_ptr< OpenSWMM::Render::IFeatureRenderer > r)
 
void resetKindRendererToDefaults (Category c)
 
QList< OpenSWMM::Render::LegendSymbolItemlegendSymbolItems () 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::RuleListruleList () override
 
const OpenSWMM::Render::RuleListruleList () const override
 
QVector< OpenSWMM::Render::AttributeFieldavailableAttributes (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.
 
MapCanvaseditCanvas () 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)
 
HydrographGroupListModelhydrographGroupListModel ()
 
HydrographRtkTableModelhydrographRtkModel ()
 
HydrographIaTableModelhydrographIaModel ()
 
HydrographDecayTableModelhydrographDecayModel ()
 
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::UserFlagsModelensureUserFlagsModel ()
 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].
 
SpatialReferenceSystemsrs () 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::TemporalSpectemporalSpec () const
 
void setTemporalSpec (const OpenSWMM::Render::TemporalSpec &spec)
 
const OpenSWMM::Render::LabelConfiglabelConfig () const
 
const OpenSWMM::Render::MaskSpecmaskSpec () const
 
void setMaskSpec (const OpenSWMM::Render::MaskSpec &spec)
 
const OpenSWMM::Render::AuxiliaryStorageSpecauxStorageSpec () 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::DiagramSpecdiagramSpec () const
 
void setDiagramSpec (const OpenSWMM::Render::DiagramSpec &spec)
 
OpenSWMMVisWorkspaceworkspace () 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")
 

Detailed Description

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:

  • Selection tracking (highlighted with a secondary colour).
  • Identify-by-point returning element attributes as QVariantMap.
  • Label display driven by element names.

Member Typedef Documentation

◆ Category

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.

Member Enumeration Documentation

◆ DataCategory

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.
Enumerator
DataCurves 
DataTimeSeries 
DataPatterns 
DataLIDControls 
DataPollutants 
DataLandUses 
DataAquifers 
DataSnowpacks 
DataControls 
DataTransects 
DataHydrographs 
DataStreets 
DataInlets 
NumDataCategories 

◆ QsgKind

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.

Constructor & Destructor Documentation

◆ SWMMModelLayer()

SWMMModelLayer::SWMMModelLayer ( const QString &  modelFilePath,
OpenSWMMVisWorkspace parent = nullptr 
)
explicit
Here is the call graph for this function:

◆ ~SWMMModelLayer()

SWMMModelLayer::~SWMMModelLayer ( )
override
Here is the call graph for this function:

Member Function Documentation

◆ adoptNewEngine()

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.

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

◆ adoptOpenEngine()

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.

Parameters
openMs/soaMs/geomMsPhase timings folded into the load telemetry (openMs = engine open; soaMs/geomMs = the worker-side build).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyControlRuleAdd()

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.

Here is the call graph for this function:

◆ applyControlRuleRemove()

bool SWMMModelLayer::applyControlRuleRemove ( const QString &  name,
QString *  outError = nullptr 
)

Drop the rule with name from the engine + registry. Returns false if not found.

Here is the call graph for this function:

◆ applyControlRuleRename()

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.

Here is the call graph for this function:

◆ applyControlRuleReplace()

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.

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

◆ applyDeleteMany()

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.

Parameters
[out]cascadeLinkNamesNames of links the node batch cascaded.
Returns
true when anything was deleted.
Here is the call graph for this function:

◆ applyFuseInletJunction()

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).

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

◆ applyFuseJunctionSplit()

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.

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

◆ applyFuseVirtualJunction()

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).

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

◆ applyGageAdd()

bool SWMMModelLayer::applyGageAdd ( const QString &  name,
double  x,
double  y,
int *  outIdx = nullptr 
)

Add a rain gage: engine + cache.

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

◆ applyGageDelete()

bool SWMMModelLayer::applyGageDelete ( const QString &  name)

Delete a rain gage.

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

◆ applyGageMove()

bool SWMMModelLayer::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.

Parameters
idxCache/engine gage index.
newX,newYNew coordinate in the layer CRS.
Returns
true on success. Emits repaintRequested() and modelEdited() ([SYMBOLS] is authored data).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyHydrographAddGroup()

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.

Here is the call graph for this function:

◆ applyHydrographClearMonths()

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.

Here is the call graph for this function:

◆ applyHydrographRemoveEntry()

bool SWMMModelLayer::applyHydrographRemoveEntry ( const QString &  name,
int  month,
int  response 
)

Remove one (group, month, response) parameter row. Idempotent.

Here is the call graph for this function:

◆ applyHydrographRemoveGroup()

bool SWMMModelLayer::applyHydrographRemoveGroup ( const QString &  name)

Remove a UH group: parameter rows, gage assignment, [RDII_DECAY] rows, and any [RDII] node assignments referencing it.

Here is the call graph for this function:

◆ applyHydrographRenameGroup()

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.

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

◆ applyHydrographSetGage()

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.

Here is the call graph for this function:

◆ applyHydrographSetIa()

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.

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

◆ applyHydrographSetRtk()

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.

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

◆ applyInsertInletJunction()

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.

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

◆ applyInsertJunctionSplit()

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).

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

◆ applyInsertVirtualJunction()

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.

Parameters
[out]outNodeIdxEngine/cache index of the inserted node.
[out]outLinkIdxEngine/cache index of the new conduit.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyLinkAdd()

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.

Parameters
nameUnique identifier.
linkType0=Conduit, 1=Pump, 2=Orifice, 3=Weir, 4=Outlet.
fromNodeNameFrom-node name (must already exist).
toNodeNameTo-node name (must already exist).
interiorVerticesInterior (non-endpoint) polyline points.
[out]outIdxLink index on success.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyLinkBarrels()

bool SWMMModelLayer::applyLinkBarrels ( int  linkIdx,
int  barrels 
)

Slice SC.1 — Write the parallel-barrels count. Emits attributeChanged on success.

Here is the call graph for this function:

◆ applyLinkConvert()

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().

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

◆ applyLinkCulvertCode()

bool SWMMModelLayer::applyLinkCulvertCode ( int  linkIdx,
int  code 
)

Slice SC.1 — Write the FHWA culvert chart code (0 = none). Emits attributeChanged on success.

Here is the call graph for this function:

◆ applyLinkDelete()

bool SWMMModelLayer::applyLinkDelete ( const QString &  name)

Delete a single link.

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

◆ applyLinkFlip()

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.

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

◆ applyLinkInteriorVertices()

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.

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

◆ applyLinkLength()

bool SWMMModelLayer::applyLinkLength ( int  linkIdx,
double  length 
)

Write the conduit length for a link. No-op if the link is not a conduit.

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

◆ applyLinkXsect()

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).

Here is the call graph for this function:

◆ applyNodeAdd()

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.

Parameters
nameUnique null-terminated node identifier.
nodeType0=Junction, 1=Outfall, 2=Storage, 3=Divider (matches SWMM_NodeType).
x,yInitial coordinate in the layer CRS.
[out]outIdxNewly assigned node index on success.
Returns
true on success. On failure outIdx is -1.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyNodeConvert()

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.

Parameters
[out]outClearedEngine-reported cleared field names.
[out]outWarningsEngine-reported topology warnings.
[out]outErrorHuman-readable failure reason.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyNodeDelete()

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.

Parameters
nameNode to delete.
[out]cascadeLinkNamesNames of links deleted as cascade.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyNodeMove()

bool SWMMModelLayer::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.

Parameters
idxCache/engine node index.
newX,newYNew coordinate in the layer CRS.
Returns
true on success.

Emits repaintRequested() on success.

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

◆ applyRdiiDecayRemove()

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.

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

◆ applyRdiiDecaySet()

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).

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

◆ applyRemoveInletUsage()

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.

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

◆ applyRename()

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().

Parameters
oldNameCurrent name of the element.
newNameDesired new name (must not already exist).
kindHintSWMM 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.
Returns
true on success; false if oldName is not found (under kindHint, when given), newName is empty, newName is already in use, or the engine rejects the rename.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applySetInlet()

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).

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

◆ applySetInletUsage()

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).

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

◆ applySetVirtual()

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().

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

◆ applySubcatchAdd()

bool SWMMModelLayer::applySubcatchAdd ( const QString &  name,
const QVector< QPointF > &  polygon,
int *  outIdx = nullptr 
)

Add a subcatchment polygon: engine + cache.

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

◆ applySubcatchArea()

bool SWMMModelLayer::applySubcatchArea ( int  idx,
double  areaInModelUnits 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applySubcatchDelete()

bool SWMMModelLayer::applySubcatchDelete ( const QString &  name)

Delete a subcatchment.

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

◆ applySubcatchSetGage()

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.

Parameters
idxZero-based subcatchment index.
gageNameRain gage identifier. Must name an existing gage; an empty string is rejected, since SWMM requires a gage.
Returns
false when the index is out of range, the gage is unknown, or the engine rejected the write.
Here is the call graph for this function:

◆ applySubcatchVertices()

bool SWMMModelLayer::applySubcatchVertices ( int  idx,
const QVector< QPointF > &  vertices 
)

Replace a subcatchment's polygon vertices: engine + cache. Recomputes the centroid as the vertex average.

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

◆ applyTransectAdd()

bool SWMMModelLayer::applyTransectAdd ( const QString &  name,
QString *  outError = nullptr 
)

Create a new transect. Refuses on duplicate or empty name.

Here is the call graph for this function:

◆ applyTransectRemove()

bool SWMMModelLayer::applyTransectRemove ( const QString &  name,
QString *  outError = nullptr 
)

Remove a transect by name.

Here is the call graph for this function:

◆ applyTransectRename()

bool SWMMModelLayer::applyTransectRename ( const QString &  oldName,
const QString &  newName,
QString *  outError = nullptr 
)

Rename. Refuses on duplicate (case-insensitive) or empty.

Here is the call graph for this function:

◆ applyTransectSetBankStations()

bool SWMMModelLayer::applyTransectSetBankStations ( const QString &  name,
double  xLeft,
double  xRight 
)
Here is the call graph for this function:

◆ applyTransectSetComments()

bool SWMMModelLayer::applyTransectSetComments ( const QString &  name,
const QString &  comments 
)
Here is the call graph for this function:

◆ applyTransectSetEncroachmentStations()

bool SWMMModelLayer::applyTransectSetEncroachmentStations ( const QString &  name,
double  xLeft,
double  xRight 
)
Here is the call graph for this function:

◆ applyTransectSetModifiers()

bool SWMMModelLayer::applyTransectSetModifiers ( const QString &  name,
double  stationMul,
double  elevOffset,
double  meander 
)
Here is the call graph for this function:

◆ applyTransectSetRoughness()

bool SWMMModelLayer::applyTransectSetRoughness ( const QString &  name,
double  nLeft,
double  nRight,
double  nChannel 
)
Here is the call graph for this function:

◆ applyTransectSetStations()

bool SWMMModelLayer::applyTransectSetStations ( const QString &  name,
const QVector< QPair< double, double > > &  stations 
)

Snapshot-and-rewrite the full station list.

Here is the call graph for this function:

◆ attributeChanged

void SWMMModelLayer::attributeChanged ( const QString &  objectName)
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.

Here is the caller graph for this function:

◆ availableAttributes()

QVector< OpenSWMM::Render::AttributeField > SWMMModelLayer::availableAttributes ( OpenSWMMVis::SwmmCategory  cat) const
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.

Here is the call graph for this function:

◆ beginBulkEdit()

void SWMMModelLayer::beginBulkEdit ( )

Open a bulk-edit scope. Nestable; only the outermost pair does work. Prefer the BulkEdit guard.

◆ buildFromEngine()

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.

Parameters
soaMsOut/geomMsOutOptional out: SoA-copy / geometry-cache ms.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ bulkEditActive()

bool SWMMModelLayer::bulkEditActive ( ) const
inline

True while a bulk-edit scope is open. The applyXxxAdd/Delete helpers consult this to skip their per-object derived work.

Here is the caller graph for this function:

◆ cachedGageCoord()

bool SWMMModelLayer::cachedGageCoord ( int  idx,
double x,
double y 
) const

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.

Parameters
idxZero-based gage index.
Returns
false when 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.
Here is the caller graph for this function:

◆ cachedGageCount()

int SWMMModelLayer::cachedGageCount ( ) const

◆ cachedLinkCount()

int SWMMModelLayer::cachedLinkCount ( ) const

◆ cachedLinkInteriorVertices()

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.

Here is the caller graph for this function:

◆ cachedLinkPolyline()

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.

Here is the caller graph for this function:

◆ cachedNodeCoord()

bool SWMMModelLayer::cachedNodeCoord ( int  idx,
double x,
double y 
) const

Cached layer-CRS coordinate of a node by index.

Returns
true on success; x / y untouched on failure.
Here is the caller graph for this function:

◆ cachedNodeCount()

int SWMMModelLayer::cachedNodeCount ( ) const

Cached top-level object counts (all node/link kinds summed). Convenience for load-summary logging.

◆ cachedSubcatchCount()

int SWMMModelLayer::cachedSubcatchCount ( ) const

Number of subcatchments cached. Equivalent to categoryCount(CatSubcatchments) but provided alongside cachedSubcatchVertices for direct iteration.

Here is the caller graph for this function:

◆ cachedSubcatchVertices()

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).

Here is the caller graph for this function:

◆ categoryCheckState()

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.

Here is the call graph for this function:

◆ categoryCount()

int SWMMModelLayer::categoryCount ( Category  c) const

Number of objects in the given category. O(1).

Here is the caller graph for this function:

◆ categoryOpacity()

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.

◆ categoryOrder()

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.

◆ categoryOrderChanged

void SWMMModelLayer::categoryOrderChanged ( )
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).

Here is the caller graph for this function:

◆ classifyGraduatedIfNeeded()

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.

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

◆ clearObjectOrder()

void SWMMModelLayer::clearObjectOrder ( Category  cat)

Drop the user override for this category; display falls back to the default per-category index bucket.

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

◆ clearSelection()

void SWMMModelLayer::clearSelection ( )
Here is the call graph for this function:

◆ closeEngine()

void SWMMModelLayer::closeEngine ( )

Close and destroy the engine, clearing all geometry caches.

Here is the caller graph for this function:

◆ colorForClass()

QColor SWMMModelLayer::colorForClass ( const QString &  classKey) const
Here is the call graph for this function:

◆ conduitSymbol()

SWMMElementSymbol SWMMModelLayer::conduitSymbol ( ) const
Here is the caller graph for this function:

◆ controlRulesChanged

void SWMMModelLayer::controlRulesChanged ( const QString &  ruleName)
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

  • future RulesEditorDialog subscribe here and re-render off the same ControlRuleRegistry, so inline-edit-in-property-panel and edit-in-dialog converge through a single signal.
Here is the caller graph for this function:

◆ convertLinkOffsets()

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:

  • convertValues == true (legacy "Yes": same physics, new numbers) is a no-op on the store — the option flip alone changes file and display.
  • convertValues == false (legacy "No": same numbers, new meaning) reinterprets each stored depth under the new convention. Conduits use both ends, orifices offset_up, weirs/outlets the crest, pumps skipped. Emits geometryChanged() once when values were touched.
    Parameters
    toElevationThe mode just switched TO.
    convertValuesThe prompt answer (true = Yes).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createBlankEngine()

SWMM_Engine SWMMModelLayer::createBlankEngine ( const NewProjectSpec spec,
QString *  errorDetail 
)
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).

Returns
nullptr on failure with errorDetail filled.
Here is the caller graph for this function:

◆ createDataObject()

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.

Parameters
cData-object category to create.
nameName for the new object (caller-supplied, typically from suggestUniqueDataObjectName).
optionsPer-category creation options (see above).
outErrorIf non-null, populated with an error message on failure (empty on success).
Returns
true on success, false otherwise.
Here is the call graph for this function:

◆ crsAssigned()

bool SWMMModelLayer::crsAssigned ( ) const
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.

Here is the caller graph for this function:

◆ dataObjectCount()

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.

Here is the caller graph for this function:

◆ dataObjectNameAt()

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.

Here is the caller graph for this function:

◆ dataObjectsChanged

void SWMMModelLayer::dataObjectsChanged ( )
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().

Here is the caller graph for this function:

◆ defaultObjectOrder()

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.

Here is the caller graph for this function:

◆ depopulateScene()

void SWMMModelLayer::depopulateScene ( QGraphicsScene *  scene)
overridevirtual

Removes all QGraphicsItems belonging to this layer from the scene.

Reimplemented from OpenSWMMVisLayer.

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

◆ dividerSymbol()

SWMMElementSymbol SWMMModelLayer::dividerSymbol ( ) const
Here is the caller graph for this function:

◆ editCanvas()

MapCanvas * SWMMModelLayer::editCanvas ( ) const
Here is the caller graph for this function:

◆ editRevision()

quint64 SWMMModelLayer::editRevision ( ) const
inline

Data-edit epoch — bumped on every modelEdited / attributeChanged. Consumers (label text cache) compare against their stored value to detect stale derived data.

◆ elementPosition()

bool SWMMModelLayer::elementPosition ( const QString &  name,
double x,
double y 
) const

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.

Returns
true on success; x / y untouched on failure.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ elementSymbolAdapter()

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.

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

◆ endBulkEdit()

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.

Here is the call graph for this function:

◆ engine()

SWMM_Engine SWMMModelLayer::engine ( ) const

Raw engine handle — valid only after a successful loadModel().

◆ engineLinkLength()

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.

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

◆ engineSupportsInletJunctions()

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.

◆ ensureAquiferRegistry()

QObject * SWMMModelLayer::ensureAquiferRegistry ( )

Lazy accessor for the project-scoped AquiferRegistry.

Here is the call graph for this function:

◆ ensureControlRuleRegistry()

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*.

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

◆ ensureCurveRegistry()

QObject * SWMMModelLayer::ensureCurveRegistry ( )

Same lazy-init pattern, for the CurveRegistry.

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

◆ ensureInletRegistry()

QObject * SWMMModelLayer::ensureInletRegistry ( )

Lazy accessor for the project-scoped InletRegistry.

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

◆ ensureLandUseRegistry()

QObject * SWMMModelLayer::ensureLandUseRegistry ( )

Lazy accessor for the project-scoped LandUseRegistry.

Here is the call graph for this function:

◆ ensureLidControlRegistry()

QObject * SWMMModelLayer::ensureLidControlRegistry ( )

Lazy accessor for the project-scoped LidControlRegistry.

Here is the call graph for this function:

◆ ensurePatternRegistry()

QObject * SWMMModelLayer::ensurePatternRegistry ( )

Same lazy-init pattern as ensureTimeseriesRegistry, for the PatternRegistry.

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

◆ ensurePollutantRegistry()

QObject * SWMMModelLayer::ensurePollutantRegistry ( )

Lazy accessor for the project-scoped PollutantRegistry.

Here is the call graph for this function:

◆ ensureSnowpackRegistry()

QObject * SWMMModelLayer::ensureSnowpackRegistry ( )

Lazy accessor for the project-scoped SnowpackRegistry.

Here is the call graph for this function:

◆ ensureStreetRegistry()

QObject * SWMMModelLayer::ensureStreetRegistry ( )

Lazy accessor for the project-scoped StreetRegistry.

Here is the call graph for this function:

◆ ensureTimeseriesRegistry()

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.

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

◆ ensureTransectRegistry()

QObject * SWMMModelLayer::ensureTransectRegistry ( )

Lazy accessor for the project-scoped TransectRegistry.

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

◆ ensureUserFlagsModel()

openswmmvis::ui::UserFlagsModel * SWMMModelLayer::ensureUserFlagsModel ( )

Lazy accessor for the project-scoped UserFlagsModel. Returns nullptr if the engine isn't open.

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

◆ extendedMetadata()

QVector< QPair< QString, QString > > SWMMModelLayer::extendedMetadata ( ) const
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.

Here is the call graph for this function:

◆ featureColor()

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).

◆ featureOffset()

double SWMMModelLayer::featureOffset ( Category  c,
int  idx 
) const

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).

◆ featureShape()

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).

◆ featureSize()

double SWMMModelLayer::featureSize ( Category  c,
int  idx 
) const

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).

◆ findObjectLocation()

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.

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

◆ gagesInPolygon()

QStringList SWMMModelLayer::gagesInPolygon ( const QPolygonF &  canvasPoly) const
Here is the call graph for this function:

◆ gagesInRect()

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.

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

◆ geometryChanged

void SWMMModelLayer::geometryChanged ( )
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.

Here is the caller graph for this function:

◆ geomRevision()

quint64 SWMMModelLayer::geomRevision ( ) const
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.

◆ getOption()

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.

Here is the caller graph for this function:

◆ glRenderingEnabled()

bool SWMMModelLayer::glRenderingEnabled ( ) const
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.

◆ hiddenObjects()

QSet< QString > SWMMModelLayer::hiddenObjects ( ) const
inline

Names currently hidden via per-object toggles. Used by the Object Browser to seed leaf-row check states on refresh.

◆ hydrographChanged

void SWMMModelLayer::hydrographChanged ( const QString &  uhName)
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.

Here is the caller graph for this function:

◆ hydrographDecayModel()

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.

Here is the caller graph for this function:

◆ hydrographGroupListModel()

HydrographGroupListModel * SWMMModelLayer::hydrographGroupListModel ( )

Shared QAbstractListModel of UH group names. Lazily constructed; one per layer. Re-emits modelReset() on hydrographChanged("").

Here is the caller graph for this function:

◆ hydrographIaModel()

HydrographIaTableModel * SWMMModelLayer::hydrographIaModel ( )

Shared QAbstractTableModel for one (group, month) linear-IA grid (3 rows × 4 cols). Call setContext() to rebind.

Here is the caller graph for this function:

◆ hydrographRtkModel()

HydrographRtkTableModel * SWMMModelLayer::hydrographRtkModel ( )

Shared QAbstractTableModel for one (group, month) R/T/K grid (3 rows × 4 cols). Call setContext() to rebind.

Here is the caller graph for this function:

◆ identifyAt() [1/2]

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.

Parameters
mapXX in canvas CRS.
mapYY in canvas CRS.
canvasSRSCanvas CRS (may be nullptr).
toleranceSearch radius in map units.
Returns
Attribute map, or an empty map if nothing was found. Includes "elementType", "elementName", and all SWMM properties.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ identifyAt() [2/2]

QVariantMap SWMMModelLayer::identifyAt ( double  mapX,
double  mapY,
double  tolerance = 1e-6 
) const

Convenience overload — no CRS needed.

Here is the call graph for this function:

◆ identifyByName()

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.

Parameters
kindMaskkKind* 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.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ inletConnectors()

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.

◆ inletConnectorSymbol()

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.

Here is the caller graph for this function:

◆ inletJunctionSymbol()

SWMMElementSymbol SWMMModelLayer::inletJunctionSymbol ( ) const

Inlet junctions — same CatJunctions bucket as virtual junctions (D-G1), distinct glyph.

Here is the caller graph for this function:

◆ inletUsageFor()

bool SWMMModelLayer::inletUsageFor ( int  hostKind,
int  hostIdx,
SWMM_InletUsage *  out 
) const

Read the inlet-usage row hosted by (hostKind, hostIdx).

Parameters
hostKindSWMM_INLET_HOST_LINK (0) or SWMM_INLET_HOST_NODE (1).
Returns
false when no row exists (out untouched).
Here is the caller graph for this function:

◆ invalidateDataObjectCache()

void SWMMModelLayer::invalidateDataObjectCache ( )
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.

◆ isConduit()

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).

Here is the caller graph for this function:

◆ isObjectVisible() [1/2]

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.

Here is the call graph for this function:

◆ isObjectVisible() [2/2]

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.

Here is the call graph for this function:

◆ junctionSymbol()

SWMMElementSymbol SWMMModelLayer::junctionSymbol ( ) const
Here is the caller graph for this function:

◆ kindBitForCategory()

quint8 SWMMModelLayer::kindBitForCategory ( Category  c)
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.

Here is the caller graph for this function:

◆ kindHasAnyOffset()

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.

◆ kindKey()

QString SWMMModelLayer::kindKey ( Category  c)
static

Convenience: stable string key used for MultiKindRenderer keying

  • .oswp persistence. e.g. CatJunctions → "Junctions".
Here is the caller graph for this function:

◆ kindRenderer()

OpenSWMM::Render::IFeatureRenderer * SWMMModelLayer::kindRenderer ( Category  c) const

Returns the renderer for one Category kind (never null).

Here is the caller graph for this function:

◆ kindUsesOverrides()

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).

◆ legendSymbolItems()

QList< OpenSWMM::Render::LegendSymbolItem > SWMMModelLayer::legendSymbolItems ( ) const
Here is the call graph for this function:

◆ linkArrowColor()

QColor SWMMModelLayer::linkArrowColor ( Category  c) const

◆ linkArrowOnlyWhenFlowPos()

bool SWMMModelLayer::linkArrowOnlyWhenFlowPos ( Category  c) const

◆ linkArrowsEnabled()

bool SWMMModelLayer::linkArrowsEnabled ( Category  c) const

True if flow-direction arrows are enabled for the link kind.

◆ linkArrowSize()

double SWMMModelLayer::linkArrowSize ( Category  c) const

◆ linkArrowWidth()

double SWMMModelLayer::linkArrowWidth ( Category  c) const

Arrowhead width ACROSS the link, independent of its length.

◆ linkEndForNode()

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.

Here is the caller graph for this function:

◆ linkFlow()

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.

◆ linkFromNodeIdx()

int SWMMModelLayer::linkFromNodeIdx ( int  linkIdx) const

Returns the from-node (upstream) engine index for linkIdx, or -1.

Here is the caller graph for this function:

◆ linkIndex()

int SWMMModelLayer::linkIndex ( const QString &  name) const

Returns the cache index of the link with the given name, or -1 if none matches.

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

◆ linksAttachedToNode()

QVector< int > SWMMModelLayer::linksAttachedToNode ( int  nodeIdx) const

Indices of links whose from/to endpoint is the given node.

Here is the caller graph for this function:

◆ linksInPolygon()

QStringList SWMMModelLayer::linksInPolygon ( const QPolygonF &  canvasPoly) const
Here is the call graph for this function:

◆ linksInRect()

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.

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

◆ linkToNodeIdx()

int SWMMModelLayer::linkToNodeIdx ( int  linkIdx) const

Returns the to-node (downstream) engine index for linkIdx, or -1.

Here is the caller graph for this function:

◆ loadModel()

bool SWMMModelLayer::loadModel ( QList< QString > &  warnings,
QList< QString > &  errors 
)

Loads (or reloads) the SWMM input file and rebuilds geometry caches.

Returns
true on success.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ markEdited

void SWMMModelLayer::markEdited ( )
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.

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

◆ maxMarkerHalfBoundPx()

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).

◆ modelEdited

void SWMMModelLayer::modelEdited ( )
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.

Here is the caller graph for this function:

◆ modelFilePath()

QString SWMMModelLayer::modelFilePath ( ) const

◆ modelFilePathChanged

void SWMMModelLayer::modelFilePathChanged ( const QString &  path)
signal
Here is the caller graph for this function:

◆ modelLoaded

void SWMMModelLayer::modelLoaded ( )
signal
Here is the caller graph for this function:

◆ modelLoadError

void SWMMModelLayer::modelLoadError ( const QString &  errorMessage)
signal
Here is the caller graph for this function:

◆ nodeIndex()

int SWMMModelLayer::nodeIndex ( const QString &  name) const

Returns the cache index of the node with the given name, or -1 if none matches.

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

◆ nodeIsInlet()

bool SWMMModelLayer::nodeIsInlet ( int  soaIdx) const
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.

◆ nodeIsVirtual()

bool SWMMModelLayer::nodeIsVirtual ( int  soaIdx) const
inline

True when cached node soaIdx is a virtual junction.

◆ nodesInPolygon()

QStringList SWMMModelLayer::nodesInPolygon ( const QPolygonF &  canvasPoly) const
Here is the call graph for this function:

◆ nodesInRect()

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).

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

◆ objectExtent()

MapExtent SWMMModelLayer::objectExtent ( const QString &  name) const

Layer-CRS bounding box of a cached object by name.

  • Node / Rain Gage: single-point extent (caller pads for a usable zoom).
  • Link: bbox of the cached polyline (endpoints + vertices).
  • Subcatchment: bbox of the cached polygon ring. Returns an invalid 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.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ objectNameAt()

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.

Here is the caller graph for this function:

◆ objectOrder()

QVector< int > SWMMModelLayer::objectOrder ( Category  cat) const

Read-only access to the current override for a category. Empty when no override is installed.

◆ objectTypeFor()

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.

Returns
0=Unknown, 1=Node, 2=Link, 3=Subcatchment, 4=RainGage — matches the SWMMObjectRef::ObjectType enum values.
Here is the call graph for this function:

◆ onCanvasCRSChanged()

void SWMMModelLayer::onCanvasCRSChanged ( const SpatialReferenceSystem newCanvasSRS)
overridevirtual

Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform caches.

Parameters
newCanvasSRSThe new canvas CRS.

Reimplemented from OpenSWMMVisLayer.

◆ openEngineForPath()

SWMM_Engine SWMMModelLayer::openEngineForPath ( const QString &  path,
QString *  errorDetail,
qint64 *  openMs = nullptr 
)
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).

Parameters
openMsOptional out: elapsed open time in ms (for the load timing log adoptOpenEngine() emits).
Here is the caller graph for this function:

◆ optionsChanged

void SWMMModelLayer::optionsChanged ( const QStringList &  keys)
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.

Here is the caller graph for this function:

◆ orificeSymbol()

SWMMElementSymbol SWMMModelLayer::orificeSymbol ( ) const
Here is the caller graph for this function:

◆ outfallSymbol()

SWMMElementSymbol SWMMModelLayer::outfallSymbol ( ) const
Here is the caller graph for this function:

◆ outletSymbol()

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.

Here is the caller graph for this function:

◆ pickAt()

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.

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

◆ polygonCanvasToLayer()

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.

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

◆ polylineLengthInModelUnits()

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]:

  • Projected CRS: raw Euclidean × linearUnitsToMetres() → metres, then to feet if not SI.
  • Geographic CRS: great-circle distance per segment (WGS-84 sphere) → metres, then to feet if not SI.
  • No SRS: raw Euclidean (preserves legacy behaviour for projects without a CRS set).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ populateScene()

void SWMMModelLayer::populateScene ( QGraphicsScene *  scene,
const MapExtent canvasExtent,
const SpatialReferenceSystem canvasSRS 
)
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:

  • The layer is first added.
  • The canvas CRS changes (after onCanvasCRSChanged).
  • The layer data changes (model loaded, tile fetched, etc.).
Parameters
sceneThe shared OpenSWMMVisScene to add items to.
canvasExtentVisible extent in canvas-CRS coordinates.
canvasSRSThe CRS currently used by the MapCanvas.

Implements OpenSWMMVisLayer.

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

◆ previewGageMove()

bool SWMMModelLayer::previewGageMove ( int  idx,
double  newX,
double  newY 
)

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.

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

◆ previewNodeMove()

bool SWMMModelLayer::previewNodeMove ( int  idx,
double  newX,
double  newY 
)

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.

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

◆ pumpSymbol()

SWMMElementSymbol SWMMModelLayer::pumpSymbol ( ) const
Here is the caller graph for this function:

◆ pushInletUsageEdit()

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.

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

◆ pushInletUsageRemoval()

bool SWMMModelLayer::pushInletUsageRemoval ( int  hostKind,
int  hostIdx 
)

Undoable counterpart of applyRemoveInletUsage().

Here is the call graph for this function:

◆ qsgOwnsKind()

bool SWMMModelLayer::qsgOwnsKind ( QsgKind  k) const
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.

◆ qsgRenderKinds()

QsgKinds SWMMModelLayer::qsgRenderKinds ( ) const
inlinenoexcept
Here is the caller graph for this function:

◆ qsgRenderKindsChanged

void SWMMModelLayer::qsgRenderKindsChanged ( QsgKinds  kinds)
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.

Here is the caller graph for this function:

◆ rainGageSymbol()

SWMMElementSymbol SWMMModelLayer::rainGageSymbol ( ) const
Here is the caller graph for this function:

◆ rebuildKindFeatureColors()

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.

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

◆ refreshScene()

void SWMMModelLayer::refreshScene ( QGraphicsScene *  scene,
const MapExtent canvasExtent,
const SpatialReferenceSystem canvasSRS 
)
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.

Here is the call graph for this function:

◆ reloadGeometry()

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.

Here is the call graph for this function:

◆ renderer()

OpenSWMM::Render::IFeatureRenderer * SWMMModelLayer::renderer ( ) const
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.

◆ rendererChanged

void SWMMModelLayer::rendererChanged ( )
signal

Slice BI Phase 8.13.6.5 — emitted when setRenderer() swaps the renderer pointer.

Here is the caller graph for this function:

◆ renderLinkCount()

int SWMMModelLayer::renderLinkCount ( ) const
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.

◆ renderLinkHidden()

bool SWMMModelLayer::renderLinkHidden ( int  idx) const
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.

◆ resetKindRendererToDefaults()

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.

Here is the call graph for this function:

◆ rollbackTailGageAdd()

bool SWMMModelLayer::rollbackTailGageAdd ( const QString &  name)

Undo tail gage add (swmm_gage_delete on tail).

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

◆ rollbackTailLinkAdd()

bool SWMMModelLayer::rollbackTailLinkAdd ( const QString &  name)

Undo tail link add (swmm_link_pop_last).

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

◆ rollbackTailNodeAdd()

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.

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

◆ rollbackTailSubcatchAdd()

bool SWMMModelLayer::rollbackTailSubcatchAdd ( const QString &  name)

Undo tail subcatch add (swmm_subcatch_delete on tail).

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

◆ ruleList() [1/2]

const OpenSWMM::Render::RuleList * SWMMModelLayer::ruleList ( ) const
overridevirtual

Reimplemented from OpenSWMMVisLayer.

◆ ruleList() [2/2]

OpenSWMM::Render::RuleList * SWMMModelLayer::ruleList ( )
overridevirtual

Reimplemented from OpenSWMMVisLayer.

◆ selectedElementNames()

QStringList SWMMModelLayer::selectedElementNames ( ) const

Returns the names of currently selected network elements.

◆ selectedElements()

const QVector< SelectedElement > & SWMMModelLayer::selectedElements ( ) const
inline

Typed selection — canonical form. Each entry names WHICH kind is selected, so same-named objects of other kinds stay unselected.

Here is the caller graph for this function:

◆ selectionChanged

void SWMMModelLayer::selectionChanged ( const QStringList &  selectedNames)
signal
Here is the caller graph for this function:

◆ setCategoryOpacity()

void SWMMModelLayer::setCategoryOpacity ( Category  c,
qreal  opacity 
)
Here is the call graph for this function:

◆ setCategoryOrder()

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.

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

◆ setCategoryVisible()

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.

Here is the call graph for this function:

◆ setColorForClass()

void SWMMModelLayer::setColorForClass ( const QString &  classKey,
const QColor &  color 
)
Here is the call graph for this function:

◆ setConduitSymbol()

void SWMMModelLayer::setConduitSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDividerSymbol()

void SWMMModelLayer::setDividerSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEditCanvas()

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).

◆ setGlRenderingEnabled()

void SWMMModelLayer::setGlRenderingEnabled ( bool  on)
inline
Here is the call graph for this function:

◆ setInletConnectorSymbol()

void SWMMModelLayer::setInletConnectorSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setInletJunctionSymbol()

void SWMMModelLayer::setInletJunctionSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setJunctionSymbol()

void SWMMModelLayer::setJunctionSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setKindRenderer()

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.

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

◆ setLabelConfig()

void SWMMModelLayer::setLabelConfig ( const OpenSWMM::Render::LabelConfig cfg)
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.

Here is the call graph for this function:

◆ setLinkArrowColor()

void SWMMModelLayer::setLinkArrowColor ( Category  c,
const QColor &  col 
)
Here is the call graph for this function:

◆ setLinkArrowOnlyWhenFlowPos()

void SWMMModelLayer::setLinkArrowOnlyWhenFlowPos ( Category  c,
bool  onlyPos 
)
Here is the call graph for this function:

◆ setLinkArrowsEnabled()

void SWMMModelLayer::setLinkArrowsEnabled ( Category  c,
bool  enabled 
)

Toggle flow-direction arrows for a link kind. Emits repaintRequested.

Here is the call graph for this function:

◆ setLinkArrowSize()

void SWMMModelLayer::setLinkArrowSize ( Category  c,
double  pixels 
)
Here is the call graph for this function:

◆ setLinkArrowWidth()

void SWMMModelLayer::setLinkArrowWidth ( Category  c,
double  pixels 
)
Here is the call graph for this function:

◆ setModelFilePath()

void SWMMModelLayer::setModelFilePath ( const QString &  path)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setObjectOrder()

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.

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

◆ setObjectsVisible()

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.

Here is the call graph for this function:

◆ setObjectVisible()

void SWMMModelLayer::setObjectVisible ( const QString &  name,
bool  visible 
)
Here is the call graph for this function:

◆ setObjectVisibleAt()

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().

Here is the call graph for this function:

◆ setOption()

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.

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

◆ setOptions()

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.

Here is the call graph for this function:

◆ setOrificeSymbol()

void SWMMModelLayer::setOrificeSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOutfallSymbol()

void SWMMModelLayer::setOutfallSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOutletSymbol()

void SWMMModelLayer::setOutletSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPumpSymbol()

void SWMMModelLayer::setPumpSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setQsgRenderKinds()

void SWMMModelLayer::setQsgRenderKinds ( QsgKinds  kinds)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRainGageSymbol()

void SWMMModelLayer::setRainGageSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRenderer()

void SWMMModelLayer::setRenderer ( std::unique_ptr< OpenSWMM::Render::IFeatureRenderer r)
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.

Here is the call graph for this function:

◆ setSelectedElementNames()

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.

Here is the caller graph for this function:

◆ setSelectedElements()

void SWMMModelLayer::setSelectedElements ( const QVector< SelectedElement > &  sel)

Replaces the selection with typed entries (kind-exact).

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

◆ setShowLabels()

void SWMMModelLayer::setShowLabels ( bool  show)
Here is the call graph for this function:

◆ setShowLinks()

void SWMMModelLayer::setShowLinks ( bool  show)
Here is the call graph for this function:

◆ setShowNodes()

void SWMMModelLayer::setShowNodes ( bool  show)
Here is the call graph for this function:

◆ setShowRainGages()

void SWMMModelLayer::setShowRainGages ( bool  show)
Here is the call graph for this function:

◆ setShowSubcatchments()

void SWMMModelLayer::setShowSubcatchments ( bool  show)
Here is the call graph for this function:

◆ setSizeForClass()

void SWMMModelLayer::setSizeForClass ( const QString &  classKey,
qreal  size 
)
Here is the call graph for this function:

◆ setStorageSymbol()

void SWMMModelLayer::setStorageSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setSubcatchmentSymbol()

void SWMMModelLayer::setSubcatchmentSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVirtualJunctionSymbol()

void SWMMModelLayer::setVirtualJunctionSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setWeirSymbol()

void SWMMModelLayer::setWeirSymbol ( const SWMMElementSymbol s)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ showLabels()

bool SWMMModelLayer::showLabels ( ) const

◆ showLabelsChanged

void SWMMModelLayer::showLabelsChanged ( bool  show)
signal
Here is the caller graph for this function:

◆ showLinks()

bool SWMMModelLayer::showLinks ( ) const

◆ showLinksChanged

void SWMMModelLayer::showLinksChanged ( bool  show)
signal
Here is the caller graph for this function:

◆ showNodes()

bool SWMMModelLayer::showNodes ( ) const

◆ showNodesChanged

void SWMMModelLayer::showNodesChanged ( bool  show)
signal
Here is the caller graph for this function:

◆ showRainGages()

bool SWMMModelLayer::showRainGages ( ) const

◆ showRainGagesChanged

void SWMMModelLayer::showRainGagesChanged ( bool  show)
signal
Here is the caller graph for this function:

◆ showSubcatchments()

bool SWMMModelLayer::showSubcatchments ( ) const

◆ showSubcatchmentsChanged

void SWMMModelLayer::showSubcatchmentsChanged ( bool  show)
signal
Here is the caller graph for this function:

◆ sizeForClass()

qreal SWMMModelLayer::sizeForClass ( const QString &  classKey) const
Here is the call graph for this function:

◆ snapNearestPoint()

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.

Parameters
[in]mapX,mapYQuery point in layer CRS.
[in]mapRadiusSearch radius in layer CRS units.
[out]outPtSet to the nearest candidate when returning true.
Returns
true if a candidate was found within mapRadius.

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.

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

◆ soaIndexAt()

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.

◆ sourceDescription()

QString SWMMModelLayer::sourceDescription ( ) const
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.

◆ storageSymbol()

SWMMElementSymbol SWMMModelLayer::storageSymbol ( ) const
Here is the caller graph for this function:

◆ styleSubjects()

std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > SWMMModelLayer::styleSubjects ( )
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.

Here is the call graph for this function:

◆ subcatchmentsInPolygon()

QStringList SWMMModelLayer::subcatchmentsInPolygon ( const QPolygonF &  canvasPoly) const
Here is the call graph for this function:

◆ subcatchmentsInRect()

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.

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

◆ subcatchmentSymbol()

SWMMElementSymbol SWMMModelLayer::subcatchmentSymbol ( ) const
Here is the caller graph for this function:

◆ suggestUniqueDataObjectName()

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.

Here is the call graph for this function:

◆ supportsClassEdit()

bool SWMMModelLayer::supportsClassEdit ( OpenSWMM::Render::ClassEditKind  kind) const
Here is the call graph for this function:

◆ tableIdsOfType()

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).

◆ transectChanged

void SWMMModelLayer::transectChanged ( const QString &  transectName)
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.

Here is the caller graph for this function:

◆ transformCanvasToLayer()

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.

Returns
true on success; on failure, lx/ly equal cx/cy.
Here is the caller graph for this function:

◆ transformLayerToCanvas()

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.

Returns
true on success; on failure, cx/cy equal lx/ly.
Here is the caller graph for this function:

◆ virtualJunctionRuleText()

QString SWMMModelLayer::virtualJunctionRuleText ( int  engineErrorCode)
static

Actionable text for a virtual-junction / inlet-junction rule code (609..621 VJ, 623..635 inlet).

Here is the caller graph for this function:

◆ virtualJunctionSymbol()

SWMMElementSymbol SWMMModelLayer::virtualJunctionSymbol ( ) const
Here is the caller graph for this function:

◆ weirSymbol()

SWMMElementSymbol SWMMModelLayer::weirSymbol ( ) const
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ SWMMLayerItem

friend class SWMMLayerItem
friend

◆ SWMMLayerQSGRenderer

friend class SWMMLayerQSGRenderer
friend

Member Data Documentation

◆ CatConduits

constexpr Category SWMMModelLayer::CatConduits = OpenSWMMVis::CatConduits
staticconstexpr

◆ CatDividers

constexpr Category SWMMModelLayer::CatDividers = OpenSWMMVis::CatDividers
staticconstexpr

◆ CatJunctions

constexpr Category SWMMModelLayer::CatJunctions = OpenSWMMVis::CatJunctions
staticconstexpr

◆ CatOrifices

constexpr Category SWMMModelLayer::CatOrifices = OpenSWMMVis::CatOrifices
staticconstexpr

◆ CatOutfalls

constexpr Category SWMMModelLayer::CatOutfalls = OpenSWMMVis::CatOutfalls
staticconstexpr

◆ CatOutlets

constexpr Category SWMMModelLayer::CatOutlets = OpenSWMMVis::CatOutlets
staticconstexpr

◆ CatPumps

constexpr Category SWMMModelLayer::CatPumps = OpenSWMMVis::CatPumps
staticconstexpr

◆ CatRainGages

constexpr Category SWMMModelLayer::CatRainGages = OpenSWMMVis::CatRainGages
staticconstexpr

◆ CatStorage

constexpr Category SWMMModelLayer::CatStorage = OpenSWMMVis::CatStorage
staticconstexpr

◆ CatSubcatchments

constexpr Category SWMMModelLayer::CatSubcatchments = OpenSWMMVis::CatSubcatchments
staticconstexpr

◆ CatWeirs

constexpr Category SWMMModelLayer::CatWeirs = OpenSWMMVis::CatWeirs
staticconstexpr

◆ kKindAll

constexpr quint8 SWMMModelLayer::kKindAll = 0x0F
staticconstexpr

◆ kKindCatch

constexpr quint8 SWMMModelLayer::kKindCatch = 0x04
staticconstexpr

◆ kKindGage

constexpr quint8 SWMMModelLayer::kKindGage = 0x08
staticconstexpr

◆ kKindLink

constexpr quint8 SWMMModelLayer::kKindLink = 0x02
staticconstexpr

◆ kKindNode

constexpr quint8 SWMMModelLayer::kKindNode = 0x01
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.

◆ NumCategories

constexpr Category SWMMModelLayer::NumCategories = OpenSWMMVis::NumCategories
staticconstexpr

Property Documentation

◆ modelFilePath

QString SWMMModelLayer::modelFilePath
read

◆ showLabels

bool SWMMModelLayer::showLabels
readwrite

◆ showLinks

bool SWMMModelLayer::showLinks
readwrite

◆ showNodes

bool SWMMModelLayer::showNodes
readwrite

◆ showRainGages

bool SWMMModelLayer::showRainGages
readwrite

◆ showSubcatchments

bool SWMMModelLayer::showSubcatchments
readwrite

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