SUMO - Simulation of Urban MObility
GUIInductLoop.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 /****************************************************************************/
20 // The gui-version of the MSInductLoop, together with the according
21 /****************************************************************************/
22 #ifndef GUIInductLoop_h
23 #define GUIInductLoop_h
24 
25 
26 // ===========================================================================
27 // included modules
28 // ===========================================================================
29 #ifdef _MSC_VER
30 #include <windows_config.h>
31 #else
32 #include <config.h>
33 #endif
34 
37 #include <utils/geom/Position.h>
38 #include "GUIDetectorWrapper.h"
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
54 class GUIInductLoop : public MSInductLoop {
55 public:
63  GUIInductLoop(const std::string& id, MSLane* const lane, double position, const std::string& vTypes);
64 
65 
68 
69 
75  void reset();
76 
77 
82 
83 
94  std::vector<VehicleData> collectVehiclesOnDet(SUMOTime t, bool leaveTime = false) const;
95 
96 
97 protected:
100 
109  void enterDetectorByMove(SUMOVehicle& veh, double entryTimestep);
110 
111 
120  void leaveDetectorByMove(SUMOVehicle& veh, double leaveTimestep);
121 
122 
130  void leaveDetectorByLaneChange(SUMOVehicle& veh, double lastPos);
132 
133 
134 
135 
136 public:
141  class MyWrapper : public GUIDetectorWrapper {
142  public:
144  MyWrapper(GUIInductLoop& detector, double pos);
145 
147  ~MyWrapper();
148 
149 
151 
152 
161  GUIMainWindow& app, GUISUMOAbstractView& parent);
162 
163 
170 
171 
176  void drawGL(const GUIVisualizationSettings& s) const;
178 
179 
182 
183 
184  private:
187 
190 
193 
195  double myFGRotation;
196 
198  double myPosition;
199 
200  private:
202  MyWrapper(const MyWrapper&);
203 
205  MyWrapper& operator=(const MyWrapper&);
206 
207  };
208 
209 
211  mutable MFXMutex myLock;
212 
213 };
214 
215 
216 #endif
217 
218 /****************************************************************************/
219 
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.
MyWrapper(GUIInductLoop &detector, double pos)
Constructor.
Stores the information about how to visualize structures.
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:47
MFXMutex myLock
Mutex preventing parallel read/write access to internal MSInductLoop state.
GUIInductLoop(const std::string &id, MSLane *const lane, double position, const std::string &vTypes)
Constructor.
The gui-version of the MSInductLoop.
Definition: GUIInductLoop.h:54
double myPosition
The position on the lane.
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:45
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.
void enterDetectorByMove(SUMOVehicle &veh, double entryTimestep)
Introduces a vehicle to the detector&#39;s map myVehiclesOnDet.
~GUIInductLoop()
Destructor.
long long int SUMOTime
Definition: TraCIDefs.h:51
void leaveDetectorByLaneChange(SUMOVehicle &veh, double lastPos)
Removes a vehicle from the detector&#39;s map myVehiclesOnDet.
GUIInductLoop & getLoop()
Returns the detector itself.
void leaveDetectorByMove(SUMOVehicle &veh, double leaveTimestep)
Processes a vehicle that leaves the detector.
double myFGRotation
The rotation in full-geometry mode.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
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:70