SUMO - Simulation of Urban MObility
GNEChange_Additional.cpp
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
10 // Copyright (C) 2001-2013 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #ifdef _MSC_VER
25 #include <windows_config.h>
26 #else
27 #include <config.h>
28 #endif
29 
30 #include "GNEChange_Additional.h"
31 #include "GNENet.h"
32 #include "GNEAdditional.h"
33 #include "GNEViewNet.h"
34 
35 #ifdef CHECK_MEMORY_LEAKS
36 #include <foreign/nvwa/debug_new.h>
37 #endif
38 
39 
40 // ===========================================================================
41 // FOX-declarations
42 // ===========================================================================
43 FXIMPLEMENT_ABSTRACT(GNEChange_Additional, GNEChange, NULL, 0)
44 
45 // ===========================================================================
46 // member method definitions
47 // ===========================================================================
48 
50  GNEChange(net, forward),
51  myAdditional(additional) {
52  assert(myNet);
53  myAdditional->incRef("GNEChange_Additional");
54 }
55 
56 
58  assert(myAdditional);
59  myAdditional->decRef("GNEChange_Additional");
60  if (myAdditional->unreferenced()) {
61  delete myAdditional;
62  }
63 }
64 
65 
67  if (myForward) {
69  } else {
71  }
72 }
73 
74 
76  if (myForward) {
78  } else {
80  }
81 }
82 
83 
85  if (myForward) {
86  return ("Undo create additional");
87  } else {
88  return ("Undo delete additional");
89  }
90 }
91 
92 
94  if (myForward) {
95  return ("Redo create additional");
96  } else {
97  return ("Redo delete additional");
98  }
99 }
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:49
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:86
~GNEChange_Additional()
Destructor.
GNEAdditional * myAdditional
full information regarding the additional element that is to be created/deleted
FXString undoName() const
return undoName
void decRef(const std::string &debugMsg="")
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
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:63
bool myForward
we group antagonistic commands (create junction/delete junction) and keep them apart by this flag ...
Definition: GNEChange.h:87
void deleteAdditional(GNEAdditional *additional)
delete additional element previously inserted
Definition: GNENet.cpp:1065
FXString redoName() const
get Redo name
void insertAdditional(GNEAdditional *additional, bool hardFail=true)
Insert a additional element previously created in GNEAdditionalHandler.
Definition: GNENet.cpp:1046