SUMO - Simulation of Urban MObility
GNEDetectorE3.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 GNEDetectorE3_h
21 #define GNEDetectorE3_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 "GNEAdditionalSet.h"
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class GNEDetectorE3EntryExit;
39 class GNELane;
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
49 public:
60  GNEDetectorE3(const std::string& id, GNEViewNet* viewNet, Position pos, int freq, const std::string& filename, SUMOTime timeThreshold, SUMOReal speedThreshold, bool blocked);
61 
64 
67  void updateGeometry();
68 
71 
77  void moveAdditional(SUMOReal posx, SUMOReal posy, GNEUndoList* undoList);
78 
82  void writeAdditional(OutputDevice& device, const std::string& currentDirectory);
83 
88  const std::string& getParentName() const;
89 
94  void drawGL(const GUIVisualizationSettings& s) const;
96 
99  /* @brief method for getting the Attribute of an XML key
100  * @param[in] key The attribute key
101  * @return string with the value associated to key
102  */
103  std::string getAttribute(SumoXMLAttr key) const;
104 
105  /* @brief method for setting the attribute and letting the object perform additionalSet changes
106  * @param[in] key The attribute key
107  * @param[in] value The new value
108  * @param[in] undoList The undoList on which to register changes
109  */
110  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
111 
112  /* @brief method for checking if the key and their conrrespond attribute are valids
113  * @param[in] key The attribute key
114  * @param[in] value The value asociated to key key
115  * @return true if the value is valid, false in other case
116  */
117  bool isValid(SumoXMLAttr key, const std::string& value);
119 
120 protected:
122  int myFreq;
123 
125  std::string myFilename;
126 
129 
132 
134  std::vector<GNEDetectorE3EntryExit*> myGNEDetectorE3EntryExits;
135 
136 private:
138  void setAttribute(SumoXMLAttr key, const std::string& value);
139 
142 
145 };
146 
147 #endif
148 /****************************************************************************/
long long int SUMOTime
Definition: SUMOTime.h:43
const std::string & getParentName() const
Returns the name of the parent object (if any)
Stores the information about how to visualize structures.
Position getPositionInView() const
Returns position of detector E3 in view.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:54
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element wich group additionalSet elements.
bool isValid(SumoXMLAttr key, const std::string &value)
void writeAdditional(OutputDevice &device, const std::string &currentDirectory)
writte additionalSet element into a xml file
void updateGeometry()
update pre-computed geometry information
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
int myFreq
frequency of E3 detector
GNEDetectorE3 & operator=(const GNEDetectorE3 &)
Invalidated assignment operator.
SUMOTime myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
void moveAdditional(SUMOReal posx, SUMOReal posy, GNEUndoList *undoList)
change the position of the E3 geometry
SUMOReal mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting...
std::string getAttribute(SumoXMLAttr key) const
~GNEDetectorE3()
GNEDetectorE3 6Destructor.
GNEDetectorE3(const std::string &id, GNEViewNet *viewNet, Position pos, int freq, const std::string &filename, SUMOTime timeThreshold, SUMOReal speedThreshold, bool blocked)
GNEDetectorE3 Constructor.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:71
#define SUMOReal
Definition: config.h:213
std::vector< GNEDetectorE3EntryExit * > myGNEDetectorE3EntryExits
vector with the GNEDetectorE3EntryExits of the detector
std::string myFilename
fielname of E3 detector
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)