5 #include "ImageFonctionel.h"
6 #include "StringTools.h"
12 /*----------------------------------------------------------------------*\
14 \*---------------------------------------------------------------------*/
16 /*--------------------------------------*\
18 \*-------------------------------------*/
20 /*--------------------------------------*\
22 \*-------------------------------------*/
24 /*--------------------------------------*\
26 \*-------------------------------------*/
28 /*----------------------------------------------------------------------*\
30 \*---------------------------------------------------------------------*/
32 /*--------------------------------------*\
34 \*-------------------------------------*/
36 ImageFonctionel::ImageFonctionel(AnimableFonctionel_I
* ptrAnimable
, ColorRGB_01
* ptrColorTitreRGB
) :
37 ImageFonctionelMOOs_A(ptrAnimable
->getW(), ptrAnimable
->getH(), *ptrAnimable
->getDomaineMathInit())
39 this->ptrAnimable
= ptrAnimable
;
40 this->ptrColorTitreRGB
= ptrColorTitreRGB
;
42 setEnableDomaineOverlay(true);
45 ImageFonctionel::~ImageFonctionel(void)
53 void ImageFonctionel::animationStep(bool& isNeedUpdateView
)
55 // cout << "[CBI] : Image : animationStep" <<endl;
57 ptrAnimable
->animationStep();
58 isNeedUpdateView
= true; // true par default
64 void ImageFonctionel::fillImageGL(uchar4
* ptrDevImageGL
, int w
, int h
, const DomaineMath
& domaineMath
) // override
66 // cout << "[CBI] : Image : fillImageGL" <<endl;
68 ptrAnimable
->runGPU(ptrDevImageGL
, domaineMath
);
74 void ImageFonctionel::paintPrimitives(Graphic2Ds
& graphic2D
) // redefinition
76 const Font_A
* ptrfont
= graphic2D
.getFont(TIMES_ROMAN_24
);
78 float r
= ptrColorTitreRGB
->r
;
79 float g
= ptrColorTitreRGB
->g
;
80 float b
= ptrColorTitreRGB
->b
;
81 graphic2D
.setColorRGB(r
, g
, b
);
85 float t
= ptrAnimable
->getT();
86 string message
= "t = " + StringTools::toString(t
);
87 graphic2D
.drawTitleTop(message
, ptrfont
);
92 string title
= ptrAnimable
->getTitle();
93 graphic2D
.drawTitleBottom(title
, ptrfont
);
97 /*--------------------------------------*\
99 \*-------------------------------------*/
101 /*----------------------------------------------------------------------*\
103 \*---------------------------------------------------------------------*/