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

Embeddable widget containing the layer tree. More...

#include <layertreepanel.h>

Inheritance diagram for LayerTreePanel:
Collaboration diagram for LayerTreePanel:

Public Slots

void setActiveResultsLayer (SWMMResultsLayer *layer)
 Cache the project window's active 1D / 2D results layers so the context-menu "Set as Active Results Layer" entry can render a check-mark on the active one. Wired from the project window's activeResultsLayerChanged / active2DResultsLayerChanged signals.
 
void setActive2DResultsLayer (SWMM2DResultsLayer *layer)
 

Signals

void layerSelected (OpenSWMMVisLayer *layer)
 Emitted when the user selects a layer in the tree.
 
void kindSelected (OpenSWMMVisLayer *layer, int kindOrdinal)
 Emitted when the user selects a SWMM kind sub-row (e.g. "Storage"). kindOrdinal matches the SWMMModelLayer::Category enum value. Fires in addition to layerSelected (which collapses kind rows to their parent layer). SWMMVis listens and focuses the matching category in the Object Browser.
 
void layerPropertiesRequested (OpenSWMMVisLayer *layer, const QString &routingId=QString())
 Emitted when the user requests to view properties for a layer. routingId is empty for plain "Properties…"; the sentinel "symbology" (from "Styles ▸ Edit Symbology…") asks the dialog to open on the Symbology tab.
 
void attributeTableRequested (OpenSWMMVisLayer *layer)
 Emitted when the user picks "Open Attribute Table" on a layer's context menu. SWMMVis raises the Attribute Table dock and switches its source to layer.
 
void layerStyleRequested (OpenSWMMVisLayer *layer)
 Emitted when the user picks "Set Style…" on a layer's context menu. SWMMVis listens and opens the SymbologyDialog — same path as the animation-toolbar's Set Style action.
 
void layerKindStyleRequested (OpenSWMMVisLayer *layer, int kindOrdinal, const QString &rendererId)
 Slice BI-MK.LT — emitted when the user picks a Style option from a kind sub-row's right-click menu. kindOrdinal matches the SWMMModelLayer::Category enum value. rendererId is one of "single", "graduated", "categorized", "rule" (or empty meaning "open dialog without changing class"). SWMMVis listens and (a) swaps the kind's IFeatureRenderer to the matching class with sensible defaults, then (b) opens SymbologyDialog pre-scoped to that kind + tab when BI-MK.1 ships.
 
void plotKindObjectRequested (int kindOrdinal, const QString &objectName)
 Slice PT.1 — emitted when the user picks "Plot timeseries…" on a kind sub-row's right-click menu and selects an object name. SWMMVis listens and routes to its existing AT.2 picker (openTimeSeriesPlotFor) which pops the variable picker and opens the Comparison Plot Dialog.
 
void plotTimeSeriesFromOutputLayerRequested (class SWMMResultsLayer *layer)
 Emitted when the user right-clicks a SWMM Output (.out) layer and picks "Plot Time Series…". The receiver pops an object picker (type + id read from the .out) and then the variable picker, plotting against layer specifically. Lets the user anchor the plot to the data layer rather than the model.
 
void setActiveResultsLayerRequested (class SWMMResultsLayer *layer)
 Emitted when the user picks "Set as Active Results Layer" on a results layer's context menu. SWMMVis routes this to the project window's setActiveResultsLayer / setActive2DResultsLayer so the chosen layer becomes the target for all analysis tools.
 
void setActive2DResultsLayerRequested (class SWMM2DResultsLayer *layer)
 

Public Member Functions

 LayerTreePanel (MapCanvas *canvas=nullptr, QWidget *parent=nullptr)
 
 ~LayerTreePanel () override
 
OpenSWMMVisLayerselectedLayer () const
 Returns the currently selected layer, or nullptr.
 
void setCanvas (MapCanvas *canvas)
 Rebind the panel and its model to a different canvas.
 
LayerTreeModelmodel () const
 

Detailed Description

Embeddable widget containing the layer tree.

The panel shows the LayerTreeModel in a QTreeView. Layer-adding actions live on the main application toolbar (actionAddVectorData, actionAddRasterData, actionAddWMSData, actionAddBasemap, actionAddSWMMOutput). Per-layer operations (Zoom To, Remove, Move Up/Down, Show/Hide, Properties) live on the right-click context menu over a tree row.

The canvas binding is mutable — call setCanvas() on MDI tab switch to re-point the tree at the active project's canvas.

Constructor & Destructor Documentation

◆ LayerTreePanel()

LayerTreePanel::LayerTreePanel ( MapCanvas canvas = nullptr,
QWidget *  parent = nullptr 
)
explicit

◆ ~LayerTreePanel()

LayerTreePanel::~LayerTreePanel ( )
overridedefault

Member Function Documentation

◆ attributeTableRequested

void LayerTreePanel::attributeTableRequested ( OpenSWMMVisLayer layer)
signal

Emitted when the user picks "Open Attribute Table" on a layer's context menu. SWMMVis raises the Attribute Table dock and switches its source to layer.

◆ kindSelected

void LayerTreePanel::kindSelected ( OpenSWMMVisLayer layer,
int  kindOrdinal 
)
signal

Emitted when the user selects a SWMM kind sub-row (e.g. "Storage"). kindOrdinal matches the SWMMModelLayer::Category enum value. Fires in addition to layerSelected (which collapses kind rows to their parent layer). SWMMVis listens and focuses the matching category in the Object Browser.

◆ layerKindStyleRequested

void LayerTreePanel::layerKindStyleRequested ( OpenSWMMVisLayer layer,
int  kindOrdinal,
const QString &  rendererId 
)
signal

Slice BI-MK.LT — emitted when the user picks a Style option from a kind sub-row's right-click menu. kindOrdinal matches the SWMMModelLayer::Category enum value. rendererId is one of "single", "graduated", "categorized", "rule" (or empty meaning "open dialog without changing class"). SWMMVis listens and (a) swaps the kind's IFeatureRenderer to the matching class with sensible defaults, then (b) opens SymbologyDialog pre-scoped to that kind + tab when BI-MK.1 ships.

◆ layerPropertiesRequested

void LayerTreePanel::layerPropertiesRequested ( OpenSWMMVisLayer layer,
const QString &  routingId = QString() 
)
signal

Emitted when the user requests to view properties for a layer. routingId is empty for plain "Properties…"; the sentinel "symbology" (from "Styles ▸ Edit Symbology…") asks the dialog to open on the Symbology tab.

◆ layerSelected

void LayerTreePanel::layerSelected ( OpenSWMMVisLayer layer)
signal

Emitted when the user selects a layer in the tree.

◆ layerStyleRequested

void LayerTreePanel::layerStyleRequested ( OpenSWMMVisLayer layer)
signal

Emitted when the user picks "Set Style…" on a layer's context menu. SWMMVis listens and opens the SymbologyDialog — same path as the animation-toolbar's Set Style action.

◆ model()

LayerTreeModel * LayerTreePanel::model ( ) const
inline

◆ plotKindObjectRequested

void LayerTreePanel::plotKindObjectRequested ( int  kindOrdinal,
const QString &  objectName 
)
signal

Slice PT.1 — emitted when the user picks "Plot timeseries…" on a kind sub-row's right-click menu and selects an object name. SWMMVis listens and routes to its existing AT.2 picker (openTimeSeriesPlotFor) which pops the variable picker and opens the Comparison Plot Dialog.

◆ plotTimeSeriesFromOutputLayerRequested

void LayerTreePanel::plotTimeSeriesFromOutputLayerRequested ( class SWMMResultsLayer layer)
signal

Emitted when the user right-clicks a SWMM Output (.out) layer and picks "Plot Time Series…". The receiver pops an object picker (type + id read from the .out) and then the variable picker, plotting against layer specifically. Lets the user anchor the plot to the data layer rather than the model.

◆ selectedLayer()

OpenSWMMVisLayer * LayerTreePanel::selectedLayer ( ) const

Returns the currently selected layer, or nullptr.

Here is the call graph for this function:

◆ setActive2DResultsLayer

void LayerTreePanel::setActive2DResultsLayer ( SWMM2DResultsLayer layer)
slot

◆ setActive2DResultsLayerRequested

void LayerTreePanel::setActive2DResultsLayerRequested ( class SWMM2DResultsLayer layer)
signal

◆ setActiveResultsLayer

void LayerTreePanel::setActiveResultsLayer ( SWMMResultsLayer layer)
slot

Cache the project window's active 1D / 2D results layers so the context-menu "Set as Active Results Layer" entry can render a check-mark on the active one. Wired from the project window's activeResultsLayerChanged / active2DResultsLayerChanged signals.

◆ setActiveResultsLayerRequested

void LayerTreePanel::setActiveResultsLayerRequested ( class SWMMResultsLayer layer)
signal

Emitted when the user picks "Set as Active Results Layer" on a results layer's context menu. SWMMVis routes this to the project window's setActiveResultsLayer / setActive2DResultsLayer so the chosen layer becomes the target for all analysis tools.

◆ setCanvas()

void LayerTreePanel::setCanvas ( MapCanvas canvas)

Rebind the panel and its model to a different canvas.

Here is the call graph for this function:

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