-
Notifications
You must be signed in to change notification settings - Fork 16
/
oglwidget.h
66 lines (56 loc) · 1.55 KB
/
oglwidget.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 OGLWIDGET_H
#define OGLWIDGET_H
#include <QWidget>
#include <QMouseEvent>
#include <QMainWindow>
#include <QOpenGLWidget>
#include "glu.h"
#include "gl.h"
//#include "/home/user/CGAL/CGAL-4.9/include/CGAL/glu.h"
//#include "/home/user/CGAL/CGAL-4.9/include/CGAL/gl.h"
#include "std_include.h"
class OGLWidget : public QOpenGLWidget
{
Q_OBJECT
public:
OGLWidget(QWidget *parent = 0);
~OGLWidget();
bool drawBoundaries = true;
void setAllBoundarySites(vector<int3> &sites);
void clearObjects();
void setLines(vector<scalar3> &lineSegments, int3 sizes);
void setDefects(vector<scalar3> &def, int3 sizes);
void setSpheres(int3 sizes);
void addSphere(scalar3 &pos, scalar &radii);
void addWall(int3 planeAndNormalAndType);
void setXRotation(int angle);
void setZRotation(int angle);
vector<scalar3> lines;
vector<scalar3> defects;
int zoom=4;
vector<int3> walls;
vector<scalar3> boundarySites;
vector<scalar3> baseSpherePositions;
vector<scalar> baseSphereRadii;
vector<scalar3> spherePositions;
vector<scalar> sphereRadii;
signals:
void xRotationChanged(int XR);
void zRotationChanged(int ZR);
protected:
void initializeGL();
void resizeGL(int w, int h);
void paintGL();
void draw();
void drawSpheres();
void drawWalls();
void drawBoundarySites();
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
QPoint lastPos;
int iterator = 0;
int xRot;
int zRot;
int3 Sizes;
};
#endif // OGLWIDGET_H