X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FBilatTools_Cuda_Image%2Fsrc%2Fcore%2FcudaImageTools%2Ffonctionel%2Fcpp%2FImageFonctionel.cpp;fp=WCudaMSE%2FBilatTools_Cuda_Image%2Fsrc%2Fcore%2FcudaImageTools%2Ffonctionel%2Fcpp%2FImageFonctionel.cpp;h=b00290406a9a7a661fe09e5311c9ccb3292d8ef0;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/cpp/ImageFonctionel.cpp b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/cpp/ImageFonctionel.cpp new file mode 100755 index 0000000..b002904 --- /dev/null +++ b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/cpp/ImageFonctionel.cpp @@ -0,0 +1,103 @@ +#include +#include +#include + +#include "ImageFonctionel.h" +#include "StringTools.h" +#include "MathTools.h" + +using std::cout; +using std::endl; + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Imported *| + \*-------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +ImageFonctionel::ImageFonctionel(AnimableFonctionel_I* ptrAnimable, ColorRGB_01* ptrColorTitreRGB) : + ImageFonctionelMOOs_A(ptrAnimable->getW(), ptrAnimable->getH(), *ptrAnimable->getDomaineMathInit()) + { + this->ptrAnimable = ptrAnimable; + this->ptrColorTitreRGB = ptrColorTitreRGB; + + setEnableDomaineOverlay(true); + } + +ImageFonctionel::~ImageFonctionel(void) + { + delete ptrAnimable; + } + +/** + * Override + */ +void ImageFonctionel::animationStep(bool& isNeedUpdateView) + { + // cout << "[CBI] : Image : animationStep" <animationStep(); + isNeedUpdateView = true; // true par default + } + +/** + * Override + */ +void ImageFonctionel::fillImageGL(uchar4* ptrDevImageGL, int w, int h, const DomaineMath& domaineMath) // override + { + // cout << "[CBI] : Image : fillImageGL" <runGPU(ptrDevImageGL, domaineMath); + } + +/** + * Override + */ +void ImageFonctionel::paintPrimitives(Graphic2Ds& graphic2D) // redefinition + { + const Font_A* ptrfont = graphic2D.getFont(TIMES_ROMAN_24); + + float r = ptrColorTitreRGB->r; + float g = ptrColorTitreRGB->g; + float b = ptrColorTitreRGB->b; + graphic2D.setColorRGB(r, g, b); + + // top + { + float t = ptrAnimable->getT(); + string message = "t = " + StringTools::toString(t); + graphic2D.drawTitleTop(message, ptrfont); + } + + // bottom + { + string title = ptrAnimable->getTitle(); + graphic2D.drawTitleBottom(title, ptrfont); + } + } + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/