SUMO - Simulation of Urban MObility
GNEDetectorE3.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
17 //
18 /****************************************************************************/
19 #ifndef GNEDetectorE3_h
20 #define GNEDetectorE3_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #ifdef _MSC_VER
27 #include <windows_config.h>
28 #else
29 #include <config.h>
30 #endif
31 
32 #include "GNEAdditional.h"
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
42 class GNEDetectorE3 : public GNEAdditional {
43 
44 public:
54  GNEDetectorE3(const std::string& id, GNEViewNet* viewNet, Position pos, double freq, const std::string& filename, const double timeThreshold, double speedThreshold);
55 
58 
62  void writeAdditional(OutputDevice& device) const;
63 
65  std::string generateEntryID();
66 
68  std::string generateExitID();
69 
72 
76  void moveGeometry(const Position& oldPos, const Position& offset);
77 
82  void commitGeometryMoving(const Position& oldPos, GNEUndoList* undoList);
83 
85  void updateGeometry();
86 
90 
95  const std::string& getParentName() const;
96 
101  void drawGL(const GUIVisualizationSettings& s) const;
103 
106  /* @brief method for getting the Attribute of an XML key
107  * @param[in] key The attribute key
108  * @return string with the value associated to key
109  */
110  std::string getAttribute(SumoXMLAttr key) const;
111 
112  /* @brief method for setting the attribute and letting the object perform additional changes
113  * @param[in] key The attribute key
114  * @param[in] value The new value
115  * @param[in] undoList The undoList on which to register changes
116  */
117  void setAttribute(SumoXMLAttr key, const std::string& value, GNEUndoList* undoList);
118 
119  /* @brief method for checking if the key and their conrrespond attribute are valids
120  * @param[in] key The attribute key
121  * @param[in] value The value asociated to key key
122  * @return true if the value is valid, false in other case
123  */
124  bool isValid(SumoXMLAttr key, const std::string& value);
126 
127 protected:
130 
132  double myFreq;
133 
135  std::string myFilename;
136 
139 
142 
143 private:
145  void setAttribute(SumoXMLAttr key, const std::string& value);
146 
148  GNEDetectorE3(const GNEDetectorE3&) = delete;
149 
151  GNEDetectorE3& operator=(const GNEDetectorE3&) = delete;
152 };
153 
154 #endif
155 /****************************************************************************/
double mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting...
const std::string & getParentName() const
Returns the name of the parent object (if any)
GNEDetectorE3(const std::string &id, GNEViewNet *viewNet, Position pos, double freq, const std::string &filename, const double timeThreshold, double speedThreshold)
GNEDetectorE3 Constructor.
void moveGeometry(const Position &oldPos, const Position &offset)
change the position of the element geometry without saving in undoList
std::string getAttribute(SumoXMLAttr key) const
This functions has to be implemented in all GNEAttributeCarriers.
Position myPosition
position of E3 in view
Position getPositionInView() const
Returns position of additional in view.
Stores the information about how to visualize structures.
double myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
void updateGeometry()
update pre-computed geometry information
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:45
std::string generateEntryID()
gererate a new ID for an Entry detector child
void writeAdditional(OutputDevice &device) const
writte additional element into a xml file
double myFreq
frequency of E3 detector
void commitGeometryMoving(const Position &oldPos, GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(...)
An Element which don&#39;t belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:59
~GNEDetectorE3()
GNEDetectorE3 6Destructor.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
std::string generateExitID()
gererate a new ID for an Exit detector child
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 ...
GNEDetectorE3 & operator=(const GNEDetectorE3 &)=delete
Invalidated assignment operator.