/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2004-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 GUITriggerBuilder.h14/// @author Daniel Krajzewicz15/// @author Sascha Krieg16/// @author Michael Behrisch17/// @author Jakob Erdmann18/// @author Johannes Rummel19/// @date Mon, 26.04.200420///21// Builds trigger objects for guisim22/****************************************************************************/23#pragma once24#include <config.h>2526#include <string>27#include <netload/NLTriggerBuilder.h>28#include <utils/common/RGBColor.h>293031// ===========================================================================32// class declarations33// ===========================================================================34class MSTrigger;35class MSNet;36class MSLaneSpeedTrigger;37class MSCalibrator;38class MSTriggerControl;394041// ===========================================================================42// class definitions43// ===========================================================================44/**45* @class GUITriggerBuilder46* @brief Builds trigger objects for guisim47*/48class GUITriggerBuilder : public NLTriggerBuilder {49public:50/// @brief Constructor51GUITriggerBuilder();525354/// @brief Destructor55~GUITriggerBuilder();565758protected:59/// @name building methods60///61/// Override NLTriggerBuilder-methods for building guisim-objects62/// @see NLTriggerBuilder63//@{6465/** @brief Builds a lane speed trigger66*67* Simply calls the GUILaneSpeedTrigger constructor.68*69* @param[in] net The net the lane speed trigger belongs to70* @param[in] id The id of the lane speed trigger71* @param[in] destLanes List of lanes affected by this speed trigger72* @param[in] file Name of the file to read the speeds to set from73* @see MSLaneSpeedTrigger74* @exception ProcessError If the XML definition file is erroneous75*/76MSLaneSpeedTrigger* buildLaneSpeedTrigger(MSNet& net,77const std::string& id, const std::vector<MSLane*>& destLanes,78const std::string& file) override;798081/** @brief builds an rerouter82*83* Simply calls the GUITriggeredRerouter constructor.84*85* @param[in] net The net the rerouter belongs to86* @param[in] id The id of the rerouter87* @param[in] edges The edges the rerouter is placed at88* @param[in] prob The probability the rerouter reroutes vehicles with89*/90MSTriggeredRerouter* buildRerouter(MSNet& net,91const std::string& id, MSEdgeVector& edges,92double prob, bool off, bool optional, SUMOTime timeThreshold,93const std::string& vTypes, const Position& pos, const double radius) override;949596/** @brief Builds a bus stop97*98* Simply calls the GUIBusStop / GUIContainerStop constructor.99*100* @param[in] net The net the stop belongs to101* @param[in] id The id of the stop102* @param[in] lines Names of the lines that halt on this stop103* @param[in] lane The lane the stop is placed on104* @param[in] frompos Begin position of the stop on the lane105* @param[in] topos End position of the stop on the lane106* @param[in] element which kind of stop is to be built107* @exception InvalidArgument If the stop can not be added to the net (is duplicate)108*/109void buildStoppingPlace(MSNet& net, std::string id, std::vector<std::string> lines, MSLane* lane,110double frompos, double topos, const SumoXMLTag element, std::string string,111int personCapacity, double parkingLength, RGBColor& color, double angle) override;112113114/** @brief Builds a parking area115*116* Simply calls the GUIParkingArea constructor.117*118* @param[in] net The net the parking area belongs to119* @param[in] id The id of the parking area120* @param[in] lines Names of the lines that halt on this parking area121* @param[in] badges Names which grant access to this parking area122* @param[in] lane The lane the parking area is placed on123* @param[in] frompos Begin position of the parking area on the lane124* @param[in] topos End position of the parking area on the lane125* @param[in] capacity Capacity of the parking area126* @param[in] width Width of the default lot rectangle127* @param[in] length Length of the default lot rectangle128* @param[in] angle Angle of the default lot rectangle129* @exception InvalidArgument If the parking area can not be added to the net (is duplicate)130*/131void beginParkingArea(MSNet& net, const std::string& id,132const std::vector<std::string>& lines, const std::vector<std::string>& badges,133MSLane* lane, double frompos, double topos,134unsigned int capacity,135double width, double length, double angle, const std::string& name,136bool onRoad,137const std::string& departPos,138bool lefthand) override;139140141/** @brief Builds a charging station142*143* Simply calls the GUIChargingStation constructor.144*145* @param[in] net The net the charging station belongs to146* @param[in] id The id of the charging station147* @param[in] lane The lane the charging station is placed on148* @param[in] frompos Begin position of the charging station on the lane149* @param[in] topos End position of the charging station on the lane150* @param[in] chargingPower energy charged in every timeStep151* @param[in] efficiency efficiency of the charge152* @param[in] chargeInTransit enable or disable charge in transit153* @param[in] chargeDelay delay in the charge154* @param[in] chargeType charge type (normal, electric or fuel)155* @param[in] waitingTime waiting time until start charging156* @param[in] parkingArea The associated parking area157* @exception InvalidArgument If the charging station can not be added to the net (is duplicate)158*/159void buildChargingStation(MSNet& net, const std::string& id, MSLane* lane, double frompos, double topos, const std::string& name,160double chargingPower, double efficiency, bool chargeInTransit, SUMOTime chargeDelay, std::string chargeType,161SUMOTime waitingTime, MSParkingArea* parkingArea) override;162163164/** @brief Builds an overhead wire segment165*166* Simply calls the GUIOverheadWire constructor and adds the result to the network.167*168* @param[in] net The net the overhead wire segment belongs to169* @param[in] id The id of the overhead wire segment170* @param[in] lane The lane the overhead wire segment is placed on171* @param[in] frompos Begin position of the overhead wire segment on the lane172* @param[in] topos End position of the overhead wire segment on the lane173* @param[in] voltageSource If the segment is the place of the connection of a traction substation174* @exception InvalidArgument If the overhead wire segment can not be added to the net (is duplicate according to the id)175*/176void buildOverheadWireSegment(MSNet& net, const std::string& id, MSLane* lane,177double frompos, double topos, bool voltageSource) override;178179/** @brief Builds an overhead wire clamp180*181* Simply calls the GUIOverheadWireClamp constructor and adds the result to the network.182*183* @param[in] net The net the overhead wire clamp belongs to184* @param[in] id The id of the overhead wire clamp185* @param[in] lane_start The lane, where is the overhead wire segment placed, to the start of which the overhead wire clamp is connected186* @param[in] lane_end The lane, where is the overhead wire segment placed, to the end of which the overhead wire clamp is connected187*/188void buildOverheadWireClamp(MSNet& net, const std::string& id, MSLane* lane_start, MSLane* lane_end) override;189/// @}190191192/** @brief End a parking area193* (it must be added to the SUMORTree after all parking spaces are loaded194*/195void endParkingArea() override;196197/** @brief End a stopping place198*199* @exception InvalidArgument If the current stopping place is 0200*/201void endStoppingPlace() override;202};203204205