SUMO - Simulation of Urban MObility
GNEDetectorE2.h
Go to the documentation of this file.
1 /****************************************************************************/
8 /****************************************************************************/
9 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
10 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
11 /****************************************************************************/
12 //
13 // This file is part of SUMO.
14 // SUMO is free software; you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation; either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 /****************************************************************************/
20 #ifndef GNEDetectorE2_h
21 #define GNEDetectorE2_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #ifdef _MSC_VER
28 #include <windows_config.h>
29 #else
30 #include <config.h>
31 #endif
32 
33 #include "GNEDetector.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class GNEDetector;
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
47 class GNEDetectorE2 : public GNEDetector {
48 public:
62  GNEDetectorE2(const std::string& id, GNELane* lane, GNEViewNet* viewNet, double pos, double length, double freq, const std::string& filename,
63  bool cont, const double timeThreshold, double speedThreshold, double jamThreshold);
64 
67 
70  void updateGeometry();
71 
74 
78  void writeAdditional(OutputDevice& device) const;
79 
82 
86  void drawGL(const GUIVisualizationSettings& s) const;
88 
91  /* @brief method for getting the Attribute of an XML key
92  * @param[in] key The attribute key
93  * @return string with the value associated to key
94  */
95  std::string getAttribute(SumoXMLAttr key) const;
96 
97  /* @brief method for setting the attribute and letting the object perform additional changes
98  * @param[in] key The attribute key
99  * @param[in] value The new value
100  * @param[in] undoList The undoList on which to register changes
101  */
102  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
103 
104  /* @brief method for checking if the key and their correspond attribute are valids
105  * @param[in] key The attribute key
106  * @param[in] value The value asociated to key key
107  * @return true if the value is valid, false in other case
108  */
109  bool isValid(SumoXMLAttr key, const std::string& value);
111 
112 protected:
114  double myLength;
115 
117  bool myCont;
118 
121 
124 
127 
128 private:
130  void setAttribute(SumoXMLAttr key, const std::string& value);
131 
134 
137 };
138 
139 #endif
140 /****************************************************************************/
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
Stores the information about how to visualize structures.
bool myCont
attribute to enable or disable splitByType
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void updateGeometry()
update pre-computed geometry information
~GNEDetectorE2()
Destructor.
double mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting...
Position getPositionInView() const
Returns position of detector E2 in view.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
double myLength
attribute length
std::string getAttribute(SumoXMLAttr key) const
GNEDetectorE2 & operator=(const GNEDetectorE2 &)
Invalidated assignment operator.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
double myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
GNEDetectorE2(const std::string &id, GNELane *lane, GNEViewNet *viewNet, double pos, double length, double freq, const std::string &filename, bool cont, const double timeThreshold, double speedThreshold, double jamThreshold)
Constructor.
double myJamThreshold
The minimum distance to the next standing vehicle in order to make this vehicle count as a participan...
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.