47 double position,
double length,
48 std::string name,
const std::string& vTypes,
49 const std::string& nextEdges,
50 int detectPersons,
bool show) :
51 MSInductLoop(id, lane, position, length, name, vTypes, nextEdges, detectPersons, true),
85 myDetector(detector), myPosition(pos),
86 myHaveLength(myPosition != detector.getEndPosition()),
87 mySpecialColor(nullptr) {
104 for (
int i = 0; i < e; ++i) {
108 myFGShapeRotations.push_back((
double) atan2((s.
x() - f.
x()), (f.
y() - s.
y())) * (double) 180.0 / (
double) PI);
140 ret->
mkItem(
TL(
"name"),
false, myDetector.getName());
142 if (myDetector.getEndPosition() !=
myPosition) {
143 ret->
mkItem(
TL(
"end position [m]"),
false, myDetector.getEndPosition());
145 ret->
mkItem(
TL(
"lane"),
false, myDetector.getLane()->getID());
146 if (myDetector.isTyped()) {
150 ret->
mkItem(
TL(
"entered vehicles [-]"),
true,
152 ret->
mkItem(
TL(
"speed [m/s]"),
true,
154 ret->
mkItem(
TL(
"occupancy [%]"),
true,
156 ret->
mkItem(
TL(
"vehicle length [m]"),
true,
158 ret->
mkItem(
TL(
"empty time [s]"),
true,
160 ret->
mkItem(
TL(
"occupied time [s]"),
true,
162 ret->
mkItem(
TL(
"interval entered vehicles [#]"),
true,
164 ret->
mkItem(
TL(
"interval speed [m/s]"),
true,
166 ret->
mkItem(
TL(
"interval occupancy [%]"),
true,
168 ret->
mkItem(
TL(
"last interval entered vehicles [#]"),
true,
170 ret->
mkItem(
TL(
"last interval speed [m/s]"),
true,
172 ret->
mkItem(
TL(
"last interval occupancy [%]"),
true,
182 if (!myDetector.isVisible()) {
186 double width = (double) 2.0 * s.
scale;
188 const double exaggeration = getExaggeration(s);
194 if (width * exaggeration > 1) {
198 glTranslated(0, 0, .01);
199 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
201 for (
const Position& p : myOutline) {
202 glVertex2d(p.x(), p.y());
205 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
209 glVertex2d(myIndicators[0].x(), myIndicators[0].y());
210 glVertex2d(myIndicators[1].x(), myIndicators[1].y());
213 glVertex2d(myIndicators[2].x(), myIndicators[2].y());
214 glVertex2d(myIndicators[3].x(), myIndicators[3].y());
220 glVertex2d(myOutline[0].x(), myOutline[0].y());
221 glVertex2d(myOutline[2].x(), myOutline[2].y());
224 glVertex2d(myOutline[1].x(), myOutline[1].y());
225 glVertex2d(myOutline[3].x(), myOutline[3].y());
234 glTranslated(myFGPosition.x(), myFGPosition.y(), 0);
235 glRotated(myFGRotation, 0, 0, 1);
236 glScaled(exaggeration, exaggeration, 1);
238 glVertex2d(0 - 1.0, 2);
239 glVertex2d(-1.0, -2);
243 glTranslated(0, 0, .01);
246 if (width * exaggeration > 1) {
248 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
250 glVertex2d(0 - 1.0, 2);
251 glVertex2d(-1.0, -2);
255 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
258 glRotated(90, 0, 0, -1);
271 glVertex2d(-1.0, -2);
278 drawName(getCenteringBoundary().getCenter(), s.
scale, s.
addName);
285 if (haveOverride()) {
287 }
else if (mySpecialColor ==
nullptr) {
296 return myDetector.getOverrideTime() >= 0;
302 if (haveOverride()) {
303 myDetector.overrideTimeSinceDetection(-1);
305 myDetector.overrideTimeSinceDetection(0);
@ GLO_E1DETECTOR
a E1 detector
GUIIcon
An enumeration of icons used by the gui applications.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
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 bool registerHotkey(const std::string &key, MSInductLoop *det)
register hotkey actions
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 drawBoxLines(const PositionVector &geom, const std::vector< double > &rots, const std::vector< double > &lengths, double width, int cornerDetail=0, double offset=0)
Draws thick lines.
static void popName()
pop Name
static void pushMatrix()
push matrix
bool mySupportsOverride
whether this detector supports virtual detector calls
A MSInductLoop-visualiser.
void drawGL(const GUIVisualizationSettings &s) const override
Draws the object.
bool haveOverride() const override
whether this detector has an active virtual detector call
bool myHaveLength
Whether this detector has defined a length.
void toggleOverride() const override
toggle virtual detector call
void setSpecialColor(const RGBColor *color)
set (outline) color for extra visualization
PositionVector myIndicators
Boundary myBoundary
The detector's boundary.
std::vector< double > myFGShapeLengths
The lengths of the shape parts.
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
double myFGRotation
The rotation in full-geometry mode.
PositionVector myFGShape
The shape.
void setOutlineColor() const
MyWrapper(GUIInductLoop &detector, double pos)
Constructor.
Position myFGPosition
The position in full-geometry mode.
std::vector< double > myFGShapeRotations
The rotations of the shape parts.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent) override
Returns an own parameter window.
The gui-version of the MSInductLoop.
MyWrapper * myWrapper
the glObject wrapper for this induction loop
virtual GUIDetectorWrapper * buildDetectorGUIRepresentation()
Returns this detector's visualisation-wrapper.
~GUIInductLoop()
Destructor.
void setSpecialColor(const RGBColor *color)
sets special caller for myWrapper
GUIInductLoop(const std::string &id, MSLane *const lane, double position, double length, std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, bool show)
Constructor.
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
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 getOccupancyTime() const
Returns the time of continous occupation by the same vehicle in seconds or 0 if there is no vehicle o...
double getOccupancy() const
Returns the current occupancy.
double getIntervalOccupancy(bool lastInterval=false) const
double getEnteredNumber(const int offset) const
Returns the number of vehicles that have passed the detector.
int getIntervalVehicleNumber(bool lastInterval=false) const
double getEndPosition() const
Returns the end position of the detector on the lane.
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.
double getIntervalMeanSpeed(bool lastInterval=false) const
Representation of a lane in the micro simulation.
double interpolateLanePosToGeometryPos(double lanePos) const
virtual const PositionVector & getShape(bool) const
const Position geometryPositionAtOffset(double offset, double lateralOffset=0) const
const MSLane * getLane() const
Returns the lane the reminder works on.
bool hasParameter(const std::string &key) const
Returns whether the parameter is set.
virtual const std::string getParameter(const std::string &key, const std::string defaultValue="") const
Returns the value for a given key.
A point in 2D or 3D with translation and scaling methods.
double distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimensions
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.
PositionVector getSubpart(double beginOffset, double endOffset) const
get subpart of a position vector
static const RGBColor ORANGE