00001 00002 // glwidget.h // 00003 // ------------ // 00004 // begin : Dec 05 2003 // 00005 // copyright : (C) 2003 by cbaudry (CEA/DSM/SPP) // 00006 // email : cedric.baudry@tremplin-utc.fr // 00008 00010 // // 00011 // This program is free software; you can redistribute it and/or modify // 00012 // it under the terms of the GNU General Public License as published by // 00013 // the Free Software Foundation, version 2 of the License // 00014 // // 00016 00017 #pragma once 00018 00019 #include "engine.h" 00020 #include <qgl.h> 00021 00032 class GLWidget : public QGLWidget 00033 { 00034 Q_OBJECT 00035 00036 public : 00037 00038 GLWidget (QWidget * parent, const char *name); 00039 ~GLWidget (); 00040 00041 Engine *engine; 00042 00043 enum projTypes {PERSPECTIVE, ZPROJ, XPROJ, YPROJ}; 00044 int projectionMode; 00046 QSize sizeHint() const { return QSize( 640, 480 ); } 00047 QSize minimumSizeHint() const { return QSize( 60, 50 ); } 00048 00049 public slots : 00050 void update(){updateGL();}; 00051 00052 signals : 00053 void updated(); 00054 00055 protected : 00056 00057 void initializeGL (); 00058 void resizeGL (int width, int height); 00059 void paintGL (); 00060 00061 void mousePressEvent (QMouseEvent * e); 00062 void mouseReleaseEvent (QMouseEvent * e); 00063 void mouseMoveEvent (QMouseEvent * e); 00064 void mouseDoubleClickEvent(QMouseEvent * e); 00065 00066 }; 00067