Eclipse 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-2019 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 GNEDemandElement;
38 class GNEShape;
39 class GNENet;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
49  FXDECLARE_ABSTRACT(GNEChange_Attribute)
50 
51 public:
59  GNENet* net,
60  const SumoXMLAttr key,
61  const std::string& value,
62  bool customOrigValue = false,
63  const std::string& origValue = "");
64 
73  GNENet* net,
74  bool forceChange,
75  const SumoXMLAttr key,
76  const std::string& value);
77 
80 
84  FXString undoName() const;
85 
87  FXString redoName() const;
88 
90  void undo();
91 
93  void redo();
95 
97  bool trueChange();
98 
99 private:
104 
107 
110 
112  const std::string myOrigValue;
113 
115  const std::string myNewValue;
116 };
117 
118 #endif
119 /****************************************************************************/
GNEChange_Attribute::myOrigValue
const std::string myOrigValue
the original value
Definition: GNEChange_Attribute.h:112
fxexdefs.h
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:54
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
GNENet
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:78
GNEChange_Attribute::~GNEChange_Attribute
~GNEChange_Attribute()
Destructor.
Definition: GNEChange_Attribute.cpp:62
GNEChange.h
GNEShape
Definition: GNEShape.h:35
GNEChange_Attribute::trueChange
bool trueChange()
wether original and new value differ
Definition: GNEChange_Attribute.cpp:133
GNEChange_Attribute::myForceChange
bool myForceChange
flag used to force set attributes
Definition: GNEChange_Attribute.h:109
GNEChange_Attribute::myNewValue
const std::string myNewValue
the original value
Definition: GNEChange_Attribute.h:115
GNEChange_Attribute::GNEChange_Attribute
GNEChange_Attribute(GNEAttributeCarrier *ac, GNENet *net, const SumoXMLAttr key, const std::string &value, bool customOrigValue=false, const std::string &origValue="")
Constructor.
Definition: GNEChange_Attribute.cpp:37
GNENetElement
Definition: GNENetElement.h:42
GNEChange_Attribute::myKey
const SumoXMLAttr myKey
The attribute name (or the original attribute if we're editing a disjoint attribute)
Definition: GNEChange_Attribute.h:106
GNEChange_Attribute::undoName
FXString undoName() const
return undoName
Definition: GNEChange_Attribute.cpp:144
GNEChange_Attribute::redoName
FXString redoName() const
get Redo name
Definition: GNEChange_Attribute.cpp:150
GNEChange_Attribute::myAC
GNEAttributeCarrier * myAC
the net to which all operations shall be applied
Definition: GNEChange_Attribute.h:103
config.h
GNEChange_Attribute
the function-object for an editing operation (abstract base)
Definition: GNEChange_Attribute.h:48
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:373
GNEChange
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:43
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:54
SUMOXMLDefinitions.h
GNEChange_Attribute::redo
void redo()
redo action
Definition: GNEChange_Attribute.cpp:109
GNEChange_Attribute::undo
void undo()
undo action
Definition: GNEChange_Attribute.cpp:85