source: trunk/examples/demo/opengl/glcontrolwidget.h

Last change on this file was 160, checked in by dmik, 19 years ago

Imported table and iconview modules and a bunch of dependent examples from the official release 3.3.1 from Trolltech.

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1#ifndef GLCONTROLWIDGET_H
2#define GLCONTROLWIDGET_H
3
4#include <qgl.h>
5
6class GLControlWidget : public QGLWidget
7{
8 Q_OBJECT
9
10public:
11 GLControlWidget( QWidget *parent, const char *name = 0, QGLWidget *share = 0, WFlags f = 0 );
12
13 virtual void transform();
14
15public slots:
16 void setXRotation( double degrees );
17 void setYRotation( double degrees );
18 void setZRotation( double degrees );
19
20 void setScale( double s );
21
22 void setXTrans( double x );
23 void setYTrans( double y );
24 void setZTrans( double z );
25
26 virtual void setRotationImpulse( double x, double y, double z );
27 virtual void setTranslationImpulse( double x, double y, double z );
28 void drawText();
29
30protected:
31 void setAnimationDelay( int ms );
32 void mousePressEvent( QMouseEvent *e );
33 void mouseReleaseEvent( QMouseEvent *e );
34 void mouseMoveEvent( QMouseEvent * );
35 void mouseDoubleClickEvent( QMouseEvent * );
36 void wheelEvent( QWheelEvent * );
37
38 void showEvent( QShowEvent * );
39 void hideEvent( QHideEvent * );
40
41 GLfloat xRot, yRot, zRot;
42 GLfloat xTrans, yTrans, zTrans;
43 GLfloat scale;
44 bool animation;
45
46protected slots:
47 virtual void animate();
48
49private:
50 bool wasAnimated;
51 QPoint oldPos;
52 QTimer* timer;
53 int delay;
54};
55
56#endif
Note: See TracBrowser for help on using the repository browser.