SUMO - Simulation of Urban MObility
GUIEdgeControlBuilder.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Derivation of NLEdgeControlBuilder which build gui-edges
20 /****************************************************************************/
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include <vector>
33 #include <string>
34 #include <map>
35 #include <algorithm>
36 #include <guisim/GUIEdge.h>
37 #include <guisim/GUINet.h>
38 #include <guisim/GUILane.h>
39 #include <microsim/MSJunction.h>
40 #include <netload/NLBuilder.h>
41 #include "GUIEdgeControlBuilder.h"
42 #include <gui/GUIGlobals.h>
43 
44 
45 // ===========================================================================
46 // method definitions
47 // ===========================================================================
50 
51 
53 
54 
55 MSLane*
56 GUIEdgeControlBuilder::addLane(const std::string& id,
57  double maxSpeed, double length,
58  const PositionVector& shape,
59  double width,
60  SVCPermissions permissions,
61  int index, bool isRampAccel) {
62  MSLane* lane = new GUILane(id, maxSpeed, length, myActiveEdge, myCurrentNumericalLaneID++, shape, width, permissions, index, isRampAccel);
63  myLaneStorage->push_back(lane);
64  return lane;
65 }
66 
67 
68 
69 MSEdge*
70 GUIEdgeControlBuilder::buildEdge(const std::string& id, const SumoXMLEdgeFunc function,
71  const std::string& streetName, const std::string& edgeType, const int priority) {
72  return new GUIEdge(id, myCurrentNumericalEdgeID++, function, streetName, edgeType, priority);
73 }
74 
75 /****************************************************************************/
76 
GUIEdgeControlBuilder()
Constructor.
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
MSEdge * myActiveEdge
pointer to the currently chosen edge
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:69
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:59
A road/street connecting two junctions.
Definition: MSEdge.h:80
A list of positions.
std::vector< MSLane * > * myLaneStorage
pointer to a temporary lane storage
int myCurrentNumericalEdgeID
A running number for edge numbering.
virtual MSLane * addLane(const std::string &id, double maxSpeed, double length, const PositionVector &shape, double width, SVCPermissions permissions, int index, bool isRampAccel)
Builds and adds a lane.
MSEdge * buildEdge(const std::string &id, const SumoXMLEdgeFunc function, const std::string &streetName, const std::string &edgeType, const int priority)
Builds an edge instance (GUIEdge in this case)
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
int myCurrentNumericalLaneID
A running number for lane numbering.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
Interface for building edges.