![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Abstract base class for interactive map tools used in the MapCanvas. More...
#include <maptool.h>
Signals | |
| void | cursorChanged (const QCursor &cursor) |
| void | activeChanged (bool active) |
| void | repaintRequested () |
| Emitted to instruct the canvas to repaint its overlay. | |
Public Member Functions | |
| 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. | |
| MapCanvas * | canvas () const |
| Returns the MapCanvas this tool is attached to. | |
| virtual void | activate () |
| Called by the canvas when this tool becomes the active tool. | |
| virtual void | deactivate () |
| Called by the canvas when another tool replaces this one. | |
| virtual void | mousePressEvent (QMouseEvent *event) |
| 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) |
| virtual void | paint (QPainter *painter, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) |
| Called by the canvas in drawForeground() so the tool can draw transient overlay graphics (rubber-band, measure segments, etc.). | |
| 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. | |
Protected Attributes | |
| QString | m_toolName |
| MapCanvas * | m_canvas = nullptr |
Properties | |
| QString | toolName |
| QCursor | cursor |
| bool | active |
Friends | |
| class | MapCanvas |
Abstract base class for interactive map tools used in the MapCanvas.
A map tool handles mouse, wheel, and keyboard events on behalf of the MapCanvas. Exactly one tool is active at a time. The canvas calls activate() / deactivate() when switching tools.
Tools can also draw their own transient graphics on top of the map by overriding paint().
Concrete tool subclasses:
|
explicit |
|
virtualdefault |
|
virtual |
Called by the canvas when this tool becomes the active tool.
Reimplemented in OpenSWMMVisMapToolAddInletNode, OpenSWMMVisMapToolAddLink, OpenSWMMVisMapToolAddNode, OpenSWMMVisMapToolAddSubcatchment, OpenSWMMVisMapToolAddVirtualNode, OpenSWMMVisMapToolEditVertex, OpenSWMMVisMapToolFeatureDrawBase, OpenSWMMVisMapToolEditFeatureVertex, OpenSWMMVisMapToolIdentify, OpenSWMMVisMapToolMeasure, MapToolMeshProfile, MapToolMeshSelectEdge, MapToolMeshSelectVertex, OpenSWMMVisMapToolMoveNode, OpenSWMMVisMapToolPan, MapToolPick2DCells, OpenSWMMVisMapToolPickNode, OpenSWMMVisMapToolSelect, OpenSWMMVisMapToolSelectPolygon, OpenSWMMVisMapToolSelectProfile, and OpenSWMMVisMapToolZoom.
|
signal |
| MapCanvas * OpenSWMMVisMapTool::canvas | ( | ) | const |
|
virtual |
Returns the mouse cursor to display while this tool is active.
Reimplemented in OpenSWMMVisMapToolAddGage, OpenSWMMVisMapToolAddInletNode, OpenSWMMVisMapToolAddLink, OpenSWMMVisMapToolAddNode, OpenSWMMVisMapToolAddSubcatchment, OpenSWMMVisMapToolAddText, OpenSWMMVisMapToolAddVirtualNode, OpenSWMMVisMapToolEditVertex, OpenSWMMVisMapToolFeatureDrawBase, OpenSWMMVisMapToolEditFeatureVertex, OpenSWMMVisMapToolMoveFeature, OpenSWMMVisMapToolIdentify, OpenSWMMVisMapToolMeasure, OpenSWMMVisMapToolMoveNode, OpenSWMMVisMapToolPan, OpenSWMMVisMapToolPickNode, OpenSWMMVisMapToolPlotPick, MapToolProfileMarker, OpenSWMMVisMapToolSelect, OpenSWMMVisMapToolSelectPolygon, and OpenSWMMVisMapToolZoom.
|
signal |
|
virtual |
Called by the canvas when another tool replaces this one.
Reimplemented in OpenSWMMVisMapToolAddInletNode, OpenSWMMVisMapToolAddLink, OpenSWMMVisMapToolAddNode, OpenSWMMVisMapToolAddSubcatchment, OpenSWMMVisMapToolAddVirtualNode, OpenSWMMVisMapToolEditVertex, OpenSWMMVisMapToolFeatureDrawBase, OpenSWMMVisMapToolEditFeatureVertex, OpenSWMMVisMapToolMoveFeature, OpenSWMMVisMapToolIdentify, OpenSWMMVisMapToolMeasure, MapToolMeshProfile, MapToolMeshSelectEdge, MapToolMeshSelectVertex, OpenSWMMVisMapToolMoveNode, OpenSWMMVisMapToolPan, MapToolPick2DCells, OpenSWMMVisMapToolPickNode, MapToolProfileMarker, OpenSWMMVisMapToolSelect, OpenSWMMVisMapToolSelectPolygon, OpenSWMMVisMapToolSelectProfile, and OpenSWMMVisMapToolZoom.
| bool OpenSWMMVisMapTool::isActive | ( | ) | const |
Returns true when this tool is the active tool on its canvas.
|
virtual |
Reimplemented in OpenSWMMVisMapToolAddLink, OpenSWMMVisMapToolAddSubcatchment, OpenSWMMVisMapToolEditVertex, OpenSWMMVisMapToolFeatureDrawBase, OpenSWMMVisMapToolEditFeatureVertex, OpenSWMMVisMapToolMoveFeature, OpenSWMMVisMapToolMeasure, MapToolMeshProfile, MapToolMeshSelectEdge, MapToolMeshSelectVertex, OpenSWMMVisMapToolMoveNode, MapToolPick2DCells, OpenSWMMVisMapToolPickNode, OpenSWMMVisMapToolPlotPick, OpenSWMMVisMapToolSelect, OpenSWMMVisMapToolSelectPolygon, and OpenSWMMVisMapToolSelectProfile.
|
virtual |
|
virtual |
Reimplemented in OpenSWMMVisMapToolAddLink, OpenSWMMVisMapToolAddSubcatchment, OpenSWMMVisMapToolEditVertex, OpenSWMMVisMapToolFeatureDrawBase, OpenSWMMVisMapToolMeasure, MapToolMeshProfile, MapToolPick2DCells, OpenSWMMVisMapToolSelect, and OpenSWMMVisMapToolSelectPolygon.
|
virtual |
Reimplemented in OpenSWMMVisMapToolAddInletNode, OpenSWMMVisMapToolAddLink, OpenSWMMVisMapToolAddNode, OpenSWMMVisMapToolAddSubcatchment, OpenSWMMVisMapToolAddVirtualNode, OpenSWMMVisMapToolEditVertex, OpenSWMMVisMapToolFeatureDrawBase, OpenSWMMVisMapToolEditFeatureVertex, OpenSWMMVisMapToolMoveFeature, OpenSWMMVisMapToolMeasure, MapToolMeshProfile, MapToolMeshSelectEdge, MapToolMeshSelectVertex, OpenSWMMVisMapToolMoveNode, OpenSWMMVisMapToolPan, MapToolPick2DCells, OpenSWMMVisMapToolPickNode, MapToolProfileMarker, OpenSWMMVisMapToolSelect, OpenSWMMVisMapToolSelectPolygon, and OpenSWMMVisMapToolZoom.
|
virtual |
Reimplemented in OpenSWMMVisMapToolAddGage, OpenSWMMVisMapToolAddInletNode, OpenSWMMVisMapToolAddLink, OpenSWMMVisMapToolAddNode, OpenSWMMVisMapToolAddSubcatchment, OpenSWMMVisMapToolAddText, OpenSWMMVisMapToolAddVirtualNode, OpenSWMMVisMapToolEditVertex, OpenSWMMVisMapToolFeatureDrawBase, OpenSWMMVisMapToolDrawPoint, OpenSWMMVisMapToolEditFeatureVertex, OpenSWMMVisMapToolMoveFeature, OpenSWMMVisMapToolIdentify, OpenSWMMVisMapToolMeasure, MapToolMeshProfile, MapToolMeshSelectEdge, MapToolMeshSelectVertex, OpenSWMMVisMapToolMoveNode, OpenSWMMVisMapToolPan, MapToolPick2DCells, OpenSWMMVisMapToolPickNode, OpenSWMMVisMapToolPlotPick, MapToolProfileMarker, OpenSWMMVisMapToolSelect, OpenSWMMVisMapToolSelectPolygon, OpenSWMMVisMapToolSelectProfile, and OpenSWMMVisMapToolZoom.
|
virtual |
Reimplemented in OpenSWMMVisMapToolAddInletNode, OpenSWMMVisMapToolAddNode, OpenSWMMVisMapToolAddVirtualNode, OpenSWMMVisMapToolEditVertex, OpenSWMMVisMapToolEditFeatureVertex, OpenSWMMVisMapToolMoveFeature, MapToolMeshSelectEdge, MapToolMeshSelectVertex, OpenSWMMVisMapToolMoveNode, OpenSWMMVisMapToolPan, MapToolPick2DCells, OpenSWMMVisMapToolPickNode, MapToolProfileMarker, OpenSWMMVisMapToolSelect, OpenSWMMVisMapToolSelectPolygon, and OpenSWMMVisMapToolZoom.
|
virtual |
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 in OpenSWMMVisMapToolEditVertex, OpenSWMMVisMapToolFeatureDrawBase, OpenSWMMVisMapToolEditFeatureVertex, OpenSWMMVisMapToolIdentify, OpenSWMMVisMapToolMeasure, MapToolMeshProfile, MapToolMeshSelectEdge, MapToolMeshSelectVertex, MapToolPick2DCells, MapToolProfileMarker, OpenSWMMVisMapToolSelect, OpenSWMMVisMapToolSelectPolygon, OpenSWMMVisMapToolZoom, OpenSWMMVisMapToolAddInletNode, OpenSWMMVisMapToolAddLink, OpenSWMMVisMapToolAddNode, OpenSWMMVisMapToolAddSubcatchment, OpenSWMMVisMapToolAddVirtualNode, and OpenSWMMVisMapToolPickNode.
|
signal |
Emitted to instruct the canvas to repaint its overlay.
| QGraphicsScene * OpenSWMMVisMapTool::scene | ( | ) | const |
Returns the scene this tool's canvas is using.
Converts a widget pixel position to map coordinates.
| px | Pixel X in widget space. |
| py | Pixel Y in widget space. |
| mapX | Output map X. |
| mapY | Output map Y. |
| QString OpenSWMMVisMapTool::toolName | ( | ) | const |
Returns the human-readable name of this tool.
Converts map coordinates to widget pixel position.
|
virtual |
|
friend |
|
protected |
|
protected |
|
read |
|
read |
|
read |