Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_Bilat_Image_GL / INC / common / GLImages_A.h
diff --git a/WCudaMSE/API_Bilat_Image_GL/INC/common/GLImages_A.h b/WCudaMSE/API_Bilat_Image_GL/INC/common/GLImages_A.h
new file mode 100755 (executable)
index 0000000..f754668
--- /dev/null
@@ -0,0 +1,159 @@
+#ifndef GLIMAGE_API_WINDOWS_H\r
+#define GLIMAGE_API_WINDOWS_H\r
+\r
+#ifdef _WIN32\r
+#include <glew.h>\r
+#else\r
+#include <GL/glew.h>\r
+#endif\r
+\r
+#include "envGLImage.h"\r
+#include "ImageObserver_I.h"\r
+#include "Displayable_A.h"\r
+#include "GLPrimitiveDrawers.h"\r
+#include "Graphic2Ds.h"\r
+\r
+#include <string>\r
+using std::string;\r
+\r
+#include <vector>\r
+using std::vector;\r
+\r
+#include "ImageMOOs_I.h"\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Declaration                                     *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Public                  *|\r
+ \*-------------------------------------*/\r
+\r
+class CBI_GLIMAGE GLImages_A: public Displayable_A, public KeyListener_I, public MouseListener_I, public ImageObserver_I\r
+    {\r
+\r
+       /*--------------------------------------*\\r
+        |*             Constructor             *|\r
+        \*-------------------------------------*/\r
+\r
+    public:\r
+\r
+       GLImages_A(ImageMOOs_I* ptrImageMOO, bool isAnimationEnable = true);\r
+\r
+       /*--------------------------------------*\\r
+        |*             Destructor              *|\r
+        \*-------------------------------------*/\r
+\r
+    public:\r
+\r
+       virtual ~GLImages_A();\r
+\r
+       /*--------------------------------------*\\r
+        |*             Methodes                *|\r
+        \*-------------------------------------*/\r
+\r
+    public:\r
+\r
+       virtual void init(Panel_A &panel);\r
+\r
+       virtual void reshape(Panel_A &panel, int w, int h);\r
+\r
+       virtual void display(Panel_A &panel);\r
+\r
+       virtual void release(Panel_A &panel);\r
+\r
+       virtual void onKeyPressed(const KeyEvent &event);\r
+\r
+       virtual void onMouseMoved(const MouseEvent &event);\r
+\r
+       virtual void onMousePressed(const MouseEvent &event);\r
+\r
+       virtual void onMouseReleased(const MouseEvent &event);\r
+\r
+       virtual void onMouseWheel(const MouseWheelEvent &event);\r
+\r
+       virtual void onImageUpdate();\r
+\r
+    protected:\r
+\r
+       virtual void fillPBO()=0;\r
+\r
+       virtual void drawPrimitives(Panel_A &panel);\r
+\r
+       virtual void createPBO();\r
+\r
+       virtual void createTexture();\r
+\r
+       void drawTexture();\r
+\r
+       void deleteTexture();\r
+\r
+       void drawCredits(Panel_A &panel);\r
+\r
+    private:\r
+\r
+       /**\r
+        * Update view from model, still need to manualy repaint the Window\r
+        */\r
+       void updateView();\r
+\r
+       void toImageSpaceCoordinate(int x, int y, int &imageX, int &imageY);\r
+\r
+       /*--------------------------------------*\\r
+        |*             Get                     *|\r
+        \*-------------------------------------*/\r
+    public:\r
+       /**\r
+        * width of the  frame\r
+        */\r
+       int getDxFrame();\r
+\r
+       /**\r
+        * height of the  frame\r
+        */\r
+       int getDyFrame();\r
+\r
+       ImageMOOs_I* getImageMOO();\r
+\r
+    protected:\r
+\r
+       GLuint getPboID();\r
+\r
+       GLuint getTextureID();\r
+\r
+       /*--------------------------------------*\\r
+        |*             Is                      *|\r
+        \*-------------------------------------*/\r
+\r
+    public:\r
+\r
+       bool isAnimationEnable() const;\r
+\r
+       /*--------------------------------------*\\r
+        |*             Set                     *|\r
+        \*-------------------------------------*/\r
+\r
+    public:\r
+\r
+       void setAnimationEnable(bool isEnable);\r
+\r
+       /*--------------------------------------*\\r
+        |*             Attributs               *|\r
+        \*-------------------------------------*/\r
+\r
+    protected:\r
+\r
+       // Inputs\r
+       ImageMOOs_I* ptrImageMOO;\r
+       bool animationEnable;\r
+       int dxFrame;\r
+       int dyFrame;\r
+\r
+       // OpenGL\r
+       GLPrimitiveDrawers glPrimitiveDrawer;\r
+       Graphic2Ds graphique2D;\r
+       GLuint textureID;\r
+       GLuint pbo;\r
+    };\r
+\r
+#endif\r