Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/changes/GNEChangeGroup.h
169678 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2006-2025 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
14
/// @file GNEChangeGroup.h
15
/// @author Pablo Alvarez Lopez
16
/// @date Sep 2021
17
///
18
//
19
/****************************************************************************/
20
#pragma once
21
#include <config.h>
22
23
#include "GNEChange.h"
24
25
/**
26
* Group of undoable commands. A group may comprise multiple
27
* individual actions which together undo (or redo) a larger
28
* operation. Even larger operations may be built by nesting
29
* multiple undo groups.
30
*/
31
class GNEChangeGroup : public GNEChange {
32
FXDECLARE(GNEChangeGroup)
33
34
public:
35
/// @name declare friend class
36
friend class GNEUndoList;
37
38
/// @brief Construct initially empty undo command group
39
GNEChangeGroup(Supermode groupSupermode, GUIIcon icon, const std::string& description);
40
41
/// @brief Delete undo command and sub-commands
42
~GNEChangeGroup();
43
44
/// @brief Undo whole command group
45
void undo();
46
47
/// @brief Redo whole command group
48
void redo();
49
50
/// @brief get undo Name
51
std::string undoName() const;
52
53
/// @brief get redo name
54
std::string redoName() const;
55
56
/// @brief Return the size of the command group
57
int size() const;
58
59
/// @brief get description
60
const std::string& getDescription();
61
62
/// @brief get timeStamp
63
const std::string& getTimeStamp();
64
65
/// @brief get supermode associated with this ChangeGroup
66
Supermode getGroupSupermode() const;
67
68
/// @brief get icon associated with this ChangeGroup
69
GUIIcon getGroupIcon() const;
70
71
/// @brief Return TRUE if empty
72
bool empty() const;
73
74
protected:
75
/// @brief FOX need this
76
GNEChangeGroup();
77
78
/// @brief description of command
79
const std::string myDescription;
80
81
/// @brief supermode associated with this ChangeGroup
82
const Supermode myGroupSupermode;
83
84
/// @brief icon associated with this ChangeGroup
85
const GUIIcon myIcon;
86
87
private:
88
/// @brief undo list command (can be access by GNEUndoList)
89
GNEChange* undoList;
90
91
/// @brief redo list command (can be access by GNEUndoList)
92
GNEChange* redoList;
93
94
/// @brief group (can be access by GNEUndoList)
95
GNEChangeGroup* group;
96
97
/// @brief timeStamp HH:MM:SS
98
std::string myTimeStamp;
99
100
/// @brief invalidate copy constructor
101
GNEChangeGroup(const GNEChangeGroup&);
102
103
/// @brief invalidate assignment operator
104
GNEChangeGroup& operator=(const GNEChangeGroup&) = delete;
105
};
106
107