X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FAPI_Bilat_Image_GL%2FINC%2Fcommon%2FGLImages_A.h;fp=WCudaMSE%2FAPI_Bilat_Image_GL%2FINC%2Fcommon%2FGLImages_A.h;h=f754668273207c67209fa4d2dc57b080278ed2b5;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git 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 index 0000000..f754668 --- /dev/null +++ b/WCudaMSE/API_Bilat_Image_GL/INC/common/GLImages_A.h @@ -0,0 +1,159 @@ +#ifndef GLIMAGE_API_WINDOWS_H +#define GLIMAGE_API_WINDOWS_H + +#ifdef _WIN32 +#include +#else +#include +#endif + +#include "envGLImage.h" +#include "ImageObserver_I.h" +#include "Displayable_A.h" +#include "GLPrimitiveDrawers.h" +#include "Graphic2Ds.h" + +#include +using std::string; + +#include +using std::vector; + +#include "ImageMOOs_I.h" + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +class CBI_GLIMAGE GLImages_A: public Displayable_A, public KeyListener_I, public MouseListener_I, public ImageObserver_I + { + + /*--------------------------------------*\ + |* Constructor *| + \*-------------------------------------*/ + + public: + + GLImages_A(ImageMOOs_I* ptrImageMOO, bool isAnimationEnable = true); + + /*--------------------------------------*\ + |* Destructor *| + \*-------------------------------------*/ + + public: + + virtual ~GLImages_A(); + + /*--------------------------------------*\ + |* Methodes *| + \*-------------------------------------*/ + + public: + + virtual void init(Panel_A &panel); + + virtual void reshape(Panel_A &panel, int w, int h); + + virtual void display(Panel_A &panel); + + virtual void release(Panel_A &panel); + + virtual void onKeyPressed(const KeyEvent &event); + + virtual void onMouseMoved(const MouseEvent &event); + + virtual void onMousePressed(const MouseEvent &event); + + virtual void onMouseReleased(const MouseEvent &event); + + virtual void onMouseWheel(const MouseWheelEvent &event); + + virtual void onImageUpdate(); + + protected: + + virtual void fillPBO()=0; + + virtual void drawPrimitives(Panel_A &panel); + + virtual void createPBO(); + + virtual void createTexture(); + + void drawTexture(); + + void deleteTexture(); + + void drawCredits(Panel_A &panel); + + private: + + /** + * Update view from model, still need to manualy repaint the Window + */ + void updateView(); + + void toImageSpaceCoordinate(int x, int y, int &imageX, int &imageY); + + /*--------------------------------------*\ + |* Get *| + \*-------------------------------------*/ + public: + /** + * width of the frame + */ + int getDxFrame(); + + /** + * height of the frame + */ + int getDyFrame(); + + ImageMOOs_I* getImageMOO(); + + protected: + + GLuint getPboID(); + + GLuint getTextureID(); + + /*--------------------------------------*\ + |* Is *| + \*-------------------------------------*/ + + public: + + bool isAnimationEnable() const; + + /*--------------------------------------*\ + |* Set *| + \*-------------------------------------*/ + + public: + + void setAnimationEnable(bool isEnable); + + /*--------------------------------------*\ + |* Attributs *| + \*-------------------------------------*/ + + protected: + + // Inputs + ImageMOOs_I* ptrImageMOO; + bool animationEnable; + int dxFrame; + int dyFrame; + + // OpenGL + GLPrimitiveDrawers glPrimitiveDrawer; + Graphic2Ds graphique2D; + GLuint textureID; + GLuint pbo; + }; + +#endif