331 if (simpleTLLogic ==
nullptr) {
356 DurationsVector::reverse_iterator i =
myDurations.rbegin();
358 if (durs + (*i) > beginOffset) {
371 leftOffset = beginOffset - durs;
379 if (durs + (*i) > beginOffset) {
399 if (durs + (*i) > beginOffset) {
416 glMatrixMode(GL_PROJECTION);
418 glMatrixMode(GL_MODELVIEW);
420 glTranslated(-1, -1, 0);
422 glDisable(GL_TEXTURE_2D);
426 const double panelHeight = (double) caller.getHeight();
427 const double panelWidth = (double) caller.getWidth();
428 const double barWidth =
MAX2(1.0, panelWidth - 31);
429 const double fontHeight = 0.06 * 300. / panelHeight;
430 const double fontWidth = 0.06 * 300. / panelWidth;
431 const double h9 = 9. / panelHeight;
432 const double hTop = 20. / panelHeight;
433 const double h11 = 11. / panelHeight;
434 const double stateHeight = 16. / panelHeight;
435 const double h20 = 20. / panelHeight;
436 const double h30 = 15. / panelHeight;
437 const double h35 = 34. / panelHeight;
438 const double h60 = 70. / panelHeight;
439 const double h75 = 73. / panelHeight;
440 const double h80 = 90. / panelHeight;
441 const double w30 = 30 / panelWidth;
442 double h = 1. - hTop;
452 glVertex2d(0, h + h20);
453 glVertex2d(1.0, h + h20);
468 const double top = h;
475 glVertex2d(0, h + h20);
476 glVertex2d(1.0, h + h20);
481 glVertex2d(30. / panelWidth, top);
482 glVertex2d(30. / panelWidth, h + h20);
488 const double top = h;
495 glVertex2d(0, h + h20);
496 glVertex2d(1.0, h + h20);
501 glVertex2d(30. / panelWidth, top);
502 glVertex2d(30. / panelWidth, h + h20);
511 double x = 31. / panelWidth;
512 double ta = (double) leftOffset / panelWidth;
521 const bool phaseNames =
myIndexMode->getCheck() == TRUE;
522 std::string lastName =
"";
523 double spaceForName = 0;
526 std::vector<SUMOTime> runningGreen(
myTLLogic->getLinks().size(), 0);
532 double a = (double) duration / panelWidth;
534 const double x2 = x + a;
537 for (
int j = 0; j < (int)
myTLLogic->getLinks().size(); ++j) {
547 glVertex2d(x, h - h11);
548 glVertex2d(x, h - h9);
549 glVertex2d(x2, h - h9);
550 glVertex2d(x2, h - h11);
556 glVertex2d(x, h - stateHeight);
559 glVertex2d(x2, h - stateHeight);
570 runningGreen[j] += *pd;
572 drawnDuration = runningGreen[j];
573 xOffset = -(double)(drawnDuration - *pd) / panelWidth * (barWidth / ((double)(
myLastTime -
myBeginTime)));
577 if (runningGreen[j] > 0) {
578 drawnDuration = runningGreen[j];
583 if (drawnDuration > 0) {
594 std::string name = phaseNames ? pi->getName() :
toString(*ii);
595 if (name != lastName) {
597 if (spaceForName < lastNameWidth) {
601 glVertex2d(x, 1 - fontHeight);
604 glVertex2d(1, 1 - fontHeight);
624 glColor3d(0.7, 0.7, 1.0);
626 panelWidth, (
double)leftOffset, barWidth, stateHeight, h20, h);
630 glColor3d(0.9, 0.6, 0.9);
632 panelWidth, (
double)leftOffset, barWidth, stateHeight, h20, h);
643 while (t > barWidth / 4.) {
649 double glh = 1. - (double)
myTLLogic->getLinks().size() * h20 - hTop;
653 double glpos = 31. / panelWidth;
654 const double ticSize = 4. / panelHeight;
655 if (leftOffset > 0) {
656 const double a =
STEPS2TIME(leftOffset) * barWidth / timeRange;
657 glpos += a / panelWidth;
658 currTime += leftOffset;
661 glpos += a / panelWidth;
665 const bool mmSS =
myTimeMode->getCurrentItem() == 1;
666 const bool cycleTime =
myTimeMode->getCurrentItem() == 2;
673 ticShift = (ticShift % 3) + 1;
674 const std::string timeStr = (mmSS
678 const double w = 10 * (double)timeStr.size() / panelWidth;
679 glTranslated(glpos - w / 2., glh - h20 * ticShift, 0);
681 glTranslated(-glpos + w / 2., -glh + h20 * ticShift, 0);
686 glVertex2d(glpos, glh);
687 glVertex2d(glpos, glh - ticSize * ticShift);
693 if (!phaseNames || (pi->getName() != lastName)) {
694 glColor3d(0.4, 0.4, 0.4);
696 glVertex2d(glpos, hStart);
698 glVertex2d(glpos, hStart);
701 lastName = pi->getName();
705 glColor3d(0.4, 0.4, 0.4);
707 glVertex2d(glpos, hStart);
709 glVertex2d(glpos, hStart);
714 glColor3d(0.4, 0.4, 0.4);
716 glVertex2d(glpos, hStart);
723 if (timeInCycle == 0 || timeInCycle < lastTimeInCycle) {
724 const double cycle0pos = glpos -
STEPS2TIME(timeInCycle) * barWidth / timeRange / panelWidth;
725 if (cycle0pos >= 31 / panelWidth) {
726 glColor3d(0.6, 0.6, 0.6);
728 glVertex2d(cycle0pos, 1);
729 glVertex2d(cycle0pos, glh);
735 lastTimeInCycle = timeInCycle;
737 const double a =
STEPS2TIME(tickDist) * barWidth / timeRange;
738 glpos += a / panelWidth;
739 currTime += tickDist;
749 while (t > barWidth / 4.) {
757 glpos = (double) pos / panelWidth;
758 if (leftOffset > 0) {
759 const double a =
STEPS2TIME(leftOffset) * barWidth / timeRange;
761 glpos += a / panelWidth;
762 currTime += leftOffset;
766 glpos += a / panelWidth;
769 while (pos < panelWidth + 50.) {
770 const std::string timeStr = (mmSS
774 const double w = 10. * (double)timeStr.size() / panelWidth;
775 glTranslated(glpos - w / 2., glh - h20, 0);
777 glTranslated(-glpos + w / 2., -glh + h20, 0);
780 glVertex2d(glpos, glh);
781 glVertex2d(glpos, glh - ticSize);
786 glpos += a / panelWidth;
787 currTime += tickDist;