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

CPlayerRenderer.h

Go to the documentation of this file.
00001 /*
00002  * CPlayerRenderer.h
00003  * $Id: CPlayerRenderer.h,v 1.1 2001/09/28 08:52:47 guenth Exp $
00004  *
00005  * Copyright (C) 1999, 2000 Markus Janich, Michael Meissner
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 : Definition of an example renderer drawing a cube
00024 //                in wire frame and catching a key signal 
00025 
00026 
00035 #ifndef CRENDERER__H
00036 #define CRENDERER__H
00037     
00038     
00039 // Own
00041 #include <QGLViewer.h>
00042 
00043 // Qt
00045 #include <qmainwindow.h>
00046 #include <qslider.h>
00047 #include <qgl.h>
00048 
00049 
00050 // System
00052 #include <math.h>
00053 
00054 
00055 
00056 
00057 class CPlayerRenderer : public QObject {
00058   Q_OBJECT
00059 
00060   //****** All methods ******
00061 
00062 public:
00063   CPlayerRenderer(QGLViewer*);
00064 
00065   ~CPlayerRenderer();
00066 
00067   QGLViewer* getViewer(void) { return m_pViewer; };
00068 
00069   void MakeGlList();
00070 
00071 private:
00073   GLuint processHits(GLint hits, GLuint buffer[]);
00074 
00075 
00076   // **** All the slots *****
00077 private slots:
00078 
00080   void sltInitializeGL();
00081 
00083   void sltResizeGL(int w, int h);
00084 
00086   void sltPaintGL();
00087 
00089   void sltManageSelection(QMouseEvent *pqEvent);
00090 
00092   void sltManageRelease(QMouseEvent *pqEvent);
00093 
00095   void sltManageMove(QMouseEvent *pqEvent);
00096 
00098   void sltCatchKey(int);
00099 
00102   void sltResetSelection();
00103 
00104 private:
00105 
00107   void renderScene(void);
00108 
00110   void renderSolidSphere(const CP3D &cCenter, float radius,
00111                          int n1, int n2, float lw=2.5);
00112 
00114   void renderWireSphere(const CP3D &cCenter, float radius,
00115                         int n1, int n2, float lw=2.5);
00116 
00117   //****** All data ******
00118 
00119   QGLViewer *m_pViewer;
00120 
00121   GLuint m_glDispList;
00122 
00123   bool m_afSelected[12];               // select state of the spheres
00124 
00125   bool m_fLeftButtonPressed;           // saves left button state
00126   bool m_fMiddleButtonPressed;         // saves middle button state
00127   bool m_fRightButtonPressed;          // saves right button state
00128 
00129   CP3D m_cSphereCenter[12];            // saves centers of the spheres
00130 
00131   int m_nMousePosX, m_nMousePosY;      // last mouse position
00132 };
00133 
00134 #endif // CRENDERER__H 

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