Eclipse SUMO - Simulation of Urban MObility
GNEChange.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
14 // The reification of a NETEDIT editing operation (see command pattern)
15 // inherits from FXCommand and is used to for undo/redo
16 /****************************************************************************/
17 #ifndef GNEChange_h
18 #define GNEChange_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <fx.h>
27 #include <vector>
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
33 class GNENet;
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
42 class GNEChange : public FXCommand {
43  FXDECLARE_ABSTRACT(GNEChange)
44 
45 public:
50  GNEChange(GNENet* net, bool forward);
51 
53  ~GNEChange();
54 
56  virtual FXuint size() const;
57 
59  virtual FXString undoName() const;
60 
62  virtual FXString redoName() const;
63 
65  virtual void undo();
66 
68  virtual void redo();
69 
70 protected:
76 
80  bool myForward;
81 };
82 
83 #endif
84 /****************************************************************************/
fxexdefs.h
GNEChange::myForward
bool myForward
we group antagonistic commands (create junction/delete junction) and keep them apart by this flag
Definition: GNEChange.h:80
GNEChange::size
virtual FXuint size() const
return actual size
Definition: GNEChange.cpp:44
GNENet
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:77
GNEChange::undoName
virtual FXString undoName() const
return undoName
Definition: GNEChange.cpp:50
GNEChange::~GNEChange
~GNEChange()
Destructor.
Definition: GNEChange.cpp:40
GNEChange::myNet
GNENet * myNet
the net to which operations shall be applied or which shall be informed about gui updates (we are not...
Definition: GNEChange.h:75
GNEChange::redoName
virtual FXString redoName() const
return rendoName
Definition: GNEChange.cpp:56
GNEChange::GNEChange
GNEChange(GNENet *net, bool forward)
Constructor.
Definition: GNEChange.cpp:35
GNEChange::undo
virtual void undo()
undo action/operation
Definition: GNEChange.cpp:62
config.h
GNEChange::redo
virtual void redo()
redo action/operation
Definition: GNEChange.cpp:66
GNEChange
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:42