rock_widget_collection  0.1
SonarViewGL.h
Go to the documentation of this file.
1 /*
2  * File: SonarViewGL.h
3  * Author: Matthias Goldhoorn (matthias.goldhoorn@dfki.de)
4  *
5  */
6 
7 #ifndef SONARVIEWGL_H
8 #define SONARVIEWGL_H
9 
11 #include <QtCore/QTimer>
12 #include <QtCore/QMutex>
13 #include <stdint.h>
14 
16 {
17  Q_OBJECT
18  Q_CLASSINFO("Author", "Matthias Goldhoorn")
19 
20 public:
21  SonarViewGL(ImageViewOld &parent, unsigned int maximumBearings=6400);
22  virtual ~SonarViewGL();
23  QSize minimumSizeHint() const;
24  QSize sizeHint() const;
25  void setPosition(int xRot,int yRot, int zRot, int xMove, int yMove, int zMove, float zoom, int width, int height);
26  void setData(const std::vector<uint8_t> data, int bearing);
27  void reset(double currentScale);
28  void setGroundTrue(double sizeX,double sizeY,double posX,double posY,double rot);
29  void drawEllipse(float xradius, float yradius);
30 
31 public slots:
32  void repaintFunc();
33  void setXRotation(int angle);
34  void setYRotation(int angle);
35  void setZRotation(int angle);
36  void setxPosition(int value);
37  void setyPosition(int value);
38  void setzPosition(int value);
39  void setWallDist(int bearing, int dist,int dist2);
40  void keyPressEvent ( QKeyEvent * event );
41  void setPosition(const double posX, const double posY, const double sigmaX=0, const double sigmaY=0);
42  void setOrientation(const double orientation);
43  void setZoomMin(float value);
44  void setZoomMax(float value);
45 
46 protected:
47  void initializeGL();
48  void paintGL();
49  void resizeGL(int width, int height);
50  void mousePressEvent(QMouseEvent *event);
51  void mouseMoveEvent(QMouseEvent *event);
52  void wheelEvent(QWheelEvent *event);
53  void checkGL(const char*);
55  void drawList();
56  void drawFaces();
57  void drawSurfaces();
58  int cloudSize;
59  void paintSonar();
60  double factor;
61  GLuint makeObject();
62  GLuint show_pointcloud();
63  GLuint groundPlane;
64  void normalizeAngle(int *angle);
65  void createAvalon();
69  double orientation;
70 
71  inline double max(double a,double b){
72  return (a>b)?a:b;
73  }
74  const unsigned int maximumBearings;
75 
76  std::vector<std::pair<GLuint, QColor> > colorList;
77  GLuint *wallDist, *bearingList;
80  bool dataChanged;
82 
83  int xRot;
84  int yRot;
85  int zRot;
86  int xShift;
87  int yShift;
88  int zShift;
91  double currentScale;
92  double pos[2];
93  double sigmaPos[2];
94 
95 
96  unsigned int oldSize;
97  volatile GLuint *indices;
98  volatile GLubyte *colors;
99  volatile GLfloat *vertecies;
100  QPoint lastPos;
101  QPoint lastPosTrans;
102  QTimer repaintTimer;
103  QMutex mutex;
104 
105 signals:
106  void xRotationChanged(int angle);
107  void yRotationChanged(int angle);
108  void zRotationChanged(int angle);
109  void xPositionChanged(int value);
110  void yPositionChanged(int value);
111  void zPositionChanged(int value);
112 
113 };
114 
115 #endif
116 
QTimer repaintTimer
Definition: SonarViewGL.h:102
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
GLuint makeObject()
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
void drawFaces()
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
QMutex mutex
Definition: SonarViewGL.h:103
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 drawList()
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
bool dataChanged
Definition: SonarViewGL.h:80
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
void drawSurfaces()
GLuint show_pointcloud()
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
std::vector< std::pair< GLuint, QColor > > colorList
Definition: SonarViewGL.h:76
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 deleteSurfaces
Definition: SonarViewGL.h:54
bool paintWall
Definition: SonarViewGL.h:81
QPoint lastPos
Definition: SonarViewGL.h:100