67 : FXGLCanvas(c, app.getGLVisual(), app.getBuildGLCanvas(), (FXObject*)
nullptr, (FXSelector) 0, LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y),
76 FXObject*, FXSelector,
void*) {
78 int widthInPixels = getWidth();
79 int heightInPixels = getHeight();
80 if (widthInPixels != 0 && heightInPixels != 0) {
81 glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
82 glClearColor(0, 0, 0, 1);
83 glDisable(GL_DEPTH_TEST);
84 glDisable(GL_LIGHTING);
85 glDisable(GL_LINE_SMOOTH);
87 glEnable(GL_ALPHA_TEST);
88 glDisable(GL_COLOR_MATERIAL);
90 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
99 FXObject*, FXSelector,
void*) {
104 int widthInPixels = getWidth();
105 int heightInPixels = getHeight();
106 if (widthInPixels != 0 && heightInPixels != 0) {
107 glViewport(0, 0, widthInPixels - 1, heightInPixels - 1);
108 glClearColor(0, 0, 0, 1);
109 glDisable(GL_DEPTH_TEST);
110 glDisable(GL_LIGHTING);
111 glDisable(GL_LINE_SMOOTH);
113 glEnable(GL_ALPHA_TEST);
114 glDisable(GL_COLOR_MATERIAL);
116 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
118 glClear(GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
119 myParent->drawValues(*
this);
149 : FXMainWindow(app.getApp(), "TLS-Tracker",
nullptr,
nullptr, DECOR_ALL,
163 new FXLabel(
myToolBar,
"(s)",
nullptr, LAYOUT_CENTER_Y);
171 FXVerticalFrame* glcanvasFrame =
172 new FXVerticalFrame(
this,
173 FRAME_SUNKEN | LAYOUT_SIDE_TOP | LAYOUT_FILL_X | LAYOUT_FILL_Y,
174 0, 0, 0, 0, 0, 0, 0, 0);
177 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);
223 FXMainWindow::create();
242 if (simpleTLLogic ==
nullptr) {
246 MSSimpleTrafficLightLogic::Phases::const_iterator j;
249 for (j = phases.begin(); j != phases.end(); ++j) {
255 WRITE_ERROR(
"Overflow in time computation occurred.");
266 DurationsVector::reverse_iterator i =
myDurations.rbegin();
268 if (durs + (*i) > beginOffset) {
281 leftOffset = beginOffset - durs;
286 glMatrixMode(GL_PROJECTION);
288 glMatrixMode(GL_MODELVIEW);
290 glTranslated(-1, -1, 0);
292 glDisable(GL_TEXTURE_2D);
296 const double height = (double) caller.getHeight();
297 const double width = (double) caller.getWidth();
298 const double barWidth =
MAX2(1.0, width - 31);
299 const double fontHeight = 0.08 * 300. / height;
300 const double fontWidth = 0.08 * 300. / width;
301 const double h9 = ((double) 9 / height);
302 const double h10 = ((double) 10 / height);
303 const double h11 = ((double) 11 / height);
304 const double h16 = ((double) 16 / height);
305 const double h20 = ((double) 20 / height);
307 double h = (double)(1.0 - h10);
313 glVertex2d((
double)(30. / width), h);
317 glTranslated(0, h - h20, 0);
319 glTranslated(0, -h + h20, 0);
325 glVertex2d(0, h + h20);
326 glVertex2d(1.0, h + h20);
330 h += (double) 20 / height;
333 glVertex2d((
double) 30 / width, 1.0);
334 glVertex2d((
double) 30 / width, h);
342 double x = ((double) 31. / width);
343 double ta = (double) leftOffset / width;
358 h = (double)(1.0 - h10);
359 double a = (double) duration / width;
361 const double x2 = x + a;
374 glVertex2d(x, h - h11);
375 glVertex2d(x, h - h9);
376 glVertex2d(x2, h - h9);
377 glVertex2d(x2, h - h11);
383 glVertex2d(x, h - h16);
386 glVertex2d(x2, h - h16);
408 while (t > barWidth / 4.) {
410 t -= (double)(barWidth / 4.);
419 double glpos = (double) pos / width;
420 const double ticSize = 4 / height;
421 while (pos < width + 50) {
423 const double w = 50 / width;
424 glTranslated(glpos - w / 2., glh - h20, 0);
426 glTranslated(-glpos + w / 2., -glh + h20, 0);
429 glVertex2d(glpos, glh);
430 glVertex2d(glpos, glh - ticSize);
436 currTime += tickDist;
466 FXSelector sel,
void* data) {
468 return FXMainWindow::onConfigure(sender, sel, data);
474 FXSelector sel,
void* data) {
476 return FXMainWindow::onPaint(sender, sel, data);