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-2018 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 /****************************************************************************/
18 // The gui-version of the MSInductLoop, together with the according
19 /****************************************************************************/
20 #ifndef GUIInductLoop_h
21 #define GUIInductLoop_h
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
31 #include <utils/geom/Position.h>
32 #include "GUIDetectorWrapper.h"
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
48 class GUIInductLoop : public MSInductLoop {
49 public:
57  GUIInductLoop(const std::string& id, MSLane* const lane, double position, const std::string& vTypes);
58 
59 
62 
63 
69  void reset();
70 
71 
76 
77 
88  std::vector<VehicleData> collectVehiclesOnDet(SUMOTime t, bool leaveTime = false) const;
89 
90 
91 protected:
94 
103  void enterDetectorByMove(SUMOVehicle& veh, double entryTimestep);
104 
105 
114  void leaveDetectorByMove(SUMOVehicle& veh, double leaveTimestep);
115 
116 
124  void leaveDetectorByLaneChange(SUMOVehicle& veh, double lastPos);
126 
127 
128 
129 
130 public:
135  class MyWrapper : public GUIDetectorWrapper {
136  public:
138  MyWrapper(GUIInductLoop& detector, double pos);
139 
141  ~MyWrapper();
142 
143 
145 
146 
155  GUIMainWindow& app, GUISUMOAbstractView& parent);
156 
157 
164 
165 
170  void drawGL(const GUIVisualizationSettings& s) const;
172 
173 
176 
177 
178  private:
181 
184 
187 
189  double myFGRotation;
190 
192  double myPosition;
193 
194  private:
196  MyWrapper(const MyWrapper&);
197 
199  MyWrapper& operator=(const MyWrapper&);
200 
201  };
202 
203 
205  mutable MFXMutex myLock;
206 
207 };
208 
209 
210 #endif
211 
212 /****************************************************************************/
213 
long long int SUMOTime
Definition: SUMOTime.h:36
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:42
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:48
double myPosition
The position on the lane.
Representation of a vehicle.
Definition: SUMOVehicle.h:60
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns this detector&#39;s visualisation-wrapper.
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
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.
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:78
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:64