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

CEditorRenderer.h

Go to the documentation of this file.
00001 /*
00002  * CEditorRenderer.h
00003  * $Id: CEditorRenderer.h,v 1.2 2001/10/01 10:14:48 mjanich 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 : 
00024 //                
00025 
00026 
00027 #ifndef CRENDERER__H
00028 #define CRENDERER__H
00029     
00030     
00031 // Own
00033 #include "QGLExaminerViewer.h"
00034 #include "QCameraKeyPathEditorImpl.h"
00035 
00036 // Qt
00038 #include <qmainwindow.h>
00039 #include <qslider.h>
00040 #include <qgl.h>
00041 
00042 
00043 // System
00045 #include <math.h>
00046 
00047 
00048 
00049 
00058 class CEditorRenderer : public QObject {
00059   Q_OBJECT
00060 
00061   //****** All methods ******
00062 
00063 public:
00064   CEditorRenderer(QGLViewer*, QCameraKeyPathEditorImpl *);
00065 
00066   ~CEditorRenderer();
00067 
00068   QGLViewer* getViewer(void) { return m_pViewer; };
00069 
00070   void MakeGlList();
00071 
00072 
00073   
00074 private:
00076   GLuint processHits(GLint hits, GLuint buffer[]);
00077 
00078 
00079   // **** All the slots *****
00080 private slots:
00081 
00083   void sltInitializeGL();
00084 
00086   void sltResizeGL(int w, int h);
00087 
00089   void sltPaintGL();
00090 
00092   void sltManageSelection(QMouseEvent *pqEvent);
00093 
00095   void sltManageRelease(QMouseEvent *pqEvent);
00096 
00098   void sltManageMove(QMouseEvent *pqEvent);
00099 
00102   void sltResetSelection();
00103 
00104 
00105 private:
00106 
00108   void renderScene(void);
00109 
00111   void renderSolidSphere(const CP3D &cCenter, float radius,
00112                          int n1, int n2, float lw=2.5);
00113 
00115   void renderWireSphere(const CP3D &cCenter, float radius,
00116                         int n1, int n2, float lw=2.5);
00117 
00118   //****** All data ******
00119 
00120   QGLViewer *m_pViewer;
00121   QCameraKeyPathEditorImpl *m_pCameraEditor;
00122   
00123   GLuint m_glDispList;
00124 
00125   bool m_afSelected[12];               // select state of the spheres
00126 
00127   bool m_fLeftButtonPressed;           // saves left button state
00128   bool m_fMiddleButtonPressed;         // saves middle button state
00129   bool m_fRightButtonPressed;          // saves right button state
00130 
00131   CP3D m_cSphereCenter[12];            // saves centers of the spheres
00132 
00133   int m_nMousePosX, m_nMousePosY;      // last mouse position
00134 };
00135 
00136 #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