SUMO - Simulation of Urban MObility
GNEChange.h
Go to the documentation of this file.
1 /****************************************************************************/
7 // The reification of a NETEDIT editing operation (see command pattern)
8 // inherits from FXCommand and is used to for undo/redo
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef GNEChange_h
22 #define GNEChange_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <fx.h>
36 
37 // ===========================================================================
38 // class declarations
39 // ===========================================================================
40 class GNENet;
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
49 class GNEChange : public FXCommand {
50  FXDECLARE_ABSTRACT(GNEChange)
51 
52 public:
57  GNEChange(GNENet* net, bool forward);
58 
60  ~GNEChange();
61 
63  virtual FXuint size() const;
64 
66  virtual FXString undoName() const;
67 
69  virtual FXString redoName() const;
70 
72  virtual void undo();
73 
75  virtual void redo();
76 
77 protected:
83 
87  bool myForward;
88 };
89 
90 #endif
91 /****************************************************************************/
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:49
virtual void undo()
undo action/operation
Definition: GNEChange.cpp:75
GNEChange(GNENet *net, bool forward)
Constructor.
Definition: GNEChange.cpp:48
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:87
virtual FXuint size() const
return actual size
Definition: GNEChange.cpp:57
~GNEChange()
Destructor.
Definition: GNEChange.cpp:53
virtual void redo()
redo action/operation
Definition: GNEChange.cpp:79
virtual FXString undoName() const
return undoName
Definition: GNEChange.cpp:63
GNENet * myNet
the net to which operations shall be applied or which shall be informed about gui updates (we are not...
Definition: GNEChange.h:82
bool myForward
we group antagonistic commands (create junction/delete junction) and keep them apart by this flag ...
Definition: GNEChange.h:87
virtual FXString redoName() const
return rendoName
Definition: GNEChange.cpp:69