Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
GNEInductionLoopDetector.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
57 GNEInductionLoopDetector(const std::string& id, GNENet* net, const std::string& filename, GNELane* lane, const double pos, const SUMOTime freq,
58 const std::string& outputFilename, const std::vector<std::string>& vehicleTypes, const std::vector<std::string>& nextEdges,
59 const std::string& detectPersons, const std::string& name, const bool friendlyPos, const Parameterised::Map& parameters);
60
63
66
68 GNEMoveElement* getMoveElement() const override;
69
71 Parameterised* getParameters() override;
72
74
77
81 void writeAdditional(OutputDevice& device) const;
82
84 bool isAdditionalValid() const;
85
87 std::string getAdditionalProblem() const;
88
91
93
95 void updateGeometry() override;
96
99
101 bool checkDrawRelatedContour() const override;
102
104
107
112 void drawGL(const GUIVisualizationSettings& s) const;
113
115
118
119 /* @brief method for getting the Attribute of an XML key
120 * @param[in] key The attribute key
121 * @return string with the value associated to key
122 */
123 std::string getAttribute(SumoXMLAttr key) const override;
124
125 /* @brief method for getting the Attribute of an XML key in double format
126 * @param[in] key The attribute key
127 * @return double with the value associated to key
128 */
129 double getAttributeDouble(SumoXMLAttr key) const override;
130
131 /* @brief method for getting the Attribute of an XML key in position format
132 * @param[in] key The attribute key
133 * @return position with the value associated to key
134 */
135 Position getAttributePosition(SumoXMLAttr key) const override;
136
137 /* @brief method for setting the attribute and letting the object perform additional changes
138 * @param[in] key The attribute key
139 * @param[in] value The new value
140 * @param[in] undoList The undoList on which to register changes
141 */
142 void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList) override;
143
144 /* @brief method for checking if the key and their correspond attribute are valids
145 * @param[in] key The attribute key
146 * @param[in] value The value associated to key key
147 * @return true if the value is valid, false in other case
148 */
149 bool isValid(SumoXMLAttr key, const std::string& value) override;
150
152
153protected:
155 double myPosOverLane = 0;
156
158 bool myFriendlyPos = false;
159
162
163private:
165 void setAttribute(SumoXMLAttr key, const std::string& value) override;
166
169
172};
long long int SUMOTime
Definition GUI.h:36
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
GNEInductionLoopDetector(const GNEInductionLoopDetector &)=delete
Invalidated copy constructor.
void fixAdditionalProblem()
fix additional problem
Parameterised * getParameters() override
get parameters associated with this GNEAdditional
bool isValid(SumoXMLAttr key, const std::string &value) override
GNEMoveElementLaneSingle * myMoveElementLaneSingle
move element lane single
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList) override
std::string getAttribute(SumoXMLAttr key) const override
GNEMoveElement * getMoveElement() const override
methods to retrieve the elements linked to this GNEAdditional
double myPosOverLane
position over lane
double getAttributeDouble(SumoXMLAttr key) const override
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
bool myFriendlyPos
friendly position
GNEInductionLoopDetector & operator=(const GNEInductionLoopDetector &)=delete
Invalidated assignment operator.
void writeAdditional(OutputDevice &device) const
write additional element into a xml file
bool isAdditionalValid() const
check if current additional is valid to be written into XML
std::string getAdditionalProblem() const
return a string with the current additional problem
bool checkDrawRelatedContour() const override
check if draw related contour (cyan)
void updateGeometry() override
update pre-computed geometry information
Position getAttributePosition(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