Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEOverheadWire.h
Go to the documentation of this file.
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/****************************************************************************/
18//
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include "GNEAdditional.h"
24
25// ===========================================================================
26// class declaration
27// ===========================================================================
28
30
31// ===========================================================================
32// class definitions
33// ===========================================================================
34
36
37public:
40
55 GNEOverheadWire(const std::string& id, GNENet* net, const std::string& filename, std::vector<GNELane*> lanes, GNEAdditional* substation,
56 const double startPos, const double endPos, const bool friendlyPos,
57 const std::vector<std::string>& forbiddenInnerLanes, const Parameterised::Map& parameters);
58
61
64
66 GNEMoveElement* getMoveElement() const override;
67
69 Parameterised* getParameters() override;
70
72 const Parameterised* getParameters() const override;
73
75
78
82 void writeAdditional(OutputDevice& device) const;
83
85 bool isAdditionalValid() const;
86
88 std::string getAdditionalProblem() const;
89
92
94
97
99 bool checkDrawMoveContour() const override;
100
102
104 void updateGeometry() override;
105
108
110 void updateCenteringBoundary(const bool updateGrid);
111
113 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
114
117
122 void drawGL(const GUIVisualizationSettings& s) const;
123
125
128
130 void computePathElement();
131
137 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
138
144 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
145
147
150
151 /* @brief method for getting the Attribute of an XML key
152 * @param[in] key The attribute key
153 * @return string with the value associated to key
154 */
155 std::string getAttribute(SumoXMLAttr key) const override;
156
157 /* @brief method for getting the Attribute of an XML key in double format
158 * @param[in] key The attribute key
159 * @return double with the value associated to key
160 */
161 double getAttributeDouble(SumoXMLAttr key) const override;
162
163 /* @brief method for getting the Attribute of an XML key in position format
164 * @param[in] key The attribute key
165 * @return position with the value associated to key
166 */
167 Position getAttributePosition(SumoXMLAttr key) const override;
168
169 /* @brief method for getting the Attribute of an XML key in positionVector format
170 * @param[in] key The attribute key
171 * @return positionVector with the value associated to key
172 */
174
175 /* @brief method for setting the attribute and letting the object perform additional changes
176 * @param[in] key The attribute key
177 * @param[in] value The new value
178 * @param[in] undoList The undoList on which to register changes
179 */
180 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
181
182 /* @brief method for checking if the key and their correspond attribute are valids
183 * @param[in] key The attribute key
184 * @param[in] value The value associated to key key
185 * @return true if the value is valid, false in other case
186 */
187 bool isValid(SumoXMLAttr key, const std::string& value) override;
188
190 std::string getPopUpID() const override;
191
193 std::string getHierarchyName() const override;
194
196
197protected:
200
203
205 bool myFriendlyPosition = false;
206
208 std::vector<std::string> myForbiddenInnerLanes;
209
212
213private:
215 void setAttribute(SumoXMLAttr key, const std::string& value) override;
216
219
222};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over junction.
void fixAdditionalProblem()
fix additional problem
Position getAttributePosition(SumoXMLAttr key) const override
void updateGeometry() override
update pre-computed geometry information
~GNEOverheadWire()
Destructor.
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over lane.
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this overheadWire
PositionVector getAttributePositionVector(SumoXMLAttr key) const override
GNEMoveElementLaneDouble * myMoveElementLaneDouble
@brif move element lane double
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
void computePathElement()
compute pathElement
Parameterised * getParameters() override
get parameters associated with this overheadWire
double getAttributeDouble(SumoXMLAttr key) const override
Position getPositionInView() const
Returns position of additional in view.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNEOverheadWire & operator=(const GNEOverheadWire &)=delete
Invalidated assignment operator.
bool checkDrawMoveContour() const override
check if draw move contour (red)
double myEndPosPosOverLane
The end position over lane.
bool isValid(SumoXMLAttr key, const std::string &value) override
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
std::string getAttribute(SumoXMLAttr key) const override
std::string getPopUpID() const override
get PopPup ID (Used in AC Hierarchy)
std::string getHierarchyName() const override
get Hierarchy Name (Used in AC Hierarchy)
GNEOverheadWire(const GNEOverheadWire &)=delete
Invalidated copy constructor.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
std::string getAdditionalProblem() const
return a string with the current additional problem
double myStartPosOverLane
The start position over lane.
bool myFriendlyPosition
Flag for friendly position.
std::vector< std::string > myForbiddenInnerLanes
forbidden inner lanes
bool isAdditionalValid() const
check if current additional is valid to be written into XML
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
An upper class for objects with additional parameters.
std::map< std::string, std::string > Map
parameters map
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.