diff options
author | Marius Kintel <marius@kintel.net> | 2011-07-30 23:58:51 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-07-30 23:58:51 (GMT) |
commit | 6882228058d313bb7b98fddd90239bdb1a3e25ef (patch) | |
tree | 9e3f0077a319939df7496fc6b18350c44cc4b0ec /src/GLView.h | |
parent | dd9dfcb4ece4dcd1ae7f3374ef03a4babdb91dd8 (diff) | |
parent | c79ad5010e4ae8a612de5423cd52a518ed6b4d65 (diff) |
Merge branch 'master' into visitor
Conflicts:
src/GLView.h
src/glview.cc
src/mainwin.cc
src/render-opencsg.cc
Diffstat (limited to 'src/GLView.h')
-rw-r--r-- | src/GLView.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/GLView.h b/src/GLView.h index f729838..1001754 100644 --- a/src/GLView.h +++ b/src/GLView.h @@ -12,6 +12,8 @@ class GLView : public QGLWidget { Q_OBJECT + Q_PROPERTY(bool showFaces READ showFaces WRITE setShowFaces); + Q_PROPERTY(bool showEdges READ showEdges WRITE setShowEdges); Q_PROPERTY(bool showAxes READ showAxes WRITE setShowAxes); Q_PROPERTY(bool showCrosshairs READ showCrosshairs WRITE setShowCrosshairs); Q_PROPERTY(bool orthoMode READ orthoMode WRITE setOrthoMode); @@ -19,18 +21,23 @@ class GLView : public QGLWidget public: GLView(QWidget *parent = NULL); GLView(const QGLFormat & format, QWidget *parent = NULL); - void setRenderFunc(void (*func)(void*), void *userdata); + void setRenderer(class Renderer* r); #ifdef ENABLE_OPENCSG bool hasOpenCSGSupport() { return this->opencsg_support; } #endif // Properties + bool showFaces() const { return this->showfaces; } + void setShowFaces(bool enabled) { this->showfaces = enabled; } + bool showEdges() const { return this->showedges; } + void setShowEdges(bool enabled) { this->showedges = enabled; } bool showAxes() const { return this->showaxes; } void setShowAxes(bool enabled) { this->showaxes = enabled; } bool showCrosshairs() const { return this->showcrosshairs; } void setShowCrosshairs(bool enabled) { this->showcrosshairs = enabled; } bool orthoMode() const { return this->orthomode; } void setOrthoMode(bool enabled) { this->orthomode = enabled; } - + +public: QLabel *statusLabel; double object_rot_x; double object_rot_y; @@ -47,10 +54,10 @@ public: private: void init(); + Renderer *renderer; - void (*renderfunc)(void*); - void *renderfunc_vp; - + bool showfaces; + bool showedges; bool showaxes; bool showcrosshairs; bool orthomode; @@ -60,8 +67,7 @@ private: double w_h_ratio; bool mouse_drag_active; - int last_mouse_x; - int last_mouse_y; + QPoint last_mouse; void keyPressEvent(QKeyEvent *event); void wheelEvent(QWheelEvent *event); @@ -71,7 +77,10 @@ private: void initializeGL(); void resizeGL(int w, int h); + void setupPerspective(); + void setupOrtho(double distance,bool offset=false); void paintGL(); + void normalizeAngle(GLdouble& angle); #ifdef ENABLE_OPENCSG private slots: |