Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEEntryExitDetector.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 "GNEDetector.h"
24
25// ===========================================================================
26// class declarations
27// ===========================================================================
28
31
32// ===========================================================================
33// class definitions
34// ===========================================================================
35
37
38public:
40 GNEEntryExitDetector(SumoXMLTag entryExitTag, GNENet* net);
41
50 GNEEntryExitDetector(SumoXMLTag entryExitTag, GNEAdditional* parent, GNELane* lane, const double pos,
51 const bool friendlyPos, const Parameterised::Map& parameters);
52
55
58
60 GNEMoveElement* getMoveElement() const override;
61
63
66
70 void writeAdditional(OutputDevice& device) const;
71
73 bool isAdditionalValid() const;
74
76 std::string getAdditionalProblem() const;
77
80
82
84 void updateGeometry() override;
85
88
93 void drawGL(const GUIVisualizationSettings& s) const;
94
96
99
100 /* @brief method for getting the Attribute of an XML key
101 * @param[in] key The attribute key
102 * @return string with the value associated to key
103 */
104 std::string getAttribute(SumoXMLAttr key) const override;
105
106 /* @brief method for getting the Attribute of an XML key in double format
107 * @param[in] key The attribute key
108 * @return double with the value associated to key
109 */
110 double getAttributeDouble(SumoXMLAttr key) const override;
111
112 /* @brief method for getting the Attribute of an XML key in position format
113 * @param[in] key The attribute key
114 * @return position with the value associated to key
115 */
116 Position getAttributePosition(SumoXMLAttr key) const override;
117
118 /* @brief method for setting the attribute and letting the object perform additional changes
119 * @param[in] key The attribute key
120 * @param[in] value The new value
121 * @param[in] undoList The undoList on which to register changes
122 */
123 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
124
125 /* @brief method for checking if the key and their correspond attribute are valids
126 * @param[in] key The attribute key
127 * @param[in] value The value associated to key key
128 * @return true if the value is valid, false in other case
129 */
130 bool isValid(SumoXMLAttr key, const std::string& value) override;
131
133
134protected:
136 double myPosOverLane = 0;
137
139 bool myFriendlyPos = false;
140
143
144private:
146 void drawBody(const GUIVisualizationSettings::Detail d, const RGBColor& color, const double exaggeration) const;
147
149 void drawEntryLogo(const GUIVisualizationSettings::Detail d, const RGBColor& color, const double exaggeration) const;
150
152 void drawE3Logo(const GUIVisualizationSettings::Detail d, const RGBColor& color, const double exaggeration) const;
153
155 void setAttribute(SumoXMLAttr key, const std::string& value) override;
156
159
162};
SumoXMLTag
Numbers representing SUMO-XML - element names.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
GNEEntryExitDetector & operator=(const GNEEntryExitDetector &)=delete
Invalidated assignment operator.
GNEEntryExitDetector(const GNEEntryExitDetector &)=delete
Invalidated copy constructor.
void updateGeometry() override
update pre-computed geometry information
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this GNEAdditional
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
std::string getAdditionalProblem() const
return a string with the current additional problem
bool isAdditionalValid() const
check if current additional is valid to be written into XML
void fixAdditionalProblem()
fix additional problem
Position getAttributePosition(SumoXMLAttr key) const override
bool myFriendlyPos
friendly position
void drawBody(const GUIVisualizationSettings::Detail d, const RGBColor &color, const double exaggeration) const
draw body
GNEMoveElementLaneSingle * myMoveElementLaneSingle
move element lane single
std::string getAttribute(SumoXMLAttr key) const override
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double myPosOverLane
position over lane
double getAttributeDouble(SumoXMLAttr key) const override
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
~GNEEntryExitDetector()
destructor
bool isValid(SumoXMLAttr key, const std::string &value) override
void drawE3Logo(const GUIVisualizationSettings::Detail d, const RGBColor &color, const double exaggeration) const
draw E3 logo
void drawEntryLogo(const GUIVisualizationSettings::Detail d, const RGBColor &color, const double exaggeration) const
draw entry logo
A NBNetBuilder extended by visualisation and editing capabilities.
Definition GNENet.h:42
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
A point in 2D or 3D with translation and scaling methods.
Definition Position.h:37