Eclipse SUMO - Simulation of Urban MObility
GNEOverheadWire.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3// Copyright (C) 2001-2022 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
68 void writeAdditional(OutputDevice& device) const;
69
71 bool isAdditionalValid() const;
72
74 std::string getAdditionalProblem() const;
75
79
81 void updateGeometry();
82
85
87 void updateCenteringBoundary(const bool updateGrid);
88
90 void splitEdgeGeometry(const double splitPosition, const GNENetworkElement* originalElement, const GNENetworkElement* newElement, GNEUndoList* undoList);
91
94
98 void drawGL(const GUIVisualizationSettings& s) const;
100
103
105 void computePathElement();
106
112 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* lane, const GNEPathManager::Segment* segment, const double offsetFront) const;
113
120 void drawPartialGL(const GUIVisualizationSettings& s, const GNELane* fromLane, const GNELane* toLane, const GNEPathManager::Segment* segment, const double offsetFront) const;
121
123
126 /* @brief method for getting the Attribute of an XML key
127 * @param[in] key The attribute key
128 * @return string with the value associated to key
129 */
130 std::string getAttribute(SumoXMLAttr key) const;
131
132 /* @brief method for getting the Attribute of an XML key in double format (to avoid unnecessary parse<double>(...) for certain attributes)
133 * @param[in] key The attribute key
134 * @return double with the value associated to key
135 */
136 double getAttributeDouble(SumoXMLAttr key) const;
137
140
141 /* @brief method for setting the attribute and letting the object perform additional changes
142 * @param[in] key The attribute key
143 * @param[in] value The new value
144 * @param[in] undoList The undoList on which to register changes
145 */
146 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
147
148 /* @brief method for checking if the key and their correspond attribute are valids
149 * @param[in] key The attribute key
150 * @param[in] value The value associated to key key
151 * @return true if the value is valid, false in other case
152 */
153 bool isValid(SumoXMLAttr key, const std::string& value);
154
156 std::string getPopUpID() const;
157
159 std::string getHierarchyName() const;
161
162protected:
165
167 double myEndPos;
168
171
173 std::vector<std::string> myForbiddenInnerLanes;
174
175private:
177 void setAttribute(SumoXMLAttr key, const std::string& value);
178
180 void setMoveShape(const GNEMoveResult& moveResult);
181
183 void commitMoveShape(const GNEMoveResult& moveResult, GNEUndoList* undoList);
184
187
189 double getEndGeometryPositionOverLane() const;
190
193
196};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element which don't belong to GNENet but has influence in the simulation.
Definition: GNEAdditional.h:48
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
GNEOverheadWire(GNENet *net)
default Constructor
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.
Definition: OutputDevice.h:61
An upper class for objects with additional parameters.
Definition: Parameterised.h:41
std::map< std::string, std::string > Map
parameters map
Definition: Parameterised.h:45
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:37