From c8baf2b227a23b1361a4fa160ef1c183ef24f431 Mon Sep 17 00:00:00 2001 From: kintel Date: Wed, 9 Dec 2009 14:23:22 +0000 Subject: Extracted GLView.h from openscad.h git-svn-id: http://svn.clifford.at/openscad/trunk@154 b57f626f-c46c-0410-a088-ec61d464b74c diff --git a/GLView.h b/GLView.h new file mode 100644 index 0000000..ca269ce --- /dev/null +++ b/GLView.h @@ -0,0 +1,66 @@ +#ifndef GLVIEW_H_ +#define GLVIEW_H_ + +#ifdef ENABLE_OPENCSG +// this must be included before the GL headers +# include +#endif + +#include +#include + +class GLView : public QGLWidget +{ + Q_OBJECT + +public: + void (*renderfunc)(void*); + void *renderfunc_vp; + + bool orthomode; + bool showaxes; + bool showcrosshairs; + + double viewer_distance; + double object_rot_x; + double object_rot_y; + double object_rot_z; + double object_trans_x; + double object_trans_y; + double object_trans_z; + + double w_h_ratio; + GLint shaderinfo[11]; + + QLabel *statusLabel; +#ifdef ENABLE_OPENCSG + bool opencsg_support; +#endif + + GLView(QWidget *parent = NULL); + +protected: + bool mouse_drag_active; + int last_mouse_x; + int last_mouse_y; + + void keyPressEvent(QKeyEvent *event); + void wheelEvent(QWheelEvent *event); + void mousePressEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + + void initializeGL(); + void resizeGL(int w, int h); + void paintGL(); + +#ifdef ENABLE_OPENCSG +private slots: + void display_opengl20_warning(); +#endif + +signals: + void doAnimateUpdate(); +}; + +#endif diff --git a/glview.cc b/glview.cc index 882daf8..800b704 100644 --- a/glview.cc +++ b/glview.cc @@ -19,11 +19,13 @@ */ #include "openscad.h" +#include "GLView.h" #include #include #include #include +#include #define FAR_FAR_AWAY 100000.0 @@ -459,7 +461,7 @@ void GLView::mouseMoveEvent(QMouseEvent *event) object_trans_z += tm[11]; } updateGL(); - doAnimateUpdate(); + emit doAnimateUpdate(); } last_mouse_x = this_mouse_x; last_mouse_y = this_mouse_y; -- cgit v0.10.1