![]() |
SWMMVis
6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
|
Draw a ring inside the selected polygon; it becomes an interior ring. More...
#include <maptoolfeatureedit.h>
Public Member Functions | |
| OpenSWMMVisMapToolAddHole (MapCanvas *canvas, QObject *parent=nullptr) | |
Public Member Functions inherited from OpenSWMMVisMapToolFeatureDrawBase | |
| OpenSWMMVisMapToolFeatureDrawBase (const QString &toolName, MapCanvas *canvas, QObject *parent=nullptr) | |
| void | setTargetLayer (FeatureLayer *layer) |
| The layer being drawn into. Set by the Features dock; when it is null or not editable the tool ignores input. | |
| FeatureLayer * | targetLayer () const |
| 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 | 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. | |
| MapCanvas * | canvas () const |
| Returns the MapCanvas this tool is attached to. | |
| virtual void | mouseReleaseEvent (QMouseEvent *event) |
| 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. | |
Protected Member Functions | |
| int | minimumVertices () const override |
| bool | isClosed () const override |
| openswmmvis::feature::FeatureGeometry | buildGeometry (const openswmmvis::feature::Ring &ring) const override |
Protected Member Functions inherited from OpenSWMMVisMapToolFeatureDrawBase | |
| void | cancel () |
| void | commit () |
| QPointF | canvasToLayer (const QPointF &canvasPt) const |
Additional Inherited Members | |
Signals inherited from OpenSWMMVisMapToolFeatureDrawBase | |
| void | featureDrawn (qint64 featureId) |
| Emitted after a successful commit, with the new feature's id. | |
| void | drawRejected (const QString &reason) |
| Emitted when a commit is refused, with the reason from FeatureGeometry::validate. The Features dock shows it. | |
Signals inherited from OpenSWMMVisMapTool | |
| void | cursorChanged (const QCursor &cursor) |
| void | activeChanged (bool active) |
| void | repaintRequested () |
| Emitted to instruct the canvas to repaint its overlay. | |
Protected Attributes inherited from OpenSWMMVisMapToolFeatureDrawBase | |
| QPointer< FeatureLayer > | m_target |
| QVector< QPointF > | m_vertices |
| canvas CRS | |
| QPointF | m_cursor |
| canvas CRS | |
| bool | m_drawing = false |
| SnapEngine::Result | m_snap |
Protected Attributes inherited from OpenSWMMVisMapTool | |
| QString | m_toolName |
| MapCanvas * | m_canvas = nullptr |
Properties inherited from OpenSWMMVisMapTool | |
| QString | toolName |
| QCursor | cursor |
| bool | active |
Draw a ring inside the selected polygon; it becomes an interior ring.
The ring is validated with FeatureGeometry::validate BEFORE it is committed, so a hole drawn outside the polygon, crossing its boundary, or overlapping another hole is refused with the reason string rather than written and discovered later by the mesh generator.
|
explicit |
|
overrideprotectedvirtual |
Build the geometry to store from the accumulated LAYER-CRS vertices.
Implements OpenSWMMVisMapToolFeatureDrawBase.
|
inlineoverrideprotectedvirtual |
Close the ring in the rubber-band preview.
Reimplemented from OpenSWMMVisMapToolFeatureDrawBase.
|
inlineoverrideprotectedvirtual |
Minimum vertices before commit() will do anything.
Implements OpenSWMMVisMapToolFeatureDrawBase.