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-sim.org/
10 // Copyright (C) 2001-2013 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:
63  GNEDetectorE2(const std::string& id, GNELane* lane, GNEViewNet* viewNet, SUMOReal pos, SUMOReal length, SUMOReal freq, const std::string& filename,
64  bool cont, SUMOTime timeThreshold, SUMOReal speedThreshold, SUMOReal jamThreshold, bool blocked);
65 
68 
71  void updateGeometry();
72 
75 
79  void writeAdditional(OutputDevice& device, const std::string&);
80 
83 
87  void drawGL(const GUIVisualizationSettings& s) const;
89 
92  /* @brief method for getting the Attribute of an XML key
93  * @param[in] key The attribute key
94  * @return string with the value associated to key
95  */
96  std::string getAttribute(SumoXMLAttr key) const;
97 
98  /* @brief method for setting the attribute and letting the object perform additional changes
99  * @param[in] key The attribute key
100  * @param[in] value The new value
101  * @param[in] undoList The undoList on which to register changes
102  */
103  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
104 
105  /* @brief method for checking if the key and their correspond attribute are valids
106  * @param[in] key The attribute key
107  * @param[in] value The value asociated to key key
108  * @return true if the value is valid, false in other case
109  */
110  bool isValid(SumoXMLAttr key, const std::string& value);
112 
113 protected:
116 
118  bool myCont;
119 
122 
125 
128 
129 private:
131  void setAttribute(SumoXMLAttr key, const std::string& value);
132 
135 
138 };
139 
140 #endif
141 /****************************************************************************/
long long int SUMOTime
Definition: SUMOTime.h:43
Stores the information about how to visualize structures.
std::string getAttribute(SumoXMLAttr key) const
GNEDetectorE2(const std::string &id, GNELane *lane, GNEViewNet *viewNet, SUMOReal pos, SUMOReal length, SUMOReal freq, const std::string &filename, bool cont, SUMOTime timeThreshold, SUMOReal speedThreshold, SUMOReal jamThreshold, bool blocked)
Constructor.
bool myCont
attribute to enable or disable splitByType
SUMOReal myLength
attribute lenght
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)
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
void updateGeometry()
update pre-computed geometry information
~GNEDetectorE2()
Destructor.
SUMOTime myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
SUMOReal mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting...
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
Position getPositionInView() const
Returns position of detector E2 in view.
SUMOReal 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.
GNEDetectorE2 & operator=(const GNEDetectorE2 &)
Invalidated assignment operator.
bool isValid(SumoXMLAttr key, const std::string &value)
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:213
void writeAdditional(OutputDevice &device, const std::string &)
writte additional element into a xml file