6 #include "StringTools.h"
12 /*----------------------------------------------------------------------*\
14 \*---------------------------------------------------------------------*/
16 /*--------------------------------------*\
18 \*-------------------------------------*/
20 /*--------------------------------------*\
22 \*-------------------------------------*/
24 /*--------------------------------------*\
26 \*-------------------------------------*/
28 /*----------------------------------------------------------------------*\
30 \*---------------------------------------------------------------------*/
32 /*--------------------------------------*\
34 \*-------------------------------------*/
36 Image::Image(Animable_I
* ptrAnimable
,ColorRGB_01
* ptrColorTitreRGB
) :
37 ImageMOOs_A(ptrAnimable
->getW(), ptrAnimable
->getH())
39 this->ptrAnimable
= ptrAnimable
;
40 this->ptrColorTitreRGB
=ptrColorTitreRGB
;
42 this->valueNames
= ptrAnimable
->getNames();
43 this->values
= new float[this->valueNames
.size()];
54 void Image::animationStep(bool& isNeedUpdateView
)
56 // cout << "[CBI] : Image : animationStep" <<endl;
58 ptrAnimable
->animationStep();
59 isNeedUpdateView
= true; // true par default
65 void Image::fillImageGL(uchar4
* ptrDevImageGL
, int w
, int h
)
67 // cout << "[CBI] : Image : fillImageGL" <<endl;
69 ptrAnimable
->runGPU(ptrDevImageGL
);
75 void Image::paintPrimitives(Graphic2Ds
& graphic2D
) // redefinition
77 const Font_A
* ptrfont
= graphic2D
.getFont(TIMES_ROMAN_24
);
79 float r
= ptrColorTitreRGB
->r
;
80 float g
= ptrColorTitreRGB
->g
;
81 float b
= ptrColorTitreRGB
->b
;
82 graphic2D
.setColorRGB(r
, g
, b
);
87 this->ptrAnimable
->getValues(this->values
);
88 for (int i
= 0; i
< this->valueNames
.size(); i
++)
92 title
+= this->valueNames
[i
];
93 title
+= StringTools::toString(this->values
[i
]);
95 graphic2D
.drawTitleTop(title
, ptrfont
);
100 string title
= ptrAnimable
->getTitle();
101 graphic2D
.drawTitleBottom(title
, ptrfont
);
105 /*--------------------------------------*\
107 \*-------------------------------------*/
109 /*----------------------------------------------------------------------*\
111 \*---------------------------------------------------------------------*/