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

Drag a SWMM node or rain gage to a new location. More...

#include <maptoolmovenode.h>

Inheritance diagram for OpenSWMMVisMapToolMoveNode:
Collaboration diagram for OpenSWMMVisMapToolMoveNode:

Signals

void nodeMoved (const QString &nodeName, double newX, double newY, int autoLengthedCount)
 Emitted after a successful node move. Carries the node's name, new map-CRS coord, and the count of conduits whose length was auto-recomputed.
 
- 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

 OpenSWMMVisMapToolMoveNode (MapCanvas *canvas, 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 mouseMoveEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void keyPressEvent (QKeyEvent *event) override
 
- 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 mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void wheelEvent (QWheelEvent *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.
 

Additional Inherited Members

- Protected Attributes inherited from OpenSWMMVisMapTool
QString m_toolName
 
MapCanvasm_canvas = nullptr
 
- Properties inherited from OpenSWMMVisMapTool
QString toolName
 
QCursor cursor
 
bool active
 

Detailed Description

Drag a SWMM node or rain gage to a new location.

Left-click a node (or rain gage) to start a drag; release the mouse to commit. The commit mutates engine + cache through SWMMModelLayer and pushes a MoveNodeCommand (MoveGageCommand for a gage) on the canvas' MapUndoStack. When auto-length is enabled on the active project window, every conduit whose endpoint is the moved node has its length recomputed from the new polyline as part of the same command; gages have no links, so no auto-length leg.

Press Escape during a drag to cancel.

Post Slice R Phase 3: hit-testing and live preview go through the layer's pickAt / previewNodeMove — no dependency on per-object NodeGraphicsItem placeholders (those were retired once every interactive tool moved to the layer API).

Constructor & Destructor Documentation

◆ OpenSWMMVisMapToolMoveNode()

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

Member Function Documentation

◆ activate()

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

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

Reimplemented from OpenSWMMVisMapTool.

◆ deactivate()

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

Reimplemented from OpenSWMMVisMapTool.

◆ mouseMoveEvent()

void OpenSWMMVisMapToolMoveNode::mouseMoveEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ mousePressEvent()

void OpenSWMMVisMapToolMoveNode::mousePressEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ mouseReleaseEvent()

void OpenSWMMVisMapToolMoveNode::mouseReleaseEvent ( QMouseEvent *  event)
overridevirtual

Reimplemented from OpenSWMMVisMapTool.

Here is the call graph for this function:

◆ nodeMoved

void OpenSWMMVisMapToolMoveNode::nodeMoved ( const QString &  nodeName,
double  newX,
double  newY,
int  autoLengthedCount 
)
signal

Emitted after a successful node move. Carries the node's name, new map-CRS coord, and the count of conduits whose length was auto-recomputed.

Here is the caller graph for this function:

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