-
Notifications
You must be signed in to change notification settings - Fork 9
/
layer.h
40 lines (34 loc) · 898 Bytes
/
layer.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
#ifndef LAYER_H
#define LAYER_H
#include <QObject>
#include <QVector4D>
#include <QVector3D>
#include <QtOpenGL>
#if defined(Q_WS_MAC)
#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#elif defined(Q_WS_WIN)
#include <GL/gl.h>
#include <GL/glu.h>
#endif
//class that hold info about layer in opengl lists for faster rendering
class Layer : public QObject
{
Q_OBJECT
private:
int layer_num;
int list_index;
void renderLine(QVector3D v1, QVector3D v2, qreal radius, qreal travel, bool last);
QVector3D calculateNormal(QVector3D v1, QVector3D v2, QVector3D v3);
public:
explicit Layer(int layer, QObject *parent = 0);
QList<QVector4D> vertexes;
void draw(float scale);
//generate lists
void render(float scale);
void display(float scale, bool last, bool show_travel, int current_layer);
void freeLists();
signals:
public slots:
};
#endif // LAYER_H