47 #ifdef CHECK_MEMORY_LEAKS
49 #endif // CHECK_MEMORY_LEAKS
75 :
FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (
FXObject*) 0, (FXSelector) 0, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y),
76 myParent(&parent), myApplication(&app) {}
86 int widthInPixels = getWidth();
87 int heightInPixels = getHeight();
88 if (widthInPixels != 0 && heightInPixels != 0) {
89 glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
90 glClearColor(0, 0, 0, 1);
91 glDisable(GL_DEPTH_TEST);
92 glDisable(GL_LIGHTING);
93 glDisable(GL_LINE_SMOOTH);
95 glEnable(GL_ALPHA_TEST);
96 glDisable(GL_COLOR_MATERIAL);
98 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
112 int widthInPixels = getWidth();
113 int heightInPixels = getHeight();
114 if (widthInPixels != 0 && heightInPixels != 0) {
115 glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
116 glClearColor(0, 0, 0, 1);
117 glDisable(GL_DEPTH_TEST);
118 glDisable(GL_LIGHTING);
119 glDisable(GL_LINE_SMOOTH);
121 glEnable(GL_ALPHA_TEST);
122 glDisable(GL_COLOR_MATERIAL);
124 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
126 glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
127 myParent->drawValues(*
this);
157 :
FXMainWindow(app.getApp(), "TLS-Tracker", NULL, NULL, DECOR_ALL,
163 new FXToolBarGrip(
myToolBar,
myToolBar, FXToolBar::ID_TOOLBARGRIP, TOOLBARGRIP_DOUBLE);
174 app.addChild(
this,
true);
178 FXVerticalFrame* glcanvasFrame =
179 new FXVerticalFrame(
this,
180 FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
181 0, 0, 0, 0, 0, 0, 0, 0);
184 setTitle((logic.getID() +
" - " + logic.getProgramID() +
" - tracker").c_str());
194 :
FXMainWindow(app.getApp(),
"TLS-Tracker", NULL, NULL, DECOR_ALL,
200 setTitle(
"TLS-Tracker");
205 FXVerticalFrame* glcanvasFrame =
206 new FXVerticalFrame(
this,
207 FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
208 0, 0, 0, 0, 0, 0, 0, 0);
230 FXMainWindow::create();
242 size_t leftOffset = 0;
249 MSSimpleTrafficLightLogic::Phases::const_iterator j;
252 for (j = phases.begin(); j != phases.end(); ++j) {
265 DurationsVector::reverse_iterator i =
myDurations.rbegin();
267 if (durs + (*i) > beginOffset) {
280 leftOffset = beginOffset - durs;
285 glMatrixMode(GL_PROJECTION);
287 glMatrixMode(GL_MODELVIEW);
289 glTranslated(-1, -1, 0);
291 glDisable(GL_TEXTURE_2D);
309 glVertex2d((
SUMOReal)(30. / width), h);
312 if (i < myTLLogic->getLinks().size()) {
313 glRotated(180, 1, 0, 0);
315 glTranslated(0.0, -h + h20 - h4, 0);
317 glTranslated(-0.0, h - h20 + h4, 0);
318 glRotated(-180, 1, 0, 0);
324 glVertex2d(0, h + h20);
325 glVertex2d(1.0, h + h20);
332 glVertex2d((
SUMOReal) 30 / width, 1.0);
333 glVertex2d((
SUMOReal) 30 / width, h);
354 size_t duration = *pd - fpo;
364 LinkState state = (*pi).getSignalState(j);
369 glColor3d(0, 1.0, 0);
371 glVertex2d(x, h - h16);
372 glVertex2d(x, h - h4);
373 glVertex2d(x2, h - h4);
374 glVertex2d(x2, h - h16);
379 glColor3d(1.0, 1.0, 0);
381 glVertex2d(x, h - h16);
382 glVertex2d(x, h - h4);
383 glVertex2d(x2, h - h4);
384 glVertex2d(x2, h - h16);
388 glColor3d(1.0, 0, 0);
390 glVertex2d(x, h - h10);
391 glVertex2d(x2, h - h10);
416 while (t > (width - 31.) / 4.) {
418 t -= (
SUMOReal)((width - 31.) / 4.);
429 while (pos < width + 50) {
432 glRotated(180, 1, 0, 0);
434 glTranslated(glpos - w / 2., -glh + h20 - h4, 0);
436 glTranslated(-glpos + w / 2., glh - h20 + h4, 0);
437 glRotated(-180, 1, 0, 0);
440 glVertex2d(glpos, glh);
441 glVertex2d(glpos, glh - h4);
447 currTime += tickDist;
477 FXSelector sel,
void* data) {
479 return FXMainWindow::onConfigure(sender, sel, data);
485 FXSelector sel,
void* data) {
487 return FXMainWindow::onPaint(sender, sel, data);