SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GUIEdge.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // A road/street connecting two junctions (gui-version)
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2014 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 #include <vector>
35 #include <cmath>
36 #include <string>
37 #include <algorithm>
42 #include <utils/geom/GeomHelper.h>
45 #include <utils/gui/div/GLHelper.h>
48 #include <microsim/MSBaseVehicle.h>
49 #include <microsim/MSEdge.h>
50 #include <microsim/MSJunction.h>
51 #include <microsim/MSLaneChanger.h>
52 #include <microsim/MSGlobals.h>
55 #include "GUIEdge.h"
56 #include "GUIVehicle.h"
57 #include "GUINet.h"
58 #include "GUILane.h"
59 #include "GUIPerson.h"
60 
61 #ifdef HAVE_INTERNAL
62 #include <mesogui/GUIMEVehicleControl.h>
63 #include <mesosim/MESegment.h>
64 #include <mesosim/MELoop.h>
65 #include <mesosim/MEVehicle.h>
66 #endif
67 
68 #ifdef CHECK_MEMORY_LEAKS
69 #include <foreign/nvwa/debug_new.h>
70 #endif // CHECK_MEMORY_LEAKS
71 
72 
73 // ===========================================================================
74 // included modules
75 // ===========================================================================
76 GUIEdge::GUIEdge(const std::string& id, int numericalID,
77  const EdgeBasicFunction function,
78  const std::string& streetName, const std::string& edgeType, int priority)
79  : MSEdge(id, numericalID, function, streetName, edgeType, priority),
80  GUIGlObject(GLO_EDGE, id) {}
81 
82 
84  // just to quit cleanly on a failure
85  if (myLock.locked()) {
86  myLock.unlock();
87  }
88 }
89 
90 
91 MSLane&
92 GUIEdge::getLane(size_t laneNo) {
93  assert(laneNo < myLanes->size());
94  return *((*myLanes)[laneNo]);
95 }
96 
97 
98 std::vector<GUIGlID>
99 GUIEdge::getIDs(bool includeInternal) {
100  std::vector<GUIGlID> ret;
101  ret.reserve(MSEdge::myDict.size());
102  for (MSEdge::DictType::iterator i = MSEdge::myDict.begin(); i != MSEdge::myDict.end(); ++i) {
103  GUIEdge* edge = dynamic_cast<GUIEdge*>(i->second);
104  assert(edge);
105  if (edge->getPurpose() != EDGEFUNCTION_INTERNAL || includeInternal) {
106  ret.push_back(edge->getGlID());
107  }
108  }
109  return ret;
110 }
111 
112 
113 Boundary
115  Boundary ret;
116  for (std::vector<MSLane*>::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) {
117  ret.add((*i)->getShape().getBoxBoundary());
118  }
119  ret.grow(10);
120  return ret;
121 }
122 
123 
124 void
125 GUIEdge::fill(std::vector<GUIEdge*>& netsWrappers) {
126  size_t size = MSEdge::dictSize();
127  netsWrappers.reserve(size);
128  for (DictType::iterator i = myDict.begin(); i != myDict.end(); ++i) {
129  if (i->second->getPurpose() != MSEdge::EDGEFUNCTION_DISTRICT) {
130  netsWrappers.push_back(static_cast<GUIEdge*>((*i).second));
131  }
132  }
133 }
134 
135 
136 
139  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
140  buildPopupHeader(ret, app);
146  }
147  const SUMOReal pos = getLanes()[0]->getShape().nearest_offset_to_point2D(parent.getPositionInformation());
148  new FXMenuCommand(ret, ("pos: " + toString(pos)).c_str(), 0, 0, 0);
149  buildPositionCopyEntry(ret, false);
150  return ret;
151 }
152 
153 
156  GUISUMOAbstractView& parent) {
157  GUIParameterTableWindow* ret = 0;
158 #ifdef HAVE_INTERNAL
159  ret = new GUIParameterTableWindow(app, *this, 16);
160  // add edge items
161  ret->mkItem("length [m]", false, (*myLanes)[0]->getLength());
162  ret->mkItem("allowed speed [m/s]", false, getAllowedSpeed());
163  ret->mkItem("occupancy [%]", true, new FunctionBinding<GUIEdge, SUMOReal>(this, &GUIEdge::getBruttoOccupancy, 100.));
164  ret->mkItem("mean vehicle speed [m/s]", true, new FunctionBinding<GUIEdge, SUMOReal>(this, &GUIEdge::getMeanSpeed));
165  ret->mkItem("flow [veh/h/lane]", true, new FunctionBinding<GUIEdge, SUMOReal>(this, &GUIEdge::getFlow));
166  ret->mkItem("#vehicles", true, new CastingFunctionBinding<GUIEdge, SUMOReal, unsigned int>(this, &GUIEdge::getVehicleNo));
167  ret->mkItem("vehicle ids", false, getVehicleIDs());
168  // add segment items
169  MESegment* segment = getSegmentAtPosition(parent.getPositionInformation());
170  ret->mkItem("segment index", false, segment->getIndex());
171  ret->mkItem("segment length [m]", false, segment->getLength());
172  ret->mkItem("segment allowed speed [m/s]", false, segment->getMaxSpeed());
173  ret->mkItem("segment jam threshold [%]", false, segment->getRelativeJamThreshold());
174  ret->mkItem("segment occupancy [%]", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getRelativeOccupancy));
175  ret->mkItem("segment mean vehicle speed [m/s]", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getMeanSpeed));
176  ret->mkItem("segment flow [veh/h/lane]", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getFlow));
177  ret->mkItem("segment #vehicles", true, new CastingFunctionBinding<MESegment, SUMOReal, size_t>(segment, &MESegment::getCarNumber));
178  ret->mkItem("segment leader leave time", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getEventTimeSeconds));
179 
180  // close building
181  ret->closeBuilding();
182 #else
183  UNUSED_PARAMETER(app);
184  UNUSED_PARAMETER(parent);
185 #endif
186  return ret;
187 }
188 
189 
190 Boundary
192  Boundary b = getBoundary();
193  b.grow(20);
194  return b;
195 }
196 
197 
198 void
201  return;
202  }
203  glPushName(getGlID());
204  // draw the lanes
205  for (std::vector<MSLane*>::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) {
206 #ifdef HAVE_INTERNAL
208  setColor(s);
209  }
210 #endif
211  GUILane* l = dynamic_cast<GUILane*>(*i);
212  if (l != 0) {
213  l->drawGL(s);
214  }
215  }
216 #ifdef HAVE_INTERNAL
219  drawMesoVehicles(s);
220  }
221  }
222 #endif
223  glPopName();
224  // (optionally) draw the name and/or the street name
225  const bool drawEdgeName = s.edgeName.show && myFunction == EDGEFUNCTION_NORMAL;
226  const bool drawInternalEdgeName = s.internalEdgeName.show && myFunction == EDGEFUNCTION_INTERNAL;
227  const bool drawCwaEdgeName = s.cwaEdgeName.show && (myFunction == EDGEFUNCTION_CROSSING || myFunction == EDGEFUNCTION_WALKINGAREA);
228  const bool drawStreetName = s.streetName.show && myStreetName != "";
229  if (drawEdgeName || drawInternalEdgeName || drawCwaEdgeName || drawStreetName) {
230  GUILane* lane1 = dynamic_cast<GUILane*>((*myLanes)[0]);
231  GUILane* lane2 = dynamic_cast<GUILane*>((*myLanes).back());
232  if (lane1 != 0 && lane2 != 0) {
233  Position p = lane1->getShape().positionAtOffset(lane1->getShape().length() / (SUMOReal) 2.);
234  p.add(lane2->getShape().positionAtOffset(lane2->getShape().length() / (SUMOReal) 2.));
235  p.mul(.5);
236  SUMOReal angle = lane1->getShape().rotationDegreeAtOffset(lane1->getShape().length() / (SUMOReal) 2.);
237  angle += 90;
238  if (angle > 90 && angle < 270) {
239  angle -= 180;
240  }
241  if (drawEdgeName) {
242  drawName(p, s.scale, s.edgeName, angle);
243  } else if (drawInternalEdgeName) {
244  drawName(p, s.scale, s.internalEdgeName, angle);
245  } else if (drawCwaEdgeName) {
246  drawName(p, s.scale, s.cwaEdgeName, angle);
247  }
248  if (drawStreetName) {
250  s.streetName.size / s.scale, s.streetName.color, angle);
251  }
252  }
253  }
255  myLock.lock();
256  for (std::set<MSPerson*>::const_iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
257  GUIPerson* person = dynamic_cast<GUIPerson*>(*i);
258  assert(person != 0);
259  person->drawGL(s);
260  }
261  myLock.unlock();
262  }
263 }
264 
265 
266 #ifdef HAVE_INTERNAL
267 void
268 GUIEdge::drawMesoVehicles(const GUIVisualizationSettings& s) const {
269  const GUIVisualizationTextSettings& nameSettings = s.vehicleName;
270  GUIMEVehicleControl* vehicleControl = GUINet::getGUIInstance()->getGUIMEVehicleControl();
271  if (vehicleControl != 0) {
272  // draw the meso vehicles
273  vehicleControl->secureVehicles();
274  size_t laneIndex = 0;
275  MESegment::Queue queue;
276  for (std::vector<MSLane*>::const_iterator msl = myLanes->begin(); msl != myLanes->end(); ++msl, ++laneIndex) {
277  GUILane* l = static_cast<GUILane*>(*msl);
278  const PositionVector& shape = l->getShape();
279  const std::vector<SUMOReal>& shapeRotations = l->getShapeRotations();
280  const std::vector<SUMOReal>& shapeLengths = l->getShapeLengths();
281  const Position& laneBeg = shape[0];
282  glPushMatrix();
283  glTranslated(laneBeg.x(), laneBeg.y(), 0);
284  glRotated(shapeRotations[0], 0, 0, 1);
285  // go through the vehicles
286  int shapeIndex = 0;
287  SUMOReal shapeOffset = 0; // ofset at start of current shape
288  SUMOReal segmentOffset = 0; // offset at start of current segment
289  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this);
290  segment != 0; segment = segment->getNextSegment()) {
291  const SUMOReal length = segment->getLength() * segment->getLengthGeometryFactor();
292  if (laneIndex < segment->numQueues()) {
293  // make a copy so we don't have to worry about synchronization
294  queue = segment->getQueue(laneIndex);
295  const SUMOReal avgCarSize = segment->getBruttoOccupancy() / segment->getCarNumber();
296  const size_t queueSize = queue.size();
297  for (size_t i = 0; i < queueSize; ++i) {
298  MSBaseVehicle* veh = queue[queueSize - i - 1];
299  setVehicleColor(s, veh);
300  SUMOReal vehiclePosition = segmentOffset + length - i * avgCarSize;
301  SUMOReal xOff = 0.f;
302  while (vehiclePosition < segmentOffset) {
303  // if there is only a single queue for a
304  // multi-lane edge shift vehicles and start
305  // drawing again from the end of the segment
306  vehiclePosition += length;
307  xOff += 0.5f;
308  }
309  while (shapeIndex < (int)shapeRotations.size() - 1 && vehiclePosition > shapeOffset + shapeLengths[shapeIndex]) {
310  glPopMatrix();
311  shapeOffset += shapeLengths[shapeIndex];
312  shapeIndex++;
313  glPushMatrix();
314  glTranslated(shape[shapeIndex].x(), shape[shapeIndex].y(), 0);
315  glRotated(shapeRotations[shapeIndex], 0, 0, 1);
316  }
317  glPushMatrix();
318  glTranslated(xOff, -(vehiclePosition - shapeOffset), GLO_VEHICLE);
319  glPushMatrix();
320  glScaled(1, avgCarSize, 1);
321  glBegin(GL_TRIANGLES);
322  glVertex2d(0, 0);
323  glVertex2d(0 - 1.25, 1);
324  glVertex2d(0 + 1.25, 1);
325  glEnd();
326  glPopMatrix();
327  glPopMatrix();
328  if (nameSettings.show) {
329  GLHelper::drawText(veh->getID(),
330  Position(xOff, -(vehiclePosition - shapeOffset)),
331  GLO_MAX, nameSettings.size / s.scale, nameSettings.color, 0);
332  }
333  }
334  }
335  segmentOffset += length;
336  }
337  glPopMatrix();
338  }
339  vehicleControl->releaseVehicles();
340  }
341 }
342 
343 
344 
345 unsigned int
346 GUIEdge::getVehicleNo() const {
347  size_t vehNo = 0;
348  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != 0; segment = segment->getNextSegment()) {
349  vehNo += segment->getCarNumber();
350  }
351  return (unsigned int)vehNo;
352 }
353 
354 
355 std::string
356 GUIEdge::getVehicleIDs() const {
357  std::string result = " ";
358  std::vector<const MEVehicle*> vehs;
359  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != 0; segment = segment->getNextSegment()) {
360  std::vector<const MEVehicle*> segmentVehs = segment->getVehicles();
361  vehs.insert(vehs.end(), segmentVehs.begin(), segmentVehs.end());
362  }
363  for (std::vector<const MEVehicle*>::const_iterator it = vehs.begin(); it != vehs.end(); it++) {
364  result += (*it)->getID() + " ";
365  }
366  return result;
367 }
368 
369 
370 SUMOReal
371 GUIEdge::getFlow() const {
372  SUMOReal flow = 0;
373  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != 0; segment = segment->getNextSegment()) {
374  flow += (SUMOReal) segment->getCarNumber() * segment->getMeanSpeed();
375  }
376  return 3600 * flow / (*myLanes)[0]->getLength();
377 }
378 
379 
380 SUMOReal
381 GUIEdge::getBruttoOccupancy() const {
382  SUMOReal occ = 0;
383  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != 0; segment = segment->getNextSegment()) {
384  occ += segment->getBruttoOccupancy();
385  }
386  return occ / (*myLanes)[0]->getLength() / (SUMOReal)(myLanes->size());
387 }
388 
389 
390 SUMOReal
391 GUIEdge::getMeanSpeed() const {
392  SUMOReal v = 0;
393  SUMOReal no = 0;
394  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this); segment != 0; segment = segment->getNextSegment()) {
395  SUMOReal vehNo = (SUMOReal) segment->getCarNumber();
396  v += vehNo * segment->getMeanSpeed();
397  no += vehNo;
398  }
399  if (no == 0) {
400  return getSpeedLimit();
401  }
402  return v / no;
403 }
404 
405 
406 SUMOReal
407 GUIEdge::getAllowedSpeed() const {
408  return (*myLanes)[0]->getSpeedLimit();
409 }
410 
411 
412 SUMOReal
413 GUIEdge::getRelativeSpeed() const {
414  return getMeanSpeed() / getAllowedSpeed();
415 }
416 
417 
418 void
419 GUIEdge::setColor(const GUIVisualizationSettings& s) const {
420  GLHelper::setColor(s.edgeColorer.getScheme().getColor(getColorValue(s.edgeColorer.getActive())));
421 }
422 
423 
424 SUMOReal
425 GUIEdge::getColorValue(size_t activeScheme) const {
426  switch (activeScheme) {
427  case 1:
428  return gSelected.isSelected(getType(), getGlID());
429  case 2:
430  return getPurpose();
431  case 3:
432  return getAllowedSpeed();
433  case 4:
434  return getBruttoOccupancy();
435  case 5:
436  return getMeanSpeed();
437  case 6:
438  return getFlow();
439  case 7:
440  return getRelativeSpeed();
441  }
442  return 0;
443 }
444 
445 
446 SUMOReal
447 GUIEdge::getScaleValue(size_t activeScheme) const {
448  switch (activeScheme) {
449  case 1:
450  return gSelected.isSelected(getType(), getGlID());
451  case 2:
452  return getAllowedSpeed();
453  case 3:
454  return getBruttoOccupancy();
455  case 4:
456  return getMeanSpeed();
457  case 5:
458  return getFlow();
459  case 6:
460  return getRelativeSpeed();
461  }
462  return 0;
463 }
464 
465 
466 MESegment*
467 GUIEdge::getSegmentAtPosition(const Position& pos) {
468  const PositionVector& shape = getLanes()[0]->getShape();
469  const SUMOReal lanePos = shape.nearest_offset_to_point2D(pos);
470  return MSGlobals::gMesoNet->getSegmentForEdge(*this, lanePos);
471 }
472 
473 
474 void
475 GUIEdge::setVehicleColor(const GUIVisualizationSettings& s, MSBaseVehicle* veh) const {
476  const GUIColorer& c = s.vehicleColorer;
477  if (!GUIVehicle::setFunctionalColor(c.getActive(), veh)) {
478  GLHelper::setColor(c.getScheme().getColor(getVehicleColorValue(c.getActive(), veh)));
479  }
480 }
481 
482 
483 SUMOReal
484 GUIEdge::getVehicleColorValue(size_t activeScheme, MSBaseVehicle* veh) const {
485  switch (activeScheme) {
486  case 8:
487  return veh->getSpeed();
488  case 9:
489  return STEPS2TIME(veh->getWaitingTime());
490  case 10:
491  return 0; // invalid getLastLaneChangeOffset();
492  case 11:
493  return MIN2(veh->getMaxSpeed(), getVehicleMaxSpeed(veh));
494  case 12:
495  return 0; // invalid getCO2Emissions();
496  case 13:
497  return 0; // invalid getCOEmissions();
498  case 14:
499  return 0; // invalid getPMxEmissions();
500  case 15:
501  return 0; // invalid getNOxEmissions();
502  case 16:
503  return 0; // invalid getHCEmissions();
504  case 17:
505  return 0; // invalid getFuelConsumption();
506  case 18:
507  return 0; // invalid getHarmonoise_NoiseEmissions();
508  case 19: // !!! unused!?
509  if (veh->getNumberReroutes() == 0) {
510  return -1;
511  }
512  return veh->getNumberReroutes();
513  case 20:
514  return 0; // invalid gSelected.isSelected(GLO_VEHICLE, getGlID());
515  case 21:
516  return 0; // invalid getBestLaneOffset();
517  case 22:
518  return 0; // invalid getAcceleration();
519  case 23:
520  return 0; // invalid getTimeGap();
521  }
522  return 0;
523 }
524 
525 
526 
527 
528 
529 
530 
531 
532 #endif
533 
534 /****************************************************************************/
535 
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIEdge.cpp:191
std::set< MSPerson * > myPersons
Persons on the edge (only for drawing)
Definition: MSEdge.h:685
const std::vector< SUMOReal > & getShapeRotations() const
Definition: GUILane.cpp:662
unsigned int getNumberReroutes() const
Returns the number of new routes this vehicle got.
GUIVisualizationTextSettings streetName
static bool setFunctionalColor(size_t activeScheme, const MSBaseVehicle *veh)
sets the color according to the current scheme index and some vehicle function
SUMOReal nearest_offset_to_point2D(const Position &p, bool perpendicular=true) const
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
a vehicles
void add(const Position &pos)
Adds the given position to this one.
Definition: Position.h:119
virtual GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIEdge.cpp:138
SUMOReal getMaxSpeed() const
Returns the maximum speed.
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:180
Stores the information about how to visualize structures.
const EdgeBasicFunction myFunction
the purpose of the edge
Definition: MSEdge.h:666
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUILane.cpp:405
GUIVisualizationTextSettings vehicleName
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:251
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
The edge is a macroscopic connector (source/sink)
Definition: MSEdge.h:90
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
GUIVisualizationTextSettings cwaEdgeName
const std::vector< SUMOReal > & getShapeLengths() const
Definition: GUILane.cpp:668
static void drawText(const std::string &text, const Position &pos, const SUMOReal layer, const SUMOReal size, const RGBColor &col=RGBColor::BLACK, const SUMOReal angle=0)
draw Text with given parameters
Definition: GLHelper.cpp:378
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
The base class for microscopic and mesoscopic vehicles.
Definition: MSBaseVehicle.h:52
EdgeBasicFunction
Defines possible edge types.
Definition: MSEdge.h:84
SUMOReal x() const
Returns the x-position.
Definition: Position.h:63
void buildPositionCopyEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to copy the cursor position if geo projection is used, also builds an entry for copying the geo-position.
GUIGlID getGlID() const
Returns the numerical id of the object.
Definition: GUIGlObject.h:115
#define UNUSED_PARAMETER(x)
Definition: StdDefs.h:39
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:48
SUMOReal scale
information about a lane&#39;s width (temporary, used for a single view)
Representation of a lane in the micro simulation (gui-version)
Definition: GUILane.h:70
GUIColorer vehicleColorer
The vehicle colorer.
GUIVisualizationTextSettings edgeName
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:61
A road/street connecting two junctions.
Definition: MSEdge.h:75
size_t getActive() const
Definition: GUIColorer.h:73
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:159
SUMOReal getLength() const
return the length of the edge
Definition: MSEdge.h:514
~GUIEdge()
Destructor.
Definition: GUIEdge.cpp:83
The edge is a district edge.
Definition: MSEdge.h:94
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:361
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
Definition: GUINet.cpp:474
GUIVisualizationTextSettings internalEdgeName
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
virtual GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIEdge.cpp:155
#define STEPS2TIME(x)
Definition: SUMOTime.h:65
Position positionAtOffset(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
const T getColor(const SUMOReal value) const
T MIN2(T a, T b)
Definition: StdDefs.h:68
float minSize
The minimum size to draw this object.
const std::vector< MSLane * > * myLanes
Container for the edge&#39;s lane; should be sorted: (right-hand-traffic) the more left the lane...
Definition: MSEdge.h:660
MSLane & getLane(size_t laneNo)
returns the enumerated lane (!!! why not private with a friend?)
Definition: GUIEdge.cpp:92
void drawName(const Position &pos, const SUMOReal scale, const GUIVisualizationTextSettings &settings, const SUMOReal angle=0) const
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:53
SUMOReal getSpeedLimit() const
Returns the speed limit of the edge The speed limit of the first lane is retured; should probably be...
Definition: MSEdge.cpp:626
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPerson.cpp:166
void unlock()
release mutex lock
Definition: MFXMutex.cpp:96
GUIEdge(const std::string &id, int numericalID, const EdgeBasicFunction function, const std::string &streetName, const std::string &edgeType, int priority)
Constructor.
Definition: GUIEdge.cpp:76
The edge is a pedestrian walking area (a special type of internal edge)
Definition: MSEdge.h:98
static std::vector< GUIGlID > getIDs(bool includeInternal)
Definition: GUIEdge.cpp:99
SUMOReal length() const
Returns the length.
SUMOReal rotationDegreeAtOffset(SUMOReal pos) const
Returns the rotation at the given length.
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:76
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
Definition: Boundary.cpp:200
EdgeBasicFunction getPurpose() const
Returns the edge type (EdgeBasicFunction)
Definition: MSEdge.h:222
virtual SUMOReal getSpeed() const =0
Returns the vehicle&#39;s current speed.
MFXMutex myLock
The mutex used to avoid concurrent updates of myPersons.
Definition: GUIEdge.h:196
The edge is a normal street.
Definition: MSEdge.h:88
SUMOReal y() const
Returns the y-position.
Definition: Position.h:68
The edge is a pedestrian crossing (a special type of internal edge)
Definition: MSEdge.h:96
static size_t dictSize()
Returns the number of edges.
Definition: MSEdge.cpp:557
The popup menu of a globject.
an edge
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIEdge.cpp:199
std::string myStreetName
the real-world name of this edge (need not be unique)
Definition: MSEdge.h:704
void mul(SUMOReal val)
Multiplies both positions with the given value.
Definition: Position.h:99
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
GUIVisualizationSizeSettings personSize
void lock()
lock mutex
Definition: MFXMutex.cpp:86
virtual SUMOTime getWaitingTime() const =0
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSEdge.h:733
#define SUMOReal
Definition: config.h:218
static const bool gUseMesoSim
Definition: MSGlobals.h:102
GUIVisualizationSizeSettings vehicleSize
Boundary getBoundary() const
Returns the street&#39;s geometry.
Definition: GUIEdge.cpp:114
FXbool locked()
Definition: MFXMutex.h:70
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the maximum speed the vehicle may use on this edge.
Definition: MSEdge.cpp:633
empty max
Position getPositionInformation() const
Returns the cursor&#39;s x/y position within the network.
The edge is an internal edge.
Definition: MSEdge.h:92
void mkItem(const char *name, bool dynamic, ValueSource< unsigned > *src)
Adds a row which obtains its value from an unsigned-ValueSource.
GUISelectedStorage gSelected
A global holder of selected objects.
void closeBuilding()
Closes the building of the table.
Representation of a lane in the micro simulation.
Definition: MSLane.h:77
A window containing a gl-object&#39;s parameter.
static void fill(std::vector< GUIEdge * > &netsWrappers)
Definition: GUIEdge.cpp:125
SUMOReal getExaggeration(const GUIVisualizationSettings &s) const
return the drawing size including exaggeration and constantSize values
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
const std::string & getID() const
Returns the name of the vehicle.
const PositionVector & getShape() const
Definition: GUILane.cpp:656