Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / Tuto_Image / src / cpp / core / 02_Damier_Zoomable / a_image / DamierImage.cpp
diff --git a/WCudaMSE/Tuto_Image/src/cpp/core/02_Damier_Zoomable/a_image/DamierImage.cpp b/WCudaMSE/Tuto_Image/src/cpp/core/02_Damier_Zoomable/a_image/DamierImage.cpp
new file mode 100755 (executable)
index 0000000..a3373d9
--- /dev/null
@@ -0,0 +1,110 @@
+#include <iostream>\r
+#include <math.h>\r
+\r
+#include "DamierImage.h"\r
+#include "StringTools.h"\r
+#include "OmpTools.h"\r
+#include "MathTools.h"\r
+#include "IndiceTools.h"\r
+#include "ColorTools.h"\r
+\r
+using std::cout;\r
+using std::endl;\r
+using std::string;\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Declaration                                     *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Public                  *|\r
+ \*-------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Private                 *|\r
+ \*-------------------------------------*/\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Implementation                                  *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Public                  *|\r
+ \*-------------------------------------*/\r
+\r
+/**\r
+ * DomaineMaths(0, 0, 2 * PI, 2 * PI) : par exemple, why not celui là!\r
+ */\r
+DamierImage::DamierImage(unsigned int w, unsigned int h, float dt, int n) :\r
+       ImageFonctionelMOOs_A(w, h, DomaineMath(0, 0, 2 * PI, 2 * PI))\r
+    {\r
+    //Tools\r
+    this->ptrDamierMOO=new DamierMOO(w,h,dt,n);\r
+\r
+    setEnableDomaineOverlay(true);\r
+    }\r
+\r
+DamierImage::~DamierImage(void)\r
+    {\r
+    delete ptrDamierMOO;\r
+    }\r
+\r
+/*--------------------------------------*\\r
+ |*            Override                *|\r
+ \*-------------------------------------*/\r
+\r
+/**\r
+ * Override\r
+ * Called automatically by the API\r
+ */\r
+void DamierImage::fillImageGL(uchar4* ptrTabPixels, int w, int h, const DomaineMath& domaineMath)\r
+    {\r
+    ptrDamierMOO->process(ptrTabPixels,  w,  h,domaineMath);\r
+    }\r
+\r
+/**\r
+ * Override\r
+ * call periodicly by the api\r
+ */\r
+void DamierImage::animationStep(bool& isNeedUpdateView)\r
+    {\r
+    ptrDamierMOO->animationStep();\r
+    }\r
+\r
+/**\r
+ * Override\r
+ * call periodicly by the api\r
+ */\r
+void DamierImage::paintPrimitives(Graphic2Ds& graphic2D)\r
+    {\r
+    const Font_A* ptrFont = graphic2D.getFont(TIMES_ROMAN_24);\r
+\r
+    float r = 0;\r
+    float g = 0;\r
+    float b = 0;\r
+    graphic2D.setColorRGB(r, g, b);\r
+\r
+    // Top\r
+       {\r
+       float t=ptrDamierMOO->getT();\r
+       int n=ptrDamierMOO->getN();\r
+\r
+       string message = "t = " + StringTools::toString(t) + "  n = " + StringTools::toString(n);\r
+       graphic2D.drawTitleTop(message, ptrFont);\r
+       }\r
+\r
+    // Bottom\r
+       {\r
+       graphic2D.drawTitleBottom("[API Image Fonctionelle] : Damier zoomable OMP", ptrFont);\r
+       }\r
+    }\r
+\r
+/*--------------------------------------*\\r
+ |*            Private                 *|\r
+ \*-------------------------------------*/\r
+\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    End                                             *|\r
+ \*---------------------------------------------------------------------*/\r
+\r