1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
10 /// @file    GUIEdgeControlBuilder.cpp
11 /// @author  Daniel Krajzewicz
12 /// @author  Jakob Erdmann
13 /// @author  Michael Behrisch
14 /// @date    Sept 2002
15 /// @version $Id$
16 ///
17 // Derivation of NLEdgeControlBuilder which build gui-edges
18 /****************************************************************************/
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <vector>
27 #include <string>
28 #include <map>
29 #include <algorithm>
30 #include <guisim/GUIEdge.h>
31 #include <guisim/GUINet.h>
32 #include <guisim/GUILane.h>
33 #include <microsim/MSJunction.h>
34 #include <netload/NLBuilder.h>
35 #include "GUIEdgeControlBuilder.h"
36 #include <gui/GUIGlobals.h>
37 
38 
39 // ===========================================================================
40 // method definitions
41 // ===========================================================================
GUIEdgeControlBuilder()42 GUIEdgeControlBuilder::GUIEdgeControlBuilder()
43     : NLEdgeControlBuilder() {}
44 
45 
~GUIEdgeControlBuilder()46 GUIEdgeControlBuilder::~GUIEdgeControlBuilder() {}
47 
48 
49 MSLane*
addLane(const std::string & id,double maxSpeed,double length,const PositionVector & shape,double width,SVCPermissions permissions,int index,bool isRampAccel)50 GUIEdgeControlBuilder::addLane(const std::string& id,
51                                double maxSpeed, double length,
52                                const PositionVector& shape,
53                                double width,
54                                SVCPermissions permissions,
55                                int index, bool isRampAccel) {
56     MSLane* lane = new GUILane(id, maxSpeed, length, myActiveEdge, myCurrentNumericalLaneID++, shape, width, permissions, index, isRampAccel);
57     myLaneStorage->push_back(lane);
58     myCurrentLaneIndex = index;
59     return lane;
60 }
61 
62 
63 
64 MSEdge*
buildEdge(const std::string & id,const SumoXMLEdgeFunc function,const std::string & streetName,const std::string & edgeType,const int priority)65 GUIEdgeControlBuilder::buildEdge(const std::string& id, const SumoXMLEdgeFunc function,
66                                  const std::string& streetName, const std::string& edgeType, const int priority) {
67     return new GUIEdge(id, myCurrentNumericalEdgeID++, function, streetName, edgeType, priority);
68 }
69 
70 /****************************************************************************/
71 
72