summaryrefslogtreecommitdiff
path: root/src/GLView.h
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2011-08-03 21:37:51 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2011-08-03 21:37:51 (GMT)
commitf78d4f74b2606f3cccff0f241b608cb021a30b9b (patch)
tree6d61969163630b4ac88011eddb1894c65d768c78 /src/GLView.h
parent5aec712746eeac2e3bdf2501a7473bcac9777690 (diff)
parenta35c801eec98803bf21d0d6c8d2748f0d9ccd507 (diff)
Merge remote branch 'upstream/master'
Diffstat (limited to 'src/GLView.h')
-rw-r--r--src/GLView.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/src/GLView.h b/src/GLView.h
index 7516894..764b23b 100644
--- a/src/GLView.h
+++ b/src/GLView.h
@@ -12,24 +12,31 @@
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);
public:
GLView(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;
@@ -45,9 +52,10 @@ public:
#endif
private:
- void (*renderfunc)(void*);
- void *renderfunc_vp;
+ Renderer *renderer;
+ bool showfaces;
+ bool showedges;
bool showaxes;
bool showcrosshairs;
bool orthomode;
@@ -57,8 +65,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);
@@ -68,7 +75,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