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

#include <maptoolpick2dcells.h>

Inheritance diagram for MapToolPick2DCells:
Collaboration diagram for MapToolPick2DCells:

Public Types

enum class  Mode {
  Box ,
  Lasso
}
 

Signals

void cellsPicked (SWMM2DResultsLayer *layer, const QVector< int > &triIdxList, const QVector< openswmmvis::plot::PlotAttribute > &attrs)
 Emitted when the user picks an entry from the right-click "plot" context menu.
 
- 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

 MapToolPick2DCells (MapCanvas *canvas, SelectionManager *selection, QObject *parent=nullptr)
 
 ~MapToolPick2DCells () override=default
 
void setMode (Mode m)
 
Mode mode () const noexcept
 
void setTargetLayer (SWMM2DResultsLayer *layer)
 
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.
 
virtual QCursor cursor () const
 Returns the mouse cursor to display while this tool is active.
 
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
 

Member Enumeration Documentation

◆ Mode

enum class MapToolPick2DCells::Mode
strong
Enumerator
Box 
Lasso 

Constructor & Destructor Documentation

◆ MapToolPick2DCells()

MapToolPick2DCells::MapToolPick2DCells ( MapCanvas canvas,
SelectionManager selection,
QObject *  parent = nullptr 
)
explicit

◆ ~MapToolPick2DCells()

MapToolPick2DCells::~MapToolPick2DCells ( )
overridedefault

Member Function Documentation

◆ activate()

void MapToolPick2DCells::activate ( )
overridevirtual

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

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ cellsPicked

void MapToolPick2DCells::cellsPicked ( SWMM2DResultsLayer layer,
const QVector< int > &  triIdxList,
const QVector< openswmmvis::plot::PlotAttribute > &  attrs 
)
signal

Emitted when the user picks an entry from the right-click "plot" context menu.

Parameters
layerThe active 2D results layer (non-owning).
triIdxListSelected triangle indices (never empty).
attrsAttributes chosen from the menu (never empty).
Here is the caller graph for this function:

◆ deactivate()

void MapToolPick2DCells::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 MapToolPick2DCells::keyPressEvent ( QKeyEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ mode()

Mode MapToolPick2DCells::mode ( ) const
inlinenoexcept

◆ mouseDoubleClickEvent()

void MapToolPick2DCells::mouseDoubleClickEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ mouseMoveEvent()

void MapToolPick2DCells::mouseMoveEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ mousePressEvent()

void MapToolPick2DCells::mousePressEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ mouseReleaseEvent()

void MapToolPick2DCells::mouseReleaseEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ paint()

void MapToolPick2DCells::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:

◆ setMode()

void MapToolPick2DCells::setMode ( Mode  m)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setTargetLayer()

void MapToolPick2DCells::setTargetLayer ( SWMM2DResultsLayer layer)

Bind the tool to a specific 2D results layer (the project window's active analysis layer). When set, picks report against this layer instead of the first SWMM2DResultsLayer found on the canvas. Passing nullptr restores the first-found fallback.

Here is the caller graph for this function:

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