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

Undoable write of one per-cell parameter across a set of triangles. More...

#include <meshcommands.h>

Inheritance diagram for MeshSetTriangleAttributeCommand:
Collaboration diagram for MeshSetTriangleAttributeCommand:

Public Member Functions

 MeshSetTriangleAttributeCommand (SWMM2DMeshLayer *layer, QByteArray key, QVector< int > triangles, QVector< double > newValues, QVector< double > oldValues, const QString &text, MapCanvas *canvas, QUndoCommand *parent=nullptr)
 
void undo () override
 
void redo () override
 
int id () const override
 
- Public Member Functions inherited from MapCommand
 MapCommand (const QString &text, MapCanvas *canvas, QUndoCommand *parent=nullptr)
 Constructs a map command with a human-readable text.
 
MapCanvascanvas () const
 

Additional Inherited Members

- Protected Attributes inherited from MapCommand
MapCanvasm_canvas
 

Detailed Description

Undoable write of one per-cell parameter across a set of triangles.

Stores the pre-edit value of every touched triangle (NaN for "was unset"). redo() writes the new values, undo() restores the old ones — both through the file-local applyCellParam helper in meshcommands.cpp, so the layer emits attributeChanged and every view refreshes either way. The layer is held as a QPointer: if it is closed, the command becomes inert rather than dangling.

Constructor & Destructor Documentation

◆ MeshSetTriangleAttributeCommand()

MeshSetTriangleAttributeCommand::MeshSetTriangleAttributeCommand ( SWMM2DMeshLayer layer,
QByteArray  key,
QVector< int >  triangles,
QVector< double newValues,
QVector< double oldValues,
const QString &  text,
MapCanvas canvas,
QUndoCommand *  parent = nullptr 
)
Parameters
layerMesh layer that owns the triangles.
keymesh::CellParamSpec key ("mannings", "initDepth", …).
trianglesTriangle indices to write.
newValuesParallel to triangles: the value to write to each.
oldValuesParallel to triangles: the pre-edit value of each (NaN = the attribute was unset).
textUndo-stack label.

Member Function Documentation

◆ id()

int MeshSetTriangleAttributeCommand::id ( ) const
inlineoverride

◆ redo()

void MeshSetTriangleAttributeCommand::redo ( )
override

◆ undo()

void MeshSetTriangleAttributeCommand::undo ( )
override

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