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-2023 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#include "GNEAdditional.h"
23
24
25// ===========================================================================
26// class definitions
27// ===========================================================================
33
34public:
37
51 GNEOverheadWire(const std::string& id, std::vector<GNELane*> lanes, GNEAdditional* substation, GNENet* net,
52 const double startPos, const double endPos, const bool friendlyPos,
53 const std::vector<std::string>& forbiddenInnerLanes, const Parameterised::Map& parameters);
54
57
62
65
69 void writeAdditional(OutputDevice& device) const;
70
72 bool isAdditionalValid() const;
73
75 std::string getAdditionalProblem() const;
76
79
81
83 void updateGeometry();
84
87
89 void updateCenteringBoundary(const bool updateGrid);
90
92 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
93
96
101 void drawGL(const GUIVisualizationSettings& s) const;
102
104
107
109 void computePathElement();
110
116 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const;
117
124 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const;
125
127
130
131 /* @brief method for getting the Attribute of an XML key
132 * @param[in] key The attribute key
133 * @return string with the value associated to key
134 */
135 std::string getAttribute(SumoXMLAttr key) const;
136
137 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
138 * @param[in] key The attribute key
139 * @return double with the value associated to key
140 */
141 double getAttributeDouble(SumoXMLAttr key) const;
142
145
146 /* @brief method for setting the attribute and letting the object perform additional changes
147 * @param[in] key The attribute key
148 * @param[in] value The new value
149 * @param[in] undoList The undoList on which to register changes
150 */
151 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
152
153 /* @brief method for checking if the key and their correspond attribute are valids
154 * @param[in] key The attribute key
155 * @param[in] value The value associated to key key
156 * @return true if the value is valid, false in other case
157 */
158 bool isValid(SumoXMLAttr key, const std::string& value);
159
161 std::string getPopUpID() const;
162
164 std::string getHierarchyName() const;
165
167
168protected:
171
173 double myEndPos;
174
177
179 std::vector<std::string> myForbiddenInnerLanes;
180
181private:
183 void setAttribute(SumoXMLAttr key, const std::string& value);
184
186 void setMoveShape(const GNEMoveResult& moveResult);
187
189 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
190
193
195 double getEndGeometryPositionOverLane() const;
196
199
202};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element which don't belong to GNENet but has influence in the simulation.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition GNELane.h:46
move operation
move result
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
void updateGeometry()
update pre-computed geometry information
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.
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 drawPartialGL(const GUIVisualizationSettings &s, const GNELane *lane, const GNEPathManager::Segment *segment, const double offsetFront) const
Draws partial object (lane)
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
double myEndPos
end position over lane
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 writed 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