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 override;
83
85 bool isAdditionalValid() const override;
86
88 std::string getAdditionalProblem() const override;
89
91 void fixAdditionalProblem() override;
92
94
97
99 bool checkDrawMoveContour() const override;
100
102
104 void updateGeometry() override;
105
107 Position getPositionInView() const override;
108
110 void updateCenteringBoundary(const bool updateGrid) override;
111
113 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList) override;
114
117
122 void drawGL(const GUIVisualizationSettings& s) const override;
123
125
128
130 void computePathElement() override;
131
137 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
138
144 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const override;
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};
const std::string invalid_return< std::string >::value
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
GNEAdditional(const std::string &id, GNENet *net, const std::string &filename, SumoXMLTag tag, const std::string &additionalName)
Constructor.
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
void fixAdditionalProblem() override
fix additional problem
std::string getAdditionalProblem() const override
return a string with the current additional problem
Position getAttributePosition(SumoXMLAttr key) const override
void updateGeometry() override
update pre-computed geometry information
void computePathElement() override
compute pathElement
~GNEOverheadWire()
Destructor.
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 updateCenteringBoundary(const bool updateGrid) override
update centering boundary (implies change in RTREE)
Parameterised * getParameters() override
get parameters associated with this overheadWire
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over junction.
Position getPositionInView() const override
Returns position of additional in view.
double getAttributeDouble(SumoXMLAttr key) const override
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void writeAdditional(OutputDevice &device) const override
write additional element into a xml file
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.
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
bool isValid(SumoXMLAttr key, const std::string &value) override
bool isAdditionalValid() const override
check if current additional is valid to be written into XML
GNEOverheadWire(GNENet *net)
default Constructor
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const override
Draws partial object over lane.
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.
double myStartPosOverLane
The start position over lane.
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList) override
split geometry
bool myFriendlyPosition
Flag for friendly position.
std::vector< std::string > myForbiddenInnerLanes
forbidden inner lanes
Stores the information about how to visualize structures.
Static storage of an output device and its base (abstract) implementation.
std::map< std::string, std::string > Map
parameters map
Parameterised()
Default constructor.
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37
A list of positions.