#include <iostream>\r
#include <stdlib.h>\r
#include <string.h>\r
+using namespace std;\r
\r
#include "GLUTImageViewers.h"\r
\r
\r
#include "Rippling0Provider.h"\r
#include "RipplingProvider.h"\r
-\r
#include "FractalProvider.h"\r
+#include "NewtonProvider.h"\r
+#include "HeatTransfertProvider.h"\r
+#include "RayTracingProvider.h"\r
+#include "ConvolutionProvider.h"\r
\r
-using std::cout;\r
-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
+#include "Viewer.h"\r
\r
-/*--------------------------------------*\\r
- |* Private *|\r
- \*-------------------------------------*/\r
-\r
-/*----------------------------------------------------------------------*\\r
- |* Implementation *|\r
- \*---------------------------------------------------------------------*/\r
-\r
-/*--------------------------------------*\\r
- |* Public *|\r
- \*-------------------------------------*/\r
-\r
-int mainGL(void)\r
+int mainGL(const vector<string>& args)\r
{\r
- //Rippling0Image* ptrRippling0 = Rippling0Provider::createGL();\r
- //Image* ptrRippling = RipplingProvider::createGL();\r
-\r
- ImageFonctionel* ptrFractalMandelbrot = FractalProvider::createGL();\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
-\r
- GLUTImageViewers fractalMandelbrotViewer(ptrFractalMandelbrot, true, true, 20, 20);\r
-\r
- GLUTImageViewers::runALL(); // Bloquant, Tant qu'une fenetre est ouverte\r
-\r
- // destruction\r
- //delete ptrRippling0;\r
- //delete ptrRippling;\r
-\r
- delete ptrFractalMandelbrot;\r
+ const string defaultCommand = "raytracing";\r
+ const string command = args.size() > 0 ? args[0] : defaultCommand;\r
+\r
+ // AutoViewer<Rippling0Image, Rippling0Provider> rippling0(true, true, 10, 10); // Warmup.\r
+\r
+ if (command == "rippling")\r
+ {\r
+ AutoViewer<Image, RipplingProvider> rippling(true, true, 10, 10);\r
+ }\r
+ else if (command == "mandelbrot")\r
+ {\r
+ const bool multiGPU = args.size() >= 2 && args[1] == "--mp";\r
+ Viewer<ImageFonctionel> fractalMandelbrot(MandelbrotProvider::createGL(multiGPU), true, true, 10, 10);\r
+ }\r
+ else if (command == "julia")\r
+ AutoViewer<ImageFonctionel, JuliaProvider> fractalJulia(true, true, 10, 10);\r
+ else if (command == "newton")\r
+ AutoViewer<ImageFonctionel, NewtonProvider> newtown(true, true, 10, 10);\r
+ else if (command == "heat-transfert")\r
+ AutoViewer<Image, HeatTransfertProvider> heatTransfert(true, false, 10, 10);\r
+ else if (command == "raytracing")\r
+ AutoViewer<Image, RayTracingProvider> rayTracing(true, true, 20, 20);\r
+ else if (command == "convolution")\r
+ {\r
+ const string videoPath = args.size() >= 2 ? args[1] : "/media/Data/Video/nasaFHD_short.avi"; // Vidéo par défaut si pas donnée en paramètre.\r
+ Viewer<Image> convolution(ConvolutionProvider::createGL(videoPath), true, true, 10, 10);\r
+ }\r
+ else if (command == "demo")\r
+ {\r
+ Viewer<Image> convolution(ConvolutionProvider::createGL("/media/Data/Video/nasaFHD_short.avi"), true, true, 10, 10, false);\r
+ AutoViewer<Image, RipplingProvider> rippling(true, true, 60, 30, false);\r
+ Viewer<ImageFonctionel> fractalMandelbrot(MandelbrotProvider::createGL(false), true, true, 120, 60, false);\r
+ AutoViewer<ImageFonctionel, JuliaProvider> fractalJulia(true, true, 180, 80, false);\r
+ AutoViewer<ImageFonctionel, NewtonProvider> newtown(true, true, 260, 120, false);\r
+ AutoViewer<Image, HeatTransfertProvider> heatTransfert(true, false, 1200, 300, false);\r
+ GLUTImageViewers::runALL();\r
+ }\r
+ else\r
+ {\r
+ cout << "Command unknown: " << command << endl;\r
+ }\r
\r
return EXIT_SUCCESS;\r
}\r
-\r
-/*--------------------------------------*\\r
- |* Private *|\r
- \*-------------------------------------*/\r
-\r
-/*----------------------------------------------------------------------*\\r
- |* End *|\r
- \*---------------------------------------------------------------------*/\r
-\r