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

Tool that selects features in vector and SWMM model layers. More...

#include <maptoolselect.h>

Inheritance diagram for OpenSWMMVisMapToolSelect:
Collaboration diagram for OpenSWMMVisMapToolSelect:

Signals

void pixelToleranceChanged (int pixels)
 
void rubberBandColorChanged (const QColor &color)
 
void selectionChanged (OpenSWMMVisLayer *layer)
 Emitted after the selection changes, carrying the names/IDs of selected elements.
 
void plotTimeSeriesRequested (const SWMMObjectRef &ref)
 Emitted from the right-click context menu's "Plot Time Series…" action. Handled at the main-window level identically to the Object Browser's identically-named signal, so the chart dialog opens against the active project's results .out file.
 
void plotAttributeRequested (const SWMMObjectRef &ref, const openswmmvis::plot::ResultDescriptor &descriptor)
 Slice AT.2 — emitted when the user picks a specific attribute from the right-click attribute submenu on a map object. Carries PlotAttribute::Unknown for the "All attributes" entry.
 
void plotAttributeForLayerRequested (const SWMMObjectRef &ref, const openswmmvis::plot::ResultDescriptor &descriptor, class SWMMResultsLayer *layer)
 Variant of plotAttributeRequested that names a specific results layer. Emitted from the two-level "Plot Time Series ▸ <layer> ▸ <variable>" submenu shown when more than one SWMM Output (.out) layer is loaded on the canvas. The receiver plots against that exact layer (no auto-pick-first-found).
 
void plotSystemRequested (openswmmvis::plot::PlotAttribute attribute)
 Slice AT.2 — emitted when the user picks a system-wide variable from the background right-click menu ("Plot System Variable…" submenu).
 
void deleteFeaturesRequested (FeatureLayer *layer)
 The user chose "Delete selected feature(s)" from the background right-click menu, offered only while layer has an open edit session and a non-empty selection. The tool does not delete anything itself: the main window owns the undo stack and the error reporting, and this keeps map right-click, the Del key and the Features grid on one path.
 
void rainfallVisualizationRequested (const SWMMObjectRef &ref)
 Emitted from the right-click menu's "Rainfall Visualization…" action on a rain gage hit. The main window opens the shared Rainfall Visualization dialog focused on that gage — the map twin of the Object Browser's identically-named signal.
 
- Signals inherited from OpenSWMMVisMapTool
void cursorChanged (const QCursor &cursor)
 
void activeChanged (bool active)
 
void repaintRequested ()
 Emitted to instruct the canvas to repaint its overlay.
 

Public Member Functions

 OpenSWMMVisMapToolSelect (MapCanvas *canvas, QObject *parent=nullptr)
 
QCursor cursor () const override
 Returns the mouse cursor to display while this tool is active.
 
int pixelTolerance () const
 
void setPixelTolerance (int pixels)
 
QColor rubberBandColor () const
 
void setRubberBandColor (const QColor &color)
 
void activate () override
 Called by the canvas when this tool becomes the active tool.
 
void deactivate () override
 Called by the canvas when another tool replaces this one.
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseMoveEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void mouseDoubleClickEvent (QMouseEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 
void paint (QPainter *painter, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override
 Called by the canvas in drawForeground() so the tool can draw transient overlay graphics (rubber-band, measure segments, etc.).
 
- Public Member Functions inherited from OpenSWMMVisMapTool
 OpenSWMMVisMapTool (const QString &toolName, MapCanvas *canvas, QObject *parent=nullptr)
 
virtual ~OpenSWMMVisMapTool ()=default
 
QString toolName () const
 Returns the human-readable name of this tool.
 
bool isActive () const
 Returns true when this tool is the active tool on its canvas.
 
MapCanvascanvas () const
 Returns the MapCanvas this tool is attached to.
 
virtual void wheelEvent (QWheelEvent *event)
 
virtual void keyReleaseEvent (QKeyEvent *event)
 
QGraphicsScene * scene () const
 Returns the scene this tool's canvas is using.
 
void toMapCoords (int px, int py, double &mapX, double &mapY) const
 Converts a widget pixel position to map coordinates.
 
void toPixelCoords (double mapX, double mapY, int &px, int &py) const
 Converts map coordinates to widget pixel position.
 

Properties

int pixelTolerance
 
QColor rubberBandColor
 
- Properties inherited from OpenSWMMVisMapTool
QString toolName
 
QCursor cursor
 
bool active
 

Additional Inherited Members

- Protected Attributes inherited from OpenSWMMVisMapTool
QString m_toolName
 
MapCanvasm_canvas = nullptr
 

Detailed Description

Tool that selects features in vector and SWMM model layers.

Single-click selects the nearest feature (within a configurable pixel tolerance). Click-and-drag draws a rubber-band rectangle and selects all features that intersect it.

Holding Shift adds to the current selection. Holding Ctrl subtracts from the current selection. Pressing Escape clears all selections across all selectable layers.

Each selection change pushes an undo command so it can be reversed.

Constructor & Destructor Documentation

◆ OpenSWMMVisMapToolSelect()

OpenSWMMVisMapToolSelect::OpenSWMMVisMapToolSelect ( MapCanvas canvas,
QObject *  parent = nullptr 
)
explicit
Here is the call graph for this function:

Member Function Documentation

◆ activate()

void OpenSWMMVisMapToolSelect::activate ( )
overridevirtual

Called by the canvas when this tool becomes the active tool.

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ cursor()

QCursor OpenSWMMVisMapToolSelect::cursor ( ) const
overridevirtual

Returns the mouse cursor to display while this tool is active.

Reimplemented from OpenSWMMVisMapTool.

Here is the caller graph for this function:

◆ deactivate()

void OpenSWMMVisMapToolSelect::deactivate ( )
overridevirtual

Called by the canvas when another tool replaces this one.

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ deleteFeaturesRequested

void OpenSWMMVisMapToolSelect::deleteFeaturesRequested ( FeatureLayer layer)
signal

The user chose "Delete selected feature(s)" from the background right-click menu, offered only while layer has an open edit session and a non-empty selection. The tool does not delete anything itself: the main window owns the undo stack and the error reporting, and this keeps map right-click, the Del key and the Features grid on one path.

◆ keyPressEvent()

void OpenSWMMVisMapToolSelect::keyPressEvent ( QKeyEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ mouseDoubleClickEvent()

void OpenSWMMVisMapToolSelect::mouseDoubleClickEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ mouseMoveEvent()

void OpenSWMMVisMapToolSelect::mouseMoveEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ mousePressEvent()

void OpenSWMMVisMapToolSelect::mousePressEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ mouseReleaseEvent()

void OpenSWMMVisMapToolSelect::mouseReleaseEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ paint()

void OpenSWMMVisMapToolSelect::paint ( QPainter *  painter,
const MapExtent canvasExtent,
const SpatialReferenceSystem canvasSRS 
)
overridevirtual

Called by the canvas in drawForeground() so the tool can draw transient overlay graphics (rubber-band, measure segments, etc.).

Override this to paint tool overlays directly via QPainter in view coordinates.

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ pixelTolerance()

int OpenSWMMVisMapToolSelect::pixelTolerance ( ) const

◆ pixelToleranceChanged

void OpenSWMMVisMapToolSelect::pixelToleranceChanged ( int  pixels)
signal
Here is the caller graph for this function:

◆ plotAttributeForLayerRequested

void OpenSWMMVisMapToolSelect::plotAttributeForLayerRequested ( const SWMMObjectRef ref,
const openswmmvis::plot::ResultDescriptor descriptor,
class SWMMResultsLayer layer 
)
signal

Variant of plotAttributeRequested that names a specific results layer. Emitted from the two-level "Plot Time Series ▸ <layer> ▸ <variable>" submenu shown when more than one SWMM Output (.out) layer is loaded on the canvas. The receiver plots against that exact layer (no auto-pick-first-found).

◆ plotAttributeRequested

void OpenSWMMVisMapToolSelect::plotAttributeRequested ( const SWMMObjectRef ref,
const openswmmvis::plot::ResultDescriptor descriptor 
)
signal

Slice AT.2 — emitted when the user picks a specific attribute from the right-click attribute submenu on a map object. Carries PlotAttribute::Unknown for the "All attributes" entry.

◆ plotSystemRequested

void OpenSWMMVisMapToolSelect::plotSystemRequested ( openswmmvis::plot::PlotAttribute  attribute)
signal

Slice AT.2 — emitted when the user picks a system-wide variable from the background right-click menu ("Plot System Variable…" submenu).

◆ plotTimeSeriesRequested

void OpenSWMMVisMapToolSelect::plotTimeSeriesRequested ( const SWMMObjectRef ref)
signal

Emitted from the right-click context menu's "Plot Time Series…" action. Handled at the main-window level identically to the Object Browser's identically-named signal, so the chart dialog opens against the active project's results .out file.

◆ rainfallVisualizationRequested

void OpenSWMMVisMapToolSelect::rainfallVisualizationRequested ( const SWMMObjectRef ref)
signal

Emitted from the right-click menu's "Rainfall Visualization…" action on a rain gage hit. The main window opens the shared Rainfall Visualization dialog focused on that gage — the map twin of the Object Browser's identically-named signal.

◆ rubberBandColor()

QColor OpenSWMMVisMapToolSelect::rubberBandColor ( ) const

◆ rubberBandColorChanged

void OpenSWMMVisMapToolSelect::rubberBandColorChanged ( const QColor &  color)
signal
Here is the caller graph for this function:

◆ selectionChanged

void OpenSWMMVisMapToolSelect::selectionChanged ( OpenSWMMVisLayer layer)
signal

Emitted after the selection changes, carrying the names/IDs of selected elements.

Here is the caller graph for this function:

◆ setPixelTolerance()

void OpenSWMMVisMapToolSelect::setPixelTolerance ( int  pixels)
Here is the call graph for this function:

◆ setRubberBandColor()

void OpenSWMMVisMapToolSelect::setRubberBandColor ( const QColor &  color)
Here is the call graph for this function:

Property Documentation

◆ pixelTolerance

int OpenSWMMVisMapToolSelect::pixelTolerance
readwrite

◆ rubberBandColor

QColor OpenSWMMVisMapToolSelect::rubberBandColor
readwrite

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