This repository was archived by the owner on Jan 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathglwidget.h
More file actions
102 lines (82 loc) · 2.86 KB
/
glwidget.h
File metadata and controls
102 lines (82 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
///
/// @file
/// @copyright Copyright (C) 2017, Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
///
/// @brief
///
#pragma once
#include "types.h"
#include "globject.h"
#include "glgrid.h"
#include "camera.h"
#include "appconfig.h"
#include "lane.h"
#include "imessagesource.h"
#include "glfieldofview.h"
#include <QOpenGLWidget>
#include <QTreeWidgetItem>
#include <QOpenGLFunctions>
#include <QOpenGLShaderProgram>
#include <QOpenGLFunctions_4_3_Core>
class QWheelEvent;
class GLWidget : public QOpenGLWidget, protected QOpenGLFunctions_4_3_Core
{
Q_OBJECT
public:
GLWidget(QWidget* parent,
IMessageSource* msgSource,
QMap<ObjectType, QTreeWidgetItem*>& treeNodes,
const AppConfig& config);
void UpdateIMessageSource(IMessageSource* msgSource);
void UpdateFOVPaint(const bool showFOV);
void UpdateFOVParam(const float minRadius,
const float maxRadius,
const float azimuthPosAngle,
const float azimuthNegAngle);
signals:
void DisplayObjectInformation(GLObject* object);
void SetTrackingEnabled(bool enable);
public slots:
void UpdateGrid();
void Disconnected();
void StartTracking();
void ResetCameraAll();
void ResetCameraOrient();
void Connected(DataType dataType);
void TreeItemChanged(QTreeWidgetItem* item, int column);
void TreeItemClicked(QTreeWidgetItem* item, int column);
void MessageParsed(const Message& message, const LaneMessage& laneMessage);
protected:
void paintGL();
void initializeGL();
void resizeGL(int width, int height);
bool eventFilter(QObject* obj, QEvent* event);
private:
void ResetObjectTextOrientations();
void RenderObject(GLObject* object);
void MouseWheel(QWheelEvent* event);
void KeyPressed(QSet<int> pressedKeys);
float minCameraY_;
bool ignoreUpdate_;
bool isOpenGLInitizalized_;
int uniformMvpLocation_;
int uniformColorLocation_;
int uniformUseTextureLocation_;
DataType currentDataType_;
Camera* camera_;
QPoint mousePos_;
const AppConfig& config_;
QVector<Lane*> lanes_;
QSet<int> pressedKeys_;
QList<int> sceneKeys_;
IMessageSource* msgSource_;
bool isFirstMsgReceived_;
GLObject* selectedObject_;
QMatrix4x4 projectionMatrix_;
QVector<GLObject*> staticObjects_;
QVector<GLObject*> simulationObjects_;
QOpenGLShaderProgram shaderProgram_;
QMap<ObjectType, QTreeWidgetItem*>& treeNodes_;
bool showFOV_;
GLFieldOfView* objFOV_;
};