summaryrefslogtreecommitdiff
path: root/src/GLView.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/GLView.h')
-rw-r--r--src/GLView.h23
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:
contact: Jan Huwald // Impressum