44 #ifdef CHECK_MEMORY_LEAKS
46 #endif // CHECK_MEMORY_LEAKS
56 SUMOReal position,
const std::string& vTypes)
95 std::vector<MSInductLoop::VehicleData>
107 myDetector(detector), myPosition(pos) {
134 ret->
mkItem(
"lane",
false, myDetector.getLane()->getID());
136 ret->
mkItem(
"passed vehicles [#]",
true,
138 ret->
mkItem(
"speed [m/s]",
true,
140 ret->
mkItem(
"occupancy [%]",
true,
142 ret->
mkItem(
"vehicle length [m]",
true,
144 ret->
mkItem(
"empty time [s]",
true,
154 glPushName(getGlID());
161 glTranslated(0, 0, getType());
162 glTranslated(myFGPosition.x(), myFGPosition.y(), 0);
163 glRotated(myFGRotation, 0, 0, 1);
164 glScaled(exaggeration, exaggeration, 1);
166 glVertex2d(0 - 1.0, 2);
167 glVertex2d(-1.0, -2);
171 glTranslated(0, 0, .01);
173 glVertex2d(0, 2 - .1);
174 glVertex2d(0, -2 + .1);
178 if (width * exaggeration > 1) {
180 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
182 glVertex2f(0 - 1.0, 2);
183 glVertex2f(-1.0, -2);
187 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
191 if (width * exaggeration > 1) {
192 glRotated(90, 0, 0, -1);
200 drawName(getCenteringBoundary().getCenter(), s.
scale, s.
addName);
void leaveDetectorByMove(SUMOVehicle &veh, SUMOReal leaveTimestep)
Processes a vehicle that leaves the detector.
SUMOReal getExaggeration(const GUIVisualizationSettings &s, SUMOReal factor=20) const
return the drawing size including exaggeration and constantSize values
GUIInductLoop(const std::string &id, MSLane *const lane, SUMOReal position, const std::string &vTypes)
Constructor.
MyWrapper(GUIInductLoop &detector, SUMOReal pos)
Constructor.
Boundary myBoundary
The detector's boundary.
A MSInductLoop-visualiser.
void reset()
Resets all generated values to allow computation of next interval.
GUIVisualizationTextSettings addName
Stores the information about how to visualize structures.
virtual void reset()
Resets all generated values to allow computation of next interval.
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...
int getCurrentPassedNumber() const
Returns the number of vehicles that have passed the detector.
Position myFGPosition
The position in full-geometry mode.
virtual 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...
SUMOReal getCurrentOccupancy() const
Returns the current occupancy.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
const Position geometryPositionAtOffset(SUMOReal offset, SUMOReal lateralOffset=0) const
SUMOReal x() const
Returns the x-position.
const SUMOReal myPosition
Detector's position on lane [m].
A class that stores a 2D geometrical boundary.
const MSLane * getLane() const
Returns the lane the reminder works on.
SUMOReal scale
information about a lane's width (temporary, used for a single view)
MFXMutex myLock
Mutex preventing parallel read/write access to internal MSInductLoop state.
GUIVisualizationSizeSettings addSize
The gui-version of the MSInductLoop.
Representation of a vehicle.
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns this detector's visualisation-wrapper.
virtual void enterDetectorByMove(SUMOVehicle &veh, SUMOReal entryTimestep)
Introduces a vehicle to the detector's map myVehiclesOnDet.
void enterDetectorByMove(SUMOVehicle &veh, SUMOReal entryTimestep)
Introduces a vehicle to the detector's map myVehiclesOnDet.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
SUMOReal getCurrentSpeed() const
Returns the speed of the vehicle on the detector.
SUMOReal rotationDegreeAtOffset(SUMOReal pos) const
Returns the rotation at the given length.
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
SUMOReal myFGRotation
The rotation in full-geometry mode.
void add(SUMOReal x, SUMOReal y, SUMOReal z=0)
Makes the boundary include the given coordinate.
A mutex encapsulator which locks/unlocks the given mutex on construction/destruction, respectively.
SUMOReal y() const
Returns the y-position.
virtual void leaveDetectorByLaneChange(SUMOVehicle &veh, SUMOReal lastPos)
Removes a vehicle from the detector's map myVehiclesOnDet.
~GUIInductLoop()
Destructor.
const PositionVector & getShape() const
Returns this lane's shape.
SUMOReal getTimestepsSinceLastDetection() const
Returns the time since the last vehicle left the detector.
GUIInductLoop & getLoop()
Returns the detector itself.
SUMOReal getCurrentLength() const
Returns the length of the vehicle on the detector.
virtual void leaveDetectorByMove(SUMOVehicle &veh, SUMOReal leaveTimestep)
Processes a vehicle that leaves the detector.
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
void closeBuilding()
Closes the building of the table.
Representation of a lane in the micro simulation.
A window containing a gl-object's parameter.
An unextended detector measuring at a fixed position on a fixed lane.
void leaveDetectorByLaneChange(SUMOVehicle &veh, SUMOReal lastPos)
Removes a vehicle from the detector's map myVehiclesOnDet.