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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 // The reification of a NETEDIT editing operation (see command pattern)
18 // inherits from FXCommand and is used to for undo/redo
19 /****************************************************************************/
20 #ifndef GNEChange_h
21 #define GNEChange_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include <fx.h>
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class GNENet;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
48 class GNEChange : public FXCommand {
49  FXDECLARE_ABSTRACT(GNEChange)
50 
51 public:
56  GNEChange(GNENet* net, bool forward);
57 
59  ~GNEChange();
60 
62  virtual FXuint size() const;
63 
65  virtual FXString undoName() const;
66 
68  virtual FXString redoName() const;
69 
71  virtual void undo();
72 
74  virtual void redo();
75 
76 protected:
82 
86  bool myForward;
87 };
88 
89 #endif
90 /****************************************************************************/
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:48
virtual void undo()
undo action/operation
Definition: GNEChange.cpp:70
GNEChange(GNENet *net, bool forward)
Constructor.
Definition: GNEChange.cpp:43
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:91
virtual FXuint size() const
return actual size
Definition: GNEChange.cpp:52
~GNEChange()
Destructor.
Definition: GNEChange.cpp:48
virtual void redo()
redo action/operation
Definition: GNEChange.cpp:74
virtual FXString undoName() const
return undoName
Definition: GNEChange.cpp:58
GNENet * myNet
the net to which operations shall be applied or which shall be informed about gui updates (we are not...
Definition: GNEChange.h:81
bool myForward
we group antagonistic commands (create junction/delete junction) and keep them apart by this flag ...
Definition: GNEChange.h:86
virtual FXString redoName() const
return rendoName
Definition: GNEChange.cpp:64