rock_widget_collection  0.1
SonarViewGL.cc
Go to the documentation of this file.
1 /*
2  * File: SonarViewGL.cc
3  * Author: Matthias Goldhoorn (matthias.goldhoorn@dfki.de)
4  *
5  */
6 
7 #include <stdexcept>
8 #include "SonarViewGL.h"
9 #include <QtCore/QtPlugin>
10 #include <QtOpenGL/QtOpenGL>
11 #include <math.h>
12 #include <stdio.h>
13 #include <iostream>
14 
15 #ifdef __APPLE__
16 #include <OpenGL/gl.h>
17 #include <GLUT/glut.h>
18 #else
19 #include <GL/gl.h>
20 #include <GL/glut.h>
21 #endif
22 
23 
24 SonarViewGL::SonarViewGL(ImageViewOld &parent,unsigned int maximumBearings):
25 ImageViewOldGL(parent),
26 maximumBearings(maximumBearings)
27 {
28  colors = new GLubyte[maximumBearings];
29  vertecies = new GLfloat[maximumBearings];
30  indices = new GLuint[maximumBearings];
31  wallDist = new GLuint[maximumBearings];
32  bearingList = new GLuint[maximumBearings];
33 
34  bearingChanged = new bool[maximumBearings];
35  listValid = new bool[maximumBearings];
36 
37  xRot = 0;//180*16;
38  yRot = 180*16;
39  zRot = 0;
40  xShift = 0;
41  yShift = 0;
42  zShift = 0;
43  zoom = 40;
44  zoom_min = -6000.0;
45  zoom_max = 6000.0;
48  factor=1;
49  //repaintTimer.setSingleShot(false);
50  //repaintTimer.setInterval(100);
51  //connect(&repaintTimer,SIGNAL(timeout()),this,SLOT(repaintFunc()));
52  //repaintTimer.start();
53 
54  for(int i=0;i<maximumBearings;i++){
55  glDeleteLists(bearingList[i], 1);
56  glDeleteLists(wallDist[i], 1);
57  bearingList[i] = glGenLists( 1 );
58  wallDist[i] = glGenLists( 1 );
59  glNewList( wallDist[i], GL_COMPILE );
60  glEndList();
61  glNewList( bearingList[i], GL_COMPILE );
62  glEndList();
63 // listValid=false;
64  }
65  createAvalon();
66  paintGroundTrue=true;
67  paintWall=true;
68  lastBearing=0;
70 }
71 
72 
73 
75  this->currentScale = currentScale;
76  createAvalon();
77 // mutex.lock();
78  for(int i=0;i<maximumBearings;i++){
79  glDeleteLists(bearingList[i], 1);
80  bearingList[i] = glGenLists( 1 );
81  glNewList( bearingList[i], GL_COMPILE );
82  glEndList();
83 // listValid=false;
84  }
85 // listValid[i]=false;
86 //
87 //
88  for(int i=0;i<maximumBearings;i++){
89  glDeleteLists(wallDist[i], 1);
90  wallDist[i] = glGenLists( 1 );
91  glNewList( wallDist[i], GL_COMPILE );
92  glEndList();
93  lastBearing=0;
95  }
96 // mutex.unlock();
97 }
98 
99 
100 
101 
102 void SonarViewGL::setData(const std::vector<uint8_t> data,int bearing){
103 // printf("Bearing %i\n",bearing);
104  //for(int i=0;i<data.size();i++){
105  // if(data[i]!= 0){
106  // printf("Got data value :%i\n",data[i]);
107  //}
108  //}
109 
110  if(bearing < 0 || bearing > maximumBearings){
111  fprintf(stderr,"Cannot Set bearing is out of range\n");
112  }
113 
114  if(data.size() != oldSize){
115  printf("deleteing lists new Size is: %i\n",(int)data.size());
116  oldSize = data.size();
117  delete colors;
118  delete indices;
119  delete vertecies;
120  colors = new GLubyte[data.size()*3*maximumBearings];
121  vertecies = new GLfloat[data.size()*3*maximumBearings];
122  indices = new GLuint[data.size()*3*maximumBearings];
123  //uint16_t c=0;
124  for(unsigned int i=0;i<data.size()*3*maximumBearings; i++){
125  colors[i]=0;
126  vertecies[i]=0;
127 
128  //if((i%3)==0){
129  // vertecies[i]=0.001*(i%6399);
130  // colors[i]=++c;
131  //}else{
132  // colors[i]=c;
133  // vertecies[i]=0;
134  //}
135  indices[i]=i;
136  }
137  }
138  int begin,end;
139  if(lastBearing-bearing>0 || lastBearing-bearing < -3000){
140  begin = lastBearing;
141  end = lastBearing-bearing;
142  }else{
143  begin = bearing;
144  end = bearing-lastBearing;
145  }
146 
147 
148  for(int j=0;j<end;j++){
149  int i = ((begin+j));
150  if(i < 0 || i > 6399){
151  fprintf(stderr,"Error in glwidet, please check value make no sense, prevent crash, not displaying data for index %i (%s:%i)\n",i,__FILE__,__LINE__);
152  break;
153  }
154 
155 
156  for(unsigned int k=0; k<data.size(); k+=3){
157  int value=data[k]*factor;
158  if(value<0)value=0;
159  if(value>255)value=255;
160  colors[k+0 + i*data.size()*3] = value;
161  colors[k+1 + i*data.size()*3 ] = value;
162  colors[k+2 + i*data.size()*3 ] = value;
163  }
164 
165  for(unsigned int k=0; k<data.size(); k+=3){
166  vertecies[k+0 + i*data.size()*3] = k*currentScale;
167  vertecies[k+1 + i*data.size()*3] = 0;
168  vertecies[k+2 + i*data.size()*3] = 0;
169  }
170  glDeleteLists(wallDist[i],1);
171  wallDist[i] = glGenLists( 1 );
172  glNewList( wallDist[i], GL_COMPILE );
173  glEndList();
174 
175  glDeleteLists(bearingList[i], 1);
176  bearingList[i] = glGenLists( 1 );
177  glNewList( bearingList[i], GL_COMPILE );
178  glEnableClientState(GL_COLOR_ARRAY);
179  glEnableClientState(GL_VERTEX_ARRAY);
180  glColorPointer(3,GL_UNSIGNED_BYTE,0,(void*)colors);
181  glVertexPointer(3,GL_FLOAT,0,(void*)vertecies);
182  glPushMatrix();
183  double rotate = (double)i/6399.0*360.0;
184  glRotated( rotate , 0.0, 0.0, 1.0);
185  //if(i == 300){
186  // printf("Making for bearing: %i Color: %i, value: %f index: %i\n ",i, colors[300+i*data.size()],vertecies[300+i*data.size()],indices[300+i*data.size()]);
187  if(i*data.size() > data.size()*3*maximumBearings){
188  fprintf(stderr,"CRITIACAL ERROR\n");
189  }
190  //glPolygonOffset(i,1e-10);
191  volatile GLuint *baseIndex = &indices[i*(data.size())];
192  //glDrawElements(GL_LINES, data.size(), GL_UNSIGNED_INT, (void*)baseIndex);
193  //glDrawElements(GL_LINES, data.size(), GL_UNSIGNED_INT, (void*)baseIndex);
194  //glDrawElements(GL_LINE_STRIP, data.size(), GL_UNSIGNED_INT, (void*)baseIndex);
195  glDrawElements(GL_POINTS, data.size(), GL_UNSIGNED_INT, (void*)baseIndex);
196  //
197 /*
198  glBegin(GL_LINE_STRIP);
199  for(unsigned int k=0; k<data.size(); k++){
200  double value=colors[k + i*data.size()]; //data[k]*factor;
201  if(value<0)value=0;
202  if(value>255)value=255;
203  QColor color(value,value,value);
204  qglColor(color);
205  double pos = vertecies[k + i*data.size()];
206  glVertex3f(k*currentScale,0,0);
207  }
208  glEnd();
209  */
210 
211  //}
212  checkGL((const char*)"after Draw");
213  glPopMatrix();
214  glDisableClientState(GL_COLOR_ARRAY);
215  glDisableClientState(GL_VERTEX_ARRAY);
216  glEndList();
217  }
218 
219 
220 
221 /*
222 
223  for(unsigned int k=0; k<data.size(); k++){
224  double value=data[k]*factor;
225  if(value<0)value=0;
226  if(value>255)value=255;
227  QColor color(value,value,value);
228  qglColor(color);
229  glVertex3f(k*currentScale,0,0);
230  }
231  glEnd();
232  */
233 
234 
235 #if 0
236  if(false){ //Paint the overlay
237  glBegin(GL_LINE_STRIP);
238  int p_max = 0;
239  int point;
240  for(unsigned int k=medium_ableitung; k<data.size()-medium_ableitung; k++){
241  int prevalues =0;
242  int aftervalues=0;
243  for(int p=1;p<medium_ableitung;p++){
244 
245  prevalues += max((data[k-p] - data[(int)max((k/2-p),0)]),0);
246  aftervalues += max((data[k+p] - data[(k/2+p)]),0);
247  }
248  double value= (((prevalues - aftervalues)*data[k])) *factor;
249  if(value<0)value=0;
250  if(value>255)value=255.0;
251 
252  if(value > p_max && k >10){
253  p_max=value;
254  point = k*currentScale;
255  }
256  QColor color(value,value,value);
257  qglColor(color);
258 
259  glVertex3f(k*currentScale,0,0);
260  /*
261  if(overlay_border >0){
262  if(value >= overlay_border)
263  glVertex3f(k*currentScale,0,0);
264  }else{
265  if(value < overlay_border)
266  glVertex3f(k*currentScale,0,0);
267 
268  }
269  */
270  }
271  glEnd();
272 
273  glBegin(GL_LINE_STRIP);//;GL_POINTS);
274  QColor color("red");
275  qglColor(color);
276  glVertex3f(0,0,0);
277  glVertex3f(point,0,0);
278  glEnd();
279  }
280 #endif
281 // }
282 
283  lastBearing = bearing;
284 // mutex.unlock();
285 }
286 
288 }
289 
290 
292  update();
293  updateGL(); //TODO not calling this?
294 
295 }
296 
298 {
299  //glDeleteLists(object, 1);
300 }
301 
303 {
304  return QSize(50, 50);
305 }
306 
308 {
309  return QSize(400, 400);
310 }
311 
313 {
314  normalizeAngle(&angle);
315  if (angle != xRot) {
316  xRot = angle;
317  emit xRotationChanged(angle);
318  //updateGL();
319  }
320 }
321 
323 {
324  normalizeAngle(&angle);
325  if (angle != yRot) {
326  yRot = angle;
327  emit yRotationChanged(angle);
328  //updateGL();
329  }
330 }
331 
333 {
334  normalizeAngle(&angle);
335  if (angle != zRot) {
336  zRot = angle;
337  emit zRotationChanged(angle);
338  //updateGL();
339  }
340 }
341 
343 {
344  xShift = value;
345  //printf("%d\n",xShift);
346  emit xPositionChanged(value);
347  //updateGL();
348 }
350 {
351  yShift = value;
352  emit yPositionChanged(value);
353  //updateGL();
354 }
356 {
357  zShift = value;
358  emit zPositionChanged(value);
359  //updateGL();
360 }
361 
363 {
364  //qglClearColor(QColor(0.1,0.1,0.0));
365  //qglClearColor(purple.light());
366  //qglClearColor(white);
367  qglClearColor(QColor(0.0,0.0,0.0));
368  glShadeModel(GL_FLAT);
369 
370  glEnable(GL_DEPTH_TEST);
371  //glDisable(GL_DEPTH_TEST);
372  //glEnable(GL_CULL_FACE);
373  //glDepthFunc(GL_ALWAYS);
374  //glDepthFunc(GL_LESS);
375  glDepthFunc(GL_LEQUAL);
376 // glClearDepth(0.0);
377  //glDepthFunc(GL_GEQUAL);
378 /*
379  GLfloat fogColor[4] = {0.5,0.5,0.5,1.0};
380 
381  glFogi (GL_FOG_MODE, GL_LINEAR); //set the fog mode to GL_EXP2
382  glFogfv (GL_FOG_COLOR, fogColor ); //set the fog color to our color chosen above
383  glFogf (GL_FOG_DENSITY, 0.5); //set the density to the value above
384  glHint (GL_FOG_HINT, GL_NICEST); // set the fog to look the nicest, may slow down on older cards
385 
386  glFogf(GL_FOG_START, 1.0f); // Fog Start Depth
387  glFogf(GL_FOG_END, 100.0f); // Fog End Depth
388  glDisable(GL_FOG); // Enables GL_FOG
389 
390  glEnable (GL_BLEND);
391  glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
392 
393  glEnable(GL_POINT_SMOOTH);
394  glEnable(GL_LINE_SMOOTH);
395 */
396 
397  groundPlane = glGenLists(1);
398  glNewList(groundPlane, GL_COMPILE);
399 
400  #if 1
401  // draw the grid
402  glDisable( GL_LIGHTING );
403  glDisable( GL_COLOR_MATERIAL ) ;
404 
405  float size = 50.0f;
406  float interval = 1.0f;
407 
408 
409  glColor4f(0.5f,0.5f,1.0f,0.5f);
410  glBegin(GL_LINES);
411  float x = - size*0.5f;
412  while( x <= size*0.5f ) {
413  glVertex3f(-size/2.0f, x, 0.01f);
414  glVertex3f(size/2.0f, x, 0.01f);
415  glVertex3f(x, -size/2.0f, 0.01f);
416  glVertex3f(x, size/2.0f, 0.01f);
417  x += interval;
418  }
419  glEnd();
420 
421  // draw concentric circles
422  float r;
423  for(r=0;r<size/2;r+=interval) {
424  glBegin(GL_LINES);
425  for(x=0;x<(2*3.14152);x+=(2*3.14152)/(r*100)) {
426  glVertex3f(cos(x)*r, sin(x)*r, 0.01f);
427  }
428  glEnd();
429  }
430  glEndList();
431  #endif
432 }
433 
434 void SonarViewGL::drawEllipse(float xradius, float yradius)
435 {
436  glBegin(GL_LINE_LOOP);
437  for(int i=0; i < 360; i++)
438  {
439  glVertex2f(cos(i/180.0*M_PI)*xradius,sin(i/180.0*M_PI)*yradius);
440  }
441  glEnd();
442 }
443 
444 
445 
447 // printf("PaintGL\n");
448  //set gui
449 // mutex.lock();
450  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
451  glLoadIdentity();
452  glTranslated(0, 0, -zoom);
453 
454  //glMultMatrixf(camera);
455  //set movments
456  glTranslated(double(xShift)/100.0+pos[0], double(yShift)/100.0+pos[1], double(zShift)/100.0);
457  glRotated(orientation, 1.0, 0.0, 0.0);
458  glRotated(xRot / 16.0, 1.0, 0.0, 0.0);
459  glRotated(yRot / 16.0, 0.0, 1.0, 0.0);
460  glRotated(zRot / 16.0, 0.0, 0.0, 1.0);
461 
462 
463  QColor color("yellow");
464  qglColor(color);
466 
467  //gllDist
468  // wlCallList(point_list);
469  //glCallList(groundPlane);
470  //Wegen Nebenläufigkeit die Punkte im GUI Thread zeichnen.
471  //if(paintGroundTrue)
472 // if(glIsList(groundTrue))
473 // glCallList(groundTrue);
474  // else
475  // printf("Error gorund true is not an list\n");
476  if(glIsList(avalon))
477  glCallList(avalon);
478 
479 
480 
481  //for(unsigned int i=0;i<colorList.size();i++){
482  // glCallList(colorList[i].first);
483  //}
484 // if(paintWall)
485  for(int i=0;i<maximumBearings;i++){
486  if(glIsList(wallDist[i])){
487  glCallList(wallDist[i]);
488  }
489  }
490  for(int i=0;i<maximumBearings;i++){
491  if(glIsList(bearingList[i])){
492  glCallList(bearingList[i]);
493  }
494  }
495 
496  // mutex.unlock();
497  //printf("Paint gl end\n");
498  }
499 
500 
501 void SonarViewGL::setWallDist(int bearing, int dist, int dist2){
502  //printf("Set Wall Dist\n");
503 // mutex.lock();
504 
505  int begin,end;
506  if(lastWallBearing-bearing>0 || lastWallBearing-bearing < -3000){
507  begin = lastWallBearing;
508  end = lastWallBearing-bearing;
509  }else{
510  begin = bearing;
511  end = bearing-lastWallBearing;
512  }
513 // printf("Maximum distance: %f\n",currentScale*data.size());
514  for(int j=0;j<end-2;j++){
515  int i = (begin+j)%6400;
516  if(i < 0 || i > 6399){
517  fprintf(stderr,"Error in glwidet, please check value make no sense, prevent crash, not displaying data for index %i (%s:%i)\n",i,__FILE__,__LINE__);
518  break;
519  }
520  //glDeleteLists(wallDist[i], 1);
521  }
522  lastWallBearing = bearing;
523 
524  glDeleteLists(wallDist[bearing], 1);
525  //generate new one
526  //checkGL("delete-list");
527  wallDist[bearing] = glGenLists( 1 );
528  //checkGL("generate-list");
529  glNewList( wallDist[bearing], GL_COMPILE );
530  //checkGL("new-list");
531  //checkGL("push-Matrix");
532  glPushMatrix();
533  double rotate = (double)bearing/6399.0*360.0;
534  glRotated( rotate, 0.0, 0.0, 1.0);
535  glPointSize(2.0);
536  glBegin(GL_POINTS);
537  QColor color("yellow");
538  qglColor(color);
539  glVertex3f(dist*currentScale,0,-0.1);
540  qglColor(QColor("green"));
541  glVertex3f(dist2*currentScale,0,-0.1);
542  glEnd();
543  glPopMatrix();
544  glEndList();
545 // mutex.unlock();
546 }
547 
548 
549  void SonarViewGL::resizeGL(int width, int height)
550  {
551  glViewport(0, 0, width, height);
552  glMatrixMode(GL_PROJECTION);
553  glLoadIdentity();
554  gluPerspective( 45.0, (float)width/(float)height, 1.0, 1000.0 );
555  glMatrixMode(GL_MODELVIEW);
556  }
557 
558  void SonarViewGL::mousePressEvent(QMouseEvent *event)
559  {
560  lastPos = event->pos();
561  lastPosTrans = event->pos();
562  repaintFunc();
563  }
564 
565  void SonarViewGL::mouseMoveEvent(QMouseEvent *event)
566  {
567  //int dx = event->x() - lastPos.x();
568  //int dy = event->y() - lastPos.y();
569 
570  int dxt = event->x() - lastPosTrans.x();
571  int dyt = event->y() - lastPosTrans.y();
572 
573  if (event->buttons() & Qt::LeftButton) {
574  //setXRotation(xRot + 8 * dy);
575  //setZRotation(zRot + 8 * dx);
576  setxPosition(xShift + dxt);
577  setyPosition(yShift - dyt);
578  }else if (event->buttons() & Qt::RightButton) {
579  zoom += (dyt+dxt)*0.05;
580  zoom = std::max<float>( std::min<float>( zoom, zoom_max ), zoom_min);
581  }
582 
583  lastPos = event->pos();
584  lastPosTrans = event->pos();
585 
586 // printf("Rot: %i,%i,%i, Pos, (%i,%i,%i), zoom: %f\n",xRot,yRot,zRot,xShift,yShift,zShift,zoom);
587 
588  repaintFunc();
589  }
590 
591  //Werte für die Anzeige setzen.
592  void SonarViewGL::setPosition(int xRot,int yRot, int zRot, int xMove, int yMove, int zMove, float zoom, int width, int height){
593  resize(width,height);
594  this->xRot = xRot;
595  this->yRot = yRot;
596  this->zRot = zRot;
597  this->xShift = xMove;
598  this->yShift = yMove;
599  this->zShift = zMove;
600  this->zoom = zoom;
601  //camera[2] = -zoom;
602 
603  }
604 
605 
606 void SonarViewGL::keyPressEvent ( QKeyEvent * event ){
607  switch (event->key()) {
608  case Qt::Key_W:
610  case Qt::Key_G:
612  break;
613  case Qt::Key_Q:
614  //Exit or do something
615  break;
616  case Qt::Key_I:
617  factor+=0.02;
618  printf("Gain %f\n",factor);
619  //Exit or do something
620  break;
621  case Qt::Key_D:
622  factor-=0.02;
623  printf("Gain %f\n",factor);
624  //Exit or do something
625  break;
626  case Qt::Key_O:
627  overlay_border+=1;
628  printf("Overlay border: %i\n",overlay_border);
629  break;
630  case Qt::Key_L:
631  overlay_border-=1;
632  printf("Overlay border: %i\n",overlay_border);
633  break;
634  case Qt::Key_A:
635  medium_ableitung+=1;
636  printf("Ableitungglaettung: %i\n",medium_ableitung);
637  break;
638  case Qt::Key_Y:
639  medium_ableitung-=1;
640  printf("Ableitungglaettung: %i\n",medium_ableitung);
641  break;
642  default:
643  return;
644  }
645  repaintFunc();
646  }
647 
648  void SonarViewGL::wheelEvent(QWheelEvent *event)
649  {
650  zoom -= (2.0*(float)event->delta()/120.0)*5;
651  zoom = std::max<float>( std::min<float>( zoom, zoom_max ), zoom_min);
652  event->accept();
653  // updateGL();
654  repaintFunc();
655 }
656 
657 void SonarViewGL::setGroundTrue(double sizeX,double sizeY,double posX,double posY,double rotate){
658  sizeX/=2.0;
659  sizeY/=2.0;
660  glDeleteLists(groundTrue, 1);
661  groundTrue = glGenLists( 1 );
662  glNewList( groundTrue, GL_COMPILE );
663  //checkGL("after list create");
664  glPushMatrix();
665  qglColor(Qt::red);
666  glTranslated(-posX, -posY, 0);
667  glRotated( rotate, 0.0, 0.0, 1.0);
668  glBegin(GL_LINE_LOOP);
669  glVertex3d(-sizeX,sizeY,0);
670  glVertex3d(sizeX,sizeY,0);
671  glVertex3d(sizeX,-sizeY,0);
672  glVertex3d(-sizeX,-sizeY,0);
673  glEnd();
674  glPopMatrix();
675  glEndList();
676  //checkGL("end of set ground true:");
677 }
678 
680  glDeleteLists(avalon, 1);
681  avalon= glGenLists( 1 );
682  glNewList( avalon, GL_COMPILE );
683  //checkGL("after list create");
684  glPushMatrix();
685  qglColor(Qt::cyan);
686  //glTranslated(posX, posY, 0);
687  //glRotated( rotate, 0.0, 0.0, 1.0);
688  glBegin(GL_LINE_LOOP);
689  glVertex3d(-1,0.2,0);
690  glVertex3d(1,0.2,0);
691  glVertex3d(1,-0.2,0);
692  glVertex3d(-1,-0.2,0);
693  glEnd();
694  glPopMatrix();
695  glEndList();
696  //checkGL("end of set ground true:");
697 }
698 
699 
701  {
702  while (*angle < 0)
703  *angle += 360 * 16;
704  while (*angle > 360 * 16)
705  *angle -= 360 * 16;
706  }
707 
708 
709 void SonarViewGL::checkGL(const char* msg){
710  GLenum err = glGetError();
711  switch(err){
712  case GL_NO_ERROR:
713  break;
714  case GL_INVALID_ENUM:
715  printf("%s: Invalid enum\n",msg);
716  break;
717  case GL_INVALID_VALUE:
718  printf("%s: invalid value\n",msg);
719  break;
720  case GL_INVALID_OPERATION:
721  printf("%s: invalid operation\n",msg);
722  break;
723  case GL_STACK_OVERFLOW:
724  printf("%s: stack overflow\n",msg);
725  break;
726  case GL_STACK_UNDERFLOW:
727  printf("%s: stack underflow\n",msg);
728  break;
729  case GL_OUT_OF_MEMORY:
730  printf("%s: OpenGL Put of memoty\n",msg);
731  break;
732  case GL_TABLE_TOO_LARGE:
733  printf("%s: GL Table too large\n",msg);
734  break;
735  }
736 }
737 
739  this->orientation = orientation;
740 }
741 
742 void SonarViewGL::setPosition(const double posX, const double posY, const double sigmaX, const double sigmaY){
743  pos[0] = posX;
744  pos[1] = posY;
745  sigmaPos[0] = sigmaX;
746  sigmaPos[1] = sigmaY;
747  repaintFunc();
748 }
749 
750 
751 void SonarViewGL::setZoomMin(float value)
752 {
753  zoom_min = value;
754 }
755 
756 void SonarViewGL::setZoomMax(float value)
757 {
758  zoom_max = value;
759 }
void wheelEvent(QWheelEvent *event)
Definition: SonarViewGL.cc:648
double factor
Definition: SonarViewGL.h:60
void setWallDist(int bearing, int dist, int dist2)
Definition: SonarViewGL.cc:501
void mouseMoveEvent(QMouseEvent *event)
Definition: SonarViewGL.cc:565
void resizeGL(int width, int height)
Definition: SonarViewGL.cc:549
double sigmaPos[2]
Definition: SonarViewGL.h:93
GLuint groundTrue
Definition: SonarViewGL.h:78
void mousePressEvent(QMouseEvent *event)
Definition: SonarViewGL.cc:558
void zRotationChanged(int angle)
void setyPosition(int value)
Definition: SonarViewGL.cc:349
virtual ~SonarViewGL()
Definition: SonarViewGL.cc:297
QPoint lastPosTrans
Definition: SonarViewGL.h:101
void xRotationChanged(int angle)
GLuint * wallDist
Definition: SonarViewGL.h:77
void reset(double currentScale)
Definition: SonarViewGL.cc:74
double currentScale
Definition: SonarViewGL.h:91
const unsigned int maximumBearings
Definition: SonarViewGL.h:74
void setxPosition(int value)
Definition: SonarViewGL.cc:342
float zoom_max
Definition: SonarViewGL.h:66
void yRotationChanged(int angle)
GLuint * bearingList
Definition: SonarViewGL.h:77
void drawEllipse(float xradius, float yradius)
Definition: SonarViewGL.cc:434
void setGroundTrue(double sizeX, double sizeY, double posX, double posY, double rot)
Definition: SonarViewGL.cc:657
void setXRotation(int angle)
Definition: SonarViewGL.cc:312
void setZoomMax(float value)
Definition: SonarViewGL.cc:756
void setOrientation(const double orientation)
Definition: SonarViewGL.cc:738
int medium_ableitung
Definition: SonarViewGL.h:89
void initializeGL()
Definition: SonarViewGL.cc:362
float zoom_min
Definition: SonarViewGL.h:66
void zPositionChanged(int value)
QSize sizeHint() const
Definition: SonarViewGL.cc:307
int lastWallBearing
Definition: SonarViewGL.h:68
GLuint groundPlane
Definition: SonarViewGL.h:63
void createAvalon()
Definition: SonarViewGL.cc:679
double orientation
Definition: SonarViewGL.h:69
void setYRotation(int angle)
Definition: SonarViewGL.cc:322
int overlay_border
Definition: SonarViewGL.h:90
void keyPressEvent(QKeyEvent *event)
Definition: SonarViewGL.cc:606
void paintGL()
Definition: SonarViewGL.cc:446
void paintSonar()
Definition: SonarViewGL.cc:287
void setZoomMin(float value)
Definition: SonarViewGL.cc:751
bool * bearingChanged
Definition: SonarViewGL.h:79
double max(double a, double b)
Definition: SonarViewGL.h:71
bool * listValid
Definition: SonarViewGL.h:79
void repaintFunc()
Definition: SonarViewGL.cc:291
volatile GLuint * indices
Definition: SonarViewGL.h:97
void xPositionChanged(int value)
void checkGL(const char *)
Definition: SonarViewGL.cc:709
float zoom
Definition: SonarViewGL.h:66
SonarViewGL(ImageViewOld &parent, unsigned int maximumBearings=6400)
Definition: SonarViewGL.cc:24
void setData(const std::vector< uint8_t > data, int bearing)
Definition: SonarViewGL.cc:102
volatile GLfloat * vertecies
Definition: SonarViewGL.h:99
void yPositionChanged(int value)
int lastBearing
Definition: SonarViewGL.h:67
void setPosition(int xRot, int yRot, int zRot, int xMove, int yMove, int zMove, float zoom, int width, int height)
Definition: SonarViewGL.cc:592
bool paintGroundTrue
Definition: SonarViewGL.h:81
GLuint avalon
Definition: SonarViewGL.h:78
void normalizeAngle(int *angle)
Definition: SonarViewGL.cc:700
void setzPosition(int value)
Definition: SonarViewGL.cc:355
unsigned int oldSize
Definition: SonarViewGL.h:96
QSize minimumSizeHint() const
Definition: SonarViewGL.cc:302
volatile GLubyte * colors
Definition: SonarViewGL.h:98
void setZRotation(int angle)
Definition: SonarViewGL.cc:332
double pos[2]
Definition: SonarViewGL.h:92
bool paintWall
Definition: SonarViewGL.h:81
QPoint lastPos
Definition: SonarViewGL.h:100