Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

QGLSignalWidget.h

Go to the documentation of this file.
00001 /*
00002  * QGLSignalWidget.h
00003  * $Id: QGLSignalWidget.h,v 1.4 2001/08/23 16:16:11 mjanich Exp $
00004  *
00005  * Copyright (C) 1999, 2000 Markus Janich
00006  *
00007  * This program is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2 of the License, or
00010  * (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  */
00022 
00023 //  Description : Class QGLSignalWidget
00024 //  Purpose     : Provides a OpenGL render area
00025 
00026 
00027 #ifndef _QGLSIGNALWIDGET_H_
00028 #define _QGLSIGNALWIDGET_H_
00029 
00030 
00031 // Qt
00033 #include <qgl.h>
00034 #include <qevent.h>
00035 #include <qdragobject.h>
00036 
00037 
00038 // System
00040 
00041 
00042 // Own
00044 
00045 
00046 
00047 
00058 class QGLSignalWidget: public QGLWidget {
00059   Q_OBJECT
00060 
00061 public:
00062 
00064   QGLSignalWidget(QWidget * parent=0, const char * name=0, 
00065                 const QGLWidget * shareWidget = 0, WFlags f=0)
00066     : QGLWidget(parent, name, shareWidget, f)
00067   {
00068     //setFocusPolicy(NoFocus);
00069     setAcceptDrops(true);
00070   };
00071 
00073   QGLSignalWidget(const QGLFormat & format, QWidget * parent=0, 
00074                 const char * name=0, const QGLWidget * shareWidget = 0, 
00075                 WFlags f=0)
00076     : QGLWidget(format, parent, name, shareWidget, f)
00077   {
00078     //setFocusPolicy(NoFocus);
00079     setAcceptDrops(true);
00080   };
00081 
00082 
00083 signals:
00084 
00087   void sigInitGL();
00088 
00090   void sigRedrawGL();
00091 
00094   void sigResizeGL(int nWidth, int nHeight);
00095 
00098   void sigMouseRelease(QMouseEvent *pqEvent);
00099 
00102   void sigMousePress(QMouseEvent *pqEvent);
00103 
00106   void sigMouseMove(QMouseEvent *pqEvent);
00107 
00108   void sigDragEnter(QDragEnterEvent *pqEvent);
00109   void sigDragLeave(QDragLeaveEvent *pqEvent);
00110   void sigDrop(QDropEvent *pqEvent);
00111 
00112 protected:
00113 
00115   virtual void initializeGL() {
00116     emit( sigInitGL() );
00117   };
00118 
00120   virtual void paintGL() {
00121     emit( sigRedrawGL() );
00122   };
00123 
00125   virtual void resizeGL(int nWidth, int nHeight) {
00126     emit( sigResizeGL(nWidth, nHeight) );
00127   };
00128 
00130   virtual void mouseReleaseEvent (QMouseEvent *event) {
00131     emit(sigMouseRelease(event));
00132   };
00133 
00135   virtual void mousePressEvent (QMouseEvent *event) {
00136     emit(sigMousePress(event));
00137   };
00138 
00140   virtual void mouseMoveEvent (QMouseEvent *event) {
00141     emit(sigMouseMove(event));
00142   };
00143 
00145   void dragEnterEvent(QDragEnterEvent *qEvent) {
00146     emit(sigDragEnter(qEvent));
00147   };
00148 
00150   void dragLeaveEvent(QDragLeaveEvent *qEvent) {
00151     emit(sigDragLeave(qEvent));
00152   };
00153 
00155   void dropEvent(QDropEvent *qEvent) {
00156     emit(sigDrop(qEvent));
00157   };
00158 };
00159 
00160 #endif // __QGLSIGNALWIDGET_H_

Generated at Thu Oct 4 17:17:25 2001 for QGLViewer by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001