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
mapundostack.h
Go to the documentation of this file.
1
11#ifndef MAPUNDOSTACK_H
12#define MAPUNDOSTACK_H
13
14#include <QDateTime>
15#include <QObject>
16#include <QPair>
17#include <QPointF>
18#include <QPointer>
19#include <QString>
20#include <QUndoStack>
21#include <QVector>
22#include "map/mapextent.h"
23#include "layers/swmmmodellayer.h" // SWMMModelLayer::Category used by ReorderCategoriesCommand below
24#include "selection/selectionmanager.h" // SWMMObjectRef used by DeleteDataObjectCommand below
25
26// ---------------------------------------------------------------------------
27// Plain-data snapshots used by delete / undo
28// ---------------------------------------------------------------------------
29
32{
33 QString name;
34 int nodeType = 0;
35 double x = 0, y = 0;
36 double invertElev = 0;
37 double maxDepth = 0;
38 double initDepth = 0;
39 double surchargeDepth = 0;
40 double pondedArea = 0;
41 // virtual junction: the flag plus its rendering-only ground depth. Without
42 // these, undoing the delete of a virtual junction resurrected a plain
43 // junction (and the drawn ground line with it).
44 int isVirtual = 0;
45 double rimDepth = 0;
46 // inlet junction: the second flag plus the [INLET_USAGE] row it owns.
47 // Without them, undoing the delete of an inlet junction resurrected a
48 // plain virtual junction and silently dropped the inlet.
49 int isInlet = 0;
50 bool hasInletUsage = false;
51 SWMM_InletUsage inletUsage{};
52 QString inletDesignId;
53 QString captureNodeId;
54 // outfall-specific
55 int outfallType = 0;
57 // storage-specific
58 double seepRate = 0;
59 // divider-specific
60 int dividerType = 0;
61};
62
65{
66 QString name;
67 int linkType = 0;
68 QString fromNode;
69 QString toNode;
70 QVector<QPointF> interiorVertices;
71 double length = 0;
72 double roughness = 0;
73 double offsetUp = 0;
74 double offsetDn = 0;
75 double crestHeight = 0;
76 double dischargeCoeff = 0;
77 double endContractions = 0;
78 int flapGate = 0;
80};
81
84{
85 QString name;
86 double x = 0, y = 0;
87};
88
91{
92 QString name;
93 QVector<QPointF> polygon;
94 double area = 0;
95 double width = 0;
96 double slope = 0;
97 double impervPct = 0;
98};
99
116class MapUndoStack : public QUndoStack
117{
118 Q_OBJECT
119 Q_PROPERTY(int maxUndoCount READ maxUndoCount WRITE setMaxUndoCount
120 NOTIFY maxUndoCountChanged)
121
122public:
123
124 explicit MapUndoStack(QObject *parent = nullptr);
125
129 [[nodiscard]] int maxUndoCount() const;
130
137 void setMaxUndoCount(int count);
138
143 void loadSettings();
144
148 void saveSettings() const;
149
150signals:
152
153private:
154 static constexpr int DefaultMaxUndoCount = 50;
155};
156
157// ---------------------------------------------------------------------------
158// Base class for all undoable map commands
159// ---------------------------------------------------------------------------
160
161class MapCanvas;
162class OpenSWMMVisLayer;
163
171class MapCommand : public QUndoCommand
172{
173public:
174
180 explicit MapCommand(const QString &text, MapCanvas *canvas, QUndoCommand *parent = nullptr);
181
182 [[nodiscard]] MapCanvas *canvas() const;
183
184protected:
186};
187
188// ---------------------------------------------------------------------------
189// Concrete commands
190// ---------------------------------------------------------------------------
191
192class MapExtent;
194class SWMMModelLayer;
195
201{
202public:
203 PanZoomCommand(const MapExtent &oldExtent,
204 const MapExtent &newExtent,
206 QUndoCommand *parent = nullptr);
207
208 void undo() override;
209 void redo() override;
210
214 bool mergeWith(const QUndoCommand *other) override;
215 int id() const override { return 1; }
216
217private:
218 MapExtent m_oldExtent;
219 MapExtent m_newExtent;
220};
221
227{
228public:
229 ChangeCRSCommand(const QString &oldAuthCode,
230 const QString &newAuthCode,
232 QUndoCommand *parent = nullptr);
233
234 void undo() override;
235 void redo() override;
236
237private:
238 QString m_oldAuthCode;
239 QString m_newAuthCode;
240 bool m_firstRedo = true;
241};
242
248{
249public:
251 QUndoCommand *parent = nullptr);
252
253 void undo() override;
254 void redo() override;
255
256private:
257 OpenSWMMVisLayer *m_layer;
258 int m_position;
259};
260
266{
267public:
269 QUndoCommand *parent = nullptr);
270
271 void undo() override;
272 void redo() override;
273
274private:
275 OpenSWMMVisLayer *m_layer;
276 int m_position;
277};
278
284{
285public:
286 MoveLayerCommand(int oldIndex, int newIndex, MapCanvas *canvas,
287 QUndoCommand *parent = nullptr);
288
289 void undo() override;
290 void redo() override;
291
292private:
293 int m_oldIndex;
294 int m_newIndex;
295};
296
305{
306public:
307 MoveSublayerCommand(OpenSWMMVisLayer *host, int fromIndex, int toIndex,
308 MapCanvas *canvas, QUndoCommand *parent = nullptr);
309
310 void undo() override;
311 void redo() override;
312
313private:
314 OpenSWMMVisLayer *m_host;
315 int m_fromIndex;
316 int m_toIndex;
317};
318
319// ---------------------------------------------------------------------------
320// Phase 2 — Interactive map editing
321// ---------------------------------------------------------------------------
322
335{
336public:
343 {
345 double oldLen;
346 double newLen;
347 };
348
350 int nodeIdx,
351 double oldX, double oldY,
352 double newX, double newY,
353 QVector<LengthRec> lengthRecs,
355 QUndoCommand *parent = nullptr);
356
357 void undo() override;
358 void redo() override;
359
360 int id() const override { return 10; }
361 bool mergeWith(const QUndoCommand *other) override;
362
363private:
364 SWMMModelLayer *m_layer = nullptr;
365 int m_nodeIdx = -1;
366 double m_oldX = 0.0;
367 double m_oldY = 0.0;
368 double m_newX = 0.0;
369 double m_newY = 0.0;
370 QVector<LengthRec> m_lengthRecs;
371};
372
384{
385public:
387 int gageIdx,
388 double oldX, double oldY,
389 double newX, double newY,
391 QUndoCommand *parent = nullptr);
392
393 void undo() override;
394 void redo() override;
395
396 int id() const override { return 14; }
397 bool mergeWith(const QUndoCommand *other) override;
398
399private:
400 SWMMModelLayer *m_layer = nullptr;
401 int m_gageIdx = -1;
402 double m_oldX = 0.0;
403 double m_oldY = 0.0;
404 double m_newX = 0.0;
405 double m_newY = 0.0;
406};
407
418{
419public:
421 int linkIdx,
422 QVector<QPointF> oldInterior,
423 QVector<QPointF> newInterior,
424 double oldLen,
425 double newLen,
426 bool autoLengthApplied,
428 QUndoCommand *parent = nullptr);
429
430 void undo() override;
431 void redo() override;
432
433 int id() const override { return 11; }
434
435private:
436 SWMMModelLayer *m_layer = nullptr;
437 int m_linkIdx = -1;
438 QVector<QPointF> m_oldInterior;
439 QVector<QPointF> m_newInterior;
440 double m_oldLen = 0.0;
441 double m_newLen = 0.0;
442 bool m_autoLengthApplied = false;
443};
444
453{
454public:
456 int linkIdx,
458 QUndoCommand *parent = nullptr);
459
460 void undo() override;
461 void redo() override;
462
463 int id() const override { return 13; }
464
465private:
466 SWMMModelLayer *m_layer = nullptr;
467 int m_linkIdx = -1;
468};
469
475{
476public:
478 int catchIdx,
479 QVector<QPointF> oldVertices,
480 QVector<QPointF> newVertices,
481 double oldArea,
482 double newArea,
483 bool applyArea,
485 QUndoCommand *parent = nullptr);
486
487 void undo() override;
488 void redo() override;
489
490 int id() const override { return 12; }
491
492private:
493 SWMMModelLayer *m_layer = nullptr;
494 int m_catchIdx = -1;
495 QVector<QPointF> m_old;
496 QVector<QPointF> m_new;
497 double m_oldArea = 0.0;
498 double m_newArea = 0.0;
499 bool m_applyArea= false;
500};
501
517{
518public:
526 QString name,
527 int nodeType,
528 double x, double y,
530 double invertElev = 0.0,
531 QUndoCommand *parent = nullptr);
532
533 void undo() override;
534 void redo() override;
535
536 int id() const override { return 12; }
537
538private:
539 SWMMModelLayer *m_layer = nullptr;
540 QString m_name;
541 int m_nodeType = 0;
542 double m_x = 0.0;
543 double m_y = 0.0;
544 double m_invertElev = 0.0;
545 bool m_present = false; // true iff currently applied
546};
547
555{
556public:
564 QString name,
565 int linkType,
566 QString fromNode,
567 QString toNode,
568 QVector<QPointF> interiorVertices,
570 double offsetUp = 0.0,
571 double offsetDn = 0.0,
572 QUndoCommand *parent = nullptr);
573
574 void undo() override;
575 void redo() override;
576 int id() const override { return 13; }
577
578private:
579 SWMMModelLayer *m_layer = nullptr;
580 QString m_name;
581 int m_linkType = 0;
582 QString m_fromNode;
583 QString m_toNode;
584 QVector<QPointF> m_interiorVertices;
585 double m_offsetUp = 0.0;
586 double m_offsetDn = 0.0;
587 bool m_present = false;
588 int m_linkIdx = -1; // engine index, used for auto-length
589};
590
596{
597public:
599 QString name,
600 double x, double y,
602 QUndoCommand *parent = nullptr);
603
604 void undo() override;
605 void redo() override;
606 int id() const override { return 14; }
607
608private:
609 SWMMModelLayer *m_layer = nullptr;
610 QString m_name;
611 double m_x = 0, m_y = 0;
612 bool m_present = false;
613};
614
620{
621public:
623 QString name,
624 QVector<QPointF> polygon,
626 QUndoCommand *parent = nullptr);
627
628 void undo() override;
629 void redo() override;
630 int id() const override { return 15; }
631
632private:
633 SWMMModelLayer *m_layer = nullptr;
634 QString m_name;
635 QVector<QPointF> m_polygon;
636 bool m_present = false;
637 int m_subcatchIdx = -1; // engine index, used for auto-area
638};
639
655{
656public:
658 QStringList subcatchNames,
659 QStringList newGages,
660 QStringList oldGages,
661 const QString &text,
663 QUndoCommand *parent = nullptr);
664
665 void undo() override;
666 void redo() override;
667 int id() const override { return 47; }
668
669private:
671 void apply(const QStringList &gages);
672
673 SWMMModelLayer *m_layer = nullptr;
674 QStringList m_subcatchNames;
675 QStringList m_newGages;
676 QStringList m_oldGages;
677};
678
690{
691public:
693 struct Config
694 {
695 int dataSource = 0;
696 QString timeseries;
697 int rainType = 0;
698 double intervalSec = 3600;
699 double scaleFactor = 1.0;
700 double snowFactor = 1.0;
701 };
702
704 [[nodiscard]] static Config capture(SWMMModelLayer *layer,
705 const QString &gageName,
706 bool *ok = nullptr);
707
709 QString gageName,
710 Config newConfig,
711 Config oldConfig,
713 QUndoCommand *parent = nullptr);
714
715 void undo() override;
716 void redo() override;
717 int id() const override { return 48; }
718
719private:
720 void apply(const Config &c);
721
722 SWMMModelLayer *m_layer = nullptr;
723 QString m_gageName;
724 Config m_new;
725 Config m_old;
726};
727
748class BulkEditCommand : public QUndoCommand
749{
750public:
751 BulkEditCommand(SWMMModelLayer *layer, const QString &text,
752 QUndoCommand *parent = nullptr)
753 : QUndoCommand(text, parent), m_layer(layer) {}
754
755 void redo() override
756 {
757 SWMMModelLayer::BulkEdit guard(m_layer);
758 QUndoCommand::redo();
759 }
760
761 void undo() override
762 {
763 SWMMModelLayer::BulkEdit guard(m_layer);
764 QUndoCommand::undo();
765 }
766
767private:
768 QPointer<SWMMModelLayer> m_layer;
769};
770
780{
781public:
783
785 DeleteObjectCommand(SWMMModelLayer *layer, const QString &name,
787 QUndoCommand *parent = nullptr);
788
792 void setEngineAppliedByBatch(bool b) { m_engineAppliedByBatch = b; }
793
794 void undo() override;
795 void redo() override;
796 int id() const override { return 16; }
797
798private:
799 void snapshotNode(const QString &name);
800 void snapshotLink(const QString &name);
801 void snapshotGage(const QString &name);
802 void snapshotSubcatch(const QString &name);
803 void restoreNode();
804 void restoreLink();
805 void restoreGage();
806 void restoreSubcatch();
807
808 SWMMModelLayer *m_layer = nullptr;
809 TargetKind m_kind;
810 bool m_engineAppliedByBatch = false;
811 NodeSnapshot m_node;
812 QVector<LinkSnapshot> m_cascadeLinks; // cascade-deleted links when a node is deleted
813 LinkSnapshot m_link;
814 GageSnapshot m_gage;
815 SubcatchSnapshot m_subcatch;
816};
817
832{
833public:
835
836 BatchDeleteCommand(SWMMModelLayer *layer, const QList<Target> &targets,
837 MapCanvas *canvas, const QString &text);
838
839 void redo() override;
840
841private:
842 QPointer<SWMMModelLayer> m_layer;
843 QStringList m_nodeNames, m_linkNames, m_subcatchNames, m_gageNames;
844};
845
866{
867public:
869 const SWMMObjectRef &ref,
871 QUndoCommand *parent = nullptr);
872
873 void undo() override;
874 void redo() override;
875 int id() const override { return 17; }
876
879
880private:
881 void snapshotCurve(); void restoreCurve();
882 void snapshotTimeSeries(); void restoreTimeSeries();
883 void snapshotTransect(); void restoreTransect();
884
885 SWMMModelLayer *m_layer = nullptr;
886 SWMMObjectRef m_ref;
887 bool m_captured = false; // snapshot succeeded
888
889 // --- Curve snapshot ---
890 int m_curveType = -1; // openswmmvis::curve::CurveType as int
891 QVector<QPointF> m_curvePoints; // (x, y)
892
893 // --- Time series snapshot ---
894 QString m_tsUnits, m_tsDescription;
895 int m_tsSourceMode = 0; // TimeseriesProvider::SourceMode as int
896 QString m_tsFilePath, m_tsColumnSelector;
897 QDateTime m_tsFileMTime;
898 QVector<QPair<QDateTime, double>> m_tsPoints; // (time, value)
899
900 // --- Transect snapshot ---
901 QString m_txComments;
902 double m_txNLeft = 0, m_txNRight = 0, m_txNChannel = 0;
903 double m_txXLeftBank = 0, m_txXRightBank = 0;
904 double m_txXLeftEncroach = 0, m_txXRightEncroach = 0;
905 double m_txXFactor = 1, m_txYFactor = 1, m_txLengthFactor = 1;
906 QVector<QPair<double, double>> m_txPoints; // (station, elevation)
907};
908
915{
916public:
917 ReorderLayersCommand(QList<OpenSWMMVisLayer *> oldOrder,
918 QList<OpenSWMMVisLayer *> newOrder,
920 QUndoCommand *parent = nullptr);
921 void undo() override;
922 void redo() override;
923
924private:
925 QList<OpenSWMMVisLayer *> m_oldOrder;
926 QList<OpenSWMMVisLayer *> m_newOrder;
927 bool m_firstRedo = true;
928};
929
930// ---------------------------------------------------------------------------
931// Object Browser reorder commands (Slice AY)
932// ---------------------------------------------------------------------------
933
938class ReorderCategoriesCommand : public QUndoCommand
939{
940public:
942 QVector<SWMMModelLayer::Category> oldOrder,
943 QVector<SWMMModelLayer::Category> newOrder,
944 QUndoCommand *parent = nullptr);
945 void undo() override;
946 void redo() override;
947
948private:
949 SWMMModelLayer *m_layer;
950 QVector<SWMMModelLayer::Category> m_oldOrder;
951 QVector<SWMMModelLayer::Category> m_newOrder;
952 bool m_firstRedo = true;
953};
954
962class ReorderObjectsCommand : public QUndoCommand
963{
964public:
967 QVector<int> oldOrder, // empty = was default
968 QVector<int> newOrder,
969 QUndoCommand *parent = nullptr);
970 void undo() override;
971 void redo() override;
972
973private:
974 SWMMModelLayer *m_layer;
976 QVector<int> m_oldOrder; // empty means "was default before this cmd"
977 QVector<int> m_newOrder;
978 bool m_firstRedo = true;
979};
980
983
995{
996public:
1001 AnnotationTextItem *item,
1003 QUndoCommand *parent = nullptr);
1004 ~AddAnnotationCommand() override;
1005
1006 void undo() override;
1007 void redo() override;
1008 int id() const override { return 21; }
1009
1010private:
1011 OpenSWMMVisAnnotationLayer *m_layer = nullptr;
1012 AnnotationTextItem *m_item = nullptr;
1013 QString m_itemId;
1014 bool m_present = false;
1015};
1016
1026{
1027public:
1029 QString linkName, double t,
1030 QString nodeName, QString newLinkName,
1032 QUndoCommand *parent = nullptr);
1033
1034 void undo() override;
1035 void redo() override;
1036 int id() const override { return 22; }
1037
1038private:
1039 SWMMModelLayer *m_layer = nullptr;
1040 QString m_linkName;
1041 double m_t = 0.5;
1042 QString m_nodeName;
1043 QString m_newLinkName;
1044 bool m_present = false;
1045};
1046
1059{
1060public:
1062 QString linkName, double t,
1063 QString nodeName, QString newLinkName,
1065 QUndoCommand *parent = nullptr);
1066
1067 void undo() override;
1068 void redo() override;
1069 int id() const override { return 27; }
1070
1071private:
1072 SWMMModelLayer *m_layer = nullptr;
1073 QString m_linkName;
1074 double m_t = 0.5;
1075 QString m_nodeName;
1076 QString m_newLinkName;
1077 bool m_present = false;
1078};
1079
1099{
1100public:
1102 QString linkName, double t,
1103 QString nodeName, QString newLinkName,
1104 int nodeType,
1106 QUndoCommand *parent = nullptr);
1107
1108 void undo() override;
1109 void redo() override;
1110 int id() const override { return 49; }
1111
1114 [[nodiscard]] QStringList warnings() const { return m_warnings; }
1117 [[nodiscard]] bool retyped() const { return m_retyped; }
1118
1119private:
1120 SWMMModelLayer *m_layer = nullptr;
1121 QString m_linkName;
1122 double m_t = 0.5;
1123 QString m_nodeName;
1124 QString m_newLinkName;
1125 int m_nodeType = 0;
1126 bool m_present = false;
1127 bool m_retyped = false;
1128 QStringList m_warnings;
1129};
1130
1141{
1142public:
1144 QString nodeName,
1146 QUndoCommand *parent = nullptr);
1147
1148 void undo() override;
1149 void redo() override;
1150 int id() const override { return 23; }
1151
1154 bool valid() const { return m_valid; }
1155
1156private:
1157 SWMMModelLayer *m_layer = nullptr;
1158 QString m_nodeName;
1159 QString m_upLinkName;
1160 QString m_dnLinkName;
1161 double m_t = 0.5;
1162 double m_invert = 0.0;
1163 double m_x = 0.0, m_y = 0.0;
1164 bool m_valid = false;
1165 bool m_present = false;
1166};
1167
1179{
1180public:
1185 const SWMM_InletUsage &newUsage,
1186 bool removing,
1188 QUndoCommand *parent = nullptr);
1189
1190 void undo() override;
1191 void redo() override;
1192 int id() const override { return 24; }
1193
1194private:
1195 SWMMModelLayer *m_layer = nullptr;
1196 SWMM_InletUsage m_new{};
1197 SWMM_InletUsage m_old{};
1198 bool m_removing = false;
1199 bool m_hadOld = false;
1200};
1201
1211{
1212public:
1214 QString linkName, double t,
1215 QString nodeName, QString newLinkName,
1216 QString inletId, QString captureNode,
1218 QUndoCommand *parent = nullptr);
1219
1220 void undo() override;
1221 void redo() override;
1222 int id() const override { return 25; }
1223
1224private:
1225 SWMMModelLayer *m_layer = nullptr;
1226 QString m_linkName;
1227 double m_t = 0.5;
1228 QString m_nodeName;
1229 QString m_newLinkName;
1230 QString m_inletId;
1231 QString m_captureNode;
1232 bool m_present = false;
1233};
1234
1245{
1246public:
1248 QString nodeName,
1250 QUndoCommand *parent = nullptr);
1251
1252 void undo() override;
1253 void redo() override;
1254 int id() const override { return 26; }
1255
1258 bool valid() const { return m_valid; }
1259
1260private:
1261 SWMMModelLayer *m_layer = nullptr;
1262 QString m_nodeName;
1263 QString m_upLinkName;
1264 QString m_dnLinkName;
1265 double m_t = 0.5;
1266 double m_invert = 0.0;
1267 double m_x = 0.0, m_y = 0.0;
1268 QString m_inletId;
1269 QString m_captureNode;
1270 SWMM_InletUsage m_usage{};
1271 bool m_valid = false;
1272 bool m_present = false;
1273};
1274
1275#endif // MAPUNDOSTACK_H
Records the placement of a single text annotation.
Definition mapundostack.h:995
~AddAnnotationCommand() override
Definition mapundostack.cpp:1204
void undo() override
Definition mapundostack.cpp:1226
int id() const override
Definition mapundostack.h:1008
void redo() override
Definition mapundostack.cpp:1213
Records the creation of a rain gage.
Definition mapundostack.h:596
int id() const override
Definition mapundostack.h:606
void undo() override
Definition mapundostack.cpp:714
void redo() override
Definition mapundostack.cpp:704
Records adding a layer to the canvas layer stack.
Definition mapundostack.h:248
void undo() override
Definition mapundostack.cpp:182
void redo() override
Definition mapundostack.cpp:194
Records the creation of a SWMM node.
Definition mapundostack.h:517
void undo() override
Definition mapundostack.cpp:530
int id() const override
Definition mapundostack.h:536
void redo() override
Definition mapundostack.cpp:513
Records the creation of a subcatchment polygon.
Definition mapundostack.h:620
void undo() override
Definition mapundostack.cpp:764
void redo() override
Definition mapundostack.cpp:735
int id() const override
Definition mapundostack.h:630
Data model for a single styled text annotation.
Definition annotationtextitem.h:34
Reassigns the rain gage of many subcatchments as ONE undo step.
Definition mapundostack.h:655
int id() const override
Definition mapundostack.h:667
void redo() override
Definition mapundostack.cpp:814
void undo() override
Definition mapundostack.cpp:815
Undoable bulk deletion (perf-plan Phase A2): one engine swmm_*_delete_many call per kind instead of K...
Definition mapundostack.h:832
void redo() override
Definition mapundostack.cpp:1264
Macro command that holds one SWMMModelLayer::BulkEdit scope open across every child command.
Definition mapundostack.h:749
void undo() override
Definition mapundostack.h:761
void redo() override
Definition mapundostack.h:755
BulkEditCommand(SWMMModelLayer *layer, const QString &text, QUndoCommand *parent=nullptr)
Definition mapundostack.h:751
Records a canvas CRS change for undo/redo.
Definition mapundostack.h:227
void redo() override
Definition mapundostack.cpp:158
void undo() override
Definition mapundostack.cpp:149
Snapshot/restore of a rain gage's data-source configuration.
Definition mapundostack.h:690
int id() const override
Definition mapundostack.h:717
void undo() override
Definition mapundostack.cpp:889
static Config capture(SWMMModelLayer *layer, const QString &gageName, bool *ok=nullptr)
Read a gage's current configuration; ok reports success.
Definition mapundostack.cpp:822
void redo() override
Definition mapundostack.cpp:888
Undoable deletion of a non-spatial data object (curve, time series, or transect) held in a SWMMModelL...
Definition mapundostack.h:866
static bool supports(SWMMObjectRef::ObjectType type)
Definition mapundostack.cpp:1302
void undo() override
Definition mapundostack.cpp:1361
int id() const override
Definition mapundostack.h:875
void redo() override
Definition mapundostack.cpp:1326
Undoable deletion of a node, link, rain gage, or subcatchment.
Definition mapundostack.h:780
int id() const override
Definition mapundostack.h:796
void redo() override
Definition mapundostack.cpp:1056
void setEngineAppliedByBatch(bool b)
Definition mapundostack.h:792
void undo() override
Definition mapundostack.cpp:1071
TargetKind
Definition mapundostack.h:782
@ DeleteSubcatch
Definition mapundostack.h:782
@ DeleteLink
Definition mapundostack.h:782
@ DeleteGage
Definition mapundostack.h:782
@ DeleteNode
Definition mapundostack.h:782
Records a change to a subcatchment's polygon vertices.
Definition mapundostack.h:475
int id() const override
Definition mapundostack.h:490
void redo() override
Definition mapundostack.cpp:479
void undo() override
Definition mapundostack.cpp:486
Records a change to a link's interior polyline vertices.
Definition mapundostack.h:418
void undo() override
Definition mapundostack.cpp:420
int id() const override
Definition mapundostack.h:433
void redo() override
Definition mapundostack.cpp:412
Records the re-fusion (deletion) of an inlet junction.
Definition mapundostack.h:1245
bool valid() const
False when the node is not a two-conduit through inlet junction with a readable usage row; the comman...
Definition mapundostack.h:1258
void undo() override
Definition mapundostack.cpp:1836
int id() const override
Definition mapundostack.h:1254
void redo() override
Definition mapundostack.cpp:1829
Records the re-fusion (deletion) of a virtual junction.
Definition mapundostack.h:1141
int id() const override
Definition mapundostack.h:1150
void undo() override
Definition mapundostack.cpp:1681
void redo() override
Definition mapundostack.cpp:1674
bool valid() const
False when the node is not a two-conduit through virtual junction (snapshot failed); the command must...
Definition mapundostack.h:1154
Records a STREET-conduit split that inserts a configured inlet junction (swmm_conduit_split_inlet).
Definition mapundostack.h:1211
int id() const override
Definition mapundostack.h:1222
void undo() override
Definition mapundostack.cpp:1768
void redo() override
Definition mapundostack.cpp:1759
Records a conduit split that inserts a plain (non-virtual) junction.
Definition mapundostack.h:1059
int id() const override
Definition mapundostack.h:1069
void undo() override
Definition mapundostack.cpp:1547
void redo() override
Definition mapundostack.cpp:1539
Records "place a node ON a conduit": the conduit is split at the picked point and a node of the reque...
Definition mapundostack.h:1099
int id() const override
Definition mapundostack.h:1110
void redo() override
Definition mapundostack.cpp:1581
bool retyped() const
Definition mapundostack.h:1117
QStringList warnings() const
Definition mapundostack.h:1114
void undo() override
Definition mapundostack.cpp:1615
Records a conduit split that inserts a virtual junction.
Definition mapundostack.h:1026
void undo() override
Definition mapundostack.cpp:1512
int id() const override
Definition mapundostack.h:1036
void redo() override
Definition mapundostack.cpp:1504
The central map display widget — QGIS-style hybrid rendering.
Definition mapcanvas.h:63
Abstract base for all undoable commands that affect the MapCanvas.
Definition mapundostack.h:172
MapCanvas * m_canvas
Definition mapundostack.h:185
MapCanvas * canvas() const
Definition mapundostack.cpp:85
An axis-aligned bounding box in the coordinate space of a given CRS.
Definition mapextent.h:26
An undo/redo stack for map operations with a configurable maximum depth.
Definition mapundostack.h:117
void maxUndoCountChanged(int count)
void loadSettings()
Convenience: loads the undo limit from QSettings (key "MapCanvas/undoLimit").
Definition mapundostack.cpp:62
void saveSettings() const
Saves the current undo limit to QSettings.
Definition mapundostack.cpp:69
int maxUndoCount
Definition mapundostack.h:120
void setMaxUndoCount(int count)
Sets the maximum number of stored undo operations.
Definition mapundostack.cpp:53
Records a rain-gage coordinate change for undo/redo — the [SYMBOLS] twin of MoveNodeCommand.
Definition mapundostack.h:384
bool mergeWith(const QUndoCommand *other) override
Definition mapundostack.cpp:343
void redo() override
Definition mapundostack.cpp:331
int id() const override
Definition mapundostack.h:396
void undo() override
Definition mapundostack.cpp:337
Records reordering a layer within the canvas stack.
Definition mapundostack.h:284
void redo() override
Definition mapundostack.cpp:249
void undo() override
Definition mapundostack.cpp:243
Records a node coordinate change for undo/redo.
Definition mapundostack.h:335
void undo() override
Definition mapundostack.cpp:309
void redo() override
Definition mapundostack.cpp:301
bool mergeWith(const QUndoCommand *other) override
Definition mapundostack.cpp:356
int id() const override
Definition mapundostack.h:360
Records reordering one sublayer inside an ISublayerHost layer's paint stack (Slice LTR-2026-09-19)....
Definition mapundostack.h:305
void redo() override
Definition mapundostack.cpp:275
void undo() override
Definition mapundostack.cpp:269
Definition annotationlayer.h:30
Abstract base class for all layers displayed in the MapCanvas.
Definition openswmmvislayer.h:116
Records an extent change (pan or zoom) for undo/redo.
Definition mapundostack.h:201
int id() const override
Definition mapundostack.h:215
bool mergeWith(const QUndoCommand *other) override
Attempts to merge consecutive pan operations into a single command.
Definition mapundostack.cpp:113
void undo() override
Definition mapundostack.cpp:101
void redo() override
Definition mapundostack.cpp:107
Records removing a layer from the canvas layer stack.
Definition mapundostack.h:266
void undo() override
Definition mapundostack.cpp:214
void redo() override
Definition mapundostack.cpp:220
Records a SWMM object category order change for undo/redo.
Definition mapundostack.h:939
void undo() override
Definition mapundostack.cpp:581
void redo() override
Definition mapundostack.cpp:586
Records a full layer-stack reorder (e.g. moving an entire category group) as a single undoable step.
Definition mapundostack.h:915
void redo() override
Definition mapundostack.cpp:559
void undo() override
Definition mapundostack.cpp:553
Records a per-category object order change for undo/redo.
Definition mapundostack.h:963
void undo() override
Definition mapundostack.cpp:609
void redo() override
Definition mapundostack.cpp:617
Definition swmmmodellayer.h:1899
Renders the SWMM network elements (nodes, links, subcatchments, rain gages) for one OpenSWMMEngine mo...
Definition swmmmodellayer.h:133
Records a change to one inlet-usage row (conduit host or inlet junction host — the same command serve...
Definition mapundostack.h:1179
int id() const override
Definition mapundostack.h:1192
void redo() override
Definition mapundostack.cpp:1720
void undo() override
Definition mapundostack.cpp:1729
Represents a coordinate reference system backed by a GDAL OGRSpatialReference.
Definition spatialreferencesystem.h:28
DiagramType t
Definition diagramspec.cpp:20
enum OpenSWMM::Render::@788::Value::Type type
QString nodeName
Definition importplanning.cpp:95
bool ok
Definition inpmeshwriter.cpp:575
Axis-aligned bounding box in a map coordinate system, used by MapCanvas and all layer types to define...
int b
local residual indices, a < b
Definition meshquadmatch.cpp:46
SwmmCategory
Stable ordinal categorising every SWMM-element kind that has per-kind styling, per-kind tree rows,...
Definition swmm_category.h:28
int count
Definition numberformat.cpp:101
EdgeRef ref
Definition pslgminsize.cpp:377
QVector< int > parent
union-find
Definition pslgminsize.cpp:176
TokenKind kind
Definition queryparser.cpp:34
QString text
Definition queryparser.cpp:35
int position
Definition queryparser.cpp:149
QString name
Definition sectionmodelbuilders.cpp:474
Definition mapundostack.h:834
DeleteObjectCommand::TargetKind kind
Definition mapundostack.h:834
QString name
Definition mapundostack.h:834
The subset of gage state this command owns.
Definition mapundostack.h:694
QString timeseries
Series name when dataSource is TIMESERIES.
Definition mapundostack.h:696
double snowFactor
Definition mapundostack.h:700
double scaleFactor
Definition mapundostack.h:699
double intervalSec
Recording interval.
Definition mapundostack.h:698
int rainType
SWMM_GageRainType.
Definition mapundostack.h:697
int dataSource
SWMM_GageDataSource (0 = TIMESERIES).
Definition mapundostack.h:695
Definition mapundostack.h:84
double x
Definition mapundostack.h:86
QString name
Definition mapundostack.h:85
double y
Definition mapundostack.h:86
Per-link length snapshot used by auto-length.
Definition mapundostack.h:343
double newLen
Definition mapundostack.h:346
double oldLen
Definition mapundostack.h:345
int linkIdx
Definition mapundostack.h:344
Definition mapundostack.h:32
QString name
Definition mapundostack.h:33
int outfallFlapGate
Definition mapundostack.h:56
int nodeType
Definition mapundostack.h:34
double maxDepth
Definition mapundostack.h:37
int isVirtual
Definition mapundostack.h:44
int outfallType
Definition mapundostack.h:55
bool hasInletUsage
Definition mapundostack.h:50
QString inletDesignId
resolved by name — indices shift
Definition mapundostack.h:52
double seepRate
Definition mapundostack.h:58
int dividerType
Definition mapundostack.h:60
double invertElev
Definition mapundostack.h:36
int isInlet
Definition mapundostack.h:49
double rimDepth
Definition mapundostack.h:45
double pondedArea
Definition mapundostack.h:40
double surchargeDepth
Definition mapundostack.h:39
double x
Definition mapundostack.h:35
SWMM_InletUsage inletUsage
Definition mapundostack.h:51
QString captureNodeId
resolved by name — indices shift
Definition mapundostack.h:53
double y
Definition mapundostack.h:35
double initDepth
Definition mapundostack.h:38
Identifies a single SWMM object.
Definition selectionmanager.h:32
ObjectType
Coarse object kind. Mirrors the engine's logical groupings; finer subtypes (e.g. junction vs outfall)...
Definition selectionmanager.h:39
Definition mapundostack.h:91
double impervPct
Definition mapundostack.h:97
QString name
Definition mapundostack.h:92
double slope
Definition mapundostack.h:96
QVector< QPointF > polygon
Definition mapundostack.h:93
double area
Definition mapundostack.h:94
double width
Definition mapundostack.h:95
Map layer that renders an OpenSWMMEngine network (nodes, links, subcatchments, rain gages) and provid...