From: gburri Date: Wed, 19 Nov 2014 20:58:58 +0000 (+0100) Subject: Creation de viewer pour faciliter l'activation ou non des differents codes des labos. X-Git-Url: http://git.euphorik.ch/index.cgi?a=commitdiff_plain;h=7a1564c56b396cfeb1cbc246fe7b441304364465;p=GPU.git Creation de viewer pour faciliter l'activation ou non des differents codes des labos. --- diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp index f71dc78..3d4d02f 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp @@ -16,63 +16,50 @@ using std::cout; using std::endl; using std::string; -/*----------------------------------------------------------------------*\ - |* Declaration *| - \*---------------------------------------------------------------------*/ - -/*--------------------------------------*\ - |* Imported *| - \*-------------------------------------*/ - -/*--------------------------------------*\ - |* Public *| - \*-------------------------------------*/ - -int mainGL(void); - -/*--------------------------------------*\ - |* Private *| - \*-------------------------------------*/ - -/*----------------------------------------------------------------------*\ - |* Implementation *| - \*---------------------------------------------------------------------*/ - -/*--------------------------------------*\ - |* Public *| - \*-------------------------------------*/ +class RipplingViewer + { + public: + RipplingViewer() + : ptrRippling0(Rippling0Provider::createGL()), ptrRippling(RipplingProvider::createGL()), + rippling0Viewer(this->ptrRippling0, true, true, 0, 0), + ripplingViewer(this->ptrRippling, true, true, 20, 20) + {} + ~RipplingViewer() + { + delete this->ptrRippling0; + delete this->ptrRippling; + } + private: + Rippling0Image* ptrRippling0; + Image* ptrRippling; + GLUTImageViewers rippling0Viewer, ripplingViewer; + }; + +class FractalViewer + { + public: + FractalViewer() + : ptrMandelbrot(FractalProvider::createMandelbrotGL()), ptrJulia(FractalProvider::createJuliaGL()), + mandelbrotViewer(this->ptrMandelbrot, true, true, 0, 0), + juliaViewer(this->ptrJulia, true, true, 20, 20) + {} + ~FractalViewer() + { + delete this->ptrMandelbrot; + delete this->ptrJulia; + } + private: + ImageFonctionel* ptrMandelbrot; + ImageFonctionel* ptrJulia; + GLUTImageViewers mandelbrotViewer, juliaViewer; + }; int mainGL(void) { - //Rippling0Image* ptrRippling0 = Rippling0Provider::createGL(); - //Image* ptrRippling = RipplingProvider::createGL(); - //ImageFonctionel* ptrFractalMandelbrot = FractalProvider::createMandelbrotGL(); - //ImageFonctionel* ptrFractalJulia = FractalProvider::createJuliaGL(); - - const bool isAnimation = true; - const bool isSelection = true; - - //GLUTImageViewers rippling0Viewer(ptrRippling0, isAnimation, isSelection, 0, 0); - //GLUTImageViewers ripplingViewer(ptrRippling, isAnimation, isSelection, 10, 10); - //GLUTImageViewers fractalMandelbrotViewer(ptrFractalMandelbrot, true, true, 20, 20); - //GLUTImageViewers fractalJuliaViewer(ptrFractalJulia, true, true, 20, 20); + // RipplingViewer rippling; + // FractalViewer fractals; GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte - // destruction - //delete ptrRippling0; - //delete ptrRippling; - //delete ptrFractalMandelbrot; - delete ptrFractalJulia; - return EXIT_SUCCESS; } - -/*--------------------------------------*\ - |* Private *| - \*-------------------------------------*/ - -/*----------------------------------------------------------------------*\ - |* End *| - \*---------------------------------------------------------------------*/ -