|
| | OpenSWMMVisMapToolAddNode (MapCanvas *canvas, int nodeType, const QString &elementKind, 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 | mouseReleaseEvent (QMouseEvent *event) override |
| |
| void | mouseMoveEvent (QMouseEvent *event) override |
| |
| void | paint (QPainter *painter, const MapExtent &extent, const SpatialReferenceSystem *srs) override |
| | Called by the canvas in drawForeground() so the tool can draw transient overlay graphics (rubber-band, measure segments, etc.).
|
| |
| void | setTerrain (GISRasterLayer *layer, double offset, double factor=1.0) |
| | Sets the active terrain layer and node offset used to auto-fill InvertElev when a node is placed freely (a node inserted on a conduit takes the engine's interpolated invert instead).
|
| |
| bool | kindCanSplitConduit () const |
| | Whether this tool's node kind may be inserted mid-conduit — every kind but OUTFALL.
|
| |
| int | nodeType () const |
| |
| | 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 | 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.
|
| |
Left-click on the canvas to place a new SWMM node.
The tool is configured with a fixed node type at construction (Junction / Outfall / Storage / Divider). A numeric suffix on a default name prefix is auto-assigned to keep the engine's uniqueness invariant ("J1", "J2", …) unless the project window provides a custom prefix.
Where the click lands decides what happens (ADDNODE_SPLIT_REDESIGN_PLAN_2026-09-10.md):
- empty canvas (or snapped to an existing node) → the node is placed there (AddNodeCommand, terrain-derived invert).
- a conduit → the conduit is split at that point and the node inserted there (InsertNodeSplitCommand; storage and dividers are converted from the split junction and get their creation defaults). Outfalls are refused on a conduit — an outfall must be terminal — with a status-bar hint and no edit. Pumps, weirs, orifices and outlets have no length to divide and never count as a conduit hit. The click is armed on press and committed on RELEASE (the convention for canvas tools that may open a dialog — see maptoolpick2dcells.h).
Every placement pushes one command onto the canvas' MapUndoStack. Engine state must be OPENED or BUILDING — the tool logs and ignores clicks otherwise.