00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "CCurve.hpp"
00024
00025 #include "../Fractale/Commun.hpp"
00026 #include "../Fractale/Image.hpp"
00027 #include "../Fractale/GFractale.hpp"
00028 #include "../Fractale/Generateur.hpp"
00029
00030 #include <QObject>
00031
00032 #ifndef QT_NO_DEBUG
00033 #include <iostream>
00034 #endif
00035
00036 CCurve :: CCurve( ParamsCurve params,
00037 QObject* parent )
00038 :QThread(parent),
00039 params(params)
00040 {
00041 #ifndef QT_NO_DEBUG
00042 std::cout << "CCurve (thread) created" << std::endl;
00043
00044 std::cout << "Generator: " << params.lcfct << std::endl;
00045
00046 std::cout << "Image(" << params.iWidth << ";" << params.iHeight << ")" << std::endl;
00047 std::cout << "Zone(" << params.zX << ";" << params.zY << ";" << params.zWidth << ";" << params.zHeight << ")" << std::endl << std::endl;
00048 #endif
00049 }
00050
00051 CCurve :: ~CCurve(void)
00052 {
00053 #ifndef QT_NO_DEBUG
00054 std::cout << "CFractale (thread) deleted" << std::endl;
00055 #endif
00056 }
00057
00058 void CCurve :: run(void)
00059 {
00060 Fractale::CliffordAttractors* curveFCT = NULL;
00061
00062 switch ( params.lcfct )
00063 {
00064 case lcfctCLIFFORDATTRACTORS:
00065 {
00066 curveFCT = new Fractale::CliffordAttractors(params.paramA, params.paramB, params.paramC, params.paramD);
00067 }break;
00068
00069 case lcfctCLIFFORDATTRACTORS2:
00070 {
00071 curveFCT = new Fractale::CliffordAttractors(params.paramA, params.paramB, params.paramC, params.paramD);
00072 }break;
00073
00074 case lcfctENDOFLIST:
00075 {
00076 #ifndef QT_NO_DEBUG
00077 std::cout << "Problem with the identifier of the fractale function (lcfctENDOFLIST) " << std::endl;
00078 #endif
00079 delete curveFCT;
00080 return;
00081 }break;
00082 }
00083
00084 fractale = Fractale::TracerCourbe(*curveFCT, params.nbPoints, Fractale::point(params.pX, params.pY), Fractale::Zone(params.zX,params.zY,params.zHeight,params.zWidth, params.iHeight, params.iWidth));
00085
00086 delete curveFCT;
00087 }