66 : FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (FXObject*)
nullptr, (FXSelector) 0, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y),
75 FXObject*, FXSelector,
void*) {
77 int widthInPixels = getWidth();
78 int heightInPixels = getHeight();
79 if (widthInPixels != 0 && heightInPixels != 0) {
80 glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
81 glClearColor(0, 0, 0, 1);
82 glDisable(GL_DEPTH_TEST);
83 glDisable(GL_LIGHTING);
84 glDisable(GL_LINE_SMOOTH);
86 glEnable(GL_ALPHA_TEST);
87 glDisable(GL_COLOR_MATERIAL);
89 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
98 FXObject*, FXSelector,
void*) {
103 int widthInPixels = getWidth();
104 int heightInPixels = getHeight();
105 if (widthInPixels != 0 && heightInPixels != 0) {
106 glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
107 glClearColor(0, 0, 0, 1);
108 glDisable(GL_DEPTH_TEST);
109 glDisable(GL_LIGHTING);
110 glDisable(GL_LINE_SMOOTH);
112 glEnable(GL_ALPHA_TEST);
113 glDisable(GL_COLOR_MATERIAL);
115 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
117 glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
118 myParent->drawValues(*
this);
148 : FXMainWindow(app.getApp(), "TLS-Tracker",
nullptr,
nullptr, DECOR_ALL,
162 new FXLabel(
myToolBar,
"(s)",
nullptr, LAYOUT_CENTER_Y);
170 FXVerticalFrame* glcanvasFrame =
171 new FXVerticalFrame(
this,
172 FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
173 0, 0, 0, 0, 0, 0, 0, 0);
176 setTitle((logic.getID() +
" - " + logic.getProgramID() +
" - tracker").c_str());
187 : FXMainWindow(app.getApp(),
"TLS-Tracker", nullptr, nullptr, DECOR_ALL,
193 setTitle(
"TLS-Tracker");
198 FXVerticalFrame* glcanvasFrame =
199 new FXVerticalFrame(
this,
200 FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
201 0, 0, 0, 0, 0, 0, 0, 0);
224 FXMainWindow::create();
243 if (simpleTLLogic ==
nullptr) {
247 MSSimpleTrafficLightLogic::Phases::const_iterator j;
250 for (j = phases.begin(); j != phases.end(); ++j) {
256 WRITE_ERROR(
"Overflow in time computation occurred.");
267 DurationsVector::reverse_iterator i =
myDurations.rbegin();
269 if (durs + (*i) > beginOffset) {
282 leftOffset = beginOffset - durs;
287 glMatrixMode(GL_PROJECTION);
289 glMatrixMode(GL_MODELVIEW);
291 glTranslated(-1, -1, 0);
293 glDisable(GL_TEXTURE_2D);
297 const double height = (double) caller.getHeight();
298 const double width = (double) caller.getWidth();
299 const double barWidth =
MAX2(1.0, width - 31);
300 const double fontHeight = 0.08 * 300. / height;
301 const double fontWidth = 0.08 * 300. / width;
302 const double h9 = ((double) 9 / height);
303 const double h10 = ((double) 10 / height);
304 const double h11 = ((double) 11 / height);
305 const double h16 = ((double) 16 / height);
306 const double h20 = ((double) 20 / height);
308 double h = (double)(1.0 - h10);
314 glVertex2d((
double)(30. / width), h);
318 glTranslated(0, h - h20, 0);
320 glTranslated(0, -h + h20, 0);
326 glVertex2d(0, h + h20);
327 glVertex2d(1.0, h + h20);
331 h += (double) 20 / height;
334 glVertex2d((
double) 30 / width, 1.0);
335 glVertex2d((
double) 30 / width, h);
343 double x = ((double) 31. / width);
344 double ta = (double) leftOffset / width;
359 h = (double)(1.0 - h10);
360 double a = (double) duration / width;
362 const double x2 = x + a;
375 glVertex2d(x, h - h11);
376 glVertex2d(x, h - h9);
377 glVertex2d(x2, h - h9);
378 glVertex2d(x2, h - h11);
384 glVertex2d(x, h - h16);
387 glVertex2d(x2, h - h16);
409 while (t > barWidth / 4.) {
411 t -= (double)(barWidth / 4.);
420 double glpos = (double) pos / width;
421 const double ticSize = 4 / height;
422 while (pos < width + 50) {
426 const double w = 50 / width;
427 glTranslated(glpos - w / 2., glh - h20, 0);
429 glTranslated(-glpos + w / 2., -glh + h20, 0);
432 glVertex2d(glpos, glh);
433 glVertex2d(glpos, glh - ticSize);
439 currTime += tickDist;
469 FXSelector sel,
void* data) {
471 return FXMainWindow::onConfigure(sender, sel, data);
477 FXSelector sel,
void* data) {
479 return FXMainWindow::onPaint(sender, sel, data);