Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/guinetload/GUIEdgeControlBuilder.h
169665 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2001-2025 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
14
/// @file GUIEdgeControlBuilder.h
15
/// @author Daniel Krajzewicz
16
/// @author Jakob Erdmann
17
/// @author Sascha Krieg
18
/// @author Michael Behrisch
19
/// @date Sept 2002
20
///
21
// Derivation of NLEdgeControlBuilder which builds gui-edges
22
/****************************************************************************/
23
#pragma once
24
#include <config.h>
25
26
#include <string>
27
#include <vector>
28
#include <netload/NLEdgeControlBuilder.h>
29
#include <utils/geom/PositionVector.h>
30
#include <guisim/GUIEdge.h>
31
32
33
// ===========================================================================
34
// class declarations
35
// ===========================================================================
36
class MSJunction;
37
38
39
// ===========================================================================
40
// class definitions
41
// ===========================================================================
42
/**
43
* @class GUIEdgeControlBuilder
44
* @brief Derivation of NLEdgeControlBuilder which builds gui-edges
45
*
46
* Instead of building pure microsim-objects (MSEdge and MSLane), this class
47
* builds GUIEdges and GUILanes.
48
* @see NLEdgeControlBuilder
49
*/
50
class GUIEdgeControlBuilder : public NLEdgeControlBuilder {
51
public:
52
/** @brief Constructor
53
*
54
* @param[in] glObjectIDStorage Storage of gl-ids used to assign new ids to built edges
55
*/
56
GUIEdgeControlBuilder();
57
58
59
/// @brief Destructor
60
~GUIEdgeControlBuilder();
61
62
63
/** @brief Builds and adds a lane
64
* @param[in] id The lane's id
65
* @param[in] maxSpeed The speed allowed on this lane
66
* @param[in] length The lane's length
67
* @param[in] shape The shape of the lane
68
* @param[in] width The width of the lane
69
* @param[in] permissions Encoding of vehicle classes that may drive on this lane
70
* @param[in] index The index of this lane within its parent edge
71
* @see SUMOVehicleClass
72
* @see MSLane
73
*/
74
MSLane* addLane(const std::string& id,
75
double maxSpeed, double friction, double length,
76
const PositionVector& shape, double width,
77
SVCPermissions permissions,
78
SVCPermissions changeLeft, SVCPermissions changeRight,
79
int index, bool isRampAccel,
80
const std::string& type,
81
const PositionVector& outlineShape) override;
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, const double distance) override;
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