X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2FmainGL.cpp;h=b15ca7b3423f9972d57c41cabc8dc25668f2daf9;hb=fd0031be0a39a5d902750affaff6322fcd5229b1;hp=3d4d02f88f80e42573770ef4ebc869fb4aa487a7;hpb=7a1564c56b396cfeb1cbc246fe7b441304364465;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 3d4d02f..b15ca7b 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,57 +10,48 @@ #include "Rippling0Provider.h" #include "RipplingProvider.h" - #include "FractalProvider.h" +#include "NewtonProvider.h" +#include "HeatTransfertProvider.h" +#include "RayTracingProvider.h" -using std::cout; -using std::endl; -using std::string; - -class RipplingViewer +template +class Viewer { + private: + TOutput* ptrOutput; + GLUTImageViewers viewer; + public: - RipplingViewer() - : ptrRippling0(Rippling0Provider::createGL()), ptrRippling(RipplingProvider::createGL()), - rippling0Viewer(this->ptrRippling0, true, true, 0, 0), - ripplingViewer(this->ptrRippling, true, true, 20, 20) - {} - ~RipplingViewer() + Viewer(bool isAnimation, bool isSelection, int pxFrame, int pyFrame): + ptrOutput(TProvider::createGL()), + viewer(ptrOutput, isAnimation, isSelection, pxFrame, pyFrame) { - 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() + Viewer(TOutput* output, bool isAnimation, bool isSelection, int pxFrame, int pyFrame): + ptrOutput(output), + viewer(ptrOutput, isAnimation, isSelection, pxFrame, pyFrame) { - delete this->ptrMandelbrot; - delete this->ptrJulia; } - private: - ImageFonctionel* ptrMandelbrot; - ImageFonctionel* ptrJulia; - GLUTImageViewers mandelbrotViewer, juliaViewer; + + ~Viewer() + { + delete this->ptrOutput; + } }; int mainGL(void) { - // RipplingViewer rippling; - // FractalViewer fractals; - - GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte + // Viewer rippling0(true, true, 10, 10); + // Viewer rippling0(true, true, 10, 10); + Viewer fractalMandelbrot(MandelbrotProvider::createGL(true), true, true, 20, 20); + // Viewer fractalJulia(true, true, 30, 30); + // Viewer newtown(true, true, 20, 20); + // Viewer heatTransfert(true, false, 20, 20); + // Viewer rayTracing(true, true, 20, 20); + + GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte. return EXIT_SUCCESS; }