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
legendclasseditcommands.h File Reference

QUndoCommand wrappers for per-class renderer edits driven from the legend (Slice BB Phase 8.6.16). More...

#include <QColor>
#include <QPointer>
#include <QString>
#include <QUndoCommand>
Include dependency graph for legendclasseditcommands.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  openswmmvis::map::SetRendererClassColorCommand
 Records a per-class colour change on a layer's IFeatureRenderer. More...
 
class  openswmmvis::map::SetRendererClassSizeCommand
 Records a per-class size (or line width) change on a layer's IFeatureRenderer. Mirrors SetRendererClassColorCommand semantics: snapshots sizeForClass(classKey) at construction, restores it on undo, and merges consecutive edits on the same target so spinbox drags collapse to a single undo step. More...
 

Namespaces

namespace  openswmmvis
 
namespace  openswmmvis::map
 

Detailed Description

QUndoCommand wrappers for per-class renderer edits driven from the legend (Slice BB Phase 8.6.16).

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

Every per-class colour / size / symbol edit issued by the legend's right-click menu or by the LegendPropertiesDialog Layers tab flows through one of these commands so Ctrl+Z reverses it uniformly across every view of the same data (canvas paint, on-canvas legend, dock, dialog).

The command stores the layer + classKey, snapshots the renderer's "before" state through IFeatureRenderer::colorForClass (or sibling queries), and on undo writes that snapshot back via setColorForClass. Mutating the renderer is followed by an explicit emit of layer->repaintRequested() — the canvas + legend overlay are both subscribed to it (existing signal chain).

The layer is held via QPointer so the command becomes a clean no-op if the layer is removed before undo / redo fires.