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 
73  void moveAdditionalGeometry(SUMOReal offsetx, SUMOReal offsety);
74 
76  void commmitAdditionalGeometryMoved(SUMOReal oldPosx, SUMOReal oldPosy, GNEUndoList* undoList);
77 
81  void writeAdditional(OutputDevice& device, const std::string& currentDirectory);
82 
87  const std::string& getParentName() const;
88 
93  void drawGL(const GUIVisualizationSettings& s) const;
95 
98  /* @brief method for getting the Attribute of an XML key
99  * @param[in] key The attribute key
100  * @return string with the value associated to key
101  */
102  std::string getAttribute(SumoXMLAttr key) const;
103 
104  /* @brief method for setting the attribute and letting the object perform additionalSet changes
105  * @param[in] key The attribute key
106  * @param[in] value The new value
107  * @param[in] undoList The undoList on which to register changes
108  */
109  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
110 
111  /* @brief method for checking if the key and their conrrespond attribute are valids
112  * @param[in] key The attribute key
113  * @param[in] value The value asociated to key key
114  * @return true if the value is valid, false in other case
115  */
116  bool isValid(SumoXMLAttr key, const std::string& value);
118 
119 protected:
121  int myFreq;
122 
124  std::string myFilename;
125 
128 
131 
133  std::vector<GNEDetectorE3EntryExit*> myGNEDetectorE3EntryExits;
134 
135 private:
137  void setAttribute(SumoXMLAttr key, const std::string& value);
138 
141 
144 };
145 
146 #endif
147 /****************************************************************************/
const std::string & getParentName() const
Returns the name of the parent object (if any)
long long int SUMOTime
Definition: SUMOTime.h:43
std::string getAttribute(SumoXMLAttr key) const
Position getPositionInView() const
Returns position of detector E3 in view.
Stores the information about how to visualize structures.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
This lane is powered by an underlying GNEEdge and basically knows how to draw itself.
Definition: GNELane.h:55
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
An Element wich group additionalSet elements.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
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 commmitAdditionalGeometryMoved(SUMOReal oldPosx, SUMOReal oldPosy, GNEUndoList *undoList)
updated geometry changes in the attributes of additional
void moveAdditionalGeometry(SUMOReal offsetx, SUMOReal offsety)
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...
~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 setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes ...