16#ifndef SELECTIONMANAGER_H
17#define SELECTIONMANAGER_H
127 void select(
const QSet<SWMMObjectRef> &refs,
Mode mode = Replace);
136 [[nodiscard]]
const QSet<SWMMObjectRef> &
selection()
const {
return m_selection; }
140 {
return m_selection.contains(
ref); }
142 [[nodiscard]]
int size()
const {
return m_selection.size(); }
143 [[nodiscard]]
bool isEmpty()
const {
return m_selection.isEmpty(); }
149 const QSet<SWMMObjectRef> &added,
150 const QSet<SWMMObjectRef> &removed);
153 void applyChange(
const QSet<SWMMObjectRef> &next);
155 QSet<SWMMObjectRef> m_selection;
Owner of the canonical selection set for one SWMM project.
Definition selectionmanager.h:112
bool contains(const SWMMObjectRef &ref) const
True if ref is in the current selection.
Definition selectionmanager.h:139
bool isEmpty() const
Definition selectionmanager.h:143
Mode
Definition selectionmanager.h:116
int size() const
Definition selectionmanager.h:142
const QSet< SWMMObjectRef > & selection() const
Read-only view of the current selection.
Definition selectionmanager.h:136
void selectionChanged(const QSet< SWMMObjectRef > ¤t, const QSet< SWMMObjectRef > &added, const QSet< SWMMObjectRef > &removed)
Emitted on every set change. added / removed are disjoint and convey the delta from the previous sele...
~SelectionManager() override
DiagramType t
Definition diagramspec.cpp:20
std::size_t n
Definition mesh2dresultsexport.cpp:426
QuadRegionMode mode
Resolved mode.
Definition meshgenerator.cpp:154
EdgeRef ref
Definition pslgminsize.cpp:377
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
size_t qHash(const SWMMObjectRef &r, size_t seed=0)
Definition selectionmanager.h:89
Identifies a single SWMM object.
Definition selectionmanager.h:32
ObjectType
Coarse object kind. Mirrors the engine's logical groupings; finer subtypes (e.g. junction vs outfall)...
Definition selectionmanager.h:39
@ Aquifer
Definition selectionmanager.h:54
@ Inlet
Definition selectionmanager.h:59
@ Hydrograph
Definition selectionmanager.h:57
@ MeshCell
2D mesh triangle/cell (see MeshObjectRef::cell)
Definition selectionmanager.h:67
@ RainGage
Definition selectionmanager.h:44
@ Control
Definition selectionmanager.h:47
@ Subcatchment
Definition selectionmanager.h:43
@ Street
Definition selectionmanager.h:58
@ Transect
Definition selectionmanager.h:56
@ Unknown
Definition selectionmanager.h:40
@ Node
Junction / outfall / divider / storage.
Definition selectionmanager.h:41
@ Curve
Definition selectionmanager.h:50
@ Feature
Definition selectionmanager.h:72
@ LandUse
Definition selectionmanager.h:46
@ TimePattern
Definition selectionmanager.h:52
@ Pollutant
Definition selectionmanager.h:45
@ TimeSeries
Definition selectionmanager.h:51
@ Snowpack
Definition selectionmanager.h:55
@ MeshEdge
Definition selectionmanager.h:66
@ Link
Conduit / pump / orifice / weir / outlet.
Definition selectionmanager.h:42
@ MeshVertex
Definition selectionmanager.h:65
@ LIDControl
Definition selectionmanager.h:53
QString name
Definition selectionmanager.h:76
ObjectType objectType
Definition selectionmanager.h:75
constexpr SWMMObjectRef()=default
bool operator!=(const SWMMObjectRef &o) const
Definition selectionmanager.h:86
bool operator==(const SWMMObjectRef &o) const
Definition selectionmanager.h:84
bool isValid() const
Definition selectionmanager.h:82
SWMMObjectRef(ObjectType t, QString n)
Definition selectionmanager.h:79