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 definitions
27// ===========================================================================
28
30
31public:
34
49 GNEOverheadWire(const std::string& id, GNENet* net, const std::string& filename, std::vector<GNELane*> lanes, GNEAdditional* substation,
50 const double startPos, const double endPos, const bool friendlyPos,
51 const std::vector<std::string>& forbiddenInnerLanes, const Parameterised::Map& parameters);
52
55
60
63
67 void writeAdditional(OutputDevice& device) const;
68
70 bool isAdditionalValid() const;
71
73 std::string getAdditionalProblem() const;
74
77
79
82
84 bool checkDrawMoveContour() const;
85
87
89 void updateGeometry();
90
93
95 void updateCenteringBoundary(const bool updateGrid);
96
98 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
99
102
107 void drawGL(const GUIVisualizationSettings& s) const;
108
110
113
115 void computePathElement();
116
122 void drawLanePartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
123
129 void drawJunctionPartialGL(const GUIVisualizationSettings& s, const GNESegment* segment, const double offsetFront) const;
130
132
135
136 /* @brief method for getting the Attribute of an XML key
137 * @param[in] key The attribute key
138 * @return string with the value associated to key
139 */
140 std::string getAttribute(SumoXMLAttr key) const;
141
142 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
143 * @param[in] key The attribute key
144 * @return double with the value associated to key
145 */
146 double getAttributeDouble(SumoXMLAttr key) const;
147
150
151 /* @brief method for setting the attribute and letting the object perform additional changes
152 * @param[in] key The attribute key
153 * @param[in] value The new value
154 * @param[in] undoList The undoList on which to register changes
155 */
156 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
157
158 /* @brief method for checking if the key and their correspond attribute are valids
159 * @param[in] key The attribute key
160 * @param[in] value The value associated to key key
161 * @return true if the value is valid, false in other case
162 */
163 bool isValid(SumoXMLAttr key, const std::string& value);
164
166 std::string getPopUpID() const;
167
169 std::string getHierarchyName() const;
170
172
173protected:
175 double myStartPos = 0;
176
178 double myEndPos = 0;
179
181 bool myFriendlyPosition = false;
182
184 std::vector<std::string> myForbiddenInnerLanes;
185
186private:
188 void setAttribute(SumoXMLAttr key, const std::string& value);
189
191 void setMoveShape(const GNEMoveResult& moveResult);
192
194 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
195
198
200 double getEndGeometryPositionOverLane() const;
201
204
207};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
void updateGeometry()
update pre-computed geometry information
void drawJunctionPartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over junction.
void fixAdditionalProblem()
fix additional problem
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
~GNEOverheadWire()
Destructor.
void drawLanePartialGL(const GUIVisualizationSettings &s, const GNESegment *segment, const double offsetFront) const
Draws partial object over lane.
double getStartGeometryPositionOverLane() const
get start position over lane that is applicable to the shape
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their correspondent attribute are valids
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
double myEndPos
end position over lane
bool checkDrawMoveContour() const
check if draw move contour (red)
const Parameterised::Map & getACParametersMap() const
get parameters map
void commitMoveShape(const GNEMoveResult &moveResult, GNEUndoList *undoList)
commit move shape
void computePathElement()
compute pathElement
GNEMoveOperation * getMoveOperation()
get move operation
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Position getPositionInView() const
Returns position of additional in view.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
GNEOverheadWire & operator=(const GNEOverheadWire &)=delete
Invalidated assignment operator.
double myStartPos
start position over lane
double getAttributeDouble(SumoXMLAttr key) const
void splitEdgeGeometry(const double splitPosition, const GNENetworkElement *originalElement, const GNENetworkElement *newElement, GNEUndoList *undoList)
split geometry
double getEndGeometryPositionOverLane() const
get end position over lane that is applicable to the shape
void setMoveShape(const GNEMoveResult &moveResult)
set move shape
GNEOverheadWire(const GNEOverheadWire &)=delete
Invalidated copy constructor.
void updateCenteringBoundary(const bool updateGrid)
update centering boundary (implies change in RTREE)
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
std::string getAdditionalProblem() const
return a string with the current additional problem
std::string getAttribute(SumoXMLAttr key) const
bool myFriendlyPosition
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