-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathview.h
More file actions
77 lines (52 loc) · 1.33 KB
/
view.h
File metadata and controls
77 lines (52 loc) · 1.33 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
#ifndef VIEW_H
#define VIEW_H
#include <QGLViewer/qglviewer.h>
#include <QGLViewer/manipulatedFrame.h>
#include <QMutex>
#include <QSettings>
#include "g2m.hpp"
using namespace qglviewer;
using namespace g2m;
class View : public QGLViewer
{
Q_OBJECT;
Q_PROPERTY(bool autoZoom READ autoZoom WRITE setAutoZoom RESET unsetAutoZoom);
public:
View(QWidget *parent = NULL);
~View();
void resetCamView();
void updateGLViewer() {
#if QGLVIEWER_VERSION < 0x020700
this->updateGL();
#else
QMetaObject::invokeMethod(this, "update", Qt::QueuedConnection);
#endif
};
bool autoZoom()const{ return _autoZoom; };
void setAutoZoom(bool autoZoom){ _autoZoom = autoZoom; update(); };
void unsetAutoZoom(){ _autoZoom = true; update(); };
public slots:
void close();
void appendCanonLine(canonLine *l);
void setCanonLines(const QVector<canonLine*>& lines);
void clear();
void update();
void keyPressEvent(QKeyEvent *e);
protected:
void init();
void initializeGL();
virtual void draw();
virtual void fastDraw();
virtual void postDraw();
void drawObjects(bool simplified);
private:
Vec initialCameraPosition;
Quaternion initialCameraOrientation;
QMutex mutex;
QSettings * settings;
std::vector<g2m::canonLine*> lines;
bool dirty;
double aabb[6];
bool _autoZoom;
};
#endif // VIEW_H