Path: blob/main/src/guinetload/GUIEdgeControlBuilder.cpp
169665 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 GUIEdgeControlBuilder.cpp14/// @author Daniel Krajzewicz15/// @author Jakob Erdmann16/// @author Michael Behrisch17/// @date Sept 200218///19// Derivation of NLEdgeControlBuilder which build gui-edges20/****************************************************************************/21#include <config.h>2223#include <vector>24#include <string>25#include <map>26#include <algorithm>27#include <guisim/GUIEdge.h>28#include <guisim/GUINet.h>29#include <guisim/GUILane.h>30#include <microsim/MSJunction.h>31#include <netload/NLBuilder.h>32#include "GUIEdgeControlBuilder.h"33#include <gui/GUIGlobals.h>343536// ===========================================================================37// method definitions38// ===========================================================================39GUIEdgeControlBuilder::GUIEdgeControlBuilder()40: NLEdgeControlBuilder() {}414243GUIEdgeControlBuilder::~GUIEdgeControlBuilder() {}444546MSLane*47GUIEdgeControlBuilder::addLane(const std::string& id,48double maxSpeed, double friction, double length,49const PositionVector& shape,50double width,51SVCPermissions permissions,52SVCPermissions changeLeft, SVCPermissions changeRight,53int index, bool isRampAccel,54const std::string& type,55const PositionVector& outlineShape) {56MSLane* lane = new GUILane(id, maxSpeed, friction, length, myActiveEdge, myCurrentNumericalLaneID++, shape, width, permissions, changeLeft, changeRight, index, isRampAccel, type, outlineShape);57myLaneStorage->push_back(lane);58myCurrentLaneIndex = index;59return lane;60}61626364MSEdge*65GUIEdgeControlBuilder::buildEdge(const std::string& id, const SumoXMLEdgeFunc function,66const std::string& streetName, const std::string& edgeType, const int priority, const double distance) {67return new GUIEdge(id, myCurrentNumericalEdgeID++, function, streetName, edgeType, priority, distance);68}697071/****************************************************************************/727374