SUMO - Simulation of Urban MObility
GUIInductLoop.h
Go to the documentation of this file.
1 /****************************************************************************/
10 // The gui-version of the MSInductLoop, together with the according
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2016 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 #ifndef GUIInductLoop_h
24 #define GUIInductLoop_h
25 
26 
27 // ===========================================================================
28 // included modules
29 // ===========================================================================
30 #ifdef _MSC_VER
31 #include <windows_config.h>
32 #else
33 #include <config.h>
34 #endif
35 
38 #include <utils/geom/Position.h>
39 #include "GUIDetectorWrapper.h"
40 
41 
42 // ===========================================================================
43 // class definitions
44 // ===========================================================================
55 class GUIInductLoop : public MSInductLoop {
56 public:
64  GUIInductLoop(const std::string& id, MSLane* const lane, SUMOReal position, const std::string& vTypes);
65 
66 
69 
70 
76  void reset();
77 
78 
83 
84 
95  std::vector<VehicleData> collectVehiclesOnDet(SUMOTime t, bool leaveTime = false) const;
96 
97 
98 protected:
101 
110  void enterDetectorByMove(SUMOVehicle& veh, SUMOReal entryTimestep);
111 
112 
121  void leaveDetectorByMove(SUMOVehicle& veh, SUMOReal leaveTimestep);
122 
123 
131  void leaveDetectorByLaneChange(SUMOVehicle& veh, SUMOReal lastPos);
133 
134 
135 
136 
137 public:
142  class MyWrapper : public GUIDetectorWrapper {
143  public:
145  MyWrapper(GUIInductLoop& detector, SUMOReal pos);
146 
148  ~MyWrapper();
149 
150 
152 
153 
162  GUIMainWindow& app, GUISUMOAbstractView& parent);
163 
164 
171 
172 
177  void drawGL(const GUIVisualizationSettings& s) const;
179 
180 
183 
184 
185  private:
188 
191 
194 
197 
200 
201  private:
203  MyWrapper(const MyWrapper&);
204 
206  MyWrapper& operator=(const MyWrapper&);
207 
208  };
209 
210 
212  mutable MFXMutex myLock;
213 
214 };
215 
216 
217 #endif
218 
219 /****************************************************************************/
220 
void leaveDetectorByMove(SUMOVehicle &veh, SUMOReal leaveTimestep)
Processes a vehicle that leaves the detector.
GUIInductLoop(const std::string &id, MSLane *const lane, SUMOReal position, const std::string &vTypes)
Constructor.
MyWrapper(GUIInductLoop &detector, SUMOReal pos)
Constructor.
long long int SUMOTime
Definition: SUMOTime.h:43
Boundary myBoundary
The detector&#39;s boundary.
A MSInductLoop-visualiser.
void reset()
Resets all generated values to allow computation of next interval.
MyWrapper & operator=(const MyWrapper &)
Invalidated assignment operator.
Stores the information about how to visualize structures.
SUMOReal myPosition
The position on the lane.
Position myFGPosition
The position in full-geometry mode.
GUIInductLoop & myDetector
The wrapped detector.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
MFXMutex myLock
Mutex preventing parallel read/write access to internal MSInductLoop state.
The gui-version of the MSInductLoop.
Definition: GUIInductLoop.h:55
Representation of a vehicle.
Definition: SUMOVehicle.h:66
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns this detector&#39;s visualisation-wrapper.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
void enterDetectorByMove(SUMOVehicle &veh, SUMOReal entryTimestep)
Introduces a vehicle to the detector&#39;s map myVehiclesOnDet.
std::vector< VehicleData > collectVehiclesOnDet(SUMOTime t, bool leaveTime=false) const
Returns vehicle data for vehicles that have been on the detector starting at the given time...
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
SUMOReal myFGRotation
The rotation in full-geometry mode.
~GUIInductLoop()
Destructor.
#define SUMOReal
Definition: config.h:213
GUIInductLoop & getLoop()
Returns the detector itself.
Representation of a lane in the micro simulation.
Definition: MSLane.h:79
A window containing a gl-object&#39;s parameter.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
An unextended detector measuring at a fixed position on a fixed lane.
Definition: MSInductLoop.h:71
void leaveDetectorByLaneChange(SUMOVehicle &veh, SUMOReal lastPos)
Removes a vehicle from the detector&#39;s map myVehiclesOnDet.