![]() |
SUMO - Simulation of Urban MObility
|
the function-object for an editing operation (abstract base) More...
#include <GNEChange_Attribute.h>
Public Member Functions | |
GNEChange_Attribute (GNENetElement *netElement, const SumoXMLAttr key, const std::string &value, bool customOrigValue=false, const std::string &origValue="") | |
Constructor for NetElements. More... | |
GNEChange_Attribute (GNEAdditional *additional, const SumoXMLAttr key, const std::string &value, bool customOrigValue=false, const std::string &origValue="") | |
Constructor for Additionals. More... | |
GNEChange_Attribute (GNEShape *shape, const SumoXMLAttr key, const std::string &value, bool customOrigValue=false, const std::string &origValue="") | |
Constructor for Shapes. More... | |
virtual FXuint | size () const |
return actual size More... | |
bool | trueChange () |
wether original and new value differ More... | |
~GNEChange_Attribute () | |
Destructor. More... | |
inherited from GNEChange | |
get undo Name | |
FXString | undoName () const |
return undoName More... | |
FXString | redoName () const |
get Redo name More... | |
void | undo () |
undo action More... | |
void | redo () |
redo action More... | |
Protected Attributes | |
bool | myForward |
we group antagonistic commands (create junction/delete junction) and keep them apart by this flag More... | |
Private Attributes | |
GNEAttributeCarrier * | myAC |
the net to which all operations shall be applied More... | |
GNEAdditional * | myAdditional |
used if AC is an additional element More... | |
SumoXMLAttr | myKey |
The attribute name. More... | |
GNENet * | myNet |
pointer to Net (used to simplify code) More... | |
GNENetElement * | myNetElement |
used if AC is an net element More... | |
std::string | myNewValue |
the original value More... | |
std::string | myOrigValue |
the original value More... | |
GNEShape * | myShape |
used if AC is a shape element More... | |
the function-object for an editing operation (abstract base)
Definition at line 47 of file GNEChange_Attribute.h.
GNEChange_Attribute::GNEChange_Attribute | ( | GNENetElement * | netElement, |
const SumoXMLAttr | key, | ||
const std::string & | value, | ||
bool | customOrigValue = false , |
||
const std::string & | origValue = "" |
||
) |
Constructor for NetElements.
[in] | ac | The attribute-carrier to be modified |
[in] | key | The attribute key |
[in] | value | The new value |
[in] | testingMode | flag to indicate if netedit is running in testing mode |
Definition at line 40 of file GNEChange_Attribute.cpp.
References toString().
GNEChange_Attribute::GNEChange_Attribute | ( | GNEAdditional * | additional, |
const SumoXMLAttr | key, | ||
const std::string & | value, | ||
bool | customOrigValue = false , |
||
const std::string & | origValue = "" |
||
) |
Constructor for Additionals.
[in] | ac | The attribute-carrier to be modified |
[in] | key | The attribute key |
[in] | value | The new value |
[in] | testingMode | flag to indicate if netedit is running in testing mode |
Definition at line 57 of file GNEChange_Attribute.cpp.
References GNEReferenceCounter::incRef(), myAC, myAdditional, myKey, myNetElement, myShape, and toString().
GNEChange_Attribute::GNEChange_Attribute | ( | GNEShape * | shape, |
const SumoXMLAttr | key, | ||
const std::string & | value, | ||
bool | customOrigValue = false , |
||
const std::string & | origValue = "" |
||
) |
Constructor for Shapes.
[in] | ac | The attribute-carrier to be modified |
[in] | key | The attribute key |
[in] | value | The new value |
[in] | testingMode | flag to indicate if netedit is running in testing mode |
Definition at line 74 of file GNEChange_Attribute.cpp.
References GNEReferenceCounter::incRef(), myAC, myAdditional, myKey, myNetElement, myShape, and toString().
GNEChange_Attribute::~GNEChange_Attribute | ( | ) |
Destructor.
Definition at line 91 of file GNEChange_Attribute.cpp.
References GNEReferenceCounter::decRef(), GNEAttributeCarrier::getID(), GNEAttributeCarrier::TagProperties::getTag(), GNEAttributeCarrier::getTagProperty(), GNEAttributeCarrier::getTagStr(), myAC, myKey, myNet, myShape, ShapeContainer::removePOI(), ShapeContainer::removePolygon(), SUMO_TAG_POI, SUMO_TAG_POILANE, SUMO_TAG_POLY, toString(), GNEReferenceCounter::unreferenced(), and WRITE_DEBUG.
|
virtual |
redo action
Reimplemented from GNEChange.
Definition at line 132 of file GNEChange_Attribute.cpp.
References GNEAttributeCarrier::getID(), GNEAttributeCarrier::getTagStr(), GNE_ATTR_SELECTED, myAC, myAdditional, myKey, myNet, myNetElement, myNewValue, myShape, GNENet::requiereSaveAdditionals(), GNENet::requiereSaveNet(), GNENet::requiereSaveShapes(), GNEAttributeCarrier::setAttribute(), toString(), and WRITE_DEBUG.
|
virtual |
get Redo name
Reimplemented from GNEChange.
Definition at line 163 of file GNEChange_Attribute.cpp.
References GNEAttributeCarrier::getTagStr(), and myAC.
|
virtualinherited |
bool GNEChange_Attribute::trueChange | ( | ) |
wether original and new value differ
Definition at line 151 of file GNEChange_Attribute.cpp.
References myNewValue, and myOrigValue.
Referenced by GNEUndoList::p_add().
|
virtual |
undo action
Reimplemented from GNEChange.
Definition at line 113 of file GNEChange_Attribute.cpp.
References GNEAttributeCarrier::getID(), GNEAttributeCarrier::getTagStr(), GNE_ATTR_SELECTED, myAC, myAdditional, myKey, myNet, myNetElement, myOrigValue, myShape, GNENet::requiereSaveAdditionals(), GNENet::requiereSaveNet(), GNENet::requiereSaveShapes(), GNEAttributeCarrier::setAttribute(), toString(), and WRITE_DEBUG.
|
virtual |
return undoName
Reimplemented from GNEChange.
Definition at line 157 of file GNEChange_Attribute.cpp.
References GNEAttributeCarrier::getTagStr(), and myAC.
|
private |
the net to which all operations shall be applied
Definition at line 112 of file GNEChange_Attribute.h.
Referenced by GNEChange_Attribute(), redo(), redoName(), undo(), undoName(), and ~GNEChange_Attribute().
|
private |
used if AC is an additional element
Definition at line 130 of file GNEChange_Attribute.h.
Referenced by GNEChange_Attribute(), redo(), and undo().
|
protectedinherited |
we group antagonistic commands (create junction/delete junction) and keep them apart by this flag
Definition at line 81 of file GNEChange.h.
Referenced by GNEChange_Junction::redo(), GNEChange_Shape::redo(), GNEChange_Additional::redo(), GNEChange_TLS::redo(), GNEChange_Connection::redo(), GNEChange_Edge::redo(), GNEChange_Lane::redo(), GNEChange_Crossing::redo(), GNEChange_Junction::redoName(), GNEChange_Shape::redoName(), GNEChange_TLS::redoName(), GNEChange_Additional::redoName(), GNEChange_Connection::redoName(), GNEChange_Edge::redoName(), GNEChange_Lane::redoName(), GNEChange_Crossing::redoName(), GNEChange_Junction::undo(), GNEChange_Shape::undo(), GNEChange_TLS::undo(), GNEChange_Additional::undo(), GNEChange_Connection::undo(), GNEChange_Edge::undo(), GNEChange_Lane::undo(), GNEChange_Crossing::undo(), GNEChange_Shape::undoName(), GNEChange_Junction::undoName(), GNEChange_TLS::undoName(), GNEChange_Additional::undoName(), GNEChange_Connection::undoName(), GNEChange_Edge::undoName(), GNEChange_Lane::undoName(), and GNEChange_Crossing::undoName().
|
private |
The attribute name.
Definition at line 115 of file GNEChange_Attribute.h.
Referenced by GNEChange_Attribute(), redo(), undo(), and ~GNEChange_Attribute().
|
private |
pointer to Net (used to simplify code)
Definition at line 124 of file GNEChange_Attribute.h.
Referenced by redo(), undo(), and ~GNEChange_Attribute().
|
private |
used if AC is an net element
Definition at line 127 of file GNEChange_Attribute.h.
Referenced by GNEChange_Attribute(), redo(), and undo().
|
private |
the original value
Definition at line 121 of file GNEChange_Attribute.h.
Referenced by redo(), and trueChange().
|
private |
the original value
Definition at line 118 of file GNEChange_Attribute.h.
Referenced by trueChange(), and undo().
|
private |
used if AC is a shape element
Definition at line 133 of file GNEChange_Attribute.h.
Referenced by GNEChange_Attribute(), redo(), undo(), and ~GNEChange_Attribute().