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 // 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 
58 
60  ~GNEChange() {};
61 
62  virtual FXuint size() const {
63  return 1;
64  }
65 
66  virtual FXString undoName() const {
67  return "Undo";
68  }
69  virtual FXString redoName() const {
70  return "Redo";
71  }
72  virtual void undo() {};
73  virtual void redo() {};
74 
75 
76 protected:
81  GNENet* myNet;
82 
86  bool myForward;
87 };
88 
89 #endif
90 /****************************************************************************/
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:48
GNEChange(GNENet *net, bool forward)
Constructor.
Definition: GNEChange.cpp:48
virtual void undo()
Definition: GNEChange.h:72
virtual void redo()
Definition: GNEChange.h:73
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:77
~GNEChange()
Destructor.
Definition: GNEChange.h:60
virtual FXString redoName() const
Definition: GNEChange.h:69
GNENet * myNet
the net to which operations shall be applied or which shall be informed about gui updates (we are not...
Definition: GNEChange.h:73
bool myForward
we group antagonistic commands (create junction/delete junction) and keep them apart by this flag ...
Definition: GNEChange.h:86
virtual FXuint size() const
Definition: GNEChange.h:62
virtual FXString undoName() const
Definition: GNEChange.h:66