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

Embeddable object-navigation widget. Mirrors the legacy Delphi browser's per-type collapsible groups but sits on top of a virtualised QAbstractItemModel so millions of objects don't stall the UI. More...

#include <objectbrowserpanel.h>

Inheritance diagram for ObjectBrowserPanel:
Collaboration diagram for ObjectBrowserPanel:

Signals

void plotTimeSeriesRequested (const SWMMObjectRef &object)
 Emitted when the user picks "Plot Time Series" from the right-click menu and exactly one results layer (.out) is loaded — the receiver picks that single layer implicitly.
 
void plotTimeSeriesForLayerRequested (const SWMMObjectRef &object, SWMMResultsLayer *layer)
 Emitted when more than one .out is loaded and the user picks a specific results layer from the "Plot Time Series ▸" submenu. The receiver plots object against that exact layer (no auto-pick-first-found fallback).
 
void rainfallVisualizationRequested (const SWMMObjectRef &object)
 Emitted when the user picks "Rainfall Visualization…" from a rain gage's right-click menu. The dialog shows every gage; object is carried for a future pre-highlight.
 

Public Member Functions

 ObjectBrowserPanel (QWidget *parent=nullptr)
 
 ~ObjectBrowserPanel () override
 
void setProject (SWMMModelLayer *layer, SelectionManager *selMgr, MapCanvas *canvas=nullptr)
 Bind the panel to a project's model layer + selection bus + canvas.
 
void refresh ()
 Rebuild the backing model from the bound layer. Call after SWMMModelLayer::modelLoaded fires, or after bulk add/remove changes the per-category counts.
 
void focusSearch ()
 Show + focus the search box and select its text (toolbar Search).
 
void selectCategory (SWMMModelLayer::Category c)
 Select + scroll to the category header for c (e.g. the "Storage" row when the user clicks the matching kind sub-row in the Layers panel). No-op when the category is empty/hidden. Runs under the applying-from-bus guard: a category header carries no object refs, so without the guard the tree-selection handler would push an empty Replace onto the SelectionManager and wipe the user's map selection.
 
void launchAddNewEditor (SWMMModelLayer::DataCategory dc)
 
void launchBrowseEditor (SWMMModelLayer::DataCategory dc)
 

Static Public Member Functions

static bool hasComplexEditor (SWMMModelLayer::DataCategory dc) noexcept
 
static QString gapTooltipFor (SWMMModelLayer::DataCategory dc)
 
static void openComprehensiveEditorFor (SWMMModelLayer *layer, QUndoStack *undoStack, const SWMMObjectRef &ref, QWidget *parent)
 

Detailed Description

Embeddable object-navigation widget. Mirrors the legacy Delphi browser's per-type collapsible groups but sits on top of a virtualised QAbstractItemModel so millions of objects don't stall the UI.

The panel is canvas-agnostic: it binds to a (SWMMModelLayer*, SelectionManager*) pair on every MDI tab switch via setProject(). Pass nulls to detach (empty tree, no signal traffic).

Constructor & Destructor Documentation

◆ ObjectBrowserPanel()

ObjectBrowserPanel::ObjectBrowserPanel ( QWidget *  parent = nullptr)
explicit

◆ ~ObjectBrowserPanel()

ObjectBrowserPanel::~ObjectBrowserPanel ( )
overridedefault

Member Function Documentation

◆ focusSearch()

void ObjectBrowserPanel::focusSearch ( )

Show + focus the search box and select its text (toolbar Search).

◆ gapTooltipFor()

QString ObjectBrowserPanel::gapTooltipFor ( SWMMModelLayer::DataCategory  dc)
static

Slice BM.0-Add-New — tooltip text for the disabled Add-New action on gap categories. Hardcoded mapping of category → future slice ID

  • editor name. Returns an empty string for categories where hasComplexEditor is true.
Here is the call graph for this function:

◆ hasComplexEditor()

bool ObjectBrowserPanel::hasComplexEditor ( SWMMModelLayer::DataCategory  dc)
staticnoexcept

Slice BM.0-Add-New (2026-05-24) — does this data category have a complex MVC editor wired into Add-New today? Returns true only for DataTimeSeries + DataHydrographs. Each future editor slice (BO/BP/BQ/BR) adds one more true case as it ships.

Here is the call graph for this function:

◆ launchAddNewEditor()

void ObjectBrowserPanel::launchAddNewEditor ( SWMMModelLayer::DataCategory  dc)

Slice BM.0-Add-New — launch the per-category complex editor in create mode. Asserts in debug if called with a gap category (the context menu disables those, so this should be unreachable in production paths).

Here is the call graph for this function:

◆ launchBrowseEditor()

void ObjectBrowserPanel::launchBrowseEditor ( SWMMModelLayer::DataCategory  dc)

2026-08-31 — launch the per-category complex editor in review/browse mode: nothing is created, the user picks from the editor's own list (and can create via its Add/New button). Used by the Data menu and the ribbon's Data Objects buttons. No-op for gap categories.

Here is the call graph for this function:

◆ openComprehensiveEditorFor()

void ObjectBrowserPanel::openComprehensiveEditorFor ( SWMMModelLayer layer,
QUndoStack *  undoStack,
const SWMMObjectRef ref,
QWidget *  parent 
)
static

2026-05-29 — Open the comprehensive editor for an existing data object referenced by ref, with that object pre-selected for editing. Shared between three surfaces: the object-browser leaf double-click, the object-browser leaf right-click "Edit…" menu, and the attribute-panel header "Open in <Editor>…" button.

Static so the attribute panel can dispatch without needing an object-browser instance; the dialogs are reused across calls via file-scope QPointer statics inside the implementation, so a single editor window is shared no matter which surface launched it. No-op for non-data refs (Node/Link/Subcatchment/Unknown) and for data kinds whose editor hasn't shipped.

Parameters
layerActive project's model layer; no-op when null.
undoStackCanvas undo stack to feed dialogs that take one; null is acceptable (editors work without undo).
refObject to open. Must carry a non-empty name.
parentQWidget parent for the spawned dialog.
Here is the call graph for this function:

◆ plotTimeSeriesForLayerRequested

void ObjectBrowserPanel::plotTimeSeriesForLayerRequested ( const SWMMObjectRef object,
SWMMResultsLayer layer 
)
signal

Emitted when more than one .out is loaded and the user picks a specific results layer from the "Plot Time Series ▸" submenu. The receiver plots object against that exact layer (no auto-pick-first-found fallback).

◆ plotTimeSeriesRequested

void ObjectBrowserPanel::plotTimeSeriesRequested ( const SWMMObjectRef object)
signal

Emitted when the user picks "Plot Time Series" from the right-click menu and exactly one results layer (.out) is loaded — the receiver picks that single layer implicitly.

◆ rainfallVisualizationRequested

void ObjectBrowserPanel::rainfallVisualizationRequested ( const SWMMObjectRef object)
signal

Emitted when the user picks "Rainfall Visualization…" from a rain gage's right-click menu. The dialog shows every gage; object is carried for a future pre-highlight.

◆ refresh()

void ObjectBrowserPanel::refresh ( )

Rebuild the backing model from the bound layer. Call after SWMMModelLayer::modelLoaded fires, or after bulk add/remove changes the per-category counts.

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

◆ selectCategory()

void ObjectBrowserPanel::selectCategory ( SWMMModelLayer::Category  c)

Select + scroll to the category header for c (e.g. the "Storage" row when the user clicks the matching kind sub-row in the Layers panel). No-op when the category is empty/hidden. Runs under the applying-from-bus guard: a category header carries no object refs, so without the guard the tree-selection handler would push an empty Replace onto the SelectionManager and wipe the user's map selection.

Here is the call graph for this function:

◆ setProject()

void ObjectBrowserPanel::setProject ( SWMMModelLayer layer,
SelectionManager selMgr,
MapCanvas canvas = nullptr 
)

Bind the panel to a project's model layer + selection bus + canvas.

Parameters
layerSWMM model layer for the active project (or nullptr).
selMgrSelectionManager owned by the same project (or nullptr).
canvasMapCanvas for zoom-to-object actions (or nullptr to disable them).
Here is the call graph for this function:

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