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

glrenderset.h

00001 /***************************************************************************
00002                           glrenderset.h  -  description
00003                              -------------------
00004     begin                : Wed Jul 9 2003
00005     copyright            : (C) 2003 by Jacques Gasselin de Richebourg
00006     email                : jacquesgasselin@hotmail.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU Lesser General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef GLRENDERSET_H
00019 #define GLRENDERSET_H
00020 
00021 #include <vector>
00022 #include "glscene.h"
00023 #include "glcamera.h"
00024 #include "gllight.h"
00025 
00026 using namespace std;
00027 
00032 typedef enum { GLWG_XY_PLANE, GLWG_XZ_PLANE, GLWG_YZ_PLANE } GLWGenum;
00033    
00034 class GLWireGrid
00035 {
00036    GLVector upperLeft;
00037    GLVector lowerLeft;
00038    GLVector lowerRight;
00039    GLuint samples;
00040    
00041    GLVector tangentX,tangentY;
00042    GLVector planeNormal;
00043    bool enabled;
00044    
00045 public:
00046    GLWireGrid(const GLVector& ul, const GLVector& ll, const GLVector& lr, const GLuint s);
00047    GLWireGrid(const GLWGenum, const GLuint s);
00048    
00049    virtual ~GLWireGrid();
00050 
00051    virtual void enable();
00052    virtual void disable();
00053    virtual void toggle();
00054    virtual bool getState();
00055    virtual void display();
00056 };
00057 
00069 class GLRenderSet: public ReferenceCounted
00070 {
00071 #define GLRS_MAX_LIGHTS 8
00072    vector<GLScene::CameraPtr > cameras;
00073    vector<GLScene::LightPtr > lights;
00074    vector<GLWireGrid* > grids;
00075 
00076    GLScene::CameraPtr activeCamera;
00077    GLScene::CameraPtr defaultCamera;
00078    
00079 public: 
00080    GLRenderSet(GLsizei w, GLsizei h);
00081    virtual ~GLRenderSet();
00082 
00083    virtual void addCamera(GLScene::CameraPtr);
00084    virtual void addLight(GLScene::LightPtr);
00085    virtual void addGrid(GLWireGrid*);
00086    virtual void setCameraAspects(GLfloat);
00087 
00088    virtual GLScene::CameraPtr getCamera(unsigned index);
00089    virtual GLScene::LightPtr getLight(unsigned index);
00090    virtual GLWireGrid* getGrid(unsigned index);
00091     
00092    virtual void removeCamera(unsigned index);
00093    virtual void removeLight(unsigned index);
00094    virtual void removeGrid(unsigned index);
00095 
00096    virtual void enableGrid(unsigned index);
00097    virtual void disableGrid(unsigned index);
00098    virtual void toggleGrid(unsigned index);
00103    virtual void setActiveCamera(unsigned index); 
00104    virtual GLScene::CameraPtr getActiveCamera();
00105    //use the camera and the lights
00106    virtual void useCamera();
00107    virtual void useLights();
00108    
00109    virtual void displayGrids(); //show the grids
00110    
00111 };
00112 
00113 
00114 #endif

Generated on Wed Feb 4 23:11:33 2004 by doxygen 1.3.3