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.h
11 /// @author  Daniel Krajzewicz
12 /// @author  Jakob Erdmann
13 /// @author  Sascha Krieg
14 /// @author  Michael Behrisch
15 /// @date    Sept 2002
16 /// @version $Id$
17 ///
18 // Derivation of NLEdgeControlBuilder which builds gui-edges
19 /****************************************************************************/
20 #ifndef GUIEdgeControlBuilder_h
21 #define GUIEdgeControlBuilder_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
29 #include <string>
30 #include <vector>
31 #include <netload/NLEdgeControlBuilder.h>
32 #include <utils/geom/PositionVector.h>
33 #include <guisim/GUIEdge.h>
34 
35 
36 // ===========================================================================
37 // class declarations
38 // ===========================================================================
39 class MSJunction;
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
45 /**
46  * @class GUIEdgeControlBuilder
47  * @brief Derivation of NLEdgeControlBuilder which builds gui-edges
48  *
49  * Instead of building pure microsim-objects (MSEdge and MSLane), this class
50  *  builds GUIEdges and GUILanes.
51  * @see NLEdgeControlBuilder
52  */
53 class GUIEdgeControlBuilder : public NLEdgeControlBuilder {
54 public:
55     /** @brief Constructor
56      *
57      * @param[in] glObjectIDStorage Storage of gl-ids used to assign new ids to built edges
58      */
59     GUIEdgeControlBuilder();
60 
61 
62     /// @brief Destructor
63     ~GUIEdgeControlBuilder();
64 
65 
66     /** @brief Builds and adds a lane
67      * @param[in] id The lane's id
68      * @param[in] maxSpeed The speed allowed on this lane
69      * @param[in] length The lane's length
70      * @param[in] shape The shape of the lane
71      * @param[in] width The width of the lane
72      * @param[in] permissions Encoding of vehicle classes that may drive on this lane
73      * @param[in] index The index of this lane within its parent edge
74      * @see SUMOVehicleClass
75      * @see MSLane
76      */
77     virtual MSLane* addLane(const std::string& id,
78                             double maxSpeed, double length,
79                             const PositionVector& shape, double width,
80                             SVCPermissions permissions,
81                             int index, bool isRampAccel);
82 
83 
84 
85     /** @brief Builds an edge instance (GUIEdge in this case)
86      *
87      * Builds an GUIEdge-instance using the given name and the current index
88      *  "myCurrentNumericalEdgeID"
89      *  Post-increments the index, returns the built edge.
90      *
91      * @param[in] id The id of the edge to build
92      */
93     MSEdge* buildEdge(const std::string& id, const SumoXMLEdgeFunc function,
94                       const std::string& streetName, const std::string& edgeType, const int priority);
95 
96 
97 private:
98     /// @brief invalidated copy constructor
99     GUIEdgeControlBuilder(const GUIEdgeControlBuilder& s);
100 
101     /// @brief invalidated assignment operator
102     GUIEdgeControlBuilder& operator=(const GUIEdgeControlBuilder& s);
103 
104 };
105 
106 
107 #endif
108 
109 /****************************************************************************/
110 
111