46 #ifdef CHECK_MEMORY_LEAKS
48 #endif // CHECK_MEMORY_LEAKS
74 :
FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (
FXObject*) 0, (FXSelector) 0, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y),
75 myParent(&parent), myApplication(&app) {}
85 int widthInPixels = getWidth();
86 int heightInPixels = getHeight();
87 if (widthInPixels != 0 && heightInPixels != 0) {
88 glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
89 glClearColor(0, 0, 0, 1);
90 glDisable(GL_DEPTH_TEST);
91 glDisable(GL_LIGHTING);
92 glDisable(GL_LINE_SMOOTH);
94 glEnable(GL_ALPHA_TEST);
95 glDisable(GL_COLOR_MATERIAL);
97 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
111 int widthInPixels = getWidth();
112 int heightInPixels = getHeight();
113 if (widthInPixels != 0 && heightInPixels != 0) {
114 glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
115 glClearColor(0, 0, 0, 1);
116 glDisable(GL_DEPTH_TEST);
117 glDisable(GL_LIGHTING);
118 glDisable(GL_LINE_SMOOTH);
120 glEnable(GL_ALPHA_TEST);
121 glDisable(GL_COLOR_MATERIAL);
123 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
125 glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
126 myParent->drawValues(*
this);
156 :
FXMainWindow(app.getApp(), "TLS-Tracker", NULL, NULL, DECOR_ALL,
162 new FXToolBarGrip(
myToolBar,
myToolBar, FXToolBar::ID_TOOLBARGRIP, TOOLBARGRIP_DOUBLE);
173 app.addChild(
this,
true);
177 FXVerticalFrame* glcanvasFrame =
178 new FXVerticalFrame(
this,
179 FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
180 0, 0, 0, 0, 0, 0, 0, 0);
183 setTitle((logic.getID() +
" - " + logic.getProgramID() +
" - tracker").c_str());
193 :
FXMainWindow(app.getApp(),
"TLS-Tracker", NULL, NULL, DECOR_ALL,
199 setTitle(
"TLS-Tracker");
204 FXVerticalFrame* glcanvasFrame =
205 new FXVerticalFrame(
this,
206 FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
207 0, 0, 0, 0, 0, 0, 0, 0);
229 FXMainWindow::create();
241 size_t leftOffset = 0;
248 MSSimpleTrafficLightLogic::Phases::const_iterator j;
251 for (j = phases.begin(); j != phases.end(); ++j) {
264 DurationsVector::reverse_iterator i =
myDurations.rbegin();
266 if (durs + (*i) > beginOffset) {
279 leftOffset = beginOffset - durs;
284 glMatrixMode(GL_PROJECTION);
286 glMatrixMode(GL_MODELVIEW);
288 glTranslated(-1, -1, 0);
290 glDisable(GL_TEXTURE_2D);
308 glVertex2d((
SUMOReal)(30. / width), h);
311 if (i < myTLLogic->getLinks().size()) {
312 glRotated(180, 1, 0, 0);
314 glTranslated(0.0, -h + h20 - h4, 0);
316 glTranslated(-0.0, h - h20 + h4, 0);
317 glRotated(-180, 1, 0, 0);
323 glVertex2d(0, h + h20);
324 glVertex2d(1.0, h + h20);
331 glVertex2d((
SUMOReal) 30 / width, 1.0);
332 glVertex2d((
SUMOReal) 30 / width, h);
353 size_t duration = *pd - fpo;
363 LinkState state = (*pi).getSignalState(j);
368 glColor3d(0, 1.0, 0);
370 glVertex2d(x, h - h16);
371 glVertex2d(x, h - h4);
372 glVertex2d(x2, h - h4);
373 glVertex2d(x2, h - h16);
378 glColor3d(1.0, 1.0, 0);
380 glVertex2d(x, h - h16);
381 glVertex2d(x, h - h4);
382 glVertex2d(x2, h - h4);
383 glVertex2d(x2, h - h16);
387 glColor3d(1.0, 0, 0);
389 glVertex2d(x, h - h10);
390 glVertex2d(x2, h - h10);
415 while (t > (width - 31.) / 4.) {
417 t -= (
SUMOReal)((width - 31.) / 4.);
428 while (pos < width + 50) {
431 glRotated(180, 1, 0, 0);
433 glTranslated(glpos - w / 2., -glh + h20 - h4, 0);
435 glTranslated(-glpos + w / 2., glh - h20 + h4, 0);
436 glRotated(-180, 1, 0, 0);
439 glVertex2d(glpos, glh);
440 glVertex2d(glpos, glh - h4);
446 currTime += tickDist;
476 FXSelector sel,
void* data) {
478 return FXMainWindow::onConfigure(sender, sel, data);
484 FXSelector sel,
void* data) {
486 return FXMainWindow::onPaint(sender, sel, data);