-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathglcanvas.h
66 lines (50 loc) · 1.24 KB
/
glcanvas.h
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
#ifndef GLCANVAS_H
#define GLCANVAS_H
#include <memory>
#include <QOpenGLWidget>
#include <QMouseEvent>
#include <QOpenGLFunctions>
#include "OPI/opi_cpp.h"
struct tColor {
float r;
float g;
float b;
};
class GLCanvas : public QOpenGLWidget, protected QOpenGLFunctions
{
Q_OBJECT
public:
explicit GLCanvas(QWidget *parent = 0);
//void updatePopulationPointer(std::shared_ptr<OPI::Population> p);
void drawObject(OPI::Vector3 pos);
void setOrbit(OPI::Orbit o, OPI::Vector3 p);
protected:
void initializeGL();
void paintGL();
void resizeGL(int width, int height);
void mousePressEvent(QMouseEvent* event);
void mouseReleaseEvent(QMouseEvent* event);
void mouseMoveEvent(QMouseEvent* event);
private:
void draw();
void drawOrbit(const OPI::Orbit o, const tColor c);
void drawCoordinateSystem();
//void drawPopulation();
OPI::Orbit orbit1;
OPI::Orbit orbit2;
OPI::Vector3 pos1;
OPI::Vector3 pos2;
//std::shared_ptr<OPI::Population> population;
bool drawOrbits;
struct pos2D {
int x;
int y;
};
pos2D rightClickPosition;
pos2D middleClickPosition;
float rotationY;
float zoom;
signals:
public slots:
};
#endif // GLCANVAS_H