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

Tool that queries all visible layers at a clicked point and reports attributes. More...

#include <maptoolidentify.h>

Inheritance diagram for OpenSWMMVisMapToolIdentify:
Collaboration diagram for OpenSWMMVisMapToolIdentify:

Signals

void mapToleranceChanged (double tolerance)
 
void queryAllLayersChanged (bool all)
 
void identifyResult (const QList< IdentifyResult > &results)
 Emitted after a click with the list of identify results (one per 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

 OpenSWMMVisMapToolIdentify (MapCanvas *canvas, QObject *parent=nullptr)
 
QCursor cursor () const override
 Returns the mouse cursor to display while this tool is active.
 
double mapTolerance () const
 Returns the search tolerance in map units (default 1e-6).
 
void setMapTolerance (double tolerance)
 
bool queryAllLayers () const
 When true, all visible layers are queried; otherwise only the top-most.
 
void setQueryAllLayers (bool all)
 
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 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 mouseMoveEvent (QMouseEvent *event)
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void wheelEvent (QWheelEvent *event)
 
virtual void keyPressEvent (QKeyEvent *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

double mapTolerance
 
bool queryAllLayers
 
- 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 queries all visible layers at a clicked point and reports attributes.

On mouse press the tool calls identifyAt() on every active GIS and SWMM model layer, collects the attribute maps, and emits identifyResult(). The PropertiesPanel widget listens to this signal to populate itself. A cross-hair overlay is painted at the queried point until the next identify action or until the tool is deactivated.

Constructor & Destructor Documentation

◆ OpenSWMMVisMapToolIdentify()

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

Member Function Documentation

◆ activate()

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

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

Reimplemented from OpenSWMMVisMapTool.

◆ deactivate()

void OpenSWMMVisMapToolIdentify::deactivate ( )
overridevirtual

Called by the canvas when another tool replaces this one.

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ identifyResult

void OpenSWMMVisMapToolIdentify::identifyResult ( const QList< IdentifyResult > &  results)
signal

Emitted after a click with the list of identify results (one per layer).

Here is the caller graph for this function:

◆ mapTolerance()

double OpenSWMMVisMapToolIdentify::mapTolerance ( ) const

Returns the search tolerance in map units (default 1e-6).

◆ mapToleranceChanged

void OpenSWMMVisMapToolIdentify::mapToleranceChanged ( double  tolerance)
signal
Here is the caller graph for this function:

◆ mousePressEvent()

void OpenSWMMVisMapToolIdentify::mousePressEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ paint()

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

◆ queryAllLayers()

bool OpenSWMMVisMapToolIdentify::queryAllLayers ( ) const

When true, all visible layers are queried; otherwise only the top-most.

◆ queryAllLayersChanged

void OpenSWMMVisMapToolIdentify::queryAllLayersChanged ( bool  all)
signal
Here is the caller graph for this function:

◆ setMapTolerance()

void OpenSWMMVisMapToolIdentify::setMapTolerance ( double  tolerance)
Here is the call graph for this function:

◆ setQueryAllLayers()

void OpenSWMMVisMapToolIdentify::setQueryAllLayers ( bool  all)
Here is the call graph for this function:

Property Documentation

◆ mapTolerance

double OpenSWMMVisMapToolIdentify::mapTolerance
readwrite

◆ queryAllLayers

bool OpenSWMMVisMapToolIdentify::queryAllLayers
readwrite

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