68 #ifdef CHECK_MEMORY_LEAKS
70 #endif // CHECK_MEMORY_LEAKS
101 double
vehiclePoly_PassengerCarBody[] = { .5, 0, 0, 0, 0, .3, 0.08, .44, 0.25, .5, 0.95, .5, 1., .4, 1., -.4, 0.95, -.5, 0.25, -.5, 0.08, -.44, 0, -.3, 0, 0, -10000 };
102 double vehiclePoly_PassengerCarBodyFront[] = { 0.1, 0, 0.025, 0, 0.025, 0.25, 0.27, 0.4, 0.27, -.4, 0.025, -0.25, 0.025, 0, -10000 };
103 double vehiclePoly_PassengerFrontGlass[] = { 0.35, 0, 0.3, 0, 0.3, 0.4, 0.43, 0.3, 0.43, -0.3, 0.3, -0.4, 0.3, 0, -10000 };
104 double vehiclePoly_PassengerSedanRightGlass[] = { 0.36, -.43, 0.34, -.47, 0.77, -.47, 0.67, -.37, 0.45, -.37, 0.34, -.47, -10000 };
105 double vehiclePoly_PassengerSedanLeftGlass[] = { 0.36, .43, 0.34, .47, 0.77, .47, 0.67, .37, 0.45, .37, 0.34, .47, -10000 };
106 double vehiclePoly_PassengerSedanBackGlass[] = { 0.80, 0, 0.70, 0, 0.70, 0.3, 0.83, 0.4, 0.83, -.4, 0.70, -.3, 0.70, 0, -10000 };
107 double vehiclePoly_PassengerHatchbackRightGlass[] = { 0.36, -.43, 0.34, -.47, 0.94, -.47, 0.80, -.37, 0.45, -.37, 0.34, -.47, -10000 };
108 double vehiclePoly_PassengerHatchbackLeftGlass[] = { 0.36, .43, 0.34, .47, 0.94, .47, 0.80, .37, 0.45, .37, 0.34, .47, -10000 };
109 double vehiclePoly_PassengerHatchbackBackGlass[] = { 0.92, 0, 0.80, 0, 0.80, 0.3, 0.95, 0.4, 0.95, -.4, 0.80, -.3, 0.80, 0, -10000 };
110 double vehiclePoly_PassengerWagonRightGlass[] = { 0.36, -.43, 0.34, -.47, 0.94, -.47, 0.87, -.37, 0.45, -.37, 0.34, -.47, -10000 };
111 double vehiclePoly_PassengerWagonLeftGlass[] = { 0.36, .43, 0.34, .47, 0.94, .47, 0.87, .37, 0.45, .37, 0.34, .47, -10000 };
112 double vehiclePoly_PassengerWagonBackGlass[] = { 0.92, 0, 0.90, 0, 0.90, 0.3, 0.95, 0.4, 0.95, -.4, 0.90, -.3, 0.90, 0, -10000 };
114 double vehiclePoly_PassengerVanBody[] = { .5, 0, 0, 0, 0, .4, 0.1, .5, 0.97, .5, 1., .47, 1., -.47, 0.97, -.5, 0.1, -.5, 0, -.4, 0, 0, -10000 };
115 double vehiclePoly_PassengerVanBodyFront[] = { 0.1, 0, 0.025, 0, 0.025, 0.25, 0.13, 0.4, 0.13, -.4, 0.025, -0.25, 0.025, 0, -10000 };
116 double vehiclePoly_PassengerVanFrontGlass[] = { 0.21, 0, 0.16, 0, 0.16, 0.4, 0.29, 0.3, 0.29, -0.3, 0.16, -0.4, 0.16, 0, -10000 };
117 double vehiclePoly_PassengerVanRightGlass[] = { 0.36, -.43, 0.20, -.47, 0.98, -.47, 0.91, -.37, 0.31, -.37, 0.20, -.47, -10000 };
118 double vehiclePoly_PassengerVanLeftGlass[] = { 0.36, .43, 0.20, .47, 0.98, .47, 0.91, .37, 0.31, .37, 0.20, .47, -10000 };
119 double vehiclePoly_PassengerVanBackGlass[] = { 0.95, 0, 0.94, 0, 0.94, 0.3, 0.98, 0.4, 0.98, -.4, 0.94, -.3, 0.94, 0, -10000 };
121 double vehiclePoly_DeliveryMediumRightGlass[] = { 0.21, -.43, 0.20, -.47, 0.38, -.47, 0.38, -.37, 0.31, -.37, 0.20, -.47, -10000 };
122 double vehiclePoly_DeliveryMediumLeftGlass[] = { 0.21, .43, 0.20, .47, 0.38, .47, 0.38, .37, 0.31, .37, 0.20, .47, -10000 };
124 double vehiclePoly_TransportBody[] = { .5, 0, 0, 0, 0, .45, 0.05, .5, 2.25, .5, 2.25, -.5, 0.05, -.5, 0, -.45, 0, 0, -10000 };
125 double vehiclePoly_TransportFrontGlass[] = { 0.1, 0, 0.05, 0, 0.05, 0.45, 0.25, 0.4, 0.25, -.4, 0.05, -0.45, 0.05, 0, -10000 };
126 double vehiclePoly_TransportRightGlass[] = { 0.36, -.47, 0.10, -.48, 1.25, -.48, 1.25, -.4, 0.3, -.4, 0.10, -.48, -10000 };
127 double vehiclePoly_TransportLeftGlass[] = { 0.36, .47, 0.10, .48, 1.25, .48, 1.25, .4, 0.3, .4, 0.10, .48, -10000 };
129 double vehiclePoly_EVehicleBody[] = { .5, 0, 0, 0, 0, .3, 0.08, .44, 0.25, .5, 0.75, .5, .92, .44, 1, .3, 1, -.3, .92, -.44, .75, -.5, .25, -.5, 0.08, -.44, 0, -.3, 0, 0, -1000 };
130 double vehiclePoly_EVehicleFrontGlass[] = { .5, 0, 0.05, .05, 0.05, .25, 0.13, .39, 0.3, .45, 0.70, .45, .87, .39, .95, .25, .95, -.25, .87, -.39, .70, -.45, .3, -.45, 0.13, -.39, 0.05, -.25, 0.05, 0.05, -1000 };
132 double vehiclePoly_EVehicleBackGlass[] = { 0.65, 0, 0.9, 0, 0.9, 0.4, 0.57, 0.3, 0.57, -0.3, 0.9, -0.4, 0.9, 0, -10000 };
134 double vehiclePoly_Ship[] = { 0.25, 0, 0, 0, 0.1, 0.25, 0.2, 0.45, 0.25, 0.5, 0.95, 0.5, 1.0, 0.45, 1.0, -0.45, 0.95, -0.5, 0.25, -0.5, 0.2, -0.45, 0.1, -0.25, 0, 0, -10000 };
135 double vehiclePoly_ShipDeck[] = { 0.5, 0, 0.25, 0.4, 0.95, 0.4, 0.95, -0.4, 0.25, -0.4, 0.25, 0.4, -10000 };
136 double vehiclePoly_ShipSuperStructure[] = { 0.8, 0, 0.5, 0.3, 0.85, 0.3, 0.85, -0.3, 0.5, -0.3, 0.5, 0.3, -10000 };
138 double vehiclePoly_Cyclist[] = { 0.5, 0, 0.25, 0.45, 0.25, 0.5, 0.8, 0.15, 0.8, -0.15, 0.25, -0.5, 0.25, -0.45, -10000 };
148 GUIGlObject& o, std::map<GUISUMOAbstractView*, int>& additionalVisualizations)
149 :
GUIGLObjectPopupMenu(app, parent, o), myVehiclesAdditionalVisualizations(additionalVisualizations) {
159 if (!static_cast<GUIVehicle*>(myObject)->hasActiveAddVisualisation(myParent,
VO_SHOW_ALL_ROUTES)) {
176 if (!static_cast<GUIVehicle*>(myObject)->hasActiveAddVisualisation(myParent,
VO_SHOW_ROUTE)) {
193 if (!static_cast<GUIVehicle*>(myObject)->hasActiveAddVisualisation(myParent,
VO_SHOW_BEST_LANES)) {
210 if (!static_cast<GUIVehicle*>(myObject)->hasActiveAddVisualisation(myParent,
VO_TRACKED)) {
211 myParent->startTrack(static_cast<GUIVehicle*>(myObject)->
getGlID());
221 myParent->stopTrack();
229 if (!static_cast<GUIVehicle*>(myObject)->hasActiveAddVisualisation(myParent,
VO_SHOW_LFLINKITEMS)) {
255 MSVehicle(pars, route, type, speedFactor),
267 while (i->first->removeAdditionalGLVisualisation(
this));
304 new FXMenuSeparator(ret);
306 if (trackedID < 0 || (
size_t)trackedID !=
getGlID()) {
313 new FXMenuSeparator(ret);
328 ret->
mkItem(
"position [m]",
true,
330 ret->
mkItem(
"speed [m/s]",
true,
332 ret->
mkItem(
"angle [degree]",
true,
337 ret->
mkItem(
"time gap [s]",
true,
339 ret->
mkItem(
"waiting time [s]",
true,
341 ret->
mkItem(
"impatience",
true,
343 ret->
mkItem(
"last lane change [s]",
true,
357 ret->
mkItem(
"CO2 [mg/s]",
true,
359 ret->
mkItem(
"CO [mg/s]",
true,
361 ret->
mkItem(
"HC [mg/s]",
true,
363 ret->
mkItem(
"NOx [mg/s]",
true,
365 ret->
mkItem(
"PMx [mg/s]",
true,
367 ret->
mkItem(
"fuel [ml/s]",
true,
369 ret->
mkItem(
"noise (Harmonoise) [dB]",
true,
371 std::ostringstream str;
372 for (std::vector<MSDevice*>::const_iterator i =
myDevices.begin(); i !=
myDevices.end(); ++i) {
376 str << (*i)->getID().substr(0, (*i)->getID().find(
getID()));
378 ret->
mkItem(
"devices",
false, str.str());
379 ret->
mkItem(
"persons",
true,
381 ret->
mkItem(
"containers",
true,
385 ret->
mkItem(
"",
false,
"");
386 ret->
mkItem(
"Type Information:",
false,
"");
420 glBegin(GL_TRIANGLE_STRIP);
422 glVertex2d(-.5, .15);
440 glBegin(GL_TRIANGLES);
452 glTranslated(0, 0, offset * .1);
453 glPolygonOffset(0, offset * -1);
454 glBegin(GL_TRIANGLE_FAN);
456 while (poses[i] > -999) {
457 glVertex2d(poses[i], poses[i + 1]);
474 glRotated(90, 0, 0, 1);
475 glScaled(length, width, 1.);
483 drawPoly(vehiclePoly_PassengerCarBodyFront, 4.5);
485 drawPoly(vehiclePoly_PassengerFrontGlass, 4.5);
488 glTranslated(0, 0, .045);
490 glTranslated(0, 0, -.045);
492 glTranslated(0, 0, .04);
495 glTranslated(0, 0, -.04);
505 glTranslated(0.4, 0, .5);
506 glScaled(0.1, 0.2, 1);
513 glTranslated(0.5, 0, .3);
514 glScaled(0.5, 0.05, 1);
519 glTranslated(0.25, 0, .3);
520 glScaled(0.02, 0.5, 1);
531 drawPoly(vehiclePoly_PassengerCarBodyFront, 4.5);
533 drawPoly(vehiclePoly_PassengerFrontGlass, 4.5);
536 drawPoly(vehiclePoly_PassengerVanBody, 4);
538 drawPoly(vehiclePoly_PassengerVanBodyFront, 4.5);
540 drawPoly(vehiclePoly_PassengerVanFrontGlass, 4.5);
541 drawPoly(vehiclePoly_PassengerVanRightGlass, 4.5);
542 drawPoly(vehiclePoly_PassengerVanLeftGlass, 4.5);
543 drawPoly(vehiclePoly_PassengerVanBackGlass, 4.5);
546 drawPoly(vehiclePoly_PassengerVanBody, 4);
548 drawPoly(vehiclePoly_PassengerVanBodyFront, 4.5);
550 drawPoly(vehiclePoly_PassengerVanFrontGlass, 4.5);
551 drawPoly(vehiclePoly_DeliveryMediumRightGlass, 4.5);
552 drawPoly(vehiclePoly_DeliveryMediumLeftGlass, 4.5);
557 glScaled(1. / (length), 1, 1.);
558 drawPoly(vehiclePoly_TransportBody, 4);
560 drawPoly(vehiclePoly_TransportFrontGlass, 4.5);
561 drawPoly(vehiclePoly_TransportRightGlass, 4.5);
562 drawPoly(vehiclePoly_TransportLeftGlass, 4.5);
568 glScaled(1. / (length), 1, 1.);
569 glTranslated(0, 0, .04);
570 glBegin(GL_TRIANGLE_FAN);
571 glVertex2d(ml / 2., 0);
574 glVertex2d(0 + .05, -.5);
575 glVertex2d(ml - .05, -.5);
576 glVertex2d(ml, -.45);
578 glVertex2d(ml - .05, .5);
579 glVertex2d(0 + .05, .5);
583 glTranslated(0, 0, -.04);
585 glTranslated(0, 0, .045);
588 glVertex2d(0 + .05, .48);
589 glVertex2d(0 + .05, -.48);
590 glVertex2d(0 + .15, -.48);
591 glVertex2d(0 + .15, .48);
593 glVertex2d(ml - .1, .45);
594 glVertex2d(ml - .1, -.45);
595 glVertex2d(ml - .05, -.45);
596 glVertex2d(ml - .05, .45);
598 glVertex2d(0 + .20, .49);
599 glVertex2d(0 + .20, .45);
600 glVertex2d(ml - .20, .45);
601 glVertex2d(ml - .20, .49);
603 glVertex2d(0 + .20, -.49);
604 glVertex2d(0 + .20, -.45);
605 glVertex2d(ml - .20, -.45);
606 glVertex2d(ml - .20, -.49);
609 glTranslated(0, 0, -.045);
619 drawPoly(vehiclePoly_EVehicleBody, 4);
621 drawPoly(vehiclePoly_EVehicleFrontGlass, 4.5);
622 glTranslated(0, 0, .048);
627 glVertex2d(.35, -.5);
630 glVertex2d(.3, -.05);
631 glVertex2d(.7, -.05);
637 glVertex2d(.65, -.5);
640 glTranslated(0, 0, -.048);
667 glTranslated(0, 0, 0.1);
669 glTranslated(.4, 0, 0);
671 glTranslated(.4, 0, 0);
682 drawPoly(vehiclePoly_ShipSuperStructure, 6);
688 drawPoly(vehiclePoly_PassengerCarBodyFront, 4.5);
690 drawPoly(vehiclePoly_PassengerFrontGlass, 4.5);
700 glBegin(GL_TRIANGLE_FAN);
701 glVertex2d(1 / 2., 0);
704 glVertex2d(0 + .05, -.05);
705 glVertex2d(1 - .05, -.05);
708 glVertex2d(1 - .05, .05);
709 glVertex2d(0 + .05, .05);
717 glBegin(GL_TRIANGLE_FAN);
718 glVertex2d(1 / 2., 0);
721 glVertex2d(0 + .05, -.2);
722 glVertex2d(1 - .05, -.2);
725 glVertex2d(1 - .05, .2);
726 glVertex2d(0 + .05, .2);
733 drawPoly(vehiclePoly_PassengerSedanRightGlass, 4.5);
734 drawPoly(vehiclePoly_PassengerSedanLeftGlass, 4.5);
735 drawPoly(vehiclePoly_PassengerSedanBackGlass, 4.5);
738 drawPoly(vehiclePoly_PassengerHatchbackRightGlass, 4.5);
739 drawPoly(vehiclePoly_PassengerHatchbackLeftGlass, 4.5);
740 drawPoly(vehiclePoly_PassengerHatchbackBackGlass, 4.5);
743 drawPoly(vehiclePoly_PassengerWagonRightGlass, 4.5);
744 drawPoly(vehiclePoly_PassengerWagonLeftGlass, 4.5);
745 drawPoly(vehiclePoly_PassengerWagonBackGlass, 4.5);
768 glTranslated(0, 0, .1);
771 glTranslated(0, 0, .1);
790 drawPoly(vehiclePoly_PassengerSedanRightGlass, 4.5);
791 drawPoly(vehiclePoly_PassengerSedanLeftGlass, 4.5);
792 drawPoly(vehiclePoly_PassengerSedanBackGlass, 4.5);
911 #define BLINKER_POS_FRONT .5
912 #define BLINKER_POS_BACK .5
916 glColor3d(1.f, .8f, 0);
952 glColor3f(1.f, .2f, 0);
977 glScaled(upscale, upscale, 1);
1013 glColor3d(0., 1., 0.);
1016 glVertex2d(0., minGap);
1017 glVertex2d(-.5, minGap);
1018 glVertex2d(.5, minGap);
1023 glColor3d(1., 0., 0.);
1028 glTranslated(0, 0, .1);
1102 size_t personIndex = 0;
1103 for (std::vector<MSTransportable*>::const_iterator i = ps.begin(); i != ps.end(); ++i) {
1105 assert(person != 0);
1112 size_t containerIndex = 0;
1113 for (std::vector<MSTransportable*>::const_iterator i = cs.begin(); i != cs.end(); ++i) {
1115 assert(container != 0);
1127 glTranslated(0, 0,
getType() - .1);
1137 for (
int i = noReroutePlus1 - 1; i >= 0; i--) {
1147 if ((*i).myLink == 0) {
1150 MSLink* link = (*i).myLink;
1154 if ((*i).mySetRequest) {
1155 glColor3d(0, .8, 0);
1157 glColor3d(.8, 0, 0);
1159 const SUMOTime leaveTime = (*i).myLink->getLeaveTime(
1165 assert(avi.arrivalTime == (*i).myArrivalTime && avi.leavingTime == leaveTime);
1177 glTranslated(pos.
x(), pos.
y(), -.1);
1181 glTranslated(-pos.
x(), -pos.
y(), .1);
1196 switch (activeScheme) {
1237 SUMOReal hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
PI;
1246 SUMOReal hue = 180. + atan2(center.
x() - p.
x(), center.
y() - p.
y()) * 180. /
PI;
1255 SUMOReal hue = 180. + atan2(pb.
x() - pe.
x(), pb.
y() - pe.
y()) * 180. /
PI;
1263 const SUMOReal hue = (long)veh % 360;
1264 const SUMOReal sat = (((long)veh / 360) % 67) / 100.0 + 0.33;
1275 switch (activeScheme) {
1344 glGetDoublev(GL_CURRENT_COLOR, colors);
1345 colors[0] -= darken;
1346 if (colors[0] < 0) {
1349 colors[1] -= darken;
1350 if (colors[1] < 0) {
1353 colors[2] -= darken;
1354 if (colors[2] < 0) {
1357 colors[3] -= darken;
1358 if (colors[3] < 0) {
1375 std::vector<std::vector<MSVehicle::LaneQ> > bestLanes =
myBestLanes;
1378 for (std::vector<std::vector<MSVehicle::LaneQ> >::iterator j = bestLanes.begin(); j != bestLanes.end(); ++j) {
1379 std::vector<MSVehicle::LaneQ>& lanes = *j;
1382 for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
1383 gmax =
MAX2((*i).length, gmax);
1384 rmax =
MAX2((*i).occupation, rmax);
1386 for (std::vector<MSVehicle::LaneQ>::const_iterator i = lanes.begin(); i != lanes.end(); ++i) {
1389 SUMOReal r = (*i).occupation / rmax;
1414 size_t bestLaneIndex = (&r ==
myRoute ? 0 : bestLaneConts.
size());
1415 for (; i != r.
end(); ++i) {
1417 if (bestLaneIndex < bestLaneConts.size() && bestLaneConts[bestLaneIndex] != 0 && (*i) == &(bestLaneConts[bestLaneIndex]->getEdge())) {
1418 lane =
static_cast<GUILane*
>(bestLaneConts[bestLaneIndex]);
1421 lane =
static_cast<GUILane*
>((*i)->getLanes()[0]);
1443 defaultLength *= exaggeration;
1444 if (exaggeration == 0) {
1447 carriageGap *= exaggeration;
1453 const SUMOReal xCornerCut = 0.3 * exaggeration;
1454 const SUMOReal yCornerCut = 0.4 * exaggeration;
1456 const int numCarriages = floor(length / (defaultLength + carriageGap) + 0.5);
1457 assert(numCarriages > 0);
1458 const SUMOReal carriageLengthWithGap = length / numCarriages;
1459 const SUMOReal carriageLength = carriageLengthWithGap - carriageGap;
1462 int furtherIndex = 0;
1465 int backFurtherIndex = furtherIndex;
1471 if (requiredSeats > 0) {
1477 for (
int i = 0; i < numCarriages; ++i) {
1478 while (carriageOffset < 0) {
1488 while (carriageBackOffset < 0) {
1490 if (prev != backLane) {
1491 carriageBackOffset += prev->
getLength();
1494 carriageBackOffset = 0;
1500 if (front == back) {
1505 if (i >= firstPassengerCarriage) {
1509 glTranslated(front.
x(), front.
y(),
getType());
1510 glRotated(angle, 0, 0, 1);
1512 glBegin(GL_TRIANGLE_FAN);
1513 glVertex2d(-halfWidth + xCornerCut, 0);
1514 glVertex2d(-halfWidth, yCornerCut);
1515 glVertex2d(-halfWidth, carriageLength - yCornerCut);
1516 glVertex2d(-halfWidth + xCornerCut, carriageLength);
1517 glVertex2d(halfWidth - xCornerCut, carriageLength);
1518 glVertex2d(halfWidth, carriageLength - yCornerCut);
1519 glVertex2d(halfWidth, yCornerCut);
1520 glVertex2d(halfWidth - xCornerCut, 0);
1524 carriageOffset -= carriageLengthWithGap;
1525 carriageBackOffset -= carriageLengthWithGap;
1531 glTranslated(front.
x(), front.
y(),
getType());
1532 glRotated(angle, 0, 0, 1);
1555 if (requiredSeats <= 0) {
1558 const Line l(front, back);
1565 for (
SUMOReal p = 2; p <= length - 1; p += 1) {
1581 std::string result =
"";
1583 result +=
"parking";
1585 result +=
"stopped";
1589 if (
myStops.front().triggered) {
1590 result +=
", triggered";
1591 }
else if (
myStops.front().containerTriggered) {
1592 result +=
", containerTriggered";
1608 std::vector<const SUMOVehicle*> blockingFoes;
1609 std::vector<const MSPerson*> blockingPersons;
1612 for (std::vector<const SUMOVehicle*>::const_iterator it = blockingFoes.begin(); it != blockingFoes.end(); ++it) {
1615 #ifdef HAVE_INTERNAL_LANES
1617 for (MSLink::LinkLeaders::const_iterator it = linkLeaders.begin(); it != linkLeaders.end(); ++it) {
1626 for (std::vector<const MSPerson*>::iterator it_p = blockingPersons.begin(); it_p != blockingPersons.end(); ++it_p) {
SUMOReal length2D() const
bool signalSet(int which) const
Returns whether the given signal is on.
GUIParameterTableWindow * getParameterWindow(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own parameter window.
virtual void drawGLAdditional(GUISUMOAbstractView *const parent, const GUIVisualizationSettings &s) const
Draws additionally triggered visualisations.
bool wasSet(int what) const
Returns whether the given parameter was set.
void selectBlockingFoes() const
adds the blocking foes to the current selection
const MSVehicleType * myType
This Vehicle's type.
void setColor(const GUIVisualizationSettings &s) const
sets the color according to the currente settings
SUMOReal getColorValue(size_t activeScheme) const
gets the color value according to the current scheme index
const std::vector< SUMOReal > & getShapeRotations() const
RGBColor color
The vehicle's color.
MSDevice * getDevice(const std::type_info &type) const
Returns a device of the given type if it exists or 0.
bool drawAction_drawCarriageClass(const GUIVisualizationSettings &s, SUMOVehicleShape guiShape, bool asImage) const
draws the given guiShape if it has distinc carriages/modules and eturns true if so ...
Representation of a vehicle in the micro simulation.
double vehiclePoly_Ship[]
unsigned int getNumberReroutes() const
Returns the number of new routes this vehicle got.
double vehiclePoly_TransportFrontGlass[]
SUMOVehicleClass getVehicleClass() const
Get this vehicle type's vehicle class.
GUIGLObjectPopupMenu * getPopUpMenu(GUIMainWindow &app, GUISUMOAbstractView &parent)
Returns an own popup-menu.
static bool setFunctionalColor(size_t activeScheme, const MSBaseVehicle *veh)
sets the color according to the current scheme index and some vehicle function
MoveReminderCont myMoveReminders
Current lane's move reminder.
static RGBColor fromHSV(SUMOReal h, SUMOReal s, SUMOReal v)
Converts the given hsv-triplet to rgb.
bool showBlinker
Information whether vehicle blinkers shall be drawn.
void buildNameCopyPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds entries which allow to copy the name / typed name into the clipboard.
std::vector< std::vector< LaneQ > > myBestLanes
Position getCenter() const
Returns the center of the boundary.
void drawAction_drawVehicleBlinker(const GUIVehicle &veh, SUMOReal length)
const MSCFModel & getCarFollowModel() const
Returns the vehicle's car following model definition.
std::vector< MSLane * > myFurtherLanes
The information into which lanes the vehicle laps into.
State myState
This Vehicles driving state (pos and speed)
GUIVisualizationTextSettings personName
const Position geometryPositionAtOffset(SUMOReal offset) const
SUMOReal getMaxSpeed() const
Returns the maximum speed.
DriveItemVector myLFLinkLanes
Container for used Links/visited Lanes during lookForward.
SUMOReal pos() const
Position of this state.
SUMOReal getLengthWithGap() const
Get vehicle's length including the minimum gap [m].
SUMOReal getImpatience() const
Returns this vehicles impatience.
void drawBestLanes() const
Draws the vehicle's best lanes.
bool showBTRange
Information whether the communication range shall be drawn.
SUMOReal getLeaveSpeed() const
double vehiclePoly_ShipDeck[]
SUMOTime getWaitingTime() const
Returns the SUMOTime waited (speed was lesser than 0.1m/s)
SUMOReal ymin() const
Returns minimum y-coordinate.
Stores the information about how to visualize structures.
SUMOReal getLength() const
Returns the lane's length.
Position getPosition(const SUMOReal offset=0) const
Return current position (x/y, cartesian)
render as a transport vehicle
void select(GUIGlID id, bool update=true)
Adds the object with the given id.
render as a flexible city bus
Position getPositionAtDistance2D(SUMOReal offset) const
static void drawOutlineCircle(SUMOReal width, SUMOReal iwidth, int steps=8)
Draws an unfilled circle around (0,0)
bool drawLaneChangePreference
Information whether the lane change preference shall be drawn.
double vehiclePoly_EVehicleBody[]
SUMOReal xmin() const
Returns minimum x-coordinate.
bool hasActiveAddVisualisation(GUISUMOAbstractView *const parent, int which) const
Returns whether the named feature is enabled in the given view.
std::string time2string(SUMOTime t)
GUIVisualizationTextSettings vehicleName
SUMOReal getLength() const
Get vehicle's length [m].
SUMOReal getLastLaneChangeOffset() const
Returns the time since the last lane change in seconds.
static void drawBoxLines(const PositionVector &geom, const std::vector< SUMOReal > &rots, const std::vector< SUMOReal > &lengths, SUMOReal width, int cornerDetail=0, SUMOReal offset=0)
Draws thick lines.
SUMOReal getHCEmissions() const
Returns HC emission of the current state.
void buildCenterPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to center to the object.
double vehiclePoly_TransportBody[]
bool addAdditionalGLVisualisation(GUIGlObject *const which)
Adds an object to call its additional visualisation method.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
show all vehicle's routes
Boundary getCenteringBoundary() const
Returns the boundary to which the view shall be centered in order to show the object.
const MSRoute & getRoute() const
Returns the current route.
render as a delivery vehicle
double vehiclePoly_ShipSuperStructure[]
static void drawBoxLine(const Position &beg, SUMOReal rot, SUMOReal visLength, SUMOReal width, SUMOReal offset=0)
Draws a thick line.
unsigned int getPersonNumber() const
Returns the number of persons.
bool isSelected(GUIGlObjectType type, GUIGlID id)
Returns the information whether the object with the given type and id is selected.
const MSRoute * myRoute
This Vehicle's route.
void removeActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
render as a sedan passenger vehicle ("Stufenheck")
SUMOReal getCO2Emissions() const
Returns CO2 emission of the current state.
const std::map< std::string, std::string > & getMap() const
Returns the inner key/value map.
double vehiclePoly_Cyclist[]
const std::vector< SUMOReal > & getShapeLengths() const
SUMOReal distanceTo(const Position &p2) const
returns the euclidean distance in 3 dimension
SUMOReal getPositionOnLane() const
Get the vehicle's position along the lane.
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
const SUMOVehicleParameter * myParameter
This Vehicle's parameter.
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.
Show vehicle's current route.
bool drawAction_drawVehicleAsImage(const GUIVisualizationSettings &s, SUMOReal length=-1) const
double vehiclePoly_PassengerWagonRightGlass[]
SUMOReal x() const
Returns the x-position.
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.
Position positionAtOffset2D(SUMOReal pos, SUMOReal lateralOffset=0) const
Returns the position at the given length.
GUIGlID getGlID() const
Returns the numerical id of the object.
double vehiclePoly_PassengerVanRightGlass[]
#define UNUSED_PARAMETER(x)
SUMOReal xmax() const
Returns maximum x-coordinate.
A class that stores a 2D geometrical boundary.
double vehiclePoly_PassengerHatchbackRightGlass[]
FXDEFMAP(GUIDialog_AppSettings) GUIDialog_AppSettingsMap[]
The car-following model and parameter.
MSAbstractLaneChangeModel & getLaneChangeModel()
SUMOReal scale
information about a lane's width (temporary, used for a single view)
double vehiclePoly_PassengerCarBody[]
std::string getStopInfo() const
retrieve information about the current stop state
Right blinker lights are switched on.
Representation of a lane in the micro simulation (gui-version)
double vehiclePoly_PassengerFrontGlass[]
GUIColorer vehicleColorer
The vehicle colorer.
virtual int getTrackedID() const
const std::vector< MSTransportable * > & getPersons() const
Returns the list of persons using this vehicle.
static void drawFilledCircle(SUMOReal width, int steps=8)
Draws a filled circle around (0,0)
const std::string & getID() const
Returns the id.
GUIGlObjectType getType() const
Returns the type of the object as coded in GUIGlObjectType.
double vehiclePoly_PassengerCarBodyFront[]
void drawAction_drawVehicleAsPoly(const GUIVisualizationSettings &s) const
bool removeAdditionalGLVisualisation(GUIGlObject *const which)
Removes an object from the list of objects that show additional things.
static const RGBColor GREEN
Left blinker lights are switched on.
static const RGBColor GREY
void drawAction_drawVehicleAsTrianglePlus() const
unsigned int getContainerNumber() const
Returns the number of containers.
GUIVehicle(SUMOVehicleParameter *pars, const MSRoute *route, const MSVehicleType *type, const SUMOReal speedFactor)
Constructor.
const SUMOVTypeParameter & getParameter() const
static void drawTexturedBox(unsigned int which, SUMOReal size)
Draws a named texture as a box with the given size.
static void setColor(const RGBColor &c)
Sets the gl-color to this value.
render as a hatchback passenger vehicle ("Fliessheck")
double vehiclePoly_EVehicleBackGlass[]
SUMOReal getMinGap() const
Get the free space in front of vehicles of this class.
bool wasSet(int what) const
Returns whether the given parameter was set.
const std::vector< MSLane * > & getBestLanesContinuation() const
Returns the subpart of best lanes that describes the vehicle's current lane and their successors...
A point in 2D or 3D with translation and scaling methods.
bool drawMinGap
Information whether the minimum gap shall be drawn.
static const RGBColor DEFAULT_COLOR
The default color (for vehicle types and vehicles)
double vehiclePoly_EVehicleFrontGlass[]
std::map< GUISUMOAbstractView *, int > myAdditionalVisualizations
Enabled visualisations, per view.
std::list< Stop > myStops
The vehicle's list of stops.
ConstMSEdgeVector::const_iterator MSRouteIterator
show vehicle's current route
MSLane * getPreviousLane(MSLane *current, int &furtherIndex) const
bool isStopped() const
Returns whether the vehicle is at a stop.
double vehiclePoly_TransportLeftGlass[]
MSLane * myLane
The lane the vehicle is on.
Blinker lights on both sides are switched on.
const ConstMSEdgeVector & getEdges() const
const T getColor(const SUMOReal value) const
void setPositionInVehicle(const Position &pos)
double vehiclePoly_DeliveryMediumLeftGlass[]
render as a (city) rail without locomotive
double vehiclePoly_PassengerWagonBackGlass[]
RGBColor changedBrightness(int change, int toChange=3) const
Returns a new color with altered brightness.
std::vector< LinkLeader > LinkLeaders
static void drawPoly(double *poses, SUMOReal offset)
MSDevice_Vehroutes * myRoutes
int getNumPassengers() const
return the number of passengers
Show all vehicle's routes.
static std::string getName(const SUMOEmissionClass c)
Checks whether the string describes a known vehicle class.
SUMOReal getMaxDecel() const
Get the vehicle type's maximum deceleration [m/s^2].
StringBijection< SUMOVehicleClass > SumoVehicleClassStrings(sumoVehicleClassStringInitializer, SVC_CUSTOM2, false)
const std::vector< MSTransportable * > & getContainers() const
Returns the list of containers using this vehicle.
render as a passenger vehicle
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)
unsigned int getPersonCapacity() const
Get this vehicle type's person capacity.
const int VEHPARS_COLOR_SET
bool isParking() const
Returns whether the vehicle is parking.
PositionVector mySeatPositions
positions of seats in the vehicle (updated at every drawing step)
SUMOReal getHarmonoise_NoiseEmissions() const
Returns noise emissions of the current state.
static void drawLinkItem(const Position &pos, SUMOTime arrivalTime, SUMOTime leaveTime, SUMOReal exagerate)
std::string line
The vehicle's line (mainly for public transport)
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
SUMOVehicleShape getGuiShape() const
Get this vehicle type's shape.
MFXMutex myLock
The mutex used to avoid concurrent updates of the vehicle buffer.
SUMOReal getNOxEmissions() const
Returns NOx emission of the current state.
Show vehicle's best lanes.
static void removeObject(GUIGlObject &o)
Removes all instances that pass values from the object with the given id.
void setPositionInVehicle(const Position &pos)
SUMOReal getPMxEmissions() const
Returns PMx emission of the current state.
SUMOReal getCOEmissions() const
Returns CO emission of the current state.
void computeSeats(const Position &front, const Position &back, int &requiredSeats) const
add seats to mySeatPositions and update requiredSeats
void drawAction_drawVehicleBrakeLight(const GUIVehicle &veh, SUMOReal length)
const MSJunction * getJunction() const
return the junction to which this link belongs
void unlock()
release mutex lock
Hide all vehicle's routes.
Hide vehicle's best lanes.
SUMOReal getWidth() const
Get the width which vehicles of this class shall have when being drawn.
Hide vehicle's current route.
void push_back(const PositionVector &p)
Appends all positions from the given vector.
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
Boundary & grow(SUMOReal by)
extends the boundary by the given amount
const Position & getSeatPosition(size_t personIndex) const
returns the seat position for the person with the given index
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
Structure representing possible vehicle parameter.
double vehiclePoly_PassengerVanLeftGlass[]
void drawAction_drawVehicleAsBoxPlus() const
MSRouteIterator end() const
Returns the end of the list of edges to pass.
SUMOVehicleShape
Definition of vehicle classes to differ between different appearences.
render as a arbitrary ship
A MSNet extended by some values for usage within the gui.
void drawRoute(const GUIVisualizationSettings &s, int routeNo, SUMOReal darken) const
Chooses the route to draw and draws it, darkening it as given.
MSLane * getViaLaneOrLane() const
return the via lane if it exists and the lane otherwise
SUMOReal getAcceleration() const
Returns the vehicle's acceleration in m/s.
double vehiclePoly_PassengerVanBodyFront[]
SUMOReal y() const
Returns the y-position.
SUMOReal getFuelConsumption() const
Returns fuel consumption of the current state.
const MSVehicleType & getVehicleType() const
Returns the vehicle's type definition.
static MSDevice_Vehroutes * buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into, unsigned int maxRoutes=INT_MAX)
Build devices for the given vehicle, if needed.
SUMOReal getChosenSpeedFactor() const
Returns the precomputed factor by which the driver wants to be faster than the speed limit...
void buildSelectionPopupEntry(GUIGLObjectPopupMenu *ret, bool addSeparator=true)
Builds an entry which allows to (de)select the object.
const std::string & getID() const
Returns the name of the vehicle type.
void drawAction_drawBlinker(double dir, SUMOReal length)
SUMOReal getSpeed() const
Returns the vehicle's current speed.
const SUMOVehicleParameter & getParameter() const
Returns the vehicle's parameter (including departure definition)
SUMOReal getWaitingSeconds() const
Returns the number of seconds waited (speed was lesser than 0.1m/s)
const RGBColor & getColor() const
Returns this type's color.
double vehiclePoly_PassengerSedanBackGlass[]
double vehiclePoly_PassengerHatchbackBackGlass[]
unsigned size() const
Returns the number of edges to pass.
const PositionVector & getShape() const
Returns this lane's shape.
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
render as a (futuristic) e-vehicle
static void drawLine(const Position &beg, SUMOReal rot, SUMOReal visLength)
Draws a thin line.
void drawAction_drawRailCarriages(const GUIVisualizationSettings &s, SUMOReal defaultLength, SUMOReal carriageGap, int firstPassengerCarriage, bool asImage) const
void move2side(SUMOReal amount)
#define BLINKER_POS_FRONT
unsigned int getContainerCapacity() const
Get this vehicle type's container capacity.
const RGBColor & getColor() const
Returns the color.
std::string getImgFile() const
Get this vehicle type's raster model file name.
GUIVisualizationSizeSettings vehicleSize
SUMOReal ymax() const
Returns maximum y-coordinate.
double vehiclePoly_PassengerVanFrontGlass[]
show vehicle's best lanes
void drawRouteHelper(const MSRoute &r, SUMOReal exaggeration) const
Draws the route.
int vehicleQuality
The quality of vehicle drawing.
double vehiclePoly_TransportRightGlass[]
double vehiclePoly_DeliveryMediumRightGlass[]
static SUMOReal getRange()
Returns the configured range.
double vehiclePoly_PassengerVanBody[]
SUMOReal getVehicleMaxSpeed(const SUMOVehicle *const veh) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
SUMOEmissionClass getEmissionClass() const
Get this vehicle type's emission class.
MSLane * getLane() const
Returns the lane the vehicle is on.
render as a transport vehicle with one trailer
render as a wagon passenger vehicle ("Combi")
SUMOReal getTimeGap() const
Returns the time gap in seconds to the leader of the vehicle looking for a fixed distance.
double vehiclePoly_PassengerVanBackGlass[]
double vehiclePoly_PassengerWagonLeftGlass[]
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.
MSDevice_Container * myContainerDevice
The containers this vehicle may have.
std::vector< MSDevice * > myDevices
The devices this vehicle has.
A window containing a gl-object's parameter.
const int VTYPEPARS_COLOR_SET
render as a semi-trailer transport vehicle ("Sattelschlepper")
bool opened(SUMOTime arrivalTime, SUMOReal arrivalSpeed, SUMOReal leaveSpeed, SUMOReal vehicleLength, SUMOReal impatience, SUMOReal decel, SUMOTime waitingTime, std::vector< const SUMOVehicle * > *collectFoes=0) const
Returns the information whether the link may be passed.
double vehiclePoly_PassengerHatchbackLeftGlass[]
void drawGL(const GUIVisualizationSettings &s) const
Draws the object.
double vehiclePoly_PassengerSedanRightGlass[]
SUMOReal getExaggeration(const GUIVisualizationSettings &s) const
return the drawing size including exaggeration and constantSize values
MSDevice_Person * myPersonDevice
The passengers this vehicle may have.
double vehiclePoly_PassengerSedanLeftGlass[]
Start to track a vehicle.
int getBestLaneOffset() const
returns the current offset from the best lane
MSRouteIterator begin() const
Returns the begin of the list of edges to pass.
void addActiveAddVisualisation(GUISUMOAbstractView *const parent, int which)
Adds the named visualisation feature to the given view.
void buildPopupHeader(GUIGLObjectPopupMenu *ret, GUIMainWindow &app, bool addSeparator=true)
Builds the header.
SUMOReal getAngle() const
Returns the vehicle's direction in degrees.
SUMOReal myCarriageLength
Variable to set with the length of the last drawn carriage or the vehicle length. ...
const std::string & getID() const
Returns the name of the vehicle.
const PositionVector & getShape() const
const MSRoute * getRoute(int index) const
Called on route retrieval.
static RGBColor getColor()
gets the gl-color
static int getTextureID(const std::string &filename)
return texture id for the given filename (initialize on first use)
A MSVehicle extended by some values for usage within the gui.