SUMO - Simulation of Urban MObility
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-2015 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 "GUITriggeredRerouter.h"
56 #include "GUIEdge.h"
57 #include "GUIVehicle.h"
58 #include "GUINet.h"
59 #include "GUILane.h"
60 #include "GUIPerson.h"
61 #include "GUIContainer.h"
62 
63 #ifdef HAVE_INTERNAL
64 #include <mesogui/GUIMEVehicleControl.h>
65 #include <mesogui/GUIMEVehicle.h>
66 #include <mesosim/MESegment.h>
67 #include <mesosim/MELoop.h>
68 #include <mesosim/MEVehicle.h>
69 #endif
70 
71 #ifdef CHECK_MEMORY_LEAKS
72 #include <foreign/nvwa/debug_new.h>
73 #endif // CHECK_MEMORY_LEAKS
74 
75 
76 // ===========================================================================
77 // included modules
78 // ===========================================================================
79 GUIEdge::GUIEdge(const std::string& id, int numericalID,
80  const EdgeBasicFunction function,
81  const std::string& streetName, const std::string& edgeType, int priority)
82  : MSEdge(id, numericalID, function, streetName, edgeType, priority),
83  GUIGlObject(GLO_EDGE, id) {}
84 
85 
87  // just to quit cleanly on a failure
88  if (myLock.locked()) {
89  myLock.unlock();
90  }
91 }
92 
93 
94 MSLane&
95 GUIEdge::getLane(size_t laneNo) {
96  assert(laneNo < myLanes->size());
97  return *((*myLanes)[laneNo]);
98 }
99 
100 
101 std::vector<GUIGlID>
102 GUIEdge::getIDs(bool includeInternal) {
103  std::vector<GUIGlID> ret;
104  ret.reserve(MSEdge::myDict.size());
105  for (MSEdge::DictType::const_iterator i = MSEdge::myDict.begin(); i != MSEdge::myDict.end(); ++i) {
106  const GUIEdge* edge = dynamic_cast<const GUIEdge*>(i->second);
107  assert(edge);
108  if (edge->getPurpose() != EDGEFUNCTION_INTERNAL || includeInternal) {
109  ret.push_back(edge->getGlID());
110  }
111  }
112  return ret;
113 }
114 
115 
116 SUMOReal
117 GUIEdge::getTotalLength(bool includeInternal, bool eachLane) {
118  SUMOReal result = 0;
119  for (MSEdge::DictType::const_iterator i = MSEdge::myDict.begin(); i != MSEdge::myDict.end(); ++i) {
120  const MSEdge* edge = i->second;
121  if (edge->getPurpose() != EDGEFUNCTION_INTERNAL || includeInternal) {
122  // @note needs to be change once lanes may have different length
123  result += edge->getLength() * (eachLane ? edge->getLanes().size() : 1);
124  }
125  }
126  return result;
127 }
128 
129 
130 Boundary
132  Boundary ret;
133  for (std::vector<MSLane*>::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) {
134  ret.add((*i)->getShape().getBoxBoundary());
135  }
136  ret.grow(10);
137  return ret;
138 }
139 
140 
141 void
142 GUIEdge::fill(std::vector<GUIEdge*>& netsWrappers) {
143  size_t size = MSEdge::dictSize();
144  netsWrappers.reserve(size);
145  for (DictType::iterator i = myDict.begin(); i != myDict.end(); ++i) {
146  if (i->second->getPurpose() != MSEdge::EDGEFUNCTION_DISTRICT) {
147  netsWrappers.push_back(static_cast<GUIEdge*>((*i).second));
148  }
149  }
150 }
151 
152 
153 
156  GUIGLObjectPopupMenu* ret = new GUIGLObjectPopupMenu(app, parent, *this);
157  buildPopupHeader(ret, app);
163  }
164  const SUMOReal pos = getLanes()[0]->getShape().nearest_offset_to_point2D(parent.getPositionInformation());
165  new FXMenuCommand(ret, ("pos: " + toString(pos)).c_str(), 0, 0, 0);
166  buildPositionCopyEntry(ret, false);
167  return ret;
168 }
169 
170 
173  GUISUMOAbstractView& parent) {
174  GUIParameterTableWindow* ret = 0;
175 #ifdef HAVE_INTERNAL
176  ret = new GUIParameterTableWindow(app, *this, 16);
177  // add edge items
178  ret->mkItem("length [m]", false, (*myLanes)[0]->getLength());
179  ret->mkItem("allowed speed [m/s]", false, getAllowedSpeed());
180  ret->mkItem("occupancy [%]", true, new FunctionBinding<GUIEdge, SUMOReal>(this, &GUIEdge::getBruttoOccupancy, 100.));
181  ret->mkItem("mean vehicle speed [m/s]", true, new FunctionBinding<GUIEdge, SUMOReal>(this, &GUIEdge::getMeanSpeed));
182  ret->mkItem("flow [veh/h/lane]", true, new FunctionBinding<GUIEdge, SUMOReal>(this, &GUIEdge::getFlow));
183  ret->mkItem("#vehicles", true, new CastingFunctionBinding<GUIEdge, SUMOReal, unsigned int>(this, &GUIEdge::getVehicleNo));
184  ret->mkItem("vehicle ids", false, getVehicleIDs());
185  // add segment items
186  MESegment* segment = getSegmentAtPosition(parent.getPositionInformation());
187  ret->mkItem("segment index", false, segment->getIndex());
188  ret->mkItem("segment length [m]", false, segment->getLength());
189  ret->mkItem("segment allowed speed [m/s]", false, segment->getMaxSpeed());
190  ret->mkItem("segment jam threshold [%]", false, segment->getRelativeJamThreshold());
191  ret->mkItem("segment occupancy [%]", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getRelativeOccupancy));
192  ret->mkItem("segment mean vehicle speed [m/s]", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getMeanSpeed));
193  ret->mkItem("segment flow [veh/h/lane]", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getFlow));
194  ret->mkItem("segment #vehicles", true, new CastingFunctionBinding<MESegment, SUMOReal, size_t>(segment, &MESegment::getCarNumber));
195  ret->mkItem("segment leader leave time", true, new FunctionBinding<MESegment, SUMOReal>(segment, &MESegment::getEventTimeSeconds));
196 
197  // close building
198  ret->closeBuilding();
199 #else
200  UNUSED_PARAMETER(app);
201  UNUSED_PARAMETER(parent);
202 #endif
203  return ret;
204 }
205 
206 
207 Boundary
209  Boundary b = getBoundary();
210  b.grow(20);
211  return b;
212 }
213 
214 
215 void
218  return;
219  }
220  glPushName(getGlID());
221  // draw the lanes
222  for (std::vector<MSLane*>::const_iterator i = myLanes->begin(); i != myLanes->end(); ++i) {
223 #ifdef HAVE_INTERNAL
225  setColor(s);
226  }
227 #endif
228  GUILane* l = dynamic_cast<GUILane*>(*i);
229  if (l != 0) {
230  l->drawGL(s);
231  }
232  }
233 #ifdef HAVE_INTERNAL
236  drawMesoVehicles(s);
237  }
238  }
239 #endif
240  glPopName();
241  // (optionally) draw the name and/or the street name
242  const bool drawEdgeName = s.edgeName.show && myFunction == EDGEFUNCTION_NORMAL;
243  const bool drawInternalEdgeName = s.internalEdgeName.show && myFunction == EDGEFUNCTION_INTERNAL;
244  const bool drawCwaEdgeName = s.cwaEdgeName.show && (myFunction == EDGEFUNCTION_CROSSING || myFunction == EDGEFUNCTION_WALKINGAREA);
245  const bool drawStreetName = s.streetName.show && myStreetName != "";
246  if (drawEdgeName || drawInternalEdgeName || drawCwaEdgeName || drawStreetName) {
247  GUILane* lane1 = dynamic_cast<GUILane*>((*myLanes)[0]);
248  GUILane* lane2 = dynamic_cast<GUILane*>((*myLanes).back());
249  if (lane1 != 0 && lane2 != 0) {
250  Position p = lane1->getShape().positionAtOffset(lane1->getShape().length() / (SUMOReal) 2.);
251  p.add(lane2->getShape().positionAtOffset(lane2->getShape().length() / (SUMOReal) 2.));
252  p.mul(.5);
253  SUMOReal angle = lane1->getShape().rotationDegreeAtOffset(lane1->getShape().length() / (SUMOReal) 2.);
254  angle += 90;
255  if (angle > 90 && angle < 270) {
256  angle -= 180;
257  }
258  if (drawEdgeName) {
259  drawName(p, s.scale, s.edgeName, angle);
260  } else if (drawInternalEdgeName) {
261  drawName(p, s.scale, s.internalEdgeName, angle);
262  } else if (drawCwaEdgeName) {
263  drawName(p, s.scale, s.cwaEdgeName, angle);
264  }
265  if (drawStreetName) {
267  s.streetName.size / s.scale, s.streetName.color, angle);
268  }
269  }
270  }
272  myLock.lock();
273  for (std::set<MSTransportable*>::const_iterator i = myPersons.begin(); i != myPersons.end(); ++i) {
274  GUIPerson* person = dynamic_cast<GUIPerson*>(*i);
275  assert(person != 0);
276  person->drawGL(s);
277  }
278  myLock.unlock();
279  }
281  myLock.lock();
282  for (std::set<MSTransportable*>::const_iterator i = myContainers.begin(); i != myContainers.end(); ++i) {
283  GUIContainer* container = dynamic_cast<GUIContainer*>(*i);
284  assert(container != 0);
285  container->drawGL(s);
286  }
287  myLock.unlock();
288  }
289 }
290 
291 
292 #ifdef HAVE_INTERNAL
293 void
294 GUIEdge::drawMesoVehicles(const GUIVisualizationSettings& s) const {
295  const GUIVisualizationTextSettings& nameSettings = s.vehicleName;
296  const SUMOReal exaggeration = s.vehicleSize.getExaggeration(s);
297  GUIMEVehicleControl* vehicleControl = GUINet::getGUIInstance()->getGUIMEVehicleControl();
298  if (vehicleControl != 0) {
299  // draw the meso vehicles
300  vehicleControl->secureVehicles();
301  size_t laneIndex = 0;
302  MESegment::Queue queue;
303  for (std::vector<MSLane*>::const_iterator msl = myLanes->begin(); msl != myLanes->end(); ++msl, ++laneIndex) {
304  GUILane* l = static_cast<GUILane*>(*msl);
305  // go through the vehicles
306  SUMOReal segmentOffset = 0; // offset at start of current segment
307  for (MESegment* segment = MSGlobals::gMesoNet->getSegmentForEdge(*this);
308  segment != 0; segment = segment->getNextSegment()) {
309  const SUMOReal length = segment->getLength();
310  if (laneIndex < segment->numQueues()) {
311  // make a copy so we don't have to worry about synchronization
312  queue = segment->getQueue(laneIndex);
313  const SUMOReal avgCarSize = segment->getBruttoOccupancy() / segment->getCarNumber();
314  const size_t queueSize = queue.size();
315  SUMOReal vehiclePosition = segmentOffset + length;
316  // draw vehicles beginning with the leader at the end of the segment
317  SUMOReal xOff = 0;
318  for (size_t i = 0; i < queueSize; ++i) {
319  GUIMEVehicle* veh = static_cast<GUIMEVehicle*>(queue[queueSize - i - 1]);
320  const SUMOReal vehLength = veh->getVehicleType().getLengthWithGap();
321  while (vehiclePosition < segmentOffset) {
322  // if there is only a single queue for a
323  // multi-lane edge shift vehicles and start
324  // drawing again from the end of the segment
325  vehiclePosition += length;
326  xOff += 2;
327  }
328  const Position p = l->geometryPositionAtOffset(vehiclePosition);
329  const SUMOReal angle = l->getShape().rotationAtOffset(l->interpolateLanePosToGeometryPos(vehiclePosition));
330  veh->setPositionAndAngle(p, angle);
331  veh->drawGL(s);
332  vehiclePosition -= vehLength;
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 #endif
475 
476 
477 void
479  const std::vector<MSLane*>& lanes = getLanes();
480  const bool isClosed = lane->isClosed();
481  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
482  GUILane* l = dynamic_cast<GUILane*>(*i);
483  if (l->isClosed() == isClosed) {
484  l->closeTraffic(false);
485  }
486  }
488 }
489 
490 
491 void
493  MSEdgeVector edges;
494  edges.push_back(this);
495  GUITriggeredRerouter* rr = new GUITriggeredRerouter(getID() + "_dynamic_rerouter", edges, 1, "", false,
496  GUINet::getGUIInstance()->getVisualisationSpeedUp());
497 
500  ri.end = SUMOTime_MAX;
502  rr->myIntervals.push_back(ri);
503 
504  // trigger rerouting for vehicles already on this edge
505  const std::vector<MSLane*>& lanes = getLanes();
506  for (std::vector<MSLane*>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
507  const MSLane::VehCont& vehicles = (*i)->getVehiclesSecure();
508  for (MSLane::VehCont::const_iterator v = vehicles.begin(); v != vehicles.end(); ++v) {
509  if ((*v)->getLane() == (*i)) {
511  } // else: this is the shadow during a continuous lane change
512  }
513  (*i)->releaseVehicles();
514  }
515 }
516 
517 /****************************************************************************/
518 
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
Definition: GUIEdge.cpp:208
std::set< MSTransportable * > myContainers
Containers on the edge.
Definition: MSEdge.h:720
GUIVisualizationTextSettings streetName
Reroutes vehicles passing an edge One rerouter can be active on multiple edges. To reduce drawing loa...
SUMOReal rotationAtOffset(SUMOReal pos) const
Returns the rotation at the given length.
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.
void add(const Position &pos)
Adds the given position to this one.
Definition: Position.h:119
bool isClosed() const
Definition: GUILane.h:235
virtual GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
Definition: GUIEdge.cpp:155
const Position geometryPositionAtOffset(SUMOReal offset) const
Definition: MSLane.h:340
const std::vector< MSLane * > & getLanes() const
Returns this edge&#39;s lanes.
Definition: MSEdge.h:186
void closeTraffic(bool rebuildAllowed=true)
close this lane for traffic
Definition: GUILane.cpp:1012
RandomDistributor< MSEdge * > edgeProbs
The distributions of new destinations to use.
The vehicle arrived at a junction.
bool add(SUMOReal prob, T val, bool checkDuplicates=true)
Adds a value with an assigned probability to the distribution.
Stores the information about how to visualize structures.
const EdgeBasicFunction myFunction
the purpose of the edge
Definition: MSEdge.h:698
std::vector< MSVehicle * > VehCont
Container for vehicles.
Definition: MSLane.h:88
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUILane.cpp:417
GUIVisualizationTextSettings vehicleName
const std::string & getStreetName() const
Returns the street name of the edge.
Definition: MSEdge.h:264
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:96
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:162
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
GUIVisualizationTextSettings cwaEdgeName
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:460
void buildShowParamsPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to open the parameter window.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:255
EdgeBasicFunction
Defines possible edge types.
Definition: MSEdge.h:90
static SUMOReal getTotalLength(bool includeInternal, bool eachLane)
Definition: GUIEdge.cpp:117
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:123
#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
GUIVisualizationTextSettings edgeName
A road/street connecting two junctions (gui-version)
Definition: GUIEdge.h:62
const std::string & getID() const
Returns the id.
Definition: Named.h:65
A road/street connecting two junctions.
Definition: MSEdge.h:81
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
Definition: GUIGlObject.h:167
void rebuildAllowedLanes()
Definition: MSEdge.cpp:175
SUMOReal getLength() const
return the length of the edge
Definition: MSEdge.h:535
~GUIEdge()
Destructor.
Definition: GUIEdge.cpp:86
The edge is a district edge.
Definition: MSEdge.h:100
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
Definition: GLHelper.cpp:443
static GUINet * getGUIInstance()
Returns the pointer to the unique instance of GUINet (singleton).
Definition: GUINet.cpp:506
void closeTraffic(const GUILane *lane)
close this edge for traffic
Definition: GUIEdge.cpp:478
GUIVisualizationTextSettings internalEdgeName
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:46
A list of positions.
SUMOTime begin
The begin time these definitions are valid.
virtual GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
Definition: GUIEdge.cpp:172
Position positionAtOffset(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
static MSEdge mySpecialDest_keepDestination
special destination values
bool notifyEnter(SUMOVehicle &veh, MSMoveReminder::Notification reason)
Tries to reroute the vehicle.
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:692
MSLane & getLane(size_t laneNo)
returns the enumerated lane (!!! why not private with a friend?)
Definition: GUIEdge.cpp:95
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:682
void addRerouter()
add a rerouter
Definition: GUIEdge.cpp:492
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIPerson.cpp:250
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:79
The edge is a pedestrian walking area (a special type of internal edge)
Definition: MSEdge.h:104
static std::vector< GUIGlID > getIDs(bool includeInternal)
Definition: GUIEdge.cpp:102
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:201
EdgeBasicFunction getPurpose() const
Returns the edge type (EdgeBasicFunction)
Definition: MSEdge.h:235
SUMOTime end
The end time these definitions are valid.
#define SUMOTime_MAX
Definition: SUMOTime.h:44
GUIVisualizationSizeSettings containerSize
MFXMutex myLock
The mutex used to avoid concurrent updates of myPersons/ myContainers.
Definition: GUIEdge.h:212
The edge is a normal street.
Definition: MSEdge.h:94
SUMOReal interpolateLanePosToGeometryPos(SUMOReal lanePos) const
Definition: MSLane.h:334
The edge is a pedestrian crossing (a special type of internal edge)
Definition: MSEdge.h:102
static size_t dictSize()
Returns the number of edges.
Definition: MSEdge.cpp:613
std::vector< RerouteInterval > myIntervals
List of rerouting definition intervals.
The popup menu of a globject.
an edge
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Definition: GUIEdge.cpp:216
std::string myStreetName
the real-world name of this edge (need not be unique)
Definition: MSEdge.h:739
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
static DictType myDict
Static dictionary to associate string-ids with objects.
Definition: MSEdge.h:768
#define SUMOReal
Definition: config.h:214
static const bool gUseMesoSim
Definition: MSGlobals.h:102
GUIVisualizationSizeSettings vehicleSize
Boundary getBoundary() const
Returns the street&#39;s geometry.
Definition: GUIEdge.cpp:131
FXbool locked()
Definition: MFXMutex.h:70
empty max
std::vector< MSEdge * > MSEdgeVector
Definition: MSEdge.h:78
Position getPositionInformation() const
Returns the cursor&#39;s x/y position within the network.
The edge is an internal edge.
Definition: MSEdge.h:98
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.
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
static void fill(std::vector< GUIEdge * > &netsWrappers)
Definition: GUIEdge.cpp:142
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 PositionVector & getShape() const
Definition: GUILane.cpp:726
std::set< MSTransportable * > myPersons
Persons on the edge (only for drawing)
Definition: MSEdge.h:717