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 /****************************************************************************/
15 // The reification of a NETEDIT editing operation (see command pattern)
16 // inherits from FXCommand and is used to for undo/redo
17 /****************************************************************************/
18 #ifndef GNEChange_h
19 #define GNEChange_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <fx.h>
28 #include <vector>
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
34 class GNENet;
35 
36 // ===========================================================================
37 // class definitions
38 // ===========================================================================
43 class GNEChange : public FXCommand {
44  FXDECLARE_ABSTRACT(GNEChange)
45 
46 public:
51  GNEChange(GNENet* net, bool forward);
52 
54  ~GNEChange();
55 
57  virtual FXuint size() const;
58 
60  virtual FXString undoName() const;
61 
63  virtual FXString redoName() const;
64 
66  virtual void undo();
67 
69  virtual void redo();
70 
71 protected:
77 
81  bool myForward;
82 };
83 
84 #endif
85 /****************************************************************************/
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:43
virtual void undo()
undo action/operation
Definition: GNEChange.cpp:63
GNEChange(GNENet *net, bool forward)
Constructor.
Definition: GNEChange.cpp:36
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:78
virtual FXuint size() const
return actual size
Definition: GNEChange.cpp:45
~GNEChange()
Destructor.
Definition: GNEChange.cpp:41
virtual void redo()
redo action/operation
Definition: GNEChange.cpp:67
virtual FXString undoName() const
return undoName
Definition: GNEChange.cpp:51
GNENet * myNet
the net to which operations shall be applied or which shall be informed about gui updates (we are not...
Definition: GNEChange.h:76
bool myForward
we group antagonistic commands (create junction/delete junction) and keep them apart by this flag ...
Definition: GNEChange.h:81
virtual FXString redoName() const
return rendoName
Definition: GNEChange.cpp:57