 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
45 double position,
const std::string& vTypes,
bool show) :
65 FXMutexLock locker(
myLock);
72 FXMutexLock locker(
myLock);
78 FXMutexLock locker(
myLock);
84 FXMutexLock locker(
myLock);
89 std::vector<MSInductLoop::VehicleData>
91 FXMutexLock locker(
myLock);
110 myDetector(detector), myPosition(pos),
111 mySpecialColor(nullptr) {
138 ret->
mkItem(
"lane",
false, myDetector.getLane()->getID());
140 ret->
mkItem(
"passed vehicles [#]",
true,
142 ret->
mkItem(
"speed [m/s]",
true,
144 ret->
mkItem(
"occupancy [%]",
true,
146 ret->
mkItem(
"vehicle length [m]",
true,
148 ret->
mkItem(
"empty time [s]",
true,
158 if (!myDetector.isVisible()) {
161 glPushName(getGlID());
162 double width = (double) 2.0 * s.
scale;
168 glTranslated(0, 0, getType());
169 glTranslated(myFGPosition.x(), myFGPosition.y(), 0);
170 glRotated(myFGRotation, 0, 0, 1);
171 glScaled(exaggeration, exaggeration, 1);
173 glVertex2d(0 - 1.0, 2);
174 glVertex2d(-1.0, -2);
178 glTranslated(0, 0, .01);
180 glVertex2d(0, 2 - .1);
181 glVertex2d(0, -2 + .1);
184 if (mySpecialColor ==
nullptr) {
191 if (width * exaggeration > 1) {
192 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
194 glVertex2f(0 - 1.0, 2);
195 glVertex2f(-1.0, -2);
199 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
203 if (width * exaggeration > 1) {
204 glRotated(90, 0, 0, -1);
211 drawName(getCenteringBoundary().getCenter(), s.
scale, s.
addName);
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void leaveDetectorByLaneChange(SUMOTrafficObject &veh, double lastPos)
Removes a vehicle from the detector's map myVehiclesOnDet.
Representation of a vehicle or person.
A window containing a gl-object's parameter.
Representation of a lane in the micro simulation.
double getVehicleLength(const int offset) const
Returns the length of the vehicle on the detector.
virtual void enterDetectorByMove(SUMOTrafficObject &veh, double entryTimestep)
Introduces a vehicle to the detector's map myVehiclesOnDet.
void setSpecialColor(const RGBColor *color)
set (outline) color for extra visualiaztion
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
An unextended detector measuring at a fixed position on a fixed lane.
double getTimeSinceLastDetection() const
Returns the time since the last vehicle left the detector.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
virtual void leaveDetectorByLaneChange(SUMOTrafficObject &veh, double lastPos)
Removes a vehicle from the detector's map myVehiclesOnDet.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Position myFGPosition
The position in full-geometry mode.
void leaveDetectorByMove(SUMOTrafficObject &veh, double leaveTimestep)
Processes a vehicle that leaves the detector.
GUIVisualizationTextSettings addName
virtual void leaveDetectorByMove(SUMOTrafficObject &veh, double leaveTimestep)
Processes a vehicle that leaves the detector.
~GUIInductLoop()
Destructor.
GUIInductLoop(const std::string &id, MSLane *const lane, double position, const std::string &vTypes, bool show)
Constructor.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
FXMutex myLock
Mutex preventing parallel read/write access to internal MSInductLoop state.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
A class that stores a 2D geometrical boundary.
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns this detector's visualisation-wrapper.
double scale
information about a lane's width (temporary, used for a single view)
@ GLO_E1DETECTOR
a E1 detector
double myFGRotation
The rotation in full-geometry mode.
double x() const
Returns the x-position.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void reset()
Resets all generated values to allow computation of next interval.
Boundary myBoundary
The detector's boundary.
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.
The gui-version of the MSInductLoop.
const MSLane * getLane() const
Returns the lane the reminder works on.
MyWrapper * myWrapper
the glObject wrapper for this induction loop
double getPassedNumber(const int offset) const
Returns the number of vehicles that have passed the detector.
const PositionVector & getShape() const
Returns this lane's shape.
double y() const
Returns the y-position.
void setSpecialColor(const RGBColor *color)
sets special caller for myWrapper
MyWrapper(GUIInductLoop &detector, double pos)
Constructor.
double getSpeed(const int offset) const
Returns the speed of the vehicle on the detector.
GUIVisualizationSizeSettings addSize
const double myPosition
Detector's position on lane [m].
Boundary & grow(double by)
extends the boundary by the given amount
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
double getOccupancy() const
Returns the current occupancy.
Stores the information about how to visualize structures.
A MSInductLoop-visualiser.
void enterDetectorByMove(SUMOTrafficObject &veh, double entryTimestep)
Introduces a vehicle to the detector's map myVehiclesOnDet.
virtual void reset()
Resets all generated values to allow computation of next interval.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values
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.