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 /****************************************************************************/
14 // A network change in which the attribute of some object is modified
15 /****************************************************************************/
16 #ifndef GNEChange_Attribute_h
17 #define GNEChange_Attribute_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <fx.h>
28 #include "GNEChange.h"
29 
30 // ===========================================================================
31 // class declarations
32 // ===========================================================================
34 class GNENetElement;
35 class GNEAdditional;
36 class GNEDemandElement;
37 class GNEShape;
38 class GNENet;
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
48  FXDECLARE_ABSTRACT(GNEChange_Attribute)
49 
50 public:
58  GNENet* net,
59  const SumoXMLAttr key,
60  const std::string& value,
61  bool customOrigValue = false,
62  const std::string& origValue = "");
63 
72  GNENet* net,
73  bool forceChange,
74  const SumoXMLAttr key,
75  const std::string& value);
76 
79 
83  FXString undoName() const;
84 
86  FXString redoName() const;
87 
89  void undo();
90 
92  void redo();
94 
96  bool trueChange();
97 
98 private:
103 
106 
109 
111  const std::string myOrigValue;
112 
114  const std::string myNewValue;
115 };
116 
117 #endif
118 /****************************************************************************/
GNEChange_Attribute::myOrigValue
const std::string myOrigValue
the original value
Definition: GNEChange_Attribute.h:111
fxexdefs.h
GNEDemandElement
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEDemandElement.h:55
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:48
GNENet
A NBNetBuilder extended by visualisation and editing capabilities.
Definition: GNENet.h:77
GNEChange_Attribute::~GNEChange_Attribute
~GNEChange_Attribute()
Destructor.
Definition: GNEChange_Attribute.cpp:61
GNEChange.h
GNEShape
Definition: GNEShape.h:34
GNEChange_Attribute::trueChange
bool trueChange()
wether original and new value differ
Definition: GNEChange_Attribute.cpp:132
GNEChange_Attribute::myForceChange
bool myForceChange
flag used to force set attributes
Definition: GNEChange_Attribute.h:108
GNEChange_Attribute::myNewValue
const std::string myNewValue
the original value
Definition: GNEChange_Attribute.h:114
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:36
GNENetElement
Definition: GNENetElement.h:43
GNEChange_Attribute::myKey
const SumoXMLAttr myKey
The attribute name (or the original attribute if we're editing a disjoint attribute)
Definition: GNEChange_Attribute.h:105
GNEChange_Attribute::undoName
FXString undoName() const
return undoName
Definition: GNEChange_Attribute.cpp:143
GNEChange_Attribute::redoName
FXString redoName() const
get Redo name
Definition: GNEChange_Attribute.cpp:149
GNEChange_Attribute::myAC
GNEAttributeCarrier * myAC
the net to which all operations shall be applied
Definition: GNEChange_Attribute.h:102
config.h
GNEChange_Attribute
the function-object for an editing operation (abstract base)
Definition: GNEChange_Attribute.h:47
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:372
GNEChange
the function-object for an editing operation (abstract base)
Definition: GNEChange.h:42
GNEAttributeCarrier
Definition: GNEAttributeCarrier.h:54
SUMOXMLDefinitions.h
GNEChange_Attribute::redo
void redo()
redo action
Definition: GNEChange_Attribute.cpp:108
GNEChange_Attribute::undo
void undo()
undo action
Definition: GNEChange_Attribute.cpp:84