45 myForceInsert(forceInsert) {
46 myJunction->incRef(
"GNEChange_TLS");
47 if (myTlDef ==
nullptr) {
51 if (myJunction->getNBNode()->isTLControlled()) {
53 type = (*myJunction->getNBNode()->getControllingTLS().begin())->getType();
55 myTlDef =
new NBOwnTLDef(tlID ==
"" ? myJunction->getMicrosimID() : tlID, 0, type);
@ SUMO_TAG_TRAFFIC_LIGHT
a traffic light
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
const std::string & getTagStr() const
get tag assigned to this object in string format
GNENet * getNet() const
get pointer to net
GNEJunction * myJunction
we need the junction because it is the target of our change commands
FXString redoName() const
get Redo name
FXString undoName() const
return undoName
~GNEChange_TLS()
Destructor.
NBTrafficLightDefinition * myTlDef
the traffic light to be created/deleted. We assume no responsiblity for the pointer
bool myForceInsert
check if forceInsert is enabled
the function-object for an editing operation (abstract base)
bool myForward
we group antagonistic commands (create junction/delete junction) and keep them apart by this flag
void addTrafficLight(NBTrafficLightDefinition *tlDef, bool forceInsert)
adds a traffic light
void removeTrafficLight(NBTrafficLightDefinition *tlDef)
removes a traffic light
void requireSaveNet(bool value)
inform that net has to be saved
const std::string & getID() const
get ID
void decRef(const std::string &debugMsg="")
Decrease reference.
bool unreferenced()
check if object ins't referenced
A traffic light logics which must be computed (only nodes/edges are given)
The base class for traffic light logic definitions.
static OptionsCont & getOptions()
Retrieves the options.
static StringBijection< TrafficLightType > TrafficLightTypes
traffic light types
T get(const std::string &str) const