Creation de viewer pour faciliter l'activation ou non des differents codes des labos.
authorgburri <gregory.burri@master.hes-so.ch>
Wed, 19 Nov 2014 20:58:58 +0000 (21:58 +0100)
committergburri <gregory.burri@master.hes-so.ch>
Wed, 19 Nov 2014 20:58:58 +0000 (21:58 +0100)
WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp

index f71dc78..3d4d02f 100755 (executable)
@@ -16,63 +16,50 @@ using std::cout;
 using std::endl;\r
 using std::string;\r
 \r
-/*----------------------------------------------------------------------*\\r
- |*                    Declaration                                     *|\r
- \*---------------------------------------------------------------------*/\r
-\r
-/*--------------------------------------*\\r
- |*            Imported                *|\r
- \*-------------------------------------*/\r
-\r
-/*--------------------------------------*\\r
- |*            Public                  *|\r
- \*-------------------------------------*/\r
-\r
-int mainGL(void);\r
-\r
-/*--------------------------------------*\\r
- |*            Private                 *|\r
- \*-------------------------------------*/\r
-\r
-/*----------------------------------------------------------------------*\\r
- |*                    Implementation                                  *|\r
- \*---------------------------------------------------------------------*/\r
-\r
-/*--------------------------------------*\\r
- |*            Public                  *|\r
- \*-------------------------------------*/\r
+class RipplingViewer\r
+    {\r
+    public:\r
+        RipplingViewer()\r
+            : ptrRippling0(Rippling0Provider::createGL()), ptrRippling(RipplingProvider::createGL()),\r
+              rippling0Viewer(this->ptrRippling0, true, true, 0, 0),\r
+              ripplingViewer(this->ptrRippling, true, true, 20, 20)\r
+            {}\r
+        ~RipplingViewer()\r
+            {\r
+                delete this->ptrRippling0;\r
+                delete this->ptrRippling;\r
+            }\r
+    private:\r
+        Rippling0Image* ptrRippling0;\r
+        Image* ptrRippling;\r
+        GLUTImageViewers rippling0Viewer, ripplingViewer;\r
+    };\r
+\r
+class FractalViewer\r
+    {\r
+    public:\r
+        FractalViewer()\r
+            : ptrMandelbrot(FractalProvider::createMandelbrotGL()), ptrJulia(FractalProvider::createJuliaGL()),\r
+              mandelbrotViewer(this->ptrMandelbrot, true, true, 0, 0),\r
+              juliaViewer(this->ptrJulia, true, true, 20, 20)\r
+            {}\r
+        ~FractalViewer()\r
+            {\r
+                delete this->ptrMandelbrot;\r
+                delete this->ptrJulia;\r
+            }\r
+    private:\r
+        ImageFonctionel* ptrMandelbrot;\r
+        ImageFonctionel* ptrJulia;\r
+        GLUTImageViewers mandelbrotViewer, juliaViewer;\r
+    };\r
 \r
 int mainGL(void)\r
     {\r
-    //Rippling0Image* ptrRippling0 = Rippling0Provider::createGL();\r
-    //Image* ptrRippling = RipplingProvider::createGL();\r
-    //ImageFonctionel* ptrFractalMandelbrot = FractalProvider::createMandelbrotGL();\r
-    //ImageFonctionel* ptrFractalJulia = FractalProvider::createJuliaGL();\r
-\r
-    const bool isAnimation = true;\r
-    const bool isSelection = true;\r
-\r
-    //GLUTImageViewers rippling0Viewer(ptrRippling0, isAnimation, isSelection, 0, 0);\r
-    //GLUTImageViewers ripplingViewer(ptrRippling, isAnimation, isSelection, 10, 10);\r
-    //GLUTImageViewers fractalMandelbrotViewer(ptrFractalMandelbrot, true, true, 20, 20);\r
-    //GLUTImageViewers fractalJuliaViewer(ptrFractalJulia, true, true, 20, 20);\r
+    // RipplingViewer rippling;\r
+    // FractalViewer fractals;\r
 \r
     GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte\r
 \r
-    // destruction\r
-    //delete ptrRippling0;\r
-    //delete ptrRippling;\r
-    //delete ptrFractalMandelbrot;\r
-    delete ptrFractalJulia;\r
-\r
     return EXIT_SUCCESS;\r
     }\r
-\r
-/*--------------------------------------*\\r
- |*            Private                 *|\r
- \*-------------------------------------*/\r
-\r
-/*----------------------------------------------------------------------*\\r
- |*                    End                                             *|\r
- \*---------------------------------------------------------------------*/\r
-\r