X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2FmainGL.cpp;h=9f1b84aba92cc297e68ab6c09c9f8f8d1f248db7;hb=7753d7abc9c1cdf90793a2936221aa4951c574b3;hp=c8537162dd218b3120a3d6eeda2a0b5d53eeeb41;hpb=7798b7c27cf13aaeada22faae8648df8cb339f1b;p=GPU.git diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp index c853716..9f1b84a 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp @@ -1,6 +1,7 @@ #include #include #include +using namespace std; #include "GLUTImageViewers.h" @@ -9,70 +10,40 @@ #include "Rippling0Provider.h" #include "RipplingProvider.h" - #include "FractalProvider.h" +#include "NewtonProvider.h" +#include "HeatTransfertProvider.h" -using std::cout; -using std::endl; -using std::string; - -/*----------------------------------------------------------------------*\ - |* Declaration *| - \*---------------------------------------------------------------------*/ - -/*--------------------------------------*\ - |* Imported *| - \*-------------------------------------*/ - -/*--------------------------------------*\ - |* Public *| - \*-------------------------------------*/ - -int mainGL(void); - -/*--------------------------------------*\ - |* Private *| - \*-------------------------------------*/ - -/*----------------------------------------------------------------------*\ - |* Implementation *| - \*---------------------------------------------------------------------*/ - -/*--------------------------------------*\ - |* Public *| - \*-------------------------------------*/ +template +class Viewer + { + private: + TOutput* ptrProvider; + GLUTImageViewers viewer; + + public: + Viewer(bool isAnimation, bool isSelection, int pxFrame, int pyFrame): + ptrProvider(TProvider::createGL()), + viewer(ptrProvider, isAnimation, isSelection, pxFrame, pyFrame) + { + } + + ~Viewer() + { + delete this->ptrProvider; + } + }; int mainGL(void) { - //Rippling0Image* ptrRippling0 = Rippling0Provider::createGL(); - //Image* ptrRippling = RipplingProvider::createGL(); - - ImageFonctionel* ptrFractalMandelbrot = FractalProvider::createGL(); - - 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); + //Viewer rippling0(true, true, 10, 10); + //Viewer rippling0(true, true, 10, 10); + //Viewer fractalMandelbrot(true, true, 20, 20); + //Viewer fractalJulia(true, true, 30, 30); + Viewer newtown(true, true, 20, 20); + //Viewer heatTransfert(true, false, 20, 20); GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte - // destruction - //delete ptrRippling0; - //delete ptrRippling; - - delete ptrFractalMandelbrot; - return EXIT_SUCCESS; } - -/*--------------------------------------*\ - |* Private *| - \*-------------------------------------*/ - -/*----------------------------------------------------------------------*\ - |* End *| - \*---------------------------------------------------------------------*/ -