From: gburri Date: Thu, 18 Dec 2014 12:53:25 +0000 (+0100) Subject: Cleanage. X-Git-Url: https://git.euphorik.ch/?a=commitdiff_plain;h=2fd5d915e8a9de4d957d6031d2d68088784eac3c;p=GPU.git Cleanage. --- diff --git a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/cpp/Image.cpp b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/cpp/Image.cpp index 5ae2097..fa0eedf 100755 --- a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/cpp/Image.cpp +++ b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/cpp/Image.cpp @@ -38,6 +38,9 @@ Image::Image(Animable_I* ptrAnimable,ColorRGB_01* ptrColorTitreRGB) : { this->ptrAnimable = ptrAnimable; this->ptrColorTitreRGB=ptrColorTitreRGB; + + this->valueNames = ptrAnimable->getNames(); + this->values = new float[this->valueNames.size()]; } Image::~Image(void) @@ -80,9 +83,16 @@ void Image::paintPrimitives(Graphic2Ds& graphic2D) // redefinition // top { - float t = ptrAnimable->getT(); - string message = "t = " + StringTools::toString(t); - graphic2D.drawTitleTop(message, ptrfont); + string title; + this->ptrAnimable->getValues(this->values); + for (int i = 0; i < this->valueNames.size(); i++) + { + if (i != 0) + title += ", "; + title += this->valueNames[i]; + title += StringTools::toString(this->values[i]); + } + graphic2D.drawTitleTop(title, ptrfont); } // bottom diff --git a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/header/Animable_I.h b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/header/Animable_I.h index b421793..e50d301 100755 --- a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/header/Animable_I.h +++ b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/header/Animable_I.h @@ -1,10 +1,10 @@ #ifndef ANIMABLE_I_H_ #define ANIMABLE_I_H_ -#include -#include "cudaTools.h" +#include +#include -using std::string; +#include "cudaTools.h" /*----------------------------------------------------------------------*\ |* Declaration *| @@ -25,12 +25,15 @@ class Animable_I virtual int getW()=0; virtual int getH()=0; - /** - * getParaAnimation - */ - virtual float getT() = 0; + /** + * Ancienne version de l'interface. + */ + virtual float getT() { return 0.0; }; + + virtual std::vector getNames() { std::vector def; def.push_back("t = "); return def; } + virtual void getValues(float* values) { values[0] = this->getT(); } - virtual string getTitle() = 0; + virtual std::string getTitle() = 0; }; #endif diff --git a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/header/Image.h b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/header/Image.h index 69729c6..d68ec99 100755 --- a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/header/Image.h +++ b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/bitmap/header/Image.h @@ -54,6 +54,9 @@ class Image: public ImageMOOs_A // Input Animable_I* ptrAnimable; ColorRGB_01* ptrColorTitreRGB; + + std::vector valueNames; + float* values; }; #endif 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 index af78e9e..899519f 100755 --- a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/cpp/ImageFonctionel.cpp +++ b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/cpp/ImageFonctionel.cpp @@ -42,14 +42,16 @@ ImageFonctionel::ImageFonctionel(AnimableFonctionel_I* ptrAnimable, ColorRGB_01* { this->ptrAnimable = ptrAnimable; this->ptrColorTitreRGB = ptrColorTitreRGB; - this->tName = ptrAnimable->getTName(); + this->valueNames = ptrAnimable->getNames(); + this->values = new float[this->valueNames.size()]; setEnableDomaineOverlay(true); } ImageFonctionel::~ImageFonctionel(void) { - delete ptrAnimable; + delete this->ptrAnimable; + delete[] this->values; } /** @@ -87,9 +89,16 @@ void ImageFonctionel::paintPrimitives(Graphic2Ds& graphic2D) // redefinition // top { - float t = ptrAnimable->getT(); - string message = this->tName + StringTools::toString(t); - graphic2D.drawTitleTop(message, ptrfont); + string title; + this->ptrAnimable->getValues(this->values); + for (int i = 0; i < this->valueNames.size(); i++) + { + if (i != 0) + title += ", "; + title += this->valueNames[i]; + title += StringTools::toString(this->values[i]); + } + graphic2D.drawTitleTop(title, ptrfont); } // bottom diff --git a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/header/AnimableFonctionel_I.h b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/header/AnimableFonctionel_I.h index d5a2efd..d562b05 100755 --- a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/header/AnimableFonctionel_I.h +++ b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/header/AnimableFonctionel_I.h @@ -2,14 +2,12 @@ #define ANIMABLE_FONCTIONEL_I_H_ #include +#include +#include #include "cudaTools.h" #include "DomaineMath.h" -using std::string; - - - /*----------------------------------------------------------------------*\ |* Declaration *| \*---------------------------------------------------------------------*/ @@ -31,12 +29,14 @@ class AnimableFonctionel_I virtual DomaineMath* getDomaineMathInit(void)=0; /** - * getParaAnimation + * Ancienne version de l'interface. */ - virtual float getT(void)=0; - virtual string getTName() { return "t = "; } + virtual float getT(void) { return 0.0; }; + + virtual std::vector getNames() { std::vector def; def.push_back("t = "); return def; } + virtual void getValues(float* values) { values[0] = this->getT(); } - virtual string getTitle(void)=0; + virtual std::string getTitle(void)=0; }; #endif diff --git a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/header/ImageFonctionel.h b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/header/ImageFonctionel.h index d0c1f6b..0c5ad17 100755 --- a/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/header/ImageFonctionel.h +++ b/WCudaMSE/BilatTools_Cuda_Image/src/core/cudaImageTools/fonctionel/header/ImageFonctionel.h @@ -1,14 +1,14 @@ #ifndef IMAGE_FONCTIONEL_H_ #define IMAGE_FONCTIONEL_H_ +#include + #include "ImageFonctionelMOOs_A.h" #include "MathTools.h" #include "ColorRGB_01.h" #include "AnimableFonctionel_I.h" - - /*----------------------------------------------------------------------*\ |* Declaration *| \*---------------------------------------------------------------------*/ @@ -50,12 +50,11 @@ class ImageFonctionel: public ImageFonctionelMOOs_A \*-------------------------------------*/ private: - - // Input AnimableFonctionel_I* ptrAnimable; ColorRGB_01* ptrColorTitreRGB; - string tName; + std::vector valueNames; + float* values; }; #endif diff --git a/WCudaMSE/RELEASE/doc/Student_Cuda_64.doc.tar.gz b/WCudaMSE/RELEASE/doc/Student_Cuda_64.doc.tar.gz deleted file mode 100644 index 95bf645..0000000 Binary files a/WCudaMSE/RELEASE/doc/Student_Cuda_64.doc.tar.gz and /dev/null differ diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/01_Rippling/moo/host/Rippling.h b/WCudaMSE/Student_Cuda_Image/src/cpp/core/01_Rippling/moo/host/Rippling.h index 0eb853e..b9ea8f4 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/01_Rippling/moo/host/Rippling.h +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/01_Rippling/moo/host/Rippling.h @@ -1,8 +1,8 @@ #ifndef RIPPLING_H_ #define RIPPLING_H_ -#include "cudaTools.h" #include "Animable_I.h" +#include "cudaTools.h" #include "MathTools.h" /*----------------------------------------------------------------------*\ @@ -41,7 +41,7 @@ class Rippling: public Animable_I virtual int getW(void); virtual int getH(void); - virtual string getTitle(void); + virtual std::string getTitle(void); private: @@ -62,7 +62,7 @@ class Rippling: public Animable_I float t; //Outputs - string title; + std::string title; }; #endif diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/device/FractalDevice.cu b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/device/FractalDevice.cu index 997b32b..a98ed36 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/device/FractalDevice.cu +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/device/FractalDevice.cu @@ -1,8 +1,9 @@ +#include "FractalDevice.h" + #include #include "Indice2D.h" #include "IndiceTools.h" -#include "DomaineMath.h" #include "cudaTools.h" #include "Device.h" @@ -11,22 +12,6 @@ using std::cout; using std::endl; -__global__ void fractalMandelbrot(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n); -__global__ void fractalJulia(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n, float c_r, float c_i); -__device__ void fractal(uchar4* ptrDevPixels, int w, int h, const DomaineMath& domaineMath, int n, const FractalMath& fractalMath); - -__global__ void fractalMandelbrot(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n) - { - FractalMandelbrotMath fractalMath(n); - fractal(ptrDevPixels, w, h, domaineMath, n, fractalMath); - } - -__global__ void fractalJulia(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n, float c_r, float c_i) - { - FractalJuliaMath fractalMath(n, c_r, c_i); - fractal(ptrDevPixels, w, h, domaineMath, n, fractalMath); - } - __device__ void fractal(uchar4* ptrDevPixels, int w, int h, const DomaineMath& domaineMath, int n, const FractalMath& fractalMath) { const int TID = Indice2D::tid(); @@ -55,3 +40,16 @@ __device__ void fractal(uchar4* ptrDevPixels, int w, int h, const DomaineMath& d s += NB_THREAD; } } + +__global__ void fractalMandelbrot(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n) + { + FractalMandelbrotMath fractalMath(n); + fractal(ptrDevPixels, w, h, domaineMath, n, fractalMath); + } + +__global__ void fractalJulia(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n, float c_r, float c_i) + { + FractalJuliaMath fractalMath(n, c_r, c_i); + fractal(ptrDevPixels, w, h, domaineMath, n, fractalMath); + } + diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/device/FractalDevice.h b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/device/FractalDevice.h new file mode 100644 index 0000000..137aab2 --- /dev/null +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/device/FractalDevice.h @@ -0,0 +1,9 @@ +#ifndef FRACTALDEVICE_H_ +#define FRACTALDEVICE_H_ + +#include "DomaineMath.h" + +__global__ void fractalMandelbrot(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n); +__global__ void fractalJulia(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n, float c_r, float c_i); + +#endif diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.cu b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.cu index 88a225b..bfaff4b 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.cu +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.cu @@ -1,20 +1,17 @@ +#include "Fractal.h" + #include #include +using namespace std; -#include "Fractal.h" +#include "FractalDevice.h" #include "Device.h" -using std::cout; -using std::endl; - -extern __global__ void fractalMandelbrot(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n); -extern __global__ void fractalJulia(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n, float c_r, float c_i); - -Fractal::Fractal(int w, int h) - : w(w), h(h), - dg(8, 8, 1), - db(16, 16, 1), - title("Fractal Cuda") +Fractal::Fractal(int w, int h) : + w(w), h(h), + dg(8, 8, 1), + db(16, 16, 1), + title("Fractal Cuda") { //print(dg, db); Device::assertDim(dg, db); @@ -56,8 +53,10 @@ string Fractal::getTitle() ///// -FractalMandelbrot::FractalMandelbrot(int w, int h, float dn) - : Fractal(w, h), variateurAnimationN(IntervalF(30, 100), dn) +FractalMandelbrot::FractalMandelbrot(int w, int h, int dn) : + Fractal(w, h), + variateurAnimationN(IntervalI(10, 100), dn), + n(0) { this->ptrDomaineMathInit = new DomaineMath(-2, -1.3, 0.8, 1.3); } @@ -67,9 +66,16 @@ void FractalMandelbrot::animationStep() this->n = this->variateurAnimationN.varierAndGet(); } -float FractalMandelbrot::getT() +vector FractalMandelbrot::getNames() { - return this->n; + vector name; + name.push_back("n = "); + return name; + } + +void FractalMandelbrot::getValues(float* values) + { + values[0] = float(this->n); } void FractalMandelbrot::runGPU(uchar4* ptrDevPixels, const DomaineMath& domaineMath) @@ -79,8 +85,13 @@ void FractalMandelbrot::runGPU(uchar4* ptrDevPixels, const DomaineMath& domaineM ///// -FractalJulia::FractalJulia(int w, int h, float dn, float z_r_min, float z_r_max, float z_i_min, float z_i_max) - : Fractal(w, h), z_r(z_r_min), z_i(z_i_min), variateurAnimationR(IntervalF(-0.8, -0.7), 0.0005), variateurAnimationI(IntervalF(-0.3, 0.3/*0.15*/), 0.0004) +FractalJulia::FractalJulia(int w, int h, int n, float z_r_min, float z_r_max, float z_i_min, float z_i_max) : + Fractal(w, h), + n(n), + z_r(z_r_min), + z_i(z_i_min), + variateurAnimationR(IntervalF(-0.8, -0.7), 0.0005), + variateurAnimationI(IntervalF(-0.3, 0.3), 0.0004) { this->ptrDomaineMathInit = new DomaineMath(-1.7, -1.4, 1.7, 1.4); } @@ -91,13 +102,22 @@ void FractalJulia::animationStep() this->z_i = this->variateurAnimationI.varierAndGet(); } -float FractalJulia::getT() +vector FractalJulia::getNames() + { + vector name; + name.push_back("z_r = "); + name.push_back("z_i = "); + return name; + } + +void FractalJulia::getValues(float* values) { - return this->z_r; + values[0] = this->z_r; + values[1] = this->z_i; } void FractalJulia::runGPU(uchar4* ptrDevPixels, const DomaineMath& domaineMath) { - fractalJulia<<>>(ptrDevPixels, this->w, this->h, domaineMath, 300, this->z_r, this->z_i); + fractalJulia<<>>(ptrDevPixels, this->w, this->h, domaineMath, this->n, this->z_r, this->z_i); } diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.h b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.h index d9b8841..5ad7b83 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.h +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/moo/host/Fractal.h @@ -1,9 +1,13 @@ #ifndef FRACTAL_H_ #define FRACTAL_H_ +#include +#include + #include "cudaTools.h" #include "AnimableFonctionel_I.h" #include "MathTools.h" +#include "VariateurI.h" #include "VariateurF.h" class Fractal : public AnimableFonctionel_I @@ -37,31 +41,36 @@ class Fractal : public AnimableFonctionel_I class FractalMandelbrot : public Fractal { public: - FractalMandelbrot(int w, int h, float dn); + FractalMandelbrot(int w, int h, int dn); void animationStep(); - float getT() /*override*/; + + std::vector getNames(); + void getValues(float* values); private: void runGPU(uchar4* ptrDevPixels, const DomaineMath& domaineMath) /*override*/; - VariateurF variateurAnimationN; - - float n; + VariateurI variateurAnimationN; + int n; }; class FractalJulia : public Fractal { public: - FractalJulia(int w, int h, float dn, float z_r_min, float z_r_max, float z_i_min, float z_i_max); + FractalJulia(int w, int h, int n, float z_r_min, float z_r_max, float z_i_min, float z_i_max); void animationStep(); - float getT() /*override*/; + + std::vector getNames(); + void getValues(float* values); private: void runGPU(uchar4* ptrDevPixels, const DomaineMath& domaineMath) /*override*/; + const int n; + float z_r, z_i; - VariateurF variateurAnimationI; - VariateurF variateurAnimationR; + VariateurF variateurAnimationI; // Variateur pour z_i. + VariateurF variateurAnimationR; // Variateur pour z_r. }; #endif diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/provider/FractalProvider.cpp b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/provider/FractalProvider.cpp index 5282d85..ba94d73 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/provider/FractalProvider.cpp +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/02_Mandelbrot_Julia/provider/FractalProvider.cpp @@ -5,7 +5,7 @@ Fractal* MandelbrotProvider::create() int dw = 16 * 50; int dh = 16 * 30; - return new FractalMandelbrot(dw, dh, 0.2); + return new FractalMandelbrot(dw, dh, 1); } Fractal* JuliaProvider::create() @@ -13,18 +13,17 @@ Fractal* JuliaProvider::create() int dw = 16 * 50; int dh = 16 * 30; - return new FractalJulia(dw, dh, 0.01, -0.745, -0.32, -0.09, 0.1); + return new FractalJulia(dw, dh, 300, -0.745, -0.32, -0.09, 0.1); } ImageFonctionel* MandelbrotProvider::createGL() { - ColorRGB_01* ptrColorTitre = new ColorRGB_01(0, 0, 0); + ColorRGB_01* ptrColorTitre = new ColorRGB_01(0, 0, 100); return new ImageFonctionel(create(), ptrColorTitre); // both ptr destroy by destructor of ImageFonctionel } - ImageFonctionel* JuliaProvider::createGL() { - ColorRGB_01* ptrColorTitre = new ColorRGB_01(0, 0, 0); + ColorRGB_01* ptrColorTitre = new ColorRGB_01(0, 0, 100); return new ImageFonctionel(create(), ptrColorTitre); // both ptr destroy by destructor of ImageFonctionel } diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/device/Sphere.h b/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/device/Sphere.h index 0567fb8..a437dab 100644 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/device/Sphere.h +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/device/Sphere.h @@ -2,14 +2,13 @@ #define SPHERE_H #include "cudaTools.h" -#include "cudaType_CPU.h" #include "MathTools.h" class Sphere { public: __host__ - Sphere(cpu::float3 centre, float r, float hue) : + Sphere(float3 centre, float r, float hue) : centre(centre), hueInitial(hue) { @@ -22,7 +21,7 @@ class Sphere } __host__ - void setCentre(const cpu::float3& centre) + void setCentre(const float3& centre) { this->centre = centre; } @@ -41,7 +40,7 @@ class Sphere } __device__ - float hCarre(cpu::float2 xySol) + float hCarre(float2 xySol) { float a = (centre.x - xySol.x); float b = (centre.y - xySol.y); @@ -86,7 +85,7 @@ class Sphere private: float r; - cpu::float3 centre; + float3 centre; float hueInitial; float rCarre; diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/host/RayTracing.cu b/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/host/RayTracing.cu index 5034594..1623820 100644 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/host/RayTracing.cu +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/host/RayTracing.cu @@ -32,12 +32,12 @@ void RayTracing::runGPU(uchar4* ptrDevPixels) { rayTracing<<>>(ptrDevPixels, this->w, this->h, this->t); - HANDLE_ERROR(cudaDeviceSynchronize()); // Pour flusher les 'printf' (pour le DEBUG). + // HANDLE_ERROR(cudaDeviceSynchronize()); // Pour flusher les 'printf' (pour le DEBUG). } void RayTracing::animationStep() { - this->t += 0.1; // TODO + this->t += 0.1; // TODO. } int RayTracing::getW() @@ -69,7 +69,7 @@ Sphere* RayTracing::createSpheres(int n) { spheres[i].setR(float(this->alea.uniformeAB(20, this->w / 10 - 1))); - cpu::float3 centre + float3 centre { float(this->alea.uniformeAB(double(bord), double(this->w - bord))), float(this->alea.uniformeAB(double(bord), double(this->h - bord))), diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/host/RayTracing.h b/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/host/RayTracing.h index 5c0e77d..313fa6b 100644 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/host/RayTracing.h +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/04_RayTracing/moo/host/RayTracing.h @@ -4,7 +4,7 @@ #include "cudaTools.h" #include "Animable_I.h" #include "MathTools.h" -#include "cudaType_CPU.h" +#include "AleaTools.h" #include "Sphere.h" @@ -22,7 +22,7 @@ class RayTracing : public Animable_I float getT() /*override*/; - string getTitle(void) /*override*/; + std::string getTitle(void) /*override*/; private: Sphere* createSpheres(int n); @@ -37,7 +37,7 @@ class RayTracing : public Animable_I const dim3 dg; const dim3 db; - const string title; + const std::string title; }; #endif diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/05_HeatTransfert/moo/host/HeatTransfert.cu b/WCudaMSE/Student_Cuda_Image/src/cpp/core/05_HeatTransfert/moo/host/HeatTransfert.cu index 613e576..0818f52 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/05_HeatTransfert/moo/host/HeatTransfert.cu +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/05_HeatTransfert/moo/host/HeatTransfert.cu @@ -95,19 +95,19 @@ void HeatTransfert::setHeaters(HeatImage& image) const float tempCentre = 1.0; const float tempCotes = 0.2; - for (int x = 179; x <= 195; x++) + for (int x = 279; x <= 295; x++) { - for (int y = 179; y <= 195; y++) + for (int y = 279; y <= 295; y++) image.set(x, y, tempCotes); - for (int y = 605; y <= 621; y++) + for (int y = 505; y <= 521; y++) image.set(x, y, tempCotes); } - for (int x = 605; x <= 621; x++) + for (int x = 505; x <= 521; x++) { - for (int y = 179; y <= 195; y++) + for (int y = 279; y <= 295; y++) image.set(x, y, tempCotes); - for (int y = 605; y <= 621; y++) + for (int y = 505; y <= 521; y++) image.set(x, y, tempCotes); } diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/05_HeatTransfert/moo/host/HeatTransfert.h b/WCudaMSE/Student_Cuda_Image/src/cpp/core/05_HeatTransfert/moo/host/HeatTransfert.h index bd6882f..ace12be 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/05_HeatTransfert/moo/host/HeatTransfert.h +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/05_HeatTransfert/moo/host/HeatTransfert.h @@ -24,7 +24,7 @@ class HeatTransfert : public Animable_I float getT() /*override*/; - string getTitle(void) /*override*/; + std::string getTitle(void) /*override*/; private: static void setHeaters(HeatImage& image); @@ -40,7 +40,7 @@ class HeatTransfert : public Animable_I const dim3 dg; const dim3 db; - const string title; + const std::string title; }; #endif diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp index ecda2fd..fe29a86 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/mainGL.cpp @@ -39,9 +39,9 @@ int mainGL(void) { // Viewer rippling0(true, true, 10, 10); // Viewer rippling0(true, true, 10, 10); - // Viewer fractalMandelbrot(true, true, 20, 20); + Viewer fractalMandelbrot(true, true, 20, 20); // Viewer fractalJulia(true, true, 30, 30); - Viewer newtown(true, true, 20, 20); + // Viewer newtown(true, true, 20, 20); // Viewer heatTransfert(true, false, 20, 20); // Viewer rayTracing(true, true, 20, 20);