SimpleX3DGLScene.h

Go to the documentation of this file.
00001 #ifndef SIMPLEX3DGLSCENE_H
00002 #define SIMPLEX3DGLSCENE_H
00003 
00004 #include "X3DTypes.h"
00005 #include "BBox.h"
00006 #include "X3D_Scene.h"
00007 
00008 namespace X3DTK {
00009 
00010 class MemReleaser;
00011 
00012 namespace X3D {
00013 
00014 class Loader;
00015 class InlineLoader;
00016 class BBoxUpdater;
00017 class GLBuilder;
00018 class FileValidator;
00019 
00020 }
00021 
00022 namespace GL {
00023 
00024 class Scene;
00025 class Renderer;
00026 
00027 }
00028 
00053 class SimpleX3DGLScene
00054 {
00055 public:
00057   SimpleX3DGLScene();
00059   virtual ~SimpleX3DGLScene();
00060   
00062   virtual void load(const char *file, bool fileValidation = true);
00064   virtual void draw();
00066   virtual void select(double x, double y);
00068   inline const SFVec3f &getBBoxMin() const {return min;};
00070   inline const SFVec3f &getBBoxMax() const {return max;};
00072   void release();
00073 
00075   void setLoader(X3D::Loader *loader);
00077   void setBBoxUpdater(X3D::BBoxUpdater *bboxUpdater);  
00079   void setGLBuilder(X3D::GLBuilder *builder);  
00081   void setGLRenderer(GL::Renderer *renderer);  
00083   void setMemReleaser(MemReleaser *memReleaser);  
00085   void setFileValidator(X3D::FileValidator *fileValidator);  
00086   
00088   inline X3D::Loader *getLoader() const {return _loader;};
00090   inline X3D::BBoxUpdater *getBBoxUpdater() const {return _bboxupdater;};  
00092   inline X3D::GLBuilder *getGLBuilder() const {return _builder;};  
00094   inline GL::Renderer *getGLRenderer() const {return _renderer;};  
00096   inline MemReleaser *getMemReleaser() const {return _releaser;};  
00097 
00098 protected:
00099   X3D::Scene *scene;
00100   GL::Scene *glscene;
00101   
00102   SFVec3f min;
00103   SFVec3f max;
00104   
00106   void loadFile(const char *file, bool fileValidation);
00109   void computeBBox();
00111   void buildGLScene();
00112 
00113 private:
00114   X3D::Loader *_loader;
00115   X3D::InlineLoader *_inlineLoader;
00116   X3D::BBoxUpdater *_bboxupdater;
00117   X3D::GLBuilder *_builder;
00118   GL::Renderer *_renderer;
00119   MemReleaser *_releaser;
00120 };
00121 
00122 }
00123 
00124 #endif

Generated on Fri Jul 30 12:02:28 2004 for X3DToolKit by doxygen 1.3.6