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(
40 *ptrAnimable
->getDomaineMathInit()
43 this->ptrAnimable
= ptrAnimable
;
44 this->ptrColorTitreRGB
= ptrColorTitreRGB
;
45 this->tName
= ptrAnimable
->getTName();
47 setEnableDomaineOverlay(true);
50 ImageFonctionel::~ImageFonctionel(void)
58 void ImageFonctionel::animationStep(bool& isNeedUpdateView
)
60 // cout << "[CBI] : Image : animationStep" <<endl;
62 ptrAnimable
->animationStep();
63 isNeedUpdateView
= true; // true par default
69 void ImageFonctionel::fillImageGL(uchar4
* ptrDevImageGL
, int w
, int h
, const DomaineMath
& domaineMath
) // override
71 // cout << "[CBI] : Image : fillImageGL" <<endl;
73 ptrAnimable
->runGPU(ptrDevImageGL
, domaineMath
);
79 void ImageFonctionel::paintPrimitives(Graphic2Ds
& graphic2D
) // redefinition
81 const Font_A
* ptrfont
= graphic2D
.getFont(TIMES_ROMAN_24
);
83 float r
= ptrColorTitreRGB
->r
;
84 float g
= ptrColorTitreRGB
->g
;
85 float b
= ptrColorTitreRGB
->b
;
86 graphic2D
.setColorRGB(r
, g
, b
);
90 float t
= ptrAnimable
->getT();
91 string message
= this->tName
+ StringTools::toString(t
);
92 graphic2D
.drawTitleTop(message
, ptrfont
);
97 string title
= ptrAnimable
->getTitle();
98 graphic2D
.drawTitleBottom(title
, ptrfont
);
102 /*--------------------------------------*\
104 \*-------------------------------------*/
106 /*----------------------------------------------------------------------*\
108 \*---------------------------------------------------------------------*/