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),
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);
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,
186 double width = (double) 2.0 * s.
scale;
194 if (width * exaggeration > 1) {
198 glTranslated(0, 0, .01);
199 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
202 glVertex2d(p.x(), p.y());
205 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
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);
@ 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.
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
GUIDetectorWrapper(GUIGlObjectType type, const std::string &id, FXIcon *icon)
Constructor.
bool mySupportsOverride
whether this detector supports virtual detector calls
double getExaggeration(const GUIVisualizationSettings &s) const override
return exaggeration associated with this GLObject
virtual Position getCenter() const
GUIGlID getGlID() const
Returns the numerical id of the object.
void drawName(const Position &pos, const double scale, const GUIVisualizationTextSettings &settings, const double angle=0, bool forceShow=false) const
draw name of item
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
PositionVector myIndicators
double myPosition
The position on the lane.
Boundary myBoundary
The detector's boundary.
std::vector< double > myFGShapeLengths
The lengths of the shape parts.
const RGBColor * mySpecialColor
color for extra visualization
Boundary getCenteringBoundary() const override
Returns the boundary to which the view shall be centered in order to show the object.
GUIInductLoop & myDetector
The wrapped detector.
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.
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.
bool myShow
whether this induction loop shall be visible in the gui
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)
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].
MSInductLoop(const std::string &id, MSLane *const lane, double positionInMeters, double length, std::string name, const std::string &vTypes, const std::string &nextEdges, int detectPersons, const bool needLocking)
Constructor.
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.
const std::string & getID() const
Returns the id.
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.
static const RGBColor ORANGE