4 #include "envGLImage.h"
5 #include "KeyListener_I.h"
6 #include "MouseListener_I.h"
7 #include "ImageObserver_I.h"
8 #include "Graphic2Ds.h"
18 /*----------------------------------------------------------------------*\
20 \*---------------------------------------------------------------------*/
22 /*--------------------------------------*\
24 \*-------------------------------------*/
27 * Base class for Image Model.
29 class CBI_GLIMAGE ImageMOOs_I
32 /*--------------------------------------*\
34 \*-------------------------------------*/
36 ImageMOOs_I(unsigned int width
, unsigned int height
);
38 ImageMOOs_I(const ImageMOOs_I
&imageSource
);
40 /*--------------------------------------*\
42 \*-------------------------------------*/
44 virtual ~ImageMOOs_I();
46 /*--------------------------------------*\
48 \*-------------------------------------*/
51 * A redefinir par l'utilisateur
53 virtual void animationStep(bool& isNeedUpdateView
)=0;
56 * A redefinir par l'utilisateur
58 virtual void paintPrimitives(Graphic2Ds
& ptrGraphic2D
)=0;
63 virtual void animationStepAPI(bool& isNeedUpdateView
);
68 virtual void paintPrimitivesAPI(Graphic2Ds
& ptrGraphic2D
);
70 virtual void print(ostream
& stream
) const;
72 void registerImageObserver(ImageObserver_I
&ptrObserver
);
74 void unregisterImageObserver(ImageObserver_I
&ptrObserver
);
77 * Notify all registred ImageObserver_I
78 * @see registerImageObserver
82 /*--------------------------------------*\
84 \*-------------------------------------*/
87 void setKeyListener(KeyListener_I
* ptrKeyListener
);
89 void setMouseListener(MouseListener_I
* ptrMouseListener
);
91 /*--------------------------------------*\
93 \*-------------------------------------*/
97 inline unsigned int getW() const
102 inline unsigned int getH() const
107 inline KeyListener_I
* getKeyListener() const
109 return ptrKeyListener
;
112 inline MouseListener_I
* getMouseListener() const
114 return ptrMouseListener
;
117 unsigned int getSizeOctet() const;
119 /*--------------------------------------*\
121 \*-------------------------------------*/
124 * call image.print(stream)
127 friend ostream
& operator<<(ostream
& stream
, const ImageMOOs_I
& image
);
129 /*--------------------------------------*\
131 \*-------------------------------------*/
139 KeyListener_I
* ptrKeyListener
;
140 MouseListener_I
* ptrMouseListener
;
141 vector
<ImageObserver_I
*> vectorObservable
;
147 /*----------------------------------------------------------------------*\
149 \*---------------------------------------------------------------------*/