1 /*************************************************************************** 2 * Copyright (C) 2021 by Abderrahman Taha * 3 * * 4 * * 5 * This program is free software; you can redistribute it and/or modify * 6 * it under the terms of the GNU General Public License as published by * 7 * the Free Software Foundation; either version 2 of the License, or * 8 * (at your option) any later version. * 9 * * 10 * This program is distributed in the hope that it will be useful, * 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 13 * GNU General Public License for more details. * 14 * * 15 * You should have received a copy of the GNU General Public License * 16 * along with this program; if not, write to the * 17 * Free Software Foundation, Inc., * 18 * 51 Franklin Street, Fifth Floor,Boston, MA 02110-1301 USA * 19 ***************************************************************************/ 20 #ifndef PARISOOBJECT_H 21 #define PARISOOBJECT_H 22 #include "commun.h" 23 24 class ParisoObject : public QThread 25 { 26 public: 27 ParisoObject(); 28 ~ParisoObject(); 29 uint CNDtoUse(uint, struct ComponentInfos *); 30 void clear(struct ComponentInfos *); 31 32 public: 33 ObjectProperties *localScene; 34 uint WorkerThreadsNumber; 35 bool StopCalculations; 36 ScriptErrorType messageerror; 37 QString message; 38 }; 39 40 class WorkerThread : public QThread 41 { 42 public: 43 WorkerThread(); 44 ~WorkerThread(); 45 46 public: 47 uint CurrentComponent, MyIndex, WorkerThreadsNumber, iStart, iFinish; 48 double stepMorph=0.0, pace=0.0; 49 bool StopCalculations, ParsersAllocated, ParsersAllocated_C; 50 int activeMorph, signalVal; 51 }; 52 53 class MasterThread 54 { 55 public: 56 FunctionParser *ParisoConditionParser, *RgbtParser, *VRgbtParser, 57 *GradientParser, *NoiseParser, *NoiseShapeParser, Cstparser; 58 FunctionParser_cd *RgbtParser_C; 59 std::vector<std::string> Rgbts, RgbtNames, VRgbts, VRgbtNames, Functs, 60 FunctNames, Consts, ConstNames, SliderNames; 61 std::string Vect, Grid, Const, Funct, Rgbt, VRgbt, Gradient, Noise; 62 uint RgbtSize, FunctSize, VRgbtSize, ConstSize, Nb_Sliders; 63 std::vector<uint> grid, vect; 64 bool *UsedFunct, *UsedFunct2, gridnotnull, vectnotnull, constnotnull, functnotnull, 65 cndnotnull, rgbtnotnull, rgbtnotnull_C, vrgbtnotnull; 66 std::vector<double> ConstValues, SliderValues; 67 double Octaves, Lacunarity, Gain; 68 int ParisoCondition; 69 ErrorMessage stdError; 70 71 public: 72 MasterThread(); 73 ~MasterThread(); 74 }; 75 76 #endif // PARISOOBJECT_H 77