Path: blob/main/src/netedit/elements/additional/GNEAdditionalHandler.h
169684 views
/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file GNEAdditionalHandler.h14/// @author Pablo Alvarez Lopez15/// @date Nov 201516///17// Builds additional objects for netedit18/****************************************************************************/19#pragma once20#include <config.h>2122#include <utils/common/SUMOVehicleClass.h>23#include <utils/handlers/AdditionalHandler.h>2425// ===========================================================================26// class declarations27// ===========================================================================2829class GNENet;30class GNEEdge;31class GNELane;32class GNEAdditional;3334// ===========================================================================35// class definitions36// ===========================================================================3738class GNEAdditionalHandler : public AdditionalHandler {3940public:41/// @brief Constructor42GNEAdditionalHandler(GNENet* net, const std::string& filename, const bool allowUndoRedo);4344/// @brief Destructor45~GNEAdditionalHandler();4647/// @brief run post parser tasks48bool postParserTasks();4950/// @name build functions51/// @{52/**@brief Builds a bus stop53* @param[in] sumoBaseObject sumo base object used for build54* @param[in] id The id of the bus stop55* @param[in] laneID The lane the bus stop is placed on56* @param[in] startPos Begin position of the bus stop on the lane57* @param[in] endPos End position of the bus stop on the lane58* @param[in] name Name of busStop59* @param[in] lines Names of the bus lines that halt on this bus stop60* @param[in] personCapacity larger numbers of persons trying to enter will create an upstream jam on the sidewalk.61* @param[in] parkingLength parking length62* @param[in[ color busStop color63* @param[in] friendlyPos enable or disable friendly position64* @param[in] angle busStop's angle65* @param[in] parameters generic parameters66*/67bool buildBusStop(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,68const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,69const int personCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,70const double angle, const Parameterised::Map& parameters);7172/**@brief Builds a train stop73* @param[in] sumoBaseObject sumo base object used for build74* @param[in] id The id of the train stop75* @param[in] laneID The lane the train stop is placed on76* @param[in] startPos Begin position of the train stop on the lane77* @param[in] endPos End position of the train stop on the lane78* @param[in] name Name of trainStop79* @param[in] lines Names of the train lines that halt on this train stop80* @param[in] personCapacity larger numbers of persons trying to enter will create an upstream jam on the sidewalk.81* @param[in] parkingLength parking length82* @param[in[ color trainStop color83* @param[in] friendlyPos enable or disable friendly position84* @param[in] angle trainStop's angle85* @param[in] parameters generic parameters86*/87bool buildTrainStop(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,88const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,89const int personCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,90const double angle, const Parameterised::Map& parameters);9192/**@brief Builds an Access93* @param[in] sumoBaseObject sumo base object used for build94* @param[in] busStop GNEAdditional of this Access belongs95* @param[in] laneID The lane the Access is placed on96* @param[in] pos position of the Access on the lane97* @param[in[ length length of the Access98* @param[in] friendlyPos enable or disable friendly position99* @param[in] parameters generic parameters100*/101bool buildAccess(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& laneID, const std::string& pos,102const double length, const bool friendlyPos, const Parameterised::Map& parameters);103104/**@brief Builds a container stop105* @param[in] sumoBaseObject sumo base object used for build106* @param[in] id The id of the container stop107* @param[in] laneID The lane the container stop is placed on108* @param[in] startPos Begin position of the container stop on the lane109* @param[in] endPos End position of the container stop on the lane110* @param[in] name Name of container stop111* @param[in] lines Names of the bus lines that halt on this container stop112* @param[in] containerCapacity larger numbers of containers113* @param[in] parkingLength parking length114* @param[in[ color containerStop color115* @param[in] friendlyPos enable or disable friendly position116* @param[in] angle container stops's angle117* @param[in] parameters generic parameters118*/119bool buildContainerStop(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,120const double startPos, const double endPos, const std::string& name, const std::vector<std::string>& lines,121const int containerCapacity, const double parkingLength, const RGBColor& color, const bool friendlyPosition,122const double angle, const Parameterised::Map& parameters);123124/**@brief Builds a charging Station125* @param[in] sumoBaseObject sumo base object used for build126* @param[in] id The id of the charging Station127* @param[in] laneID The lane the charging Station is placed on128* @param[in] startPos Begin position of the charging Station on the lane129* @param[in] endPos End position of the charging Station on the lane130* @param[in] name Name of charging station131* @param[in] chargingPower power charged in every timeStep132* @param[in] efficiency efficiency of the charge133* @param[in] chargeInTransit enable or disable charge in transit134* @param[in] chargeDelay delay in the charge135* @param[in] chargeType charge type (normal, electric or fuel)136* @param[in] waitingTime waiting time until start charging137* @param[in] friendlyPos enable or disable friendly position138* @param[in] parameters generic parameters139*/140bool buildChargingStation(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,141const double startPos, const double endPos, const std::string& name, const double chargingPower,142const double efficiency, const bool chargeInTransit, const SUMOTime chargeDelay, const std::string& chargeType,143const SUMOTime waitingTime, const bool friendlyPosition, const std::string& parkingAreaID, const Parameterised::Map& parameters);144145/**@brief Builds a Parking Area146* @param[in] sumoBaseObject sumo base object used for build147* @param[in] id The id of the Parking >Area148* @param[in] laneID The lane the Parking Area is placed on149* @param[in] startPos Begin position of the Parking Area on the lane150* @param[in] endPos End position of the Parking Area on the lane151* @param[in] departPos lane position in that vehicle must depart when leaves parkingArea152* @param[in] name Name of Parking Area153* @param[in] badges names which grant access to the parkingArea154* @param[in] friendlyPos enable or disable friendly position155* @param[in] roadSideCapacity road side capacity of ParkingArea156* @param[in] width ParkingArea's width157* @param[in] length ParkingArea's length158* @param[in] angle ParkingArea's angle159* @param[in] lefthand enable or disable lefthand160* @param[in] parameters generic parameters161*/162bool buildParkingArea(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,163const double startPos, const double endPos, const std::string& departPos, const std::string& name,164const std::vector<std::string>& badges, const bool friendlyPosition, const int roadSideCapacity, const bool onRoad,165const double width, const double length, const double angle, const bool lefthand, const Parameterised::Map& parameters);166167/**@brief Builds a Parking Space168* @param[in] sumoBaseObject sumo base object used for build169* @param[in] x Position X170* @param[in] y Position Y171* @param[in] z Position Z172* @param[in] name Name of Parking Area173* @param[in] width ParkingArea's width174* @param[in] length ParkingArea's length175* @param[in] angle ParkingArea's angle176* @param[in] slope ParkingArea's slope (of this space)177* @param[in] parameters generic parameters178*/179bool buildParkingSpace(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const double x, const double y, const double z,180const std::string& name, const std::string& width, const std::string& length, const std::string& angle,181const double slope, const Parameterised::Map& parameters);182183/**@brief Builds a induction loop detector (E1)184* @param[in] sumoBaseObject sumo base object used for build185* @param[in] id The id of the detector186* @param[in] laneID The lane the detector is placed on187* @param[in] pos position of the detector on the lane188* @param[in] period the aggregation period the values the detector collects shall be summed up.189* @param[in] filename The path to the output file.190* @param[in] vtypes list of vehicle types to be reported191* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection192* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)193* @param[in] name E1 detector name194* @param[in] friendlyPos enable or disable friendly position195* @param[in] parameters generic parameters196*/197bool buildE1Detector(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,198const double position, const SUMOTime period, const std::string& file, const std::vector<std::string>& vehicleTypes,199const std::vector<std::string>& nextEdges, const std::string& detectPersons, const std::string& name,200const bool friendlyPos, const Parameterised::Map& parameters);201202/**@brief Builds a single-lane Area Detector (E2)203* @param[in] sumoBaseObject sumo base object used for build204* @param[in] id The id of the detector205* @param[in] laneID The lane the detector is placed on206* @param[in] pos position of the detector on the lane207* @param[in[ length length of the detector208* @param[in] period the aggregation period the values the detector collects shall be summed up.209* @param[in] trafficLight The traffic light that triggers aggregation when switching.210* @param[in] filename The path to the output file.211* @param[in] vtypes list of vehicle types to be reported212* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection213* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)214* @param[in] name E2 detector name215* @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting216* @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting217* @param[in] jamThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam218* @param[in] friendlyPos enable or disable friendly position219* @param[in] show detector in sumo-gui220* @param[in] parameters generic parameters221*/222bool buildSingleLaneDetectorE2(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,223const double pos, const double length, const SUMOTime period, const std::string& trafficLight, const std::string& filename,224const std::vector<std::string>& vehicleTypes, const std::vector<std::string>& nextEdges, const std::string& detectPersons,225const std::string& name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold,226const bool friendlyPos, const bool show, const Parameterised::Map& parameters);227228/**@brief Builds a multi-lane Area Detector (E2)229* @param[in] sumoBaseObject sumo base object used for build230* @param[in] id The id of the detector231* @param[in] laneIDs The lanes the detector is placed on232* @param[in] pos position of the detector on the first lane233* @param[in] endPos position of the detector on the last lane234* @param[in] period the aggregation period the values the detector collects shall be summed up.235* @param[in] trafficLight The traffic light that triggers aggregation when switching.236* @param[in] filename The path to the output file.237* @param[in] vtypes list of vehicle types to be reported238* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection239* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)240* @param[in] name E2 detector name241* @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting242* @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting243* @param[in] jamThreshold The minimum distance to the next standing vehicle in order to make this vehicle count as a participant to the jam244* @param[in] friendlyPos enable or disable friendly position245* @param[in] show detector in sumo-gui246* @param[in] parameters generic parameters247*/248bool buildMultiLaneDetectorE2(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::vector<std::string>& laneIDs,249const double pos, const double endPos, const SUMOTime period, const std::string& trafficLight, const std::string& filename,250const std::vector<std::string>& vehicleTypes, const std::vector<std::string>& nextEdges, const std::string& detectPersons,251const std::string& name, const SUMOTime timeThreshold, const double speedThreshold, const double jamThreshold,252const bool friendlyPos, const bool show, const Parameterised::Map& parameters);253254/**@brief Builds a multi entry exit detector (E3)255* @param[in] sumoBaseObject sumo base object used for build256* @param[in] id The id of the detector257* @param[in] pos position of the detector in the map258* @param[in] period the aggregation period the values the detector collects shall be summed up.259* @param[in] filename The path to the output file.260* @param[in] vtypes list of vehicle types to be reported261* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection262* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)263* @param[in] name E2 detector name264* @param[in] timeThreshold The time-based threshold that describes how much time has to pass until a vehicle is recognized as halting265* @param[in] speedThreshold The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting266* @param[in] openEntry enable or disable open Entry267* @param[in] expectedArrival Whether no warning should be issued when a vehicle arrives within the detector area268* @param[in] parameters generic parameters269*/270bool buildDetectorE3(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos, const SUMOTime period,271const std::string& filename, const std::vector<std::string>& vehicleTypes, const std::vector<std::string>& nextEdges,272const std::string& detectPersons, const std::string& name, const SUMOTime timeThreshold, const double speedThreshold,273const bool openEntry, const bool expectedArrival, const Parameterised::Map& parameters);274275/**@brief Builds a entry detector (E3)276* @param[in] sumoBaseObject sumo base object used for build277* @param[in] laneID The lane in which the entry detector is placed on278* @param[in] pos position of the entry detector on the lane279* @param[in] friendlyPos enable or disable friendly position280* @param[in] parameters generic parameters281*/282bool buildDetectorEntry(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& laneID, const double pos, const bool friendlyPos,283const Parameterised::Map& parameters);284285/**@brief Builds a exit detector (E3)286* @param[in] sumoBaseObject sumo base object used for build287* @param[in] laneID The lane in which the exit detector is placed on288* @param[in] pos position of the exit detector on the lane289* @param[in] friendlyPos enable or disable friendly position290* @param[in] parameters generic parameters291*/292bool buildDetectorExit(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& laneID, const double pos, const bool friendlyPos,293const Parameterised::Map& parameters);294295/**@brief Builds a Instant Induction Loop Detector (E1Instant)296* @param[in] sumoBaseObject sumo base object used for build297* @param[in] id The id of the detector298* @param[in] laneID The lane the detector is placed on299* @param[in] pos position of the detector on the lane300* @param[in] filename The path to the output file.301* @param[in] name E2 detector name302* @param[in] vtypes list of vehicle types to be reported303* @param[in] nextEdges list of edge ids that must all be part of the future route of the vehicle to qualify for detection304* @param[in] detectPersons detect persons instead of vehicles (pedestrians or passengers)305* @param[in] friendlyPos enable or disable friendly position306* @param[in] parameters generic parameters307*/308bool buildDetectorE1Instant(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,309const double pos, const std::string& filename, const std::vector<std::string>& vehicleTypes,310const std::vector<std::string>& nextEdges, const std::string& detectPersons, const std::string& name,311const bool friendlyPos, const Parameterised::Map& parameters);312313/**@brief builds a microscopic calibrator over a lane314* @param[in] id The id of the calibrator315* @param[in] laneID The lane the calibrator is placed at316* @param[in] pos The position on the edge the calibrator lies at317* @param[in] name Calibrator name318* @param[in] outfile te file in which write results319* @param[in] jamThreshold A threshold value to detect and clear unexpected jamming320* @param[in] vTypes space separated list of vehicle type ids to consider321* @param[in] parameters generic parameters322*/323bool buildLaneCalibrator(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& laneID,324const double pos, const std::string& name, const std::string& outfile, const SUMOTime period, const std::string& routeprobe,325const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);326327/**@brief builds a microscopic calibrator over an edge328* @param[in] sumoBaseObject sumo base object used for build329* @param[in] id The id of the calibrator330* @param[in] edgeID The edge the calibrator is placed at331* @param[in] pos The position on the edge the calibrator lies at332* @param[in] name Calibrator name333* @param[in] outfile te file in which write results334* @param[in] routeProbe route probe vinculated with this calibrator335* @param[in] jamThreshold A threshold value to detect and clear unexpected jamming336* @param[in] vTypes space separated list of vehicle type ids to consider337* @param[in] parameters generic parameters338*/339bool buildEdgeCalibrator(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& edgeID,340const double pos, const std::string& name, const std::string& outfile, const SUMOTime period, const std::string& routeprobe,341const double jamThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);342343/**@brief builds a calibrator flow344* @param[in] sumoBaseObject sumo base object used for build345* @param[in] vehicleParameter calibratorFlow parameter346*/347bool buildCalibratorFlow(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOVehicleParameter& vehicleParameter) ;348349/**@brief builds a rerouter350* @param[in] sumoBaseObject sumo base object used for build351* @param[in] id The id of the rerouter352* @param[in] pos position of the rerouter in the map353* @param[in] edgeIDs The edges the rerouter is placed at354* @param[in] prob The probability the rerouter reroutes vehicles with355* @param[in] name Calibrator name356* @param[in] parameters generic parameters357*/358bool buildRerouter(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos,359const std::vector<std::string>& edgeIDs, const double prob, const std::string& name, const bool off, const bool optional,360const SUMOTime timeThreshold, const std::vector<std::string>& vTypes, const Parameterised::Map& parameters);361362/**@brief builds a rerouter interval363* @param[in] sumoBaseObject sumo base object used for build364* @param[in] begin begin of interval365* @param[in] end end of interval366*/367bool buildRerouterInterval(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOTime begin, const SUMOTime end);368369/**@brief builds a closing lane reroute370* @param[in] sumoBaseObject sumo base object used for build371* @param[in] closedLane closed lane372* @param[in] permissions vClasses disallowed for the lane373*/374bool buildClosingLaneReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& closedLane, SVCPermissions permissions);375376/**@brief builds a closing edge reroute377* @param[in] sumoBaseObject sumo base object used for build378* @param[in] closedEdgeID closed edge379* @param[in] permissions vClasses disallowed for the lane380*/381bool buildClosingReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& closedEdgeID, SVCPermissions permissions);382383/**@brief builds a dest prob reroute384* @param[in] sumoBaseObject sumo base object used for build385* @param[in] newEdgeDestinationID new edge destination ID386* @param[in] probability rerouting probability387*/388bool buildDestProbReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& newEdgeDestinationID, const double probability);389390/**@brief builds a parking area reroute391* @param[in] sumoBaseObject sumo base object used for build392* @param[in] newParkignAreaID new parkingArea ID393* @param[in] probability rerouting probability394*/395bool buildParkingAreaReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& newParkignAreaID, const double probability, const bool visible);396397/**@brief builds a route prob reroute398* @param[in] sumoBaseObject sumo base object used for build399* @param[in] newRouteID new route ID400* @param[in] probability rerouting probability401*/402bool buildRouteProbReroute(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& newRouteID, const double probability);403404/**@brief builds a Route probe405* @param[in] sumoBaseObject sumo base object used for build406* @param[in] id The id of the routeprobe407* @param[in] edgeID The edges the routeprobe is placed at408* @param[in] period the aggregation period the values the routeprobe collects shall be summed up.409* @param[in] name Calibrator name410* @param[in] file The file to read the routeprobe definitions from411* @param[in] begin The time at which to start generating output412* @param[in] vTypes list of vehicle types to be affected413* @param[in] parameters generic parameters414*/415bool buildRouteProbe(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& edgeID, const SUMOTime period,416const std::string& name, const std::string& file, const SUMOTime begin, const std::vector<std::string>& vTypes,417const Parameterised::Map& parameters);418419/**@brief Builds a VariableSpeedSign (lane speed additional)420* @param[in] sumoBaseObject sumo base object used for build421* @param[in] id The id of the lane speed additional422* @param[in] destLanes List of lanes affected by this speed additional423* @param[in] name VSS name424* @param[in] vTypes list of vehicle types to be affected425* @param[in] parameters generic parameters426*/427bool buildVariableSpeedSign(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos,428const std::vector<std::string>& laneIDs, const std::string& name, const std::vector<std::string>& vTypes,429const Parameterised::Map& parameters);430431/**@brief Builds a VariableSpeedSign Step432* @param[in] sumoBaseObject sumo base object used for build433* @param[in] time step's time434* @param[in] speed step's speed435*/436bool buildVariableSpeedSignStep(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const SUMOTime time, const double speed);437438/**@brief Builds a vaporizer (lane speed additional)439* @param[in] sumoBaseObject sumo base object used for build440* @param[in] edgeID edge in which this vaporizer is placed441* @param[in] from time in which this vaporizer start442* @param[in] endTime time in which this vaporizer ends443* @param[in] name Vaporizer name444* @param[in] parameters generic parameters445*/446bool buildVaporizer(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID, const SUMOTime from,447const SUMOTime endTime, const std::string& name, const Parameterised::Map& parameters);448449/**@brief Builds a TAZ (Traffic Assignment Zone)450* @param[in] sumoBaseObject sumo base object used for build451* @param[in] id TAZ ID452* @param[in] shape TAZ shape453* @param[in] center shape center454* @param[in] fill Whether the TAZ shall be filled455* @param[in] edgeIDs list of edges (note: This will create GNETAZSourceSinks/Sinks with default values)456* @param[in] name Vaporizer name457* @param[in] parameters generic parameters458*/459bool buildTAZ(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const PositionVector& shape,460const Position& center, const bool fill, const RGBColor& color, const std::vector<std::string>& edgeIDs,461const std::string& name, const Parameterised::Map& parameters);462463/**@brief Builds a TAZSource (Traffic Assignment Zone)464* @param[in] sumoBaseObject sumo base object used for build465* @param[in] TAZ Traffic Assignment Zone in which this TAZSource is palced466* @param[in] edgeID edge in which TAZSource is placed467* @param[in] departWeight depart weight of TAZSource468*/469bool buildTAZSource(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID, const double departWeight);470471/**@brief Builds a TAZSink (Traffic Assignment Zone)472* @param[in] net net in which element will be inserted473* @param[in] allowUndoRedo enable or disable remove created additional with ctrl + Z / ctrl + Y474* @param[in] TAZ Traffic Assignment Zone in which this TAZSink is palced475* @param[in] edgeID edge in which TAZSink is placed476* @param[in] arrivalWeight arrival weight of TAZSink477*/478bool buildTAZSink(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& edgeID, const double arrivalWeight);479480/**@brief build traction substation481* @param[in] id Traction substation ID482* @param[in] pos Position of traction substation in view (optional)483* @param[in] voltage Voltage of at connection point for the overhead wire484* @param[in] currentLimit Current limit of the feeder line485* @param[in] parameters generic parameters486*/487bool buildTractionSubstation(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const Position& pos,488const double voltage, const double currentLimit, const Parameterised::Map& parameters);489490/** @brief build overhead wire491* @param[in] id Overhead wire ID492* @param[in] lane Lane over which the segment is placed493* @param[in] substationId Substation to which the circuit is connected494* @param[in] laneIDs list of consecutive lanes of the circuit495* @param[in] startPos Starting position in the specified lane496* @param[in] endPos Ending position in the specified lane497* @param[in] friendlyPos enable or disable friendly position498* @param[in] forbiddenInnerLanes Inner lanes, where placing of overhead wire is restricted499* @param[in] parameters generic parameters500*/501bool buildOverheadWire(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& substationId,502const std::vector<std::string>& laneIDs, const double startPos, const double endPos, const bool friendlyPos,503const std::vector<std::string>& forbiddenInnerLanes, const Parameterised::Map& parameters);504505/** @brief build overhead wire clamp506* @param[in] id Overhead wire clamp ID507* @param[in] overheadWireIDStartClamp ID of the overhead wire segment, to the start of which the overhead wire clamp is connected508* @param[in] laneIDStartClamp ID of the overhead wire segment lane of overheadWireIDStartClamp509* @param[in] overheadWireIDEndClamp ID of the overhead wire segment, to the end of which the overhead wire clamp is connected510* @param[in] laneIDEndClamp ID of the overhead wire segment lane of overheadWireIDEndClamp511* @param[in] parameters generic parameters512*/513bool buildOverheadWireClamp(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& overheadWireIDStartClamp,514const std::string& laneIDStartClamp, const std::string& overheadWireIDEndClamp, const std::string& laneIDEndClamp,515const Parameterised::Map& parameters);516517/**@brief Builds a polygon using the given values518* @param[in] sumoBaseObject sumo base object used for build519* @param[in] id The name of the polygon520* @param[in] type The (abstract) type of the polygon521* @param[in] color The color of the polygon522* @param[in] layer The layer of the polygon523* @param[in] angle The rotation of the polygon524* @param[in] imgFile The raster image of the polygon525* @param[in] shape The shape of the polygon526* @param[in] geo specify if shape was loaded as GEO coordinate527* @param[in] fill Whether the polygon shall be filled528* @param[in] lineWidth Line width when drawing unfilled polygon529* @param[in] name polygon name530* @param[in] parameters generic parameters531*/532bool buildPolygon(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type,533const RGBColor& color, const double layer, const double angle, const std::string& imgFile, const PositionVector& shape,534const bool geo, const bool fill, const double lineWidth, const std::string& name, const Parameterised::Map& parameters);535536/**@brief Builds a POI using the given values537* @param[in] sumoBaseObject sumo base object used for build538* @param[in] id The name of the POI539* @param[in] type The (abstract) type of the POI540* @param[in] color The color of the POI541* @param[in] x POI's x position542* @param[in] y POI's y position543* @param[in] icon The icon of the POI544* @param[in] layer The layer of the POI545* @param[in] angle The rotation of the POI546* @param[in] imgFile The raster image of the POI547* @param[in] width The width of the POI image548* @param[in] height The height of the POI image549* @param[in] name POI name550* @param[in] parameters generic parameters551*/552bool buildPOI(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type,553const RGBColor& color, const double x, const double y, const std::string& icon, const double layer,554const double angle, const std::string& imgFile, const double width, const double height, const std::string& name,555const Parameterised::Map& parameters);556557/**@brief Builds a POI over lane using the given values558* @param[in] sumoBaseObject sumo base object used for build559* @param[in] id The name of the POI560* @param[in] type The (abstract) type of the POI561* @param[in] color The color of the POI562* @param[in] laneID The Lane in which this POI is placed563* @param[in] posOverLane The position over Lane564* @param[in] friendlyPos enable or disable friendly position565* @param[in] posLat The position lateral over Lane566* @param[in] icon The icon of the POI567* @param[in] layer The layer of the POI568* @param[in] angle The rotation of the POI569* @param[in] imgFile The raster image of the POI570* @param[in] width The width of the POI image571* @param[in] height The height of the POI image572* @param[in] name POI name573* @param[in] parameters generic parameters574*/575bool buildPOILane(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type, const RGBColor& color,576const std::string& laneID, const double posOverLane, const bool friendlyPos, const double posLat, const std::string& icon,577const double layer, const double angle, const std::string& imgFile, const double width, const double height, const std::string& name,578const Parameterised::Map& parameters);579580/**@brief Builds a POI in GEO coordinaten using the given values581* @param[in] sumoBaseObject sumo base object used for build582* @param[in] id The name of the POI583* @param[in] type The (abstract) type of the POI584* @param[in] color The color of the POI585* @param[in] lon POI's longitude586* @param[in] lat POI's latitude587* @param[in] icon The icon of the POI588* @param[in] layer The layer of the POI589* @param[in] angle The rotation of the POI590* @param[in] imgFile The raster image of the POI591* @param[in] width The width of the POI image592* @param[in] height The height of the POI image593* @param[in] name POI name594* @param[in] parameters generic parameters595*/596bool buildPOIGeo(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const std::string& type,597const RGBColor& color, const double lon, const double lat, const std::string& icon, const double layer,598const double angle, const std::string& imgFile, const double width, const double height, const std::string& name,599const Parameterised::Map& parameters);600601/**@brief Builds a JuPedSim walkable area using the given values602* @param[in] sumoBaseObject sumo base object used for build603* @param[in] id The name of the walkable area604* @param[in] shape The shape of the walkable area605* @param[in] geo specify if shape was loaded as GEO606* @param[in] name walkable area name607* @param[in] parameters generic parameters608*/609bool buildJpsWalkableArea(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const PositionVector& shape,610bool geo, const std::string& name, const Parameterised::Map& parameters);611612/**@brief Builds a JuPedSim obstacle using the given values613* @param[in] sumoBaseObject sumo base object used for build614* @param[in] id The name of the obstacle615* @param[in] shape The shape of the obstacle616* @param[in] geo specify if shape was loaded as GEO617* @param[in] name obstacle name618* @param[in] parameters generic parameters619*/620bool buildJpsObstacle(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, const std::string& id, const PositionVector& shape,621bool geo, const std::string& name, const Parameterised::Map& parameters);622623/// @}624625/// @brief check if a GNEAccess can be created in a certain Edge626static bool accessCanBeCreated(GNEAdditional* busStopParent, GNEEdge* edge);627628/// @brief check if an overlapping is produced in rerouter if a interval with certain begin and end is inserted629static bool checkOverlappingRerouterIntervals(GNEAdditional* rerouter, const SUMOTime newBegin, const SUMOTime newEnd);630631/**@brief check if the given position over a lane is valid632* @param[in] pos pos position of element over lane633* @param[in] length element's length634* @param[in] laneLength Length of the lane635* @param[in] friendlyPos Attribute of element636* @return true if the element position is valid, false in otherweise637*/638static bool checkLanePosition(double pos, const double length, const double laneLength, const bool friendlyPos);639640/**@brief fix given position over lane641* @param[in] pos pos position of element over lane642* @param[in] laneLength Length of the lane643*/644static void fixLanePosition(double& pos, double& length, const double laneLength);645646/**@brief check if enable friendly pos in small lanes647* @param[in] pos pos position of element over lane648* @param[in] length element's length649* @param[in] laneLength Length of the lane650* @param[in] friendlyPos Attribute of element651* @return true if the element position is valid, false in otherweise652*/653static bool checkFriendlyPosSmallLanes(double pos, const double length, const double laneLength, const bool friendlyPos);654655/**@brief check if the given positions over a lane is valid656* @param[in] from begin position of element over lane657* @param[in] to end position of element over lane658* @param[in] laneLength Length of the lane659* @param[in] friendlyPos Attribute of element660* @return true if the element positions is valid, false in otherwise661*/662static bool checkLaneDoublePosition(double from, const double to, const double laneLength, const bool friendlyPos);663664/**@brief fix the given positions over lane665* @param[in] from begin position of element over lane666* @param[in] to end position of element over lane667* @param[in] laneLength Length of the lane668*/669static void fixLaneDoublePosition(double& from, double& to, const double laneLengt);670671/**@brief check if the given positions over two lanes are valid672* @param[in] fromPos position of element over first lane673* @param[in] fromLaneLength length of the first lane674* @param[in] toPos position of element over second lane675* @param[in] toLaneLength length of the second lane676* @param[in] friendlyPos flag for friendlyPos677* @return true if the element positions is valid, false in otherwise678*/679static bool checkMultiLanePosition(double fromPos, const double fromLaneLength, const double toPos, const double tolaneLength, const bool friendlyPos);680681/**@brief fix the given positions over two lanes682* @param[in] fromPos position of element over first lane683* @param[in] fromLaneLength length of the first lane684* @param[in] toPos position of element over second lane685* @param[in] toLaneLength length of the second lane686*/687static void fixMultiLanePosition(double fromPos, const double fromLaneLength, double toPos, const double tolaneLength);688689protected:690/// @brief get additional parent691GNEAdditional* getAdditionalParent(const CommonXMLStructure::SumoBaseObject* sumoBaseObject, SumoXMLTag tag) const;692693/// @brief get rerouter interval parent694GNEAdditional* getRerouterIntervalParent(const CommonXMLStructure::SumoBaseObject* sumoBaseObject) const;695696/// @brief parse edges697std::vector<GNEEdge*> parseEdges(const SumoXMLTag tag, const std::string& id, const std::vector<std::string>& edgeIDs);698699/// @brief parse lanes700std::vector<GNELane*> parseLanes(const SumoXMLTag tag, const std::string& id, const std::vector<std::string>& laneIDs);701702/// @brief get element by ID703GNEAdditional* retrieveAdditionalElement(const std::vector<SumoXMLTag> tags, const std::string& id);704705/// @brief check if element exist, and if overwrite706bool checkElement(const SumoXMLTag tag, GNEAdditional* additional);707708private:709/// @brief pointer to GNENet710GNENet* myNet;711712/// @brief allow undo/redo713const bool myAllowUndoRedo;714715/// @brief invalidate default constructo716GNEAdditionalHandler() = delete;717718/// @brief invalidate copy constructor719GNEAdditionalHandler(const GNEAdditionalHandler& s) = delete;720721/// @brief invalidate assignment operator722GNEAdditionalHandler& operator=(const GNEAdditionalHandler& s) = delete;723};724725726