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
SWMMVisProjectWindow Class Reference

MDI sub-window owning a MapCanvas, SWMMModelLayer, and map tools. More...

#include <swmmvisprojectwindow.h>

Inheritance diagram for SWMMVisProjectWindow:
Collaboration diagram for SWMMVisProjectWindow:

Signals

void modelLoaded ()
 
void modelLoadError (const QString &msg)
 
void modelLoadFinished (bool ok, const QList< QString > &warnings, const QList< QString > &errors)
 
void saveCompletedWithEngineWarnings (const QStringList &warnings)
 
void meshImportFinished (bool ok, const QString &message, const QString &meshPath)
 
void hasChangesChanged (bool dirty)
 
void editSessionChanged (bool active)
 
void offsetModeChanged (bool elevation)
 
void autoLengthChanged (bool enabled)
 
void activeResultsLayerChanged (SWMMResultsLayer *layer)
 
void active2DResultsLayerChanged (SWMM2DResultsLayer *layer)
 
void pick2DCellsPicked (class SWMM2DResultsLayer *layer, const QVector< int > &triIdxList, const QVector< openswmmvis::plot::PlotAttribute > &attrs)
 
void meshProfileTraced (const QVector< QPointF > &scenePolyline)
 
void analysisMeshProfileTraced (const QVector< QPointF > &scenePolyline)
 
void terrainProfileTraced (const QVector< QPointF > &scenePolyline)
 
void meshEdgeFluxRequested (class SWMM2DMeshLayer *mesh, int triIdx, int edgeLocal, openswmmvis::plot::PlotAttribute attr)
 
void meshEdgeStatusMessage (const QString &message)
 
void meshVertexSeriesRequested (class SWMM2DMeshLayer *mesh, const QVector< int > &vertexIdxList, const QVector< openswmmvis::plot::PlotAttribute > &attrs)
 
void activeTerrainChanged (GISRasterLayer *newTerrain)
 
void aboutToClose ()
 

Public Member Functions

 SWMMVisProjectWindow (OpenSWMMVisWorkspace *workspace, const QString &filePath=QString(), QWidget *parent=nullptr)
 
 ~SWMMVisProjectWindow () override
 
MapCanvascanvas () const
 
SWMMModelLayermodelLayer () const
 
UnitSystemunitSystem () const
 
SelectionManagerselectionManager () const
 
bool isElevationOffsetMode () const
 
void setElevationOffsetMode (bool elevation)
 
void convertLinkOffsets (bool toElevation, bool convertValues)
 
void reloadElevationOffsetModeFromEngine ()
 
bool loadModel (QList< QString > &warnings, QList< QString > &errors)
 
void attachMeshLayer (class SWMM2DMeshLayer *meshLayer, bool pristine=false)
 Subscribe a 2D mesh layer's edit signals to the project's dirty flag.
 
void importMeshFileAsync (const QString &srcPath)
 Browse-and-load an existing SWMMVis 2D mesh (.2dm) into this project.
 
void loadModelAsync (class OpenProgressModel *progress=nullptr)
 Non-blocking variant of loadModel().
 
bool initializeBlankModel (const SWMMModelLayer::NewProjectSpec &spec, QList< QString > &warnings, QList< QString > &errors)
 In-memory File → New: build a blank BUILDING-state engine from spec (SWMMModelLayer::adoptNewEngine) and finish the load synchronously. The window keeps its empty model path until the first Save As.
 
bool save (QString *errorOut=nullptr)
 Save the model to its current path or to a new path.
 
bool saveAs (const QString &newPath, QString *errorOut=nullptr)
 
QStringList lastSaveWarnings () const
 
bool hasChanges () const
 
void setHasChanges (bool dirty)
 
bool isEditSessionActive () const
 
void setEditSessionActive (bool active)
 
bool isUntitled () const
 
bool isClosing () const
 
void markUntitled ()
 
void activatePanTool ()
 
void activateZoomInTool ()
 
void activateZoomOutTool ()
 
void activateSelectTool ()
 
void activateSelectByPolygonTool ()
 
void activateMeasureTool ()
 
void activateSelectProfileTool ()
 
void activatePick2DCellsTool ()
 
void activateMeshProfileTool ()
 
void activateAnalysisMeshProfileTool ()
 
void activateTerrainProfileTool ()
 
bool hasModelLayer () const
 
bool hasMeshLayer () const
 
void activateMeshSelectVertexTool ()
 
void activateMeshSelectEdgeTool ()
 
class OpenSWMMVisMapToolSelectselectTool () const
 
class OpenSWMMVisMapToolSelectProfileselectProfileTool () const
 
class OpenSWMMVisMapToolAddVirtualNodeaddVirtualJunctionTool () const
 
QList< OpenSWMMVisMapToolAddNode * > addNodeTools () const
 
class OpenSWMMVisMapToolAddInletNodeaddInletJunctionTool () const
 
class MapToolPick2DCellspick2DCellsTool () const
 
class MapToolMeshProfilemeshProfileTool () const
 
class openswmmvis::OutputStatsRegistrystatsRegistry () const
 
SWMMResultsLayeractiveResultsLayer () const
 
SWMM2DResultsLayeractive2DResultsLayer () const
 
void setActiveResultsLayer (SWMMResultsLayer *layer)
 
void setActive2DResultsLayer (SWMM2DResultsLayer *layer)
 
void setPending2DResultsRestore (const QJsonArray &entries)
 
QJsonArray pending2DResultsRestore () const
 
void clearPending2DResultsRestore ()
 
QHash< class OpenSWMMVisMapTool *, QString > toolActionKeys () const
 
void activateAddJunctionTool ()
 
void activateAddVirtualJunctionTool ()
 
void activateAddInletJunctionTool ()
 
void activateAddOutfallTool ()
 
void activateAddStorageTool ()
 
void activateAddDividerTool ()
 
void activateAddConduitTool ()
 
void activateAddPumpTool ()
 
void activateAddOrificeTool ()
 
void activateAddWeirTool ()
 
void activateAddOutletTool ()
 
void activateAddGageTool ()
 
void activateAddSubcatchmentTool ()
 
void activateAddTextTool ()
 
void zoomToFullExtent ()
 
OpenSWMMVisAnnotationLayerannotationLayer () const
 
OpenSWMMVisAnnotationLayerensureAnnotationLayer ()
 
bool isAutoLengthEnabled () const
 
void setAutoLengthEnabled (bool enabled)
 
QString engineVersion () const
 
void setEngineVersion (const QString &version)
 
QString notesHtml () const
 
void setNotesHtml (const QString &html)
 
QString activeTerrainLayerPath () const
 
GISRasterLayeractiveTerrain () const
 
double terrainVertFactor () const
 
double terrainNodeOffset () const
 
double terrainLinkOffset () const
 
void setActiveTerrain (GISRasterLayer *layer)
 Sets the active terrain raster and propagates it to all add-node and add-link tools owned by this window.
 
void setTerrainNodeOffset (double offset)
 
void setTerrainLinkOffset (double offset)
 
QString terrainVerticalUnit () const
 
void setTerrainVerticalUnit (const QString &unit)
 Sets the terrain raster's vertical unit and updates the conversion factor applied when computing node/link invert elevations.
 
void restoreTerrainState (const QString &absoluteLayerPath, double nodeOffset, double linkOffset, const QString &vertUnit=QString())
 Restores terrain state from a persisted .oswp session. Called by ProjectSerializer::applySession after all layers are loaded.
 

Protected Member Functions

void closeEvent (QCloseEvent *event) override
 
void changeEvent (QEvent *event) override
 
bool eventFilter (QObject *watched, QEvent *event) override
 

Detailed Description

MDI sub-window owning a MapCanvas, SWMMModelLayer, and map tools.

One instance is created per opened .inp file.

Constructor & Destructor Documentation

◆ SWMMVisProjectWindow()

SWMMVisProjectWindow::SWMMVisProjectWindow ( OpenSWMMVisWorkspace workspace,
const QString &  filePath = QString(),
QWidget *  parent = nullptr 
)
explicit
Here is the call graph for this function:

◆ ~SWMMVisProjectWindow()

SWMMVisProjectWindow::~SWMMVisProjectWindow ( )
overridedefault

Member Function Documentation

◆ aboutToClose

void SWMMVisProjectWindow::aboutToClose ( )
signal

Fires once during closeEvent, AFTER the user-prompt save / cancel decision is committed but BEFORE the QMdiSubWindow teardown has begun. All owned QObjects (model layer, results layers, canvas, etc.) are still alive and safe to dereference. External windows that hold raw back-pointers to this project (e.g. ProfilePlotDialog) connect here so they can drop their references gracefully — using QObject::destroyed instead is unsafe because by the time it fires the children are already gone.

Here is the caller graph for this function:

◆ activateAddConduitTool()

void SWMMVisProjectWindow::activateAddConduitTool ( )
Here is the call graph for this function:

◆ activateAddDividerTool()

void SWMMVisProjectWindow::activateAddDividerTool ( )
Here is the call graph for this function:

◆ activateAddGageTool()

void SWMMVisProjectWindow::activateAddGageTool ( )
Here is the call graph for this function:

◆ activateAddInletJunctionTool()

void SWMMVisProjectWindow::activateAddInletJunctionTool ( )
Here is the call graph for this function:

◆ activateAddJunctionTool()

void SWMMVisProjectWindow::activateAddJunctionTool ( )
Here is the call graph for this function:

◆ activateAddOrificeTool()

void SWMMVisProjectWindow::activateAddOrificeTool ( )
Here is the call graph for this function:

◆ activateAddOutfallTool()

void SWMMVisProjectWindow::activateAddOutfallTool ( )
Here is the call graph for this function:

◆ activateAddOutletTool()

void SWMMVisProjectWindow::activateAddOutletTool ( )
Here is the call graph for this function:

◆ activateAddPumpTool()

void SWMMVisProjectWindow::activateAddPumpTool ( )
Here is the call graph for this function:

◆ activateAddStorageTool()

void SWMMVisProjectWindow::activateAddStorageTool ( )
Here is the call graph for this function:

◆ activateAddSubcatchmentTool()

void SWMMVisProjectWindow::activateAddSubcatchmentTool ( )
Here is the call graph for this function:

◆ activateAddTextTool()

void SWMMVisProjectWindow::activateAddTextTool ( )
Here is the call graph for this function:

◆ activateAddVirtualJunctionTool()

void SWMMVisProjectWindow::activateAddVirtualJunctionTool ( )
Here is the call graph for this function:

◆ activateAddWeirTool()

void SWMMVisProjectWindow::activateAddWeirTool ( )
Here is the call graph for this function:

◆ activateAnalysisMeshProfileTool()

void SWMMVisProjectWindow::activateAnalysisMeshProfileTool ( )

Slice US.A1 — the ANALYSIS-toolbar 2D-surface profile tool: traces the same polyline but plots ground + animated depth + envelope against the active 2D results layer (emits analysisMeshProfileTraced). A second MapToolMeshProfile instance so its checked state tracks actionPlotProfile while the mesh-toolbar tool tracks actionMeshProfile independently.

Here is the call graph for this function:

◆ activateMeasureTool()

void SWMMVisProjectWindow::activateMeasureTool ( )
Here is the call graph for this function:

◆ activateMeshProfileTool()

void SWMMVisProjectWindow::activateMeshProfileTool ( )

Trace a free-form polyline across the 2D mesh to plot a longitudinal profile. Lazy-creates the tool; toggles back to Select when already active (mirrors activateSelectProfileTool).

Slice US.A1 — this is the MESH-TOOLBAR profile tool: bed/terrain only (emits meshProfileTraced, routed to a results=nullptr dialog). The Analysis-toolbar water-depth variant is activateAnalysisMeshProfileTool.

Here is the call graph for this function:

◆ activateMeshSelectEdgeTool()

void SWMMVisProjectWindow::activateMeshSelectEdgeTool ( )

Slice §V.VB — activate the Mesh Edge Select tool. Lazy-creates on first call.

Here is the call graph for this function:

◆ activateMeshSelectVertexTool()

void SWMMVisProjectWindow::activateMeshSelectVertexTool ( )

Slice §V.VB — activate the Mesh Vertex Select tool. Lazy-creates on first call.

Here is the call graph for this function:

◆ activatePanTool()

void SWMMVisProjectWindow::activatePanTool ( )
Here is the call graph for this function:

◆ activatePick2DCellsTool()

void SWMMVisProjectWindow::activatePick2DCellsTool ( )

Slice CF.3 — activate the Pick 2D Cells tool on this canvas. Lazy-creates the tool on first call. No-op when no 2D results layer is loaded.

Here is the call graph for this function:

◆ activateSelectByPolygonTool()

void SWMMVisProjectWindow::activateSelectByPolygonTool ( )
Here is the call graph for this function:

◆ activateSelectProfileTool()

void SWMMVisProjectWindow::activateSelectProfileTool ( )
Here is the call graph for this function:

◆ activateSelectTool()

void SWMMVisProjectWindow::activateSelectTool ( )
Here is the call graph for this function:

◆ activateTerrainProfileTool()

void SWMMVisProjectWindow::activateTerrainProfileTool ( )

The TERRAIN-TOOLBAR profile tool: traces the same polyline but plots a ground profile sampled from the active DEM raster rather than the 2D mesh (emits terrainProfileTraced). A third MapToolMeshProfile instance — the tool is purely geometric — so its checked state tracks actionTerrainProfile independently of the two mesh profile actions.

Here is the call graph for this function:

◆ activateZoomInTool()

void SWMMVisProjectWindow::activateZoomInTool ( )
Here is the call graph for this function:

◆ activateZoomOutTool()

void SWMMVisProjectWindow::activateZoomOutTool ( )
Here is the call graph for this function:

◆ active2DResultsLayer()

SWMM2DResultsLayer * SWMMVisProjectWindow::active2DResultsLayer ( ) const

Active 2D results layer for analysis tools (may be null).

◆ active2DResultsLayerChanged

void SWMMVisProjectWindow::active2DResultsLayerChanged ( SWMM2DResultsLayer layer)
signal
Here is the caller graph for this function:

◆ activeResultsLayer()

SWMMResultsLayer * SWMMVisProjectWindow::activeResultsLayer ( ) const

Active 1D results layer for analysis tools (may be null). Defined out-of-line so the QPointer→T* conversion is only instantiated in the .cpp (which includes the full layer headers); a forward declaration is insufficient for QPointer's internal static_cast.

Here is the caller graph for this function:

◆ activeResultsLayerChanged

void SWMMVisProjectWindow::activeResultsLayerChanged ( SWMMResultsLayer layer)
signal

Fires when the active 1D / 2D results layer changes (including to null). The main window re-points the shared AnimationController, the analysis-toolbar combos, and the layer-tree check-state at these.

Here is the caller graph for this function:

◆ activeTerrain()

GISRasterLayer * SWMMVisProjectWindow::activeTerrain ( ) const
inline

Direct (non-owning) accessor to the active terrain raster. Used by Slice BC's profile plot when the user wants the ground line to follow a DEM rather than the rim formula (invert + maxDepth).

◆ activeTerrainChanged

void SWMMVisProjectWindow::activeTerrainChanged ( GISRasterLayer newTerrain)
signal

Slice BC — fires whenever the active terrain raster changes (set / cleared / swapped) or its vertical-unit conversion factor is updated. The profile-plot dialog listens so the ground line stays in sync with the toolbar's terrain selection.

Here is the caller graph for this function:

◆ activeTerrainLayerPath()

QString SWMMVisProjectWindow::activeTerrainLayerPath ( ) const

Returns the file path of the active terrain raster (empty if none).

◆ addInletJunctionTool()

class OpenSWMMVisMapToolAddInletNode * SWMMVisProjectWindow::addInletJunctionTool ( ) const
inline

Inlet-junction insertion tool (click-a-street-conduit split). Exposed for the same reason as the virtual-junction tool above.

◆ addNodeTools()

QList< OpenSWMMVisMapToolAddNode * > SWMMVisProjectWindow::addNodeTools ( ) const
inline

The generic add-node tools (junction / outfall / storage / divider), which also split a conduit when the click lands on one. Exposed so SWMMVis can route their statusMessageChanged to the status bar.

◆ addVirtualJunctionTool()

class OpenSWMMVisMapToolAddVirtualNode * SWMMVisProjectWindow::addVirtualJunctionTool ( ) const
inline

Virtual-junction insertion tool (click-a-conduit split). Exposed so SWMMVis can route its statusMessageChanged to the status bar.

◆ analysisMeshProfileTraced

void SWMMVisProjectWindow::analysisMeshProfileTraced ( const QVector< QPointF > &  scenePolyline)
signal
Here is the caller graph for this function:

◆ annotationLayer()

OpenSWMMVisAnnotationLayer * SWMMVisProjectWindow::annotationLayer ( ) const
inline

Annotation layer for user-placed text labels. Lazily added to the canvas on first text placement; non-null after that point.

◆ attachMeshLayer()

void SWMMVisProjectWindow::attachMeshLayer ( class SWMM2DMeshLayer meshLayer,
bool  pristine = false 
)

Subscribe a 2D mesh layer's edit signals to the project's dirty flag.

Every mesh mutation funnels through SWMM2DMeshLayer::apply* and reports via attributeChanged / meshEditsChanged. Without this the project stays "clean" after a cell edit, so Run skips its auto-save and the engine re-reads the stale .inp — the edit silently never reaches the solver. Call once per mesh layer, right after it joins the canvas.

Parameters
pristinePass true only when the layer was built from the very file the engine parsed, so the two meshes are known to agree and the save path may skip re-pushing this layer until something edits it. The default (false) is the safe one: a mesh generated or imported in-session leaves the engine holding the old mesh.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ autoLengthChanged

void SWMMVisProjectWindow::autoLengthChanged ( bool  enabled)
signal
Here is the caller graph for this function:

◆ canvas()

MapCanvas * SWMMVisProjectWindow::canvas ( ) const
Here is the caller graph for this function:

◆ changeEvent()

void SWMMVisProjectWindow::changeEvent ( QEvent *  event)
overrideprotected

◆ clearPending2DResultsRestore()

void SWMMVisProjectWindow::clearPending2DResultsRestore ( )
inline

◆ closeEvent()

void SWMMVisProjectWindow::closeEvent ( QCloseEvent *  event)
overrideprotected
Here is the call graph for this function:

◆ convertLinkOffsets()

void SWMMVisProjectWindow::convertLinkOffsets ( bool  toElevation,
bool  convertValues 
)

Apply the answer to the legacy UpdateOffsets convert prompt after the mode flip (see SWMMModelLayer::convertLinkOffsets) and mark the project dirty.

Parameters
toElevationthe mode switched TO;
convertValuesthe prompt answer (true = Yes).
Here is the call graph for this function:

◆ editSessionChanged

void SWMMVisProjectWindow::editSessionChanged ( bool  active)
signal
Here is the caller graph for this function:

◆ engineVersion()

QString SWMMVisProjectWindow::engineVersion ( ) const
inline

Engine version selector (e.g., "5.3.0", "6.0.0", "6.0.0-alpha.1"). Per-project, persisted to project file.

◆ ensureAnnotationLayer()

OpenSWMMVisAnnotationLayer * SWMMVisProjectWindow::ensureAnnotationLayer ( )

Get-or-create accessor used by ProjectSerializer to restore annotations before any tool has been activated.

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

◆ eventFilter()

bool SWMMVisProjectWindow::eventFilter ( QObject *  watched,
QEvent *  event 
)
overrideprotected

◆ hasChanges()

bool SWMMVisProjectWindow::hasChanges ( ) const
inline

Whether the project has unsaved changes.

Here is the caller graph for this function:

◆ hasChangesChanged

void SWMMVisProjectWindow::hasChangesChanged ( bool  dirty)
signal
Here is the caller graph for this function:

◆ hasMeshLayer()

bool SWMMVisProjectWindow::hasMeshLayer ( ) const
Here is the call graph for this function:

◆ hasModelLayer()

bool SWMMVisProjectWindow::hasModelLayer ( ) const

Slice US.A2 — availability probes for the context-sensitive Plot Profile dispatcher: is there a 1D SWMM model / a 2D mesh on the canvas?

Here is the call graph for this function:

◆ importMeshFileAsync()

void SWMMVisProjectWindow::importMeshFileAsync ( const QString &  srcPath)

Browse-and-load an existing SWMMVis 2D mesh (.2dm) into this project.

Until now a .2dm could only reach a model by already sitting next to its .inp (Simulation Options → Mesh only lists siblings of the model file). This stages a mesh from anywhere on disk: the file is copied next to the .inp when it lives elsewhere — so the saved [2D_MESH_FILE] reference stays relative and the project remains portable — then parsed and built on a worker thread and added to the canvas as the ACTIVE external mesh. That is the layer the save path retargets [2D_MESH_FILE] at, so the import survives save → reopen.

Existing mesh layers are kept (merely deactivated); a layer already reading the destination file is replaced rather than stacked, matching the mesh-generation path.

Asynchronous — the outcome arrives via meshImportFinished().

Here is the call graph for this function:

◆ initializeBlankModel()

bool SWMMVisProjectWindow::initializeBlankModel ( const SWMMModelLayer::NewProjectSpec spec,
QList< QString > &  warnings,
QList< QString > &  errors 
)

In-memory File → New: build a blank BUILDING-state engine from spec (SWMMModelLayer::adoptNewEngine) and finish the load synchronously. The window keeps its empty model path until the first Save As.

Here is the call graph for this function:

◆ isAutoLengthEnabled()

bool SWMMVisProjectWindow::isAutoLengthEnabled ( ) const
inline

Auto-length recalculates conduit length from polyline on every endpoint / vertex edit. Per-project, persisted to QSettings.

◆ isClosing()

bool SWMMVisProjectWindow::isClosing ( ) const
inline

True from the moment closeEvent() commits to closing (just before aboutToClose() fires) — the window is still in the MDI area's subWindowList() then, so callers that scan it for "live" project windows must skip a closing one or they rebind to a dying canvas.

◆ isEditSessionActive()

bool SWMMVisProjectWindow::isEditSessionActive ( ) const
inline

Whether an editing session is active (gate for all geometry mutations).

◆ isElevationOffsetMode()

bool SWMMVisProjectWindow::isElevationOffsetMode ( ) const
inline

Offset mode (LINK_OFFSETS option). True = ELEVATION, false = DEPTH.

◆ isUntitled()

bool SWMMVisProjectWindow::isUntitled ( ) const
inline

Slice Y — flag a window as a fresh, never-saved project. Untitled windows skip recent-files registration, force the title to "Untitled[*]", route Save through Save As, and always prompt on close (Save As… / Discard / Cancel) — the model lives only in memory until the first successful Save As clears the flag.

Here is the caller graph for this function:

◆ lastSaveWarnings()

QStringList SWMMVisProjectWindow::lastSaveWarnings ( ) const
inline

Engine warnings the LAST successful saveAs() produced (empty when the save was clean, or none has run). The writer reports through the engine's warning list — notably "embedded [REACTION_*] sections are lost from this save" (engine 7d43a1ff) — and saveAs() captures the delta across the write so callers and tests can see exactly what THIS save said, not the whole accumulated history.

◆ loadModel()

bool SWMMVisProjectWindow::loadModel ( QList< QString > &  warnings,
QList< QString > &  errors 
)
Here is the call graph for this function:

◆ loadModelAsync()

void SWMMVisProjectWindow::loadModelAsync ( class OpenProgressModel progress = nullptr)

Non-blocking variant of loadModel().

Runs the engine create+open (the dominant cost — full .inp parse) in a QtConcurrent worker so the GUI event loop stays responsive; completes the load (SoA adoption, CRS resolution, canvas zoom) on the GUI thread and then emits modelLoadFinished(). Safe against the window being closed mid-load.

Parameters
progressOptional determinate-progress sink. The worker reports into the EngineParse / SoaCopy / GeomCache stages; null is the "nobody is watching" case used by tests and the sync path.
Here is the call graph for this function:

◆ markUntitled()

void SWMMVisProjectWindow::markUntitled ( )

◆ meshEdgeFluxRequested

void SWMMVisProjectWindow::meshEdgeFluxRequested ( class SWMM2DMeshLayer mesh,
int  triIdx,
int  edgeLocal,
openswmmvis::plot::PlotAttribute  attr 
)
signal

Forwards MapToolMeshSelectEdge::plotEdgeFluxRequested up to the main window so it can open the comparison plot with the edge's flow OR flux series (carried by attr).

Here is the caller graph for this function:

◆ meshEdgeStatusMessage

void SWMMVisProjectWindow::meshEdgeStatusMessage ( const QString &  message)
signal

Forwards MapToolMeshSelectEdge::statusMessageChanged (Ctrl-click boundary path picking hints) up to the main window's status bar.

Here is the caller graph for this function:

◆ meshImportFinished

void SWMMVisProjectWindow::meshImportFinished ( bool  ok,
const QString &  message,
const QString &  meshPath 
)
signal

Completion signal for importMeshFileAsync(): fired exactly once per call, on the GUI thread. meshPath is the file the new layer reads (the copy inside the project folder, when one was made) and is empty on failure. message is user-facing (an error, or a summary plus any reader warning).

Here is the caller graph for this function:

◆ meshProfileTool()

class MapToolMeshProfile * SWMMVisProjectWindow::meshProfileTool ( ) const
inline

Free-form 2D-mesh profile-trace tool. Null until first activation.

◆ meshProfileTraced

void SWMMVisProjectWindow::meshProfileTraced ( const QVector< QPointF > &  scenePolyline)
signal

Forwards MapToolMeshProfile::profilePathTraced up to the main window so it can open the MeshProfilePlotDialog. The polyline is in scene coords (sx = mapX, sy = -mapY).

Slice US.A1 — meshProfileTraced is the MESH-TOOLBAR (bed-only) channel; analysisMeshProfileTraced is the ANALYSIS (ground+depth+envelope) channel. Same polyline payload; different dialog target.

Here is the caller graph for this function:

◆ meshVertexSeriesRequested

void SWMMVisProjectWindow::meshVertexSeriesRequested ( class SWMM2DMeshLayer mesh,
const QVector< int > &  vertexIdxList,
const QVector< openswmmvis::plot::PlotAttribute > &  attrs 
)
signal

Forwards MapToolMeshSelectVertex::plotVertexSeriesRequested up to the main window so it can plot the chosen interpolated attributes (depth / HGL) for the vertices.

Here is the caller graph for this function:

◆ modelLayer()

SWMMModelLayer * SWMMVisProjectWindow::modelLayer ( ) const
Here is the caller graph for this function:

◆ modelLoaded

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

◆ modelLoadError

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

◆ modelLoadFinished

void SWMMVisProjectWindow::modelLoadFinished ( bool  ok,
const QList< QString > &  warnings,
const QList< QString > &  errors 
)
signal

Completion signal for loadModelAsync(): fired exactly once per call, on the GUI thread, after the model is fully adopted (success) or the open failed. Warnings/errors carry the same diagnostics the sync loadModel() returns via out-params.

◆ notesHtml()

QString SWMMVisProjectWindow::notesHtml ( ) const
inline

Rich-text notes mirrored to the engine's [TITLE] section as plain text. HTML form is preserved in the .oswp sidecar; the engine only ever sees the flattened plain text.

Here is the caller graph for this function:

◆ offsetModeChanged

void SWMMVisProjectWindow::offsetModeChanged ( bool  elevation)
signal
Here is the caller graph for this function:

◆ pending2DResultsRestore()

QJsonArray SWMMVisProjectWindow::pending2DResultsRestore ( ) const
inline

◆ pick2DCellsPicked

void SWMMVisProjectWindow::pick2DCellsPicked ( class SWMM2DResultsLayer layer,
const QVector< int > &  triIdxList,
const QVector< openswmmvis::plot::PlotAttribute > &  attrs 
)
signal

Slice CF.3 — forwards MapToolPick2DCells::cellsPicked up to the main window so it can open the Comparison Plot Dialog.

Here is the caller graph for this function:

◆ pick2DCellsTool()

class MapToolPick2DCells * SWMMVisProjectWindow::pick2DCellsTool ( ) const
inline

Slice CF.3 — Pick 2D mesh cells tool (box + lasso). Returns null until a SWMM2DResultsLayer exists on the canvas (created lazily on first access via activatePick2DCellsTool).

◆ reloadElevationOffsetModeFromEngine()

void SWMMVisProjectWindow::reloadElevationOffsetModeFromEngine ( )

Re-read LINK_OFFSETS from the engine into the cached mElevationOffsetMode flag. Used by the main-window listener for SWMMModelLayer::optionsChanged so the status-bar checkbox refreshes after a Simulation Options Apply.

Here is the call graph for this function:

◆ restoreTerrainState()

void SWMMVisProjectWindow::restoreTerrainState ( const QString &  absoluteLayerPath,
double  nodeOffset,
double  linkOffset,
const QString &  vertUnit = QString() 
)

Restores terrain state from a persisted .oswp session. Called by ProjectSerializer::applySession after all layers are loaded.

Parameters
absoluteLayerPathAbsolute path of the saved raster (may be empty).
nodeOffsetSaved node invert offset.
linkOffsetSaved link invert offset.
vertUnitSaved vertical unit ("m" or "ft").
Here is the call graph for this function:

◆ save()

bool SWMMVisProjectWindow::save ( QString *  errorOut = nullptr)

Save the model to its current path or to a new path.

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

◆ saveAs()

bool SWMMVisProjectWindow::saveAs ( const QString &  newPath,
QString *  errorOut = nullptr 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ saveCompletedWithEngineWarnings

void SWMMVisProjectWindow::saveCompletedWithEngineWarnings ( const QStringList &  warnings)
signal

Fired after a SUCCESSFUL save whose engine write emitted warnings — the save-time analogue of the open path's warning routing. The list is the delta across this write only. Data-loss notices (embedded [REACTION_*] dropped) arrive here; SWMMVis routes every entry to the log panel and escalates the data-loss family to a modal.

Here is the caller graph for this function:

◆ selectionManager()

SelectionManager * SWMMVisProjectWindow::selectionManager ( ) const

◆ selectProfileTool()

class OpenSWMMVisMapToolSelectProfile * SWMMVisProjectWindow::selectProfileTool ( ) const
inline

Same direct-access pattern for Slice BC's profile tool — lets SWMMVis connect profilePathSelected to the ProfilePlotDialog spawner.

◆ selectTool()

class OpenSWMMVisMapToolSelect * SWMMVisProjectWindow::selectTool ( ) const
inline

Direct access to the Select tool so the main window can wire its context-menu plotTimeSeriesRequested into the same chart dialog that Object Browser right-clicks use.

◆ setActive2DResultsLayer()

void SWMMVisProjectWindow::setActive2DResultsLayer ( SWMM2DResultsLayer layer)

Set the active 2D results layer. Same contract as the 1D setter.

Here is the call graph for this function:

◆ setActiveResultsLayer()

void SWMMVisProjectWindow::setActiveResultsLayer ( SWMMResultsLayer layer)

Set the active 1D results layer. No-op if unchanged. Rejects a layer not currently on this window's canvas. Passing nullptr clears the selection (analysis tools then report "no results"). Emits activeResultsLayerChanged on a real change.

Here is the call graph for this function:

◆ setActiveTerrain()

void SWMMVisProjectWindow::setActiveTerrain ( GISRasterLayer layer)

Sets the active terrain raster and propagates it to all add-node and add-link tools owned by this window.

Parameters
layerRaster layer to sample; nullptr = no terrain assistance.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAutoLengthEnabled()

void SWMMVisProjectWindow::setAutoLengthEnabled ( bool  enabled)
Here is the call graph for this function:

◆ setEditSessionActive()

void SWMMVisProjectWindow::setEditSessionActive ( bool  active)
Here is the call graph for this function:

◆ setElevationOffsetMode()

void SWMMVisProjectWindow::setElevationOffsetMode ( bool  elevation)
Here is the call graph for this function:

◆ setEngineVersion()

void SWMMVisProjectWindow::setEngineVersion ( const QString &  version)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHasChanges()

void SWMMVisProjectWindow::setHasChanges ( bool  dirty)

Mark the project dirty/clean (also updates the title).

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

◆ setNotesHtml()

void SWMMVisProjectWindow::setNotesHtml ( const QString &  html)
inline

◆ setPending2DResultsRestore()

void SWMMVisProjectWindow::setPending2DResultsRestore ( const QJsonArray &  entries)
inline

2D results restore entries stashed by ProjectSerializer::applySession (the .h5 open is asynchronous and runs after the sidecar applies). Consumed once by the 2D auto-load; entries carry absolute .h5 paths plus the persisted layer settings and sublayer styles.

◆ setTerrainLinkOffset()

void SWMMVisProjectWindow::setTerrainLinkOffset ( double  offset)

Sets link offset and forwards it to all add-link tools.

Here is the call graph for this function:

◆ setTerrainNodeOffset()

void SWMMVisProjectWindow::setTerrainNodeOffset ( double  offset)

Sets node offset and forwards it to all add-node tools.

Here is the call graph for this function:

◆ setTerrainVerticalUnit()

void SWMMVisProjectWindow::setTerrainVerticalUnit ( const QString &  unit)

Sets the terrain raster's vertical unit and updates the conversion factor applied when computing node/link invert elevations.

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

◆ statsRegistry()

class openswmmvis::OutputStatsRegistry * SWMMVisProjectWindow::statsRegistry ( ) const
inline

Slice QA.2 — per-project registry that tags every loaded SWMMResultsLayer with a stable identity. Owned by the project window; lives for the project's lifetime. Consumers (the node attribute panel today, Slice CB Statistics dashboard tomorrow) read from this single source of truth so the "which output produced these stats?" answer is uniform across the GUI. Never null.

◆ terrainLinkOffset()

double SWMMVisProjectWindow::terrainLinkOffset ( ) const
inline

Signed link endpoint invert offset relative to terrain Z.

◆ terrainNodeOffset()

double SWMMVisProjectWindow::terrainNodeOffset ( ) const
inline

Signed node invert offset relative to terrain Z (model vertical units).

◆ terrainProfileTraced

void SWMMVisProjectWindow::terrainProfileTraced ( const QVector< QPointF > &  scenePolyline)
signal

The TERRAIN-TOOLBAR channel — same polyline payload, but the main window routes it to a RasterProfilePlotDialog sampling the active DEM raster.

Here is the caller graph for this function:

◆ terrainVertFactor()

double SWMMVisProjectWindow::terrainVertFactor ( ) const
inline

Multiplier that converts a raw raster sample (in the DEM's native vertical unit) into the model's vertical unit. Returns 1.0 when no terrain is active. Stays in sync with FLOW_UNITS changes via setTerrainVerticalUnit + the unitsChanged handler.

◆ terrainVerticalUnit()

QString SWMMVisProjectWindow::terrainVerticalUnit ( ) const
inline

Vertical unit of the active terrain raster ("m" or "ft").

◆ toolActionKeys()

QHash< OpenSWMMVisMapTool *, QString > SWMMVisProjectWindow::toolActionKeys ( ) const

Maps each tool pointer to a stable action-object-name key so the main window can sync toolbar checked states via activeToolChanged.

◆ unitSystem()

UnitSystem * SWMMVisProjectWindow::unitSystem ( ) const

◆ zoomToFullExtent()

void SWMMVisProjectWindow::zoomToFullExtent ( )
Here is the call graph for this function:

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