44 double position,
const std::string& vTypes,
45 int detectPersons,
bool show) :
46 MSInductLoop(id, lane, position, vTypes, detectPersons, true),
77 myDetector(detector), myPosition(pos),
78 mySpecialColor(nullptr) {
111 ret->
mkItem(
"lane",
false, myDetector.getLane()->getID());
113 ret->
mkItem(
"entered vehicles [#]",
true,
115 ret->
mkItem(
"speed [m/s]",
true,
117 ret->
mkItem(
"occupancy [%]",
true,
119 ret->
mkItem(
"vehicle length [m]",
true,
121 ret->
mkItem(
"empty time [s]",
true,
131 if (!myDetector.isVisible()) {
135 double width = (double) 2.0 * s.
scale;
137 const double exaggeration = getExaggeration(s);
141 glTranslated(0, 0, getType());
142 glTranslated(myFGPosition.x(), myFGPosition.y(), 0);
143 glRotated(myFGRotation, 0, 0, 1);
144 glScaled(exaggeration, exaggeration, 1);
146 glVertex2d(0 - 1.0, 2);
147 glVertex2d(-1.0, -2);
151 glTranslated(0, 0, .01);
153 glVertex2d(0, 2 - .1);
154 glVertex2d(0, -2 + .1);
157 if (mySpecialColor ==
nullptr) {
164 if (width * exaggeration > 1) {
165 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
167 glVertex2d(0 - 1.0, 2);
168 glVertex2d(-1.0, -2);
172 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
176 if (width * exaggeration > 1) {
177 glRotated(90, 0, 0, -1);
184 drawName(getCenteringBoundary().getCenter(), s.
scale, s.
addName);
@ GLO_E1DETECTOR
a E1 detector
A class that stores a 2D geometrical boundary.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Boundary & grow(double by)
extends the boundary by the given amount
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
static void pushName(unsigned int name)
push Name
static void popMatrix()
pop matrix
static void popName()
pop Name
static void pushMatrix()
push matrix
A MSInductLoop-visualiser.
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
void setSpecialColor(const RGBColor *color)
set (outline) color for extra visualiaztion
Boundary myBoundary
The detector's boundary.
double getExaggeration(const GUIVisualizationSettings &s) const
return exaggeration asociated with this GLObject
double myFGRotation
The rotation in full-geometry mode.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
MyWrapper(GUIInductLoop &detector, double pos)
Constructor.
Position myFGPosition
The position in full-geometry mode.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
The gui-version of the MSInductLoop.
MyWrapper * myWrapper
the glObject wrapper for this induction loop
GUIInductLoop(const std::string &id, MSLane *const lane, double position, const std::string &vTypes, int detectPersons, bool show)
Constructor.
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns this detector's visualisation-wrapper.
~GUIInductLoop()
Destructor.
void setSpecialColor(const RGBColor *color)
sets special caller for myWrapper
A window containing a gl-object's parameter.
void mkItem(const char *name, bool dynamic, ValueSource< T > *src)
Adds a row which obtains its value from a ValueSource.
void closeBuilding(const Parameterised *p=0)
Closes the building of the table.
Stores the information about how to visualize structures.
GUIVisualizationTextSettings addName
GUIVisualizationSizeSettings addSize
double scale
information about a lane's width (temporary, used for a single view)
An unextended detector measuring at a fixed position on a fixed lane.
double getOccupancy() const
Returns the current occupancy.
double getEnteredNumber(const int offset) const
Returns the number of vehicles that have passed the detector.
double getSpeed(const int offset) const
Returns the speed of the vehicle on the detector.
double getVehicleLength(const int offset) const
Returns the length of the vehicle on the detector.
const double myPosition
Detector's position on lane [m].
double getTimeSinceLastDetection() const
Returns the time since the last vehicle left the detector.
Representation of a lane in the micro simulation.
const PositionVector & getShape() const
Returns this lane's shape.
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
const MSLane * getLane() const
Returns the lane the reminder works on.
double x() const
Returns the x-position.
double y() const
Returns the y-position.
double rotationDegreeAtOffset(double pos) const
Returns the rotation at the given length.
double getExaggeration(const GUIVisualizationSettings &s, const GUIGlObject *o, double factor=20) const
return the drawing size including exaggeration and constantSize values