#ifndef __OPEN_GL_RADAR_WIDGET_HEADER__ #define __OPEN_GL_RADAR_WIDGET_HEADER__ #include "../guiClass.h" #include "../../components/base/basicMutex.h" #include "../../hardware/soc/general/3DLRF.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "targetDisplay.h" //class objectLGS; typedef struct { float x, y, z; } sTrg3D; //typedef std::queue Targets3DFIFO; typedef std::vector Targets3DFIFO; class GLRadar : public QOpenGLWidget, protected QOpenGLFunctions, public targetDisplay { //Q_OBJECT public: GLRadar(QWidget* parent);//, const QColor &background); ~GLRadar(); //void updateRanges(uint16_t *Ranges, uint32_t count); //void updateRanges(uint32_t *Ranges, uint32_t count); //uint32_t *m_pRanges; //uint32_t m_nRangesCount; //objectLGS *m_pDeviceControl; //void addTarget(uint32_t Id, uint32_t Range, bool isMaster= true ); //void clearTargets(void); //bool loadFromFile(char *fName); /* For Targets */ uint16_t *m_pActiveRanges; uint32_t m_nActiveRangesCount; uint8_t m_bLoadProcessPercent; bool m_bLoadProcessShown; bool m_bShowMinimums; public slots: void setScaling(int scale); //void attachLGS(objectLGS *ptr){ m_pDeviceControl = ptr; }; //void showLoadProcess( int p ); private slots: void handleButtonPress(); void keyPressEvent( QKeyEvent *event); void mouseMoveEvent( QMouseEvent *event); void wheelEvent( QWheelEvent *event); virtual void updateDisplay( void ); virtual void updateBackStage( void ); protected: void resizeGL(int w, int h) Q_DECL_OVERRIDE; void paintGL() Q_DECL_OVERRIDE; void initializeGL() Q_DECL_OVERRIDE; private: // http://pmg.org.ru/nehe/nehe02.htm Targets3DFIFO m_fTargets; //bool saveToFile(char *fName); void paintRadar(); void createGeometry(); void voxel(qreal x1, qreal y1, qreal x2, qreal y2, qreal x3, qreal y3, qreal x4, qreal y4, qreal z1, qreal z2); void pushDataIntoVBO( void ); basicMutex m_mDataProtectorMutex; qreal m_fAngleZ; qreal m_fAngleX; qreal m_fAngleY; qreal m_fScale; QPoint m_slastPos; bool m_bMustUpdateVBOData; float *m_pOutputBuffer; size_t m_zOutputBufferCount; size_t m_zOutputBufferSize; //QVector m_vertices; //QVector m_normals; QOpenGLShader *m_vshader; QOpenGLShader *m_fshader; QOpenGLShaderProgram *m_program; QOpenGLTexture *m_texture; QOpenGLBuffer m_vbo; int m_vertexAttr; int m_colorAttr; int m_matrixUniform; //bool m_transparent; //QPushButton *m_btn; //bool m_hasButton; QColor m_background; }; #endif