Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEInstantInductionLoopDetector.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 declaration
27// ===========================================================================
28
30
31// ===========================================================================
32// class definitions
33// ===========================================================================
34
36
37public:
40
55 GNEInstantInductionLoopDetector(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane, const double pos,
56 const std::string& outputFilename, const std::vector<std::string>& vehicleTypes,
57 const std::vector<std::string>& nextEdges, const std::string& detectPersons, const std::string& name,
58 const bool friendlyPos, const Parameterised::Map& parameters);
59
62
65
67 GNEMoveElement* getMoveElement() const override;
68
70 Parameterised* getParameters() override;
71
73
76
80 void writeAdditional(OutputDevice& device) const;
81
83 bool isAdditionalValid() const;
84
86 std::string getAdditionalProblem() const;
87
90
92
95
97 void updateGeometry() override;
98
100
103
108 void drawGL(const GUIVisualizationSettings& s) const;
109
111
114
115 /* @brief method for getting the Attribute of an XML key
116 * @param[in] key The attribute key
117 * @return string with the value associated to key
118 */
119 std::string getAttribute(SumoXMLAttr key) const override;
120
121 /* @brief method for getting the Attribute of an XML key in double format
122 * @param[in] key The attribute key
123 * @return double with the value associated to key
124 */
125 double getAttributeDouble(SumoXMLAttr key) const override;
126
127 /* @brief method for getting the Attribute of an XML key in position format
128 * @param[in] key The attribute key
129 * @return position with the value associated to key
130 */
131 Position getAttributePosition(SumoXMLAttr key) const override;
132
133 /* @brief method for setting the attribute and letting the object perform additional changes
134 * @param[in] key The attribute key
135 * @param[in] value The new value
136 * @param[in] undoList The undoList on which to register changes
137 */
138 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
139
140 /* @brief method for checking if the key and their correspond attribute are valids
141 * @param[in] key The attribute key
142 * @param[in] value The value associated to key key
143 * @return true if the value is valid, false in other case
144 */
145 bool isValid(SumoXMLAttr key, const std::string& value) override;
146
148
149protected:
151 double myPosOverLane = 0;
152
154 bool myFriendlyPos = false;
155
158
159private:
161 void setAttribute(SumoXMLAttr key, const std::string& value) override;
162
165
168};
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Position getAttributePosition(SumoXMLAttr key) const override
bool isAdditionalValid() const
check if current additional is valid to be written into XML
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
std::string getAdditionalProblem() const
return a string with the current additional problem
GNEInstantInductionLoopDetector & operator=(const GNEInstantInductionLoopDetector &)=delete
Invalidated assignment operator.
std::string getAttribute(SumoXMLAttr key) const override
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
void updateGeometry() override
update pre-computed geometry information
GNEMoveElementLaneSingle * myMoveElementLaneSingle
move element lane single
GNEInstantInductionLoopDetector(const GNEInstantInductionLoopDetector &)=delete
Invalidated copy constructor.
Parameterised * getParameters() override
get parameters associated with this GNEAdditional
bool isValid(SumoXMLAttr key, const std::string &value) override
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
double getAttributeDouble(SumoXMLAttr key) const override
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.
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