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

Owner of the canonical selection set for one SWMM project. More...

#include <selectionmanager.h>

Inheritance diagram for SelectionManager:
Collaboration diagram for SelectionManager:

Public Types

enum  Mode {
  Replace = 0 ,
  Add = 1 ,
  Toggle = 2 ,
  Subtract = 3
}
 

Signals

void selectionChanged (const QSet< SWMMObjectRef > &current, const QSet< SWMMObjectRef > &added, const QSet< SWMMObjectRef > &removed)
 Emitted on every set change. added / removed are disjoint and convey the delta from the previous selection.
 

Public Member Functions

 SelectionManager (QObject *parent=nullptr)
 
 ~SelectionManager () override
 
void select (const QSet< SWMMObjectRef > &refs, Mode mode=Replace)
 Apply refs to the current selection using mode.
 
void select (const SWMMObjectRef &ref, Mode mode=Replace)
 Convenience overload for a single ref.
 
void clear ()
 Drop everything. Equivalent to select({}, Replace).
 
const QSet< SWMMObjectRef > & selection () const
 Read-only view of the current selection.
 
bool contains (const SWMMObjectRef &ref) const
 True if ref is in the current selection.
 
int size () const
 
bool isEmpty () const
 

Detailed Description

Owner of the canonical selection set for one SWMM project.

The four selection modes follow the QGIS / ArcGIS Pro vocabulary:

  • Replace — discard the current selection and use refs as the new one.
  • Add — union with the current selection.
  • Toggle — flip each ref's membership (selected ↔ unselected).
  • Subtract — remove each ref from the current selection.

selectionChanged(current, added, removed) is emitted whenever the set changes; the added and removed sets let subscribers do incremental updates instead of diffing their own copy of current.

Member Enumeration Documentation

◆ Mode

Enumerator
Replace 
Add 
Toggle 
Subtract 

Constructor & Destructor Documentation

◆ SelectionManager()

SelectionManager::SelectionManager ( QObject *  parent = nullptr)
explicit

◆ ~SelectionManager()

SelectionManager::~SelectionManager ( )
overridedefault

Member Function Documentation

◆ clear()

void SelectionManager::clear ( )

Drop everything. Equivalent to select({}, Replace).

◆ contains()

bool SelectionManager::contains ( const SWMMObjectRef ref) const
inline

True if ref is in the current selection.

◆ isEmpty()

bool SelectionManager::isEmpty ( ) const
inline

◆ select() [1/2]

void SelectionManager::select ( const QSet< SWMMObjectRef > &  refs,
Mode  mode = Replace 
)

Apply refs to the current selection using mode.

Here is the caller graph for this function:

◆ select() [2/2]

void SelectionManager::select ( const SWMMObjectRef ref,
Mode  mode = Replace 
)

Convenience overload for a single ref.

Here is the call graph for this function:

◆ selection()

const QSet< SWMMObjectRef > & SelectionManager::selection ( ) const
inline

Read-only view of the current selection.

◆ selectionChanged

void SelectionManager::selectionChanged ( const QSet< SWMMObjectRef > &  current,
const QSet< SWMMObjectRef > &  added,
const QSet< SWMMObjectRef > &  removed 
)
signal

Emitted on every set change. added / removed are disjoint and convey the delta from the previous selection.

Here is the caller graph for this function:

◆ size()

int SelectionManager::size ( ) const
inline

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