SUMO - Simulation of Urban MObility
GNEChange_Attribute.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-2018 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 // A network change in which the attribute of some object is modified
16 /****************************************************************************/
17 #ifndef GNEChange_Attribute_h
18 #define GNEChange_Attribute_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <fx.h>
29 #include "GNEChange.h"
30 
31 // ===========================================================================
32 // class declarations
33 // ===========================================================================
35 class GNENetElement;
36 class GNEAdditional;
37 class GNEShape;
38 class GNENet;
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
48  FXDECLARE_ABSTRACT(GNEChange_Attribute)
49 
50 public:
58  const SumoXMLAttr key,
59  const std::string& value,
60  bool customOrigValue = false,
61  const std::string& origValue = "");
62 
70  const SumoXMLAttr key,
71  const std::string& value,
72  bool customOrigValue = false,
73  const std::string& origValue = "");
74 
82  const SumoXMLAttr key,
83  const std::string& value,
84  bool customOrigValue = false,
85  const std::string& origValue = "");
86 
89 
93  FXString undoName() const;
94 
96  FXString redoName() const;
97 
99  void undo();
100 
102  void redo();
104 
106  bool trueChange();
107 
108 private:
113 
116 
118  std::string myOrigValue;
119 
121  std::string myNewValue;
122 
125 
128 
131 
134 };
135 
136 #endif
137 /****************************************************************************/
void redo()
redo action
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:43
SumoXMLAttr myKey
The attribute name.
GNEChange_Attribute(GNENetElement *netElement, const SumoXMLAttr key, const std::string &value, bool customOrigValue=false, const std::string &origValue="")
Constructor for NetElements.
void undo()
undo action
GNENet * myNet
pointer to Net (used to simplify code)
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:77
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
the function-object for an editing operation (abstract base)
bool trueChange()
wether original and new value differ
std::string myNewValue
the original value
~GNEChange_Attribute()
Destructor.
FXString undoName() const
return undoName
GNEAdditional * myAdditional
used if AC is an additional element
GNENetElement * myNetElement
used if AC is an net element
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
FXString redoName() const
get Redo name
GNEAttributeCarrier * myAC
the net to which all operations shall be applied
GNEShape * myShape
used if AC is a shape element
std::string myOrigValue
the original value