Eclipse 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-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 //
16 /****************************************************************************/
17 #ifndef GNEDetectorE3_h
18 #define GNEDetectorE3_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 
25 #include "GNEAdditional.h"
26 
27 
28 // ===========================================================================
29 // class definitions
30 // ===========================================================================
35 class GNEDetectorE3 : public GNEAdditional {
36 
37 public:
50  GNEDetectorE3(const std::string& id, GNEViewNet* viewNet, Position pos, SUMOTime freq, const std::string& filename, const std::string& vehicleTypes, const std::string& name, SUMOTime timeThreshold, double speedThreshold, bool blockMovement);
51 
54 
57 
60  void moveGeometry(const Position& offset);
61 
65  void commitGeometryMoving(GNEUndoList* undoList);
66 
68  void updateGeometry();
69 
72 
76 
81  std::string getParentName() const;
82 
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 conrrespond 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);
111 
113  std::string getPopUpID() const;
114 
116  std::string getHierarchyName() const;
118 
122  void updateAdditionalParent();
124 
125 protected:
128 
131 
133  std::string myFilename;
134 
136  std::string myVehicleTypes;
137 
140 
143 
144 private:
146  bool checkAdditionalChildRestriction() const;
147 
149  void setAttribute(SumoXMLAttr key, const std::string& value);
150 
152  GNEDetectorE3(const GNEDetectorE3&) = delete;
153 
155  GNEDetectorE3& operator=(const GNEDetectorE3&) = delete;
156 };
157 
158 #endif
159 /****************************************************************************/
GNEDetectorE3::drawGL
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GNEDetectorE3.cpp:115
GNEAdditional
An Element which don't belongs to GNENet but has influency in the simulation.
Definition: GNEAdditional.h:47
GNEAdditional.h
GNEDetectorE3::commitGeometryMoving
void commitGeometryMoving(GNEUndoList *undoList)
commit geometry changes in the attributes of an element after use of moveGeometry(....
Definition: GNEDetectorE3.cpp:100
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:35
GNEDetectorE3::updateGeometry
void updateGeometry()
update pre-computed geometry information
Definition: GNEDetectorE3.cpp:52
GNEDetectorE3::myPosition
Position myPosition
position of E3 in view
Definition: GNEDetectorE3.h:127
GNEDetectorE3::mySpeedThreshold
double mySpeedThreshold
The speed-based threshold that describes how slow a vehicle has to be to be recognized as halting.
Definition: GNEDetectorE3.h:142
GNEViewNet
Definition: GNEViewNet.h:43
GNEDetectorE3::myVehicleTypes
std::string myVehicleTypes
attribute vehicle types
Definition: GNEDetectorE3.h:136
GNEDetectorE3::getParentName
std::string getParentName() const
Returns the name of the parent object (if any)
Definition: GNEDetectorE3.cpp:109
GNEDetectorE3::checkAdditionalChildRestriction
bool checkAdditionalChildRestriction() const
check restriction with the number of children
Definition: GNEDetectorE3.cpp:263
GNEDetectorE3::getPopUpID
std::string getPopUpID() const
get PopPup ID (Used in AC Hierarchy)
Definition: GNEDetectorE3.cpp:287
GNEDetectorE3::myTimeThreshold
SUMOTime myTimeThreshold
The time-based threshold that describes how much time has to pass until a vehicle is recognized as ha...
Definition: GNEDetectorE3.h:139
Boundary
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:42
GNEDetectorE3::getHierarchyName
std::string getHierarchyName() const
get Hierarchy Name (Used in AC Hierarchy)
Definition: GNEDetectorE3.cpp:293
GNEDetectorE3::isValid
bool isValid(SumoXMLAttr key, const std::string &value)
method for checking if the key and their conrrespond attribute are valids
Definition: GNEDetectorE3.cpp:228
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
GNEDetectorE3
Definition: GNEDetectorE3.h:35
GNEDetectorE3::moveGeometry
void moveGeometry(const Position &offset)
change the position of the element geometry without saving in undoList
Definition: GNEDetectorE3.cpp:88
GNEDetectorE3::setAttribute
void setAttribute(SumoXMLAttr key, const std::string &value, GNEUndoList *undoList)
method for setting the attribute and letting the object perform additional changes
Definition: GNEDetectorE3.cpp:195
GNEDetectorE3::myFilename
std::string myFilename
fielname of E3 detector
Definition: GNEDetectorE3.h:133
GNEDetectorE3::getCenteringBoundary
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GNEDetectorE3.cpp:74
GNEDetectorE3::myFreq
SUMOTime myFreq
frequency of E3 detector
Definition: GNEDetectorE3.h:130
GNEUndoList
Definition: GNEUndoList.h:49
GUIVisualizationSettings
Stores the information about how to visualize structures.
Definition: GUIVisualizationSettings.h:346
GNEDetectorE3::operator=
GNEDetectorE3 & operator=(const GNEDetectorE3 &)=delete
Invalidated assignment operator.
SumoXMLAttr
SumoXMLAttr
Numbers representing SUMO-XML - attributes.
Definition: SUMOXMLDefinitions.h:373
GNEDetectorE3::updateAdditionalParent
void updateAdditionalParent()
update parent after add or remove a child (can be reimplemented, for example used for statistics)
Definition: GNEDetectorE3.cpp:299
GNEDetectorE3::~GNEDetectorE3
~GNEDetectorE3()
GNEDetectorE3 Destructor.
Definition: GNEDetectorE3.cpp:48
GNEDetectorE3::GNEDetectorE3
GNEDetectorE3(const std::string &id, GNEViewNet *viewNet, Position pos, SUMOTime freq, const std::string &filename, const std::string &vehicleTypes, const std::string &name, SUMOTime timeThreshold, double speedThreshold, bool blockMovement)
GNEDetectorE3 Constructor.
Definition: GNEDetectorE3.cpp:37
GNEDetectorE3::getAttribute
std::string getAttribute(SumoXMLAttr key) const
Definition: GNEDetectorE3.cpp:164
GNEDetectorE3::getPositionInView
Position getPositionInView() const
Returns position of additional in view.
Definition: GNEDetectorE3.cpp:68