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

Selects SWMM model features enclosed by a user-drawn polygon. More...

#include <maptoolselectpolygon.h>

Inheritance diagram for OpenSWMMVisMapToolSelectPolygon:
Collaboration diagram for OpenSWMMVisMapToolSelectPolygon:

Signals

void selectionChanged (OpenSWMMVisLayer *layer)
 
- 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

 OpenSWMMVisMapToolSelectPolygon (MapCanvas *canvas, QObject *parent=nullptr)
 
QCursor cursor () const override
 Returns the mouse cursor to display while this tool is active.
 
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.
 

Additional Inherited Members

- Protected Attributes inherited from OpenSWMMVisMapTool
QString m_toolName
 
MapCanvasm_canvas = nullptr
 
- Properties inherited from OpenSWMMVisMapTool
QString toolName
 
QCursor cursor
 
bool active
 

Detailed Description

Selects SWMM model features enclosed by a user-drawn polygon.

Left-click drops polygon vertices on the map. The growing polygon is rendered as an overlay with a rubber-band edge tracking the cursor. Right-click, double-click, or Enter closes the polygon and selects every node, link, subcatchment, and rain gage whose representative point falls inside it. Escape cancels the in-progress polygon.

Holding Shift adds the enclosed objects to the current selection; holding Ctrl removes them. With no modifier the selection is replaced. Selection is applied through SWMMModelLayer so the Attribute Panel, Object Browser, and map highlight all stay in sync.

Constructor & Destructor Documentation

◆ OpenSWMMVisMapToolSelectPolygon()

OpenSWMMVisMapToolSelectPolygon::OpenSWMMVisMapToolSelectPolygon ( MapCanvas canvas,
QObject *  parent = nullptr 
)
explicit

Member Function Documentation

◆ activate()

void OpenSWMMVisMapToolSelectPolygon::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 OpenSWMMVisMapToolSelectPolygon::cursor ( ) const
overridevirtual

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

Reimplemented from OpenSWMMVisMapTool.

◆ deactivate()

void OpenSWMMVisMapToolSelectPolygon::deactivate ( )
overridevirtual

Called by the canvas when another tool replaces this one.

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ keyPressEvent()

void OpenSWMMVisMapToolSelectPolygon::keyPressEvent ( QKeyEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

◆ mouseDoubleClickEvent()

void OpenSWMMVisMapToolSelectPolygon::mouseDoubleClickEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

◆ mouseMoveEvent()

void OpenSWMMVisMapToolSelectPolygon::mouseMoveEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

◆ mousePressEvent()

void OpenSWMMVisMapToolSelectPolygon::mousePressEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

◆ mouseReleaseEvent()

void OpenSWMMVisMapToolSelectPolygon::mouseReleaseEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

◆ paint()

void OpenSWMMVisMapToolSelectPolygon::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.

◆ selectionChanged

void OpenSWMMVisMapToolSelectPolygon::selectionChanged ( OpenSWMMVisLayer layer)
signal

Emitted after the selection changes on layer.


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