Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/netedit/elements/network/GNELaneTemplate.cpp
185790 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 GNELaneTemplate.cpp
15
/// @author Pablo Alvarez Lopez
16
/// @date Dec 2021
17
///
18
// Template for lanes
19
/****************************************************************************/
20
21
#include <netedit/elements/network/GNELane.h>
22
23
#include "GNELaneTemplate.h"
24
25
// ===========================================================================
26
// members methods
27
// ===========================================================================
28
29
GNELaneTemplate::GNELaneTemplate(const GNELane* lane) :
30
GNEAttributeCarrier(SUMO_TAG_LANE, lane->getNet()),
31
myLane(lane) {
32
}
33
34
35
GNELaneTemplate::~GNELaneTemplate() {
36
}
37
38
39
GNEHierarchicalElement*
40
GNELaneTemplate::getHierarchicalElement() {
41
return nullptr;
42
}
43
44
45
GNEMoveElement*
46
GNELaneTemplate::getMoveElement() const {
47
return nullptr;
48
}
49
50
51
Parameterised*
52
GNELaneTemplate::getParameters() {
53
return nullptr;
54
}
55
56
57
const Parameterised*
58
GNELaneTemplate::getParameters() const {
59
return nullptr;
60
}
61
62
63
FileBucket*
64
GNELaneTemplate::getFileBucket() const {
65
return myLane->getFileBucket();
66
}
67
68
69
GUIGlObject*
70
GNELaneTemplate::getGUIGlObject() {
71
return nullptr;
72
}
73
74
75
const GUIGlObject*
76
GNELaneTemplate::getGUIGlObject() const {
77
return nullptr;
78
}
79
80
81
void
82
GNELaneTemplate::updateGeometry() {
83
throw InvalidArgument("cannot be called in templates");
84
}
85
86
87
bool
88
GNELaneTemplate::checkDrawFromContour() const {
89
return false;
90
}
91
92
93
bool
94
GNELaneTemplate::checkDrawToContour() const {
95
return false;
96
}
97
98
99
bool
100
GNELaneTemplate::checkDrawRelatedContour() const {
101
return false;
102
}
103
104
105
bool
106
GNELaneTemplate::checkDrawOverContour() const {
107
return false;
108
}
109
110
111
bool
112
GNELaneTemplate::checkDrawDeleteContour() const {
113
return false;
114
}
115
116
117
bool
118
GNELaneTemplate::checkDrawDeleteContourSmall() const {
119
return false;
120
}
121
122
123
bool
124
GNELaneTemplate::checkDrawSelectContour() const {
125
return false;
126
}
127
128
129
bool
130
GNELaneTemplate::checkDrawMoveContour() const {
131
return false;
132
}
133
134
135
std::string
136
GNELaneTemplate::getAttribute(SumoXMLAttr key) const {
137
return myLane->getAttribute(key);
138
}
139
140
141
double
142
GNELaneTemplate::getAttributeDouble(SumoXMLAttr key) const {
143
return myLane->getAttributeDouble(key);
144
}
145
146
147
Position
148
GNELaneTemplate::getAttributePosition(SumoXMLAttr key) const {
149
return getCommonAttributePosition(key);
150
}
151
152
153
PositionVector
154
GNELaneTemplate::getAttributePositionVector(SumoXMLAttr key) const {
155
return myLane->getAttributePositionVector(key);
156
}
157
158
159
void
160
GNELaneTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/, GNEUndoList* /*undoList*/) {
161
throw InvalidArgument("cannot be called in templates");
162
}
163
164
165
bool
166
GNELaneTemplate::isValid(SumoXMLAttr /*key*/, const std::string& /*value*/) {
167
throw InvalidArgument("cannot be called in templates");
168
}
169
170
171
bool
172
GNELaneTemplate::isAttributeEnabled(SumoXMLAttr /*key*/) const {
173
// All attributes are disabled in templates
174
return false;
175
}
176
177
178
std::string
179
GNELaneTemplate::getPopUpID() const {
180
return myLane->getPopUpID();
181
}
182
183
184
std::string
185
GNELaneTemplate::getHierarchyName() const {
186
return myLane->getHierarchyName();
187
}
188
189
// ===========================================================================
190
// private
191
// ===========================================================================
192
193
void
194
GNELaneTemplate::setAttribute(SumoXMLAttr /*key*/, const std::string& /*value*/) {
195
throw InvalidArgument("cannot be called in templates");
196
}
197
198
/****************************************************************************/
199
200