"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pariso/parametric/Model3D.cpp" between
mathmod-11.0-source.zip and mathmod-11.1-source.zip

About: MathMod is a mathematical modeling software that visualize and animate implicit and parametric surfaces.

Model3D.cpp  (mathmod-11.0-source):Model3D.cpp  (mathmod-11.1-source)
skipping to change at line 30 skipping to change at line 30
#include "Model3D.h" #include "Model3D.h"
#include <QElapsedTimer> #include <QElapsedTimer>
static uint NbVertexTmp = 0; static uint NbVertexTmp = 0;
static std::vector<float> ExtraDimensionVector; static std::vector<float> ExtraDimensionVector;
static CellNoise *NoiseFunction2 = new CellNoise(); static CellNoise *NoiseFunction2 = new CellNoise();
static ImprovedNoise *PNoise2 = new ImprovedNoise(4., 4., 4.); static ImprovedNoise *PNoise2 = new ImprovedNoise(4., 4., 4.);
static double ParamComponentId=0; static double ParamComponentId=0;
static double ParamThreadId=0; static double ParamThreadId=0;
static QElapsedTimer ptime; static QElapsedTimer ptime;
static int nbvariables=0;
double CurrentParamCmpId(const double* p) double CurrentParamCmpId(const double* p)
{ {
int pp = int(p[0]); int pp = int(p[0]);
if(pp==0) if(pp==0)
return ParamComponentId; return ParamComponentId;
else else
return ParamThreadId; return ParamThreadId;
} }
double TurbulenceWorley2(const double* p) double TurbulenceWorley2(const double* p)
skipping to change at line 70 skipping to change at line 71
{ {
} }
void Par3D::emitUpdateMessageSignal() void Par3D::emitUpdateMessageSignal()
{ {
emit UpdateMessageSignal(message); emit UpdateMessageSignal(message);
} }
ParWorkerThread::ParWorkerThread() ParWorkerThread::ParWorkerThread()
{ {
stepMorph = 0; stepMorph = 0;
pace = 1.0/30.0; pace = 1.0/30.0;
ParsersAllocated = false; ParsersAllocated = ParsersAllocated_C = false;
} }
ParWorkerThread::~ParWorkerThread() ParWorkerThread::~ParWorkerThread()
{ {
} }
ParMasterThread::~ParMasterThread() ParMasterThread::~ParMasterThread()
{ {
delete[] UsedFunct; delete[] UsedFunct;
delete[] UsedFunct2; delete[] UsedFunct2;
ParamStructs.clear(); ParamStructs.clear();
skipping to change at line 116 skipping to change at line 117
Par3D::Par3D(uint nbThreads, uint nbGrid) Par3D::Par3D(uint nbThreads, uint nbGrid)
{ {
initialiser_parametres(nbThreads, nbGrid); initialiser_parametres(nbThreads, nbGrid);
} }
void ParWorkerThread::run() void ParWorkerThread::run()
{ {
ParCompute(CurrentComponent, CurrentIndex); ParCompute(CurrentComponent, CurrentIndex);
} }
void ParWorkerThread::ParCompute(uint fctnb, uint idx)
{
calcul_objet(fctnb, idx);
}
void Par3D::initialiser_parametres(uint nbThreads, uint nbGrid) void Par3D::initialiser_parametres(uint nbThreads, uint nbGrid)
{ {
Ugrid = nbGrid; Ugrid = nbGrid;
Vgrid = nbGrid; Vgrid = nbGrid;
CutV = CutU = 0; CutV = CutU = 0;
tetazw = tetaxy = tetaxz = tetayz = tetaxw = tetayw = 0; tetazw = tetaxy = tetaxz = tetayz = tetaxw = tetayw = 0;
tetazw_ok = tetaxy_ok = tetaxz_ok = tetayz_ok = tetaxw_ok = tetayw_ok = pa ram4D = -1; tetazw_ok = tetaxy_ok = tetaxz_ok = tetayz_ok = tetaxw_ok = tetayw_ok = pa ram4D = -1;
// initialisation des matrices 4D // initialisation des matrices 4D
mat4D = Matrix4D(); mat4D = Matrix4D();
mat_rotation4D = Matrix4D(); mat_rotation4D = Matrix4D();
skipping to change at line 312 skipping to change at line 308
NormVertexTabVector[lndex+idx*10+7] = float(mat4D.xx*tp1 + mat4D .xy*tp2 + mat4D.xz*tp3 + mat4D.xo); NormVertexTabVector[lndex+idx*10+7] = float(mat4D.xx*tp1 + mat4D .xy*tp2 + mat4D.xz*tp3 + mat4D.xo);
NormVertexTabVector[lndex+idx*10+8] = float(mat4D.yx*tp1 + mat4D .yy*tp2 + mat4D.yz*tp3 + mat4D.yo); NormVertexTabVector[lndex+idx*10+8] = float(mat4D.yx*tp1 + mat4D .yy*tp2 + mat4D.yz*tp3 + mat4D.yo);
NormVertexTabVector[lndex+idx*10+9] = float(mat4D.zx*tp1 + mat4D .zy*tp2 + mat4D.zz*tp3 + mat4D.zo); NormVertexTabVector[lndex+idx*10+9] = float(mat4D.zx*tp1 + mat4D .zy*tp2 + mat4D.zz*tp3 + mat4D.zo);
} }
lndex += 10; lndex += 10;
} }
} }
void Par3D::project_4D_to_3D(uint idx) void Par3D::project_4D_to_3D(uint idx)
{ {
double c4; double clp;
uint I = 0; uint Il = 0;
for (uint i=0; i < Ugrid; ++i) for (uint i=0; i < Ugrid; ++i)
for (uint j=0; j < Vgrid ; ++j) for (uint j=0; j < Vgrid ; ++j)
{ {
c4 = 1.0/double(ExtraDimensionVector[i*Vgrid + j + idx] - 2); clp = 1.0/double(ExtraDimensionVector[i*Vgrid + j + idx] - 2);
NormVertexTabVector[I+idx*10+7] *= float(c4); NormVertexTabVector[Il+idx*10+7] *= float(clp);
NormVertexTabVector[I+idx*10+8] *= float(c4); NormVertexTabVector[Il+idx*10+8] *= float(clp);
NormVertexTabVector[I+idx*10+9] *= float(c4); NormVertexTabVector[Il+idx*10+9] *= float(clp);
I += 10; Il += 10;
} }
} }
void ParMasterThread::AllocateParsersForMasterThread() void ParMasterThread::AllocateParsersForMasterThread()
{ {
if(!ParsersAllocated) if(!ParsersAllocated || !ParsersAllocated_C)
{ {
myParserX = new FunctionParser[componentsNumber];
myParserY = new FunctionParser[componentsNumber];
myParserZ = new FunctionParser[componentsNumber];
myParserW = new FunctionParser[componentsNumber];
myParserUmin = new FunctionParser[componentsNumber]; myParserUmin = new FunctionParser[componentsNumber];
myParserVmin = new FunctionParser[componentsNumber]; myParserVmin = new FunctionParser[componentsNumber];
myParserUmax = new FunctionParser[componentsNumber]; myParserUmax = new FunctionParser[componentsNumber];
myParserVmax = new FunctionParser[componentsNumber]; myParserVmax = new FunctionParser[componentsNumber];
ParisoConditionParser = new FunctionParser[componentsNumber]; ParisoConditionParser = new FunctionParser[componentsNumber];
ParamStructs.resize(componentsNumber); ParamStructs.resize(componentsNumber);
v_inf.resize(componentsNumber); v_inf.resize(componentsNumber);
v_sup.resize(componentsNumber); v_sup.resize(componentsNumber);
u_inf.resize(componentsNumber); u_inf.resize(componentsNumber);
u_sup.resize(componentsNumber); u_sup.resize(componentsNumber);
dif_v.resize(componentsNumber); dif_v.resize(componentsNumber);
dif_u.resize(componentsNumber); dif_u.resize(componentsNumber);
if(!functnotnull)
FunctSize = 0;
Fct = new FunctionParser[FunctSize];
UsedFunct = new bool[4*uint(componentsNumber)*FunctSize];
UsedFunct2 = new bool[FunctSize*FunctSize];
rgbtnotnull ? rgbtnotnull ?
RgbtParser = new FunctionParser[(RgbtSize = 4)] : RgbtParser = new FunctionParser[(RgbtSize = 4)] :
RgbtParser = new FunctionParser[(RgbtSize = 0)]; RgbtParser = new FunctionParser[(RgbtSize = 0)];
rgbtnotnull ?
RgbtParser_C = new FunctionParser_cd[(RgbtSize = 4)] :
RgbtParser_C = new FunctionParser_cd[(RgbtSize = 0)];
UsedFunct = new bool[4*uint(componentsNumber)*FunctSize];
UsedFunct2 = new bool[FunctSize*FunctSize];
vectnotnull? nbvariables=vect[0] : nbvariables=0;
vrgbtnotnull ? vrgbtnotnull ?
VRgbtParser = new FunctionParser[VRgbtSize] : VRgbtParser = new FunctionParser[VRgbtSize] :
VRgbtParser = new FunctionParser[(VRgbtSize = 0)]; VRgbtParser = new FunctionParser[(VRgbtSize = 0)];
if(constnotnull) if(constnotnull)
ConstSize=0; ConstSize=0;
GradientParser = new FunctionParser; GradientParser = new FunctionParser;
NoiseParser = new FunctionParser; NoiseParser = new FunctionParser;
NoiseShapeParser = new FunctionParser; NoiseShapeParser = new FunctionParser;
}
if(!ParsersAllocated)
{
myParserX = new FunctionParser[componentsNumber];
myParserY = new FunctionParser[componentsNumber];
myParserZ = new FunctionParser[componentsNumber];
myParserW = new FunctionParser[componentsNumber];
if(!functnotnull)
FunctSize = 0;
Fct= new FunctionParser[FunctSize];
ParsersAllocated = true; ParsersAllocated = true;
} }
if(!ParsersAllocated_C)
{
myParserX_C = new FunctionParser_cd[componentsNumber];
myParserY_C = new FunctionParser_cd[componentsNumber];
myParserZ_C = new FunctionParser_cd[componentsNumber];
myParserW_C = new FunctionParser_cd[componentsNumber];
if(!functnotnull)
FunctSize = 0;
Fct_C= new FunctionParser_cd[FunctSize];
ParsersAllocated_C = true;
}
} }
void ParWorkerThread::AllocateParsersForWorkerThread(uint nbcomposants, uint nbf unct) void ParWorkerThread::AllocateParsersForWorkerThread(uint nbcomposants, uint nbf unct)
{ {
if(!ParsersAllocated_C)
{
myParserX_C = new FunctionParser_cd[nbcomposants];
myParserY_C = new FunctionParser_cd[nbcomposants];
myParserZ_C = new FunctionParser_cd[nbcomposants];
myParserW_C = new FunctionParser_cd[nbcomposants];
Fct_C = new FunctionParser_cd[nbfunct];
ParsersAllocated_C = true;
}
if(!ParsersAllocated) if(!ParsersAllocated)
{ {
myParserX = new FunctionParser[nbcomposants]; myParserX = new FunctionParser[nbcomposants];
myParserY = new FunctionParser[nbcomposants]; myParserY = new FunctionParser[nbcomposants];
myParserZ = new FunctionParser[nbcomposants]; myParserZ = new FunctionParser[nbcomposants];
myParserW = new FunctionParser[nbcomposants]; myParserW = new FunctionParser[nbcomposants];
Fct = new FunctionParser[nbfunct]; Fct = new FunctionParser[nbfunct];
ParsersAllocated = true; ParsersAllocated = true;
} }
} }
void ParMasterThread::DeleteMasterParsers() void ParMasterThread::DeleteMasterParsers()
{ {
if(ParsersAllocated) if(ParsersAllocated || ParsersAllocated_C)
{ {
delete[] myParserX;
delete[] myParserY;
delete[] myParserZ;
delete[] myParserW;
delete[] myParserUmin; delete[] myParserUmin;
delete[] myParserVmin; delete[] myParserVmin;
delete[] myParserUmax; delete[] myParserUmax;
delete[] myParserVmax; delete[] myParserVmax;
delete[] ParisoConditionParser; delete[] ParisoConditionParser;
delete[] Fct;
delete[] UsedFunct; delete[] UsedFunct;
delete[] UsedFunct2; delete[] UsedFunct2;
delete[] RgbtParser; delete[] RgbtParser;
delete[] RgbtParser_C;
delete[] VRgbtParser; delete[] VRgbtParser;
delete GradientParser; delete GradientParser;
delete NoiseParser; delete NoiseParser;
delete NoiseShapeParser; delete NoiseShapeParser;
}
if(ParsersAllocated)
{
delete[] myParserX;
delete[] myParserY;
delete[] myParserZ;
delete[] myParserW;
delete[] Fct;
ParsersAllocated = false; ParsersAllocated = false;
} }
if(ParsersAllocated_C)
{
delete[] myParserX_C;
delete[] myParserY_C;
delete[] myParserZ_C;
delete[] myParserW_C;
delete[] Fct_C;
ParsersAllocated_C = false;
}
ParamStructs.clear(); ParamStructs.clear();
v_inf.clear(); v_inf.clear();
v_sup.clear(); v_sup.clear();
u_inf.clear(); u_inf.clear();
u_sup.clear(); u_sup.clear();
dif_v.clear(); dif_v.clear();
dif_u.clear(); dif_u.clear();
SliderValues.clear(); SliderValues.clear();
SliderNames.clear(); SliderNames.clear();
skipping to change at line 437 skipping to change at line 476
{ {
if(ParsersAllocated) if(ParsersAllocated)
{ {
delete[] myParserX; delete[] myParserX;
delete[] myParserY; delete[] myParserY;
delete[] myParserZ; delete[] myParserZ;
delete[] myParserW; delete[] myParserW;
delete[] Fct; delete[] Fct;
ParsersAllocated = false; ParsersAllocated = false;
} }
if(ParsersAllocated_C)
{
delete[] myParserX_C;
delete[] myParserY_C;
delete[] myParserZ_C;
delete[] myParserW_C;
delete[] Fct_C;
ParsersAllocated_C = false;
}
} }
void ParMasterThread::InitMasterParsers() void ParMasterThread::InitMasterParsers()
{ {
DeleteMasterParsers(); DeleteMasterParsers();
AllocateParsersForMasterThread(); AllocateParsersForMasterThread();
GradientParser->AddConstant("pi", PI); GradientParser->AddConstant("pi", PI);
GradientParser->AddFunction("NoiseW",TurbulenceWorley2, 6); GradientParser->AddFunction("NoiseW",TurbulenceWorley2, 6);
GradientParser->AddFunction("NoiseP",TurbulencePerlin2, 6); GradientParser->AddFunction("NoiseP",TurbulencePerlin2, 6);
skipping to change at line 460 skipping to change at line 508
NoiseParser->AddFunction("NoiseP",TurbulencePerlin2, 6); NoiseParser->AddFunction("NoiseP",TurbulencePerlin2, 6);
NoiseParser->AddConstant("Lacunarity", Lacunarity); NoiseParser->AddConstant("Lacunarity", Lacunarity);
NoiseParser->AddConstant("Gain", Gain); NoiseParser->AddConstant("Gain", Gain);
NoiseParser->AddConstant("Octaves", Octaves); NoiseParser->AddConstant("Octaves", Octaves);
NoiseShapeParser->AddConstant("pi", PI); NoiseShapeParser->AddConstant("pi", PI);
NoiseShapeParser->AddFunction("NoiseW",TurbulenceWorley2, 6); NoiseShapeParser->AddFunction("NoiseW",TurbulenceWorley2, 6);
NoiseShapeParser->AddFunction("NoiseP",TurbulencePerlin2, 6); NoiseShapeParser->AddFunction("NoiseP",TurbulencePerlin2, 6);
for(uint i=0; i<componentsNumber; i++) for(uint i=0; i<componentsNumber; i++)
{ {
myParserX[i].AddConstant("pi", PI); if(!param3d_C && !param4d_C)
myParserY[i].AddConstant("pi", PI); {
myParserZ[i].AddConstant("pi", PI); myParserX[i].AddConstant("pi", PI);
myParserW[i].AddConstant("pi", PI); myParserY[i].AddConstant("pi", PI);
myParserZ[i].AddConstant("pi", PI);
myParserW[i].AddConstant("pi", PI);
myParserX[i].AddFunction("NoiseW",TurbulenceWorley2, 6);
myParserX[i].AddFunction("NoiseP",TurbulencePerlin2, 6);
myParserY[i].AddFunction("NoiseW",TurbulenceWorley2, 6);
myParserY[i].AddFunction("NoiseP",TurbulencePerlin2, 6);
myParserZ[i].AddFunction("NoiseW",TurbulenceWorley2, 6);
myParserZ[i].AddFunction("NoiseP",TurbulencePerlin2, 6);
myParserW[i].AddFunction("NoiseW",TurbulenceWorley2, 6);
myParserW[i].AddFunction("NoiseP",TurbulencePerlin2, 6);
}
else
{
myParserX_C[i].AddConstant("pi", PI);
myParserY_C[i].AddConstant("pi", PI);
myParserZ_C[i].AddConstant("pi", PI);
myParserW_C[i].AddConstant("pi", PI);
}
ParisoConditionParser[i].AddConstant("pi", PI); ParisoConditionParser[i].AddConstant("pi", PI);
myParserUmin[i].AddConstant("pi", PI); myParserUmin[i].AddConstant("pi", PI);
myParserVmin[i].AddConstant("pi", PI); myParserVmin[i].AddConstant("pi", PI);
myParserUmax[i].AddConstant("pi", PI); myParserUmax[i].AddConstant("pi", PI);
myParserVmax[i].AddConstant("pi", PI); myParserVmax[i].AddConstant("pi", PI);
myParserX[i].AddFunction("NoiseW",TurbulenceWorley2, 6);
myParserX[i].AddFunction("NoiseP",TurbulencePerlin2, 6);
myParserY[i].AddFunction("NoiseW",TurbulenceWorley2, 6);
myParserY[i].AddFunction("NoiseP",TurbulencePerlin2, 6);
myParserZ[i].AddFunction("NoiseW",TurbulenceWorley2, 6);
myParserZ[i].AddFunction("NoiseP",TurbulencePerlin2, 6);
myParserW[i].AddFunction("NoiseW",TurbulenceWorley2, 6);
myParserW[i].AddFunction("NoiseP",TurbulencePerlin2, 6);
ParisoConditionParser[i].AddFunction("NoiseW",TurbulenceWorley2, 6); ParisoConditionParser[i].AddFunction("NoiseW",TurbulenceWorley2, 6);
ParisoConditionParser[i].AddFunction("NoiseP",TurbulencePerlin2, 6); ParisoConditionParser[i].AddFunction("NoiseP",TurbulencePerlin2, 6);
} }
for(uint i=0; i<RgbtSize; i++) for(uint i=0; i<RgbtSize; i++)
{ {
RgbtParser[i].AddConstant("pi", PI); RgbtParser[i].AddConstant("pi", PI);
RgbtParser_C[i].AddConstant("pi", PI);
} }
for(uint i=0; i<VRgbtSize; i++) for(uint i=0; i<VRgbtSize; i++)
{ {
VRgbtParser[i].AddConstant("pi", PI); VRgbtParser[i].AddConstant("pi", PI);
} }
for(uint i=0; i<FunctSize; i++) for(uint i=0; i<FunctSize; i++)
{ {
Fct[i].AddConstant("pi", PI); if(!param3d_C && !param4d_C)
Fct[i].AddFunction("CmpId",CurrentParamCmpId, 1); {
Fct[i].AddConstant("pi", PI);
Fct[i].AddFunction("CmpId",CurrentParamCmpId, 1);
}
else
{
Fct_C[i].AddConstant("pi", PI);
}
} }
} }
ErrorMessage Par3D::ParMorph() ErrorMessage Par3D::ParMorph()
{ {
ErrorMessage err = masterthread->parse_expression(); ErrorMessage err = masterthread->parse_expression();
if(err.iErrorIndex < 0) if(err.iErrorIndex < 0)
ThreadParsersCopy(); ThreadParsersCopy();
return err; return err;
} }
ErrorMessage ParMasterThread::parse_expression() ErrorMessage ParMasterThread::parse_expression()
{ {
double vals[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; double vals[] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 ,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
std::string varliste = "x,y,z,t"; std::string varliste = "u,v,t";
std::string varliste_C = "u,v,t,Z";
InitMasterParsers(); InitMasterParsers();
if(constnotnull) if(constnotnull)
{ {
ConstSize = HowManyVariables(Const, 1); ConstSize = HowManyVariables(Const, 1);
for(uint j=0; j<ConstSize; j++) for(uint j=0; j<ConstSize; j++)
{ {
if ((stdError.iErrorIndex = Cstparser.Parse(Consts[j],"u")) >= 0) if ((stdError.iErrorIndex = Cstparser.Parse(Consts[j],"u")) >= 0)
{ {
stdError.strError = Consts[j]; stdError.strError = Consts[j];
skipping to change at line 532 skipping to change at line 597
Cstparser.AddConstant(ConstNames[j], ConstValues[j]); Cstparser.AddConstant(ConstNames[j], ConstValues[j]);
} }
} }
else else
{ {
ConstSize =0; ConstSize =0;
} }
if(functnotnull) if(functnotnull)
{ {
FunctSize = HowManyVariables(Funct, 2); FunctSize = HowManyVariables(Funct, 2);
if(!param3d_C && !param4d_C)
for(uint i=0; i<FunctSize; i++)
{ {
for(uint j=0; j<ConstSize; j++) for(uint i=0; i<FunctSize; i++)
{ {
Fct[i].AddConstant(ConstNames[j], ConstValues[j]); for(uint j=0; j<ConstSize; j++)
{
Fct[i].AddConstant(ConstNames[j], ConstValues[j]);
}
//Add predefined constatnts:
for(uint k=0; k<Nb_Sliders; k++)
{
Fct[i].AddConstant(SliderNames[k], SliderValues[k]);
}
} }
//Add predefined constatnts: for(uint i=0; i<FunctSize; i++)
for(uint k=0; k<Nb_Sliders; k++)
{ {
Fct[i].AddConstant(SliderNames[k], SliderValues[k]); for(uint j=0; j<i; j++)
if( (UsedFunct2[i*FunctSize+j]=(Functs[i].find(FunctNames[j]
) != std::string::npos)))
Fct[i].AddFunction(FunctNames[j], Fct[j]);
if ((stdError.iErrorIndex = Fct[i].Parse(Functs[i],varliste)) >=
0)
{
stdError.strError = Functs[i];
return stdError;
}
Fct[i].AllocateStackMemory(Stack_Factor, nbvariables);
} }
} }
for(uint i=0; i<FunctSize; i++) else
{ {
for(uint j=0; j<i; j++) for(uint i=0; i<FunctSize; i++)
if( (UsedFunct2[i*FunctSize+j]=(Functs[i].find(FunctNames[j]) !=
std::string::npos)))
Fct[i].AddFunction(FunctNames[j], Fct[j]);
if ((stdError.iErrorIndex = Fct[i].Parse(Functs[i],"u,v,t")) >= 0)
{ {
stdError.strError = Functs[i]; for(uint j=0; j<ConstSize; j++)
return stdError; {
Fct_C[i].AddConstant(ConstNames[j], ConstValues[j]);
}
//Add predefined constatnts:
for(uint k=0; k<Nb_Sliders; k++)
{
Fct_C[i].AddConstant(SliderNames[k], SliderValues[k]);
}
}
for(uint i=0; i<FunctSize; i++)
{
for(uint j=0; j<i; j++)
if( (UsedFunct2[i*FunctSize+j]=(Functs[i].find(FunctNames[j]
) != std::string::npos)))
Fct_C[i].AddFunction(FunctNames[j], Fct_C[j]);
if ((stdError.iErrorIndex = Fct_C[i].Parse(Functs[i],varliste_C)
) >= 0)
{
stdError.strError = Functs[i];
return stdError;
}
Fct_C[i].AllocateStackMemory(Stack_Factor, nbvariables);
} }
Fct[i].AllocateStackMemory(Stack_Factor);
} }
} }
else else
{ {
FunctSize =0; FunctSize =0;
} }
//Colors //Colors
if(rgbtnotnull) if(rgbtnotnull)
{ {
RgbtSize = HowManyVariables(Rgbt, 3); RgbtSize = HowManyVariables(Rgbt, 3);
for(uint i=0; i<RgbtSize; i++) for(uint i=0; i<RgbtSize; i++)
for(uint j=0; j<ConstSize; j++) for(uint j=0; j<ConstSize; j++)
{ {
RgbtParser[i].AddConstant(ConstNames[j], ConstValues[j]); RgbtParser[i].AddConstant(ConstNames[j], ConstValues[j]);
RgbtParser_C[i].AddConstant(ConstNames[j], ConstValues[j]);
for(uint k=0; k<Nb_Sliders; k++) for(uint k=0; k<Nb_Sliders; k++)
{
RgbtParser[i].AddConstant(SliderNames[k], SliderValues[k]); RgbtParser[i].AddConstant(SliderNames[k], SliderValues[k]);
RgbtParser_C[i].AddConstant(SliderNames[k], SliderValues[k])
;
}
} }
} }
else else
{ {
RgbtSize =0; RgbtSize =0;
} }
//Texture: //Texture:
if(vrgbtnotnull) if(vrgbtnotnull)
{ {
VRgbtSize = HowManyVariables(VRgbt, 4); VRgbtSize = HowManyVariables(VRgbt, 4);
skipping to change at line 629 skipping to change at line 727
} }
} }
HowManyParamSurface(expression_X, 0); HowManyParamSurface(expression_X, 0);
HowManyParamSurface(expression_Y, 1); HowManyParamSurface(expression_Y, 1);
HowManyParamSurface(expression_Z, 2); HowManyParamSurface(expression_Z, 2);
HowManyParamSurface(inf_u, 3); HowManyParamSurface(inf_u, 3);
HowManyParamSurface(sup_u, 4); HowManyParamSurface(sup_u, 4);
HowManyParamSurface(inf_v, 5); HowManyParamSurface(inf_v, 5);
HowManyParamSurface(sup_v, 6); HowManyParamSurface(sup_v, 6);
if(param4D == 1) if(param4D ==1)
HowManyParamSurface(expression_W, 7); HowManyParamSurface(expression_W, 7);
if(cndnotnull) if(cndnotnull)
{ {
ParisoCondition = 1; ParisoCondition = 1;
HowManyParamSurface(expression_CND, 8); HowManyParamSurface(expression_CND, 8);
} }
else else
ParisoCondition = -1; ParisoCondition = -1;
//Add defined constantes: //Add defined constantes:
for(uint i=0; i<componentsNumber; i++) for(uint i=0; i<componentsNumber; i++)
{ {
for(uint j=0; j<ConstSize; j++) for(uint j=0; j<ConstSize; j++)
{ {
if(cndnotnull) if(cndnotnull)
ParisoConditionParser[i].AddConstant(ConstNames[j], ConstValues[ j]); ParisoConditionParser[i].AddConstant(ConstNames[j], ConstValues[ j]);
myParserUmax[i].AddConstant(ConstNames[j], ConstValues[j]); myParserUmax[i].AddConstant(ConstNames[j], ConstValues[j]);
myParserUmin[i].AddConstant(ConstNames[j], ConstValues[j]); myParserUmin[i].AddConstant(ConstNames[j], ConstValues[j]);
myParserVmin[i].AddConstant(ConstNames[j], ConstValues[j]); myParserVmin[i].AddConstant(ConstNames[j], ConstValues[j]);
myParserVmax[i].AddConstant(ConstNames[j], ConstValues[j]); myParserVmax[i].AddConstant(ConstNames[j], ConstValues[j]);
myParserX[i].AddConstant(ConstNames[j], ConstValues[j]); if(!param3d_C && !param4d_C)
myParserY[i].AddConstant(ConstNames[j], ConstValues[j]); {
myParserZ[i].AddConstant(ConstNames[j], ConstValues[j]); myParserX[i].AddConstant(ConstNames[j], ConstValues[j]);
myParserW[i].AddConstant(ConstNames[j], ConstValues[j]); myParserY[i].AddConstant(ConstNames[j], ConstValues[j]);
myParserZ[i].AddConstant(ConstNames[j], ConstValues[j]);
myParserW[i].AddConstant(ConstNames[j], ConstValues[j]);
}
else
{
myParserX_C[i].AddConstant(ConstNames[j], ConstValues[j]);
myParserY_C[i].AddConstant(ConstNames[j], ConstValues[j]);
myParserZ_C[i].AddConstant(ConstNames[j], ConstValues[j]);
myParserW_C[i].AddConstant(ConstNames[j], ConstValues[j]);
}
} }
//Add predefined constatnts: //Add predefined constatnts:
for(uint k=0; k<Nb_Sliders; k++) for(uint k=0; k<Nb_Sliders; k++)
{ {
if(cndnotnull) if(cndnotnull)
ParisoConditionParser[i].AddConstant(SliderNames[k], SliderValue s[k]); ParisoConditionParser[i].AddConstant(SliderNames[k], SliderValue s[k]);
myParserUmin[i].AddConstant(SliderNames[k], SliderValues[k]); myParserUmin[i].AddConstant(SliderNames[k], SliderValues[k]);
myParserUmax[i].AddConstant(SliderNames[k], SliderValues[k]); myParserUmax[i].AddConstant(SliderNames[k], SliderValues[k]);
myParserVmin[i].AddConstant(SliderNames[k], SliderValues[k]); myParserVmin[i].AddConstant(SliderNames[k], SliderValues[k]);
myParserVmax[i].AddConstant(SliderNames[k], SliderValues[k]); myParserVmax[i].AddConstant(SliderNames[k], SliderValues[k]);
myParserX[i].AddConstant(SliderNames[k], SliderValues[k]); if(!param3d_C && !param4d_C)
myParserY[i].AddConstant(SliderNames[k], SliderValues[k]); {
myParserZ[i].AddConstant(SliderNames[k], SliderValues[k]); myParserX[i].AddConstant(SliderNames[k], SliderValues[k]);
myParserW[i].AddConstant(SliderNames[k], SliderValues[k]); myParserY[i].AddConstant(SliderNames[k], SliderValues[k]);
myParserZ[i].AddConstant(SliderNames[k], SliderValues[k]);
myParserW[i].AddConstant(SliderNames[k], SliderValues[k]);
}
else
{
myParserX_C[i].AddConstant(SliderNames[k], SliderValues[k]);
myParserY_C[i].AddConstant(SliderNames[k], SliderValues[k]);
myParserZ_C[i].AddConstant(SliderNames[k], SliderValues[k]);
myParserW_C[i].AddConstant(SliderNames[k], SliderValues[k]);
}
} }
} }
// Add defined functions : // Add defined functions :
for(uint i=0; i<componentsNumber; i++) if(!param3d_C && !param4d_C)
{ {
for(uint j=0; j<FunctSize; j++) for(uint i=0; i<componentsNumber; i++)
{ {
if((UsedFunct[i*4*FunctSize+4*j]=(ParamStructs[i].fx.find(FunctNames for(uint j=0; j<FunctSize; j++)
[j]) != std::string::npos))) {
myParserX[i].AddFunction(FunctNames[j], Fct[j]); if((UsedFunct[i*4*FunctSize+4*j]=(ParamStructs[i].fx.find(FunctN
if((UsedFunct[i*4*FunctSize+4*j+1]=(ParamStructs[i].fy.find(FunctNam ames[j]) != std::string::npos)))
es[j]) != std::string::npos))) myParserX[i].AddFunction(FunctNames[j], Fct[j]);
myParserY[i].AddFunction(FunctNames[j], Fct[j]); if((UsedFunct[i*4*FunctSize+4*j+1]=(ParamStructs[i].fy.find(Func
if((UsedFunct[i*4*FunctSize+4*j+2]=(ParamStructs[i].fz.find(FunctNam tNames[j]) != std::string::npos)))
es[j]) != std::string::npos))) myParserY[i].AddFunction(FunctNames[j], Fct[j]);
myParserZ[i].AddFunction(FunctNames[j], Fct[j]); if((UsedFunct[i*4*FunctSize+4*j+2]=(ParamStructs[i].fz.find(Func
if((UsedFunct[i*4*FunctSize+4*j+3]=(ParamStructs[i].fw.find(FunctNam tNames[j]) != std::string::npos)))
es[j]) != std::string::npos))) myParserZ[i].AddFunction(FunctNames[j], Fct[j]);
myParserW[i].AddFunction(FunctNames[j], Fct[j]); if((UsedFunct[i*4*FunctSize+4*j+3]=(ParamStructs[i].fw.find(Func
tNames[j]) != std::string::npos)))
myParserW[i].AddFunction(FunctNames[j], Fct[j]);
}
}
}
else
{
for(uint i=0; i<componentsNumber; i++)
{
for(uint j=0; j<FunctSize; j++)
{
if((UsedFunct[i*4*FunctSize+4*j]=(ParamStructs[i].fx.find(FunctN
ames[j]) != std::string::npos)))
myParserX_C[i].AddFunction(FunctNames[j], Fct_C[j]);
if((UsedFunct[i*4*FunctSize+4*j+1]=(ParamStructs[i].fy.find(Func
tNames[j]) != std::string::npos)))
myParserY_C[i].AddFunction(FunctNames[j], Fct_C[j]);
if((UsedFunct[i*4*FunctSize+4*j+2]=(ParamStructs[i].fz.find(Func
tNames[j]) != std::string::npos)))
myParserZ_C[i].AddFunction(FunctNames[j], Fct_C[j]);
if((UsedFunct[i*4*FunctSize+4*j+3]=(ParamStructs[i].fw.find(Func
tNames[j]) != std::string::npos)))
myParserW_C[i].AddFunction(FunctNames[j], Fct_C[j]);
}
} }
} }
// Parse // Parse
rgbtnotnull_C = false;
if(rgbtnotnull) if(rgbtnotnull)
{
for(uint i=0; i<RgbtSize; i++) for(uint i=0; i<RgbtSize; i++)
{
if ((stdError.iErrorIndex = RgbtParser[i].Parse(Rgbts[i],"x,y,z,u,v, i_indx,j_indx,indx,max_i,max_j,cmpId,t")) >= 0) if ((stdError.iErrorIndex = RgbtParser[i].Parse(Rgbts[i],"x,y,z,u,v, i_indx,j_indx,indx,max_i,max_j,cmpId,t")) >= 0)
{ {
stdError.strError = Rgbts[i]; if((stdError.iErrorIndex = RgbtParser_C[i].Parse(Rgbts[i],"x,y,z
return stdError; ,u,v,i_indx,j_indx,indx,max_i,max_j,cmpId,t,Z")) >= 0)
{
stdError.strError = Rgbts[i];
return stdError;
}
else
{
rgbtnotnull_C = true;
i=RgbtSize; //break;
}
}
}
if(rgbtnotnull_C)
{
for(uint i=0; i<RgbtSize; i++)
{
if ((stdError.iErrorIndex = RgbtParser_C[i].Parse(Rgbts[i],"x,y,
z,u,v,i_indx,j_indx,indx,max_i,max_j,cmpId,t,Z")) >= 0)
{
stdError.strError = Rgbts[i];
return stdError;
}
} }
}
}
// Parse // Parse
if(vrgbtnotnull && (VRgbtSize % 5) ==0) if(vrgbtnotnull && (VRgbtSize % 5) ==0)
{ {
if ((stdError.iErrorIndex = GradientParser->Parse(Gradient,"x,y,z,u,v,i_ indx,j_indx,indx,max_i,max_j,cmpId,t")) >= 0) if ((stdError.iErrorIndex = GradientParser->Parse(Gradient,"x,y,z,u,v,i_ indx,j_indx,indx,max_i,max_j,cmpId,t")) >= 0)
{ {
stdError.strError = Gradient; stdError.strError = Gradient;
return stdError; return stdError;
} }
skipping to change at line 722 skipping to change at line 884
if(Noise != "") if(Noise != "")
if ((stdError.iErrorIndex = NoiseParser->Parse(Noise,"x,y,z,u,v,i_indx,j _indx,indx,max_i,max_j,cmpId,t")) >= 0) if ((stdError.iErrorIndex = NoiseParser->Parse(Noise,"x,y,z,u,v,i_indx,j _indx,indx,max_i,max_j,cmpId,t")) >= 0)
{ {
stdError.strError = Noise; stdError.strError = Noise;
return stdError; return stdError;
} }
for(uint index=0; index< componentsNumber; index++) for(uint index=0; index< componentsNumber; index++)
{ {
if ((stdError.iErrorIndex = myParserUmin[index].Parse(ParamStructs[index ].umin, "u,v,t")) >= 0) if ((stdError.iErrorIndex = myParserUmin[index].Parse(ParamStructs[index ].umin, varliste)) >= 0)
{ {
stdError.strError = ParamStructs[index].umin; stdError.strError = ParamStructs[index].umin;
return stdError; return stdError;
} }
u_inf[index] = myParserUmin[index].Eval(vals); u_inf[index] = myParserUmin[index].Eval(vals);
if ((stdError.iErrorIndex = myParserUmax[index].Parse(ParamStructs[index ].umax, "u,v,t")) >= 0) if ((stdError.iErrorIndex = myParserUmax[index].Parse(ParamStructs[index ].umax, varliste)) >= 0)
{ {
stdError.strError = ParamStructs[index].umax; stdError.strError = ParamStructs[index].umax;
return stdError; return stdError;
} }
u_sup[index] = myParserUmax[index].Eval(vals); u_sup[index] = myParserUmax[index].Eval(vals);
dif_u[index] = u_sup[index] - u_inf[index]; dif_u[index] = u_sup[index] - u_inf[index];
if ((stdError.iErrorIndex = myParserVmin[index].Parse(ParamStructs[index ].vmin, "u,v,t")) >= 0) if ((stdError.iErrorIndex = myParserVmin[index].Parse(ParamStructs[index ].vmin, varliste)) >= 0)
{ {
stdError.strError = ParamStructs[index].vmin; stdError.strError = ParamStructs[index].vmin;
return stdError; return stdError;
} }
v_inf[index] = myParserVmin[index].Eval(vals); v_inf[index] = myParserVmin[index].Eval(vals);
if ((stdError.iErrorIndex = myParserVmax[index].Parse(ParamStructs[index ].vmax, "u,v,t")) >= 0) if ((stdError.iErrorIndex = myParserVmax[index].Parse(ParamStructs[index ].vmax, varliste)) >= 0)
{ {
stdError.strError = ParamStructs[index].vmax; stdError.strError = ParamStructs[index].vmax;
return stdError; return stdError;
} }
v_sup[index] = myParserVmax[index].Eval(vals); v_sup[index] = myParserVmax[index].Eval(vals);
dif_v[index] = v_sup[index] - v_inf[index]; dif_v[index] = v_sup[index] - v_inf[index];
if ((stdError.iErrorIndex = myParserX[index].Parse(ParamStructs[index].f x, "u,v,t")) >= 0) if(!param3d_C && !param4d_C)
{ {
stdError.strError = ParamStructs[index].fx; if ((stdError.iErrorIndex = myParserX[index].Parse(ParamStructs[inde
return stdError; x].fx, varliste)) >= 0)
} {
stdError.strError = ParamStructs[index].fx;
return stdError;
}
if ((stdError.iErrorIndex = myParserY[index].Parse(ParamStructs[index].f if ((stdError.iErrorIndex = myParserY[index].Parse(ParamStructs[inde
y, "u,v,t")) >= 0) x].fy, varliste)) >= 0)
{ {
stdError.strError = ParamStructs[index].fy; stdError.strError = ParamStructs[index].fy;
return stdError; return stdError;
} }
if ((stdError.iErrorIndex = myParserZ[index].Parse(ParamStructs[index].f if ((stdError.iErrorIndex = myParserZ[index].Parse(ParamStructs[inde
z, "u,v,t")) >= 0) x].fz, varliste)) >= 0)
{ {
stdError.strError = ParamStructs[index].fz; stdError.strError = ParamStructs[index].fz;
return stdError; return stdError;
}
if(param4D == 1)
if ((stdError.iErrorIndex = myParserW[index].Parse(ParamStructs[
index].fw, varliste)) >= 0)
{
stdError.strError = ParamStructs[index].fw;
return stdError;
}
} }
else
{
if ((stdError.iErrorIndex = myParserX_C[index].Parse(ParamStructs[in
dex].fx, varliste_C)) >= 0)
{
stdError.strError = ParamStructs[index].fx;
return stdError;
}
if(param4D == 1) if ((stdError.iErrorIndex = myParserY_C[index].Parse(ParamStructs[in
if ((stdError.iErrorIndex = myParserW[index].Parse(ParamStructs[inde dex].fy, varliste_C)) >= 0)
x].fw, "u,v,t")) >= 0)
{ {
stdError.strError = ParamStructs[index].fw; stdError.strError = ParamStructs[index].fy;
return stdError; return stdError;
} }
if ((stdError.iErrorIndex = myParserZ_C[index].Parse(ParamStructs[in
dex].fz, varliste_C)) >= 0)
{
stdError.strError = ParamStructs[index].fz;
return stdError;
}
if(param4d_C)
if ((stdError.iErrorIndex = myParserW_C[index].Parse(ParamStruct
s[index].fw, varliste_C)) >= 0)
{
stdError.strError = ParamStructs[index].fw;
return stdError;
}
}
if(cndnotnull && (ParamStructs[index].cnd!="")) if(cndnotnull && (ParamStructs[index].cnd!=""))
if ((stdError.iErrorIndex = ParisoConditionParser[index].Parse(Param Structs[index].cnd, "x,y,z,t")) >= 0) if ((stdError.iErrorIndex = ParisoConditionParser[index].Parse(Param Structs[index].cnd, "x,y,z,t")) >= 0)
{ {
stdError.strError = ParamStructs[index].cnd; stdError.strError = ParamStructs[index].cnd;
return stdError; return stdError;
} }
} }
return stdError; return stdError;
} }
ErrorMessage Par3D::parse_expression2() ErrorMessage Par3D::parse_expression2()
{ {
ErrorMessage NodError; ErrorMessage NodError;
for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++) for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++)
{ {
//Functions: //Functions:
for(uint ij=0; ij<masterthread->FunctSize; ij++) for(uint ij=0; ij<masterthread->FunctSize; ij++)
{ {
workerthreads[nbthreads].Fct[ij].AddConstant("pi", PI); workerthreads[nbthreads].Fct[ij].AddConstant("pi", PI);
workerthreads[nbthreads].Fct[ij].AddFunction("CmpId",CurrentParamCmp Id, 1); workerthreads[nbthreads].Fct[ij].AddFunction("CmpId",CurrentParamCmp Id, 1);
} }
for(uint ii=0; ii<masterthread->FunctSize; ii++) for(uint ii=0; ii<masterthread->FunctSize; ii++)
{ {
for(uint jj=0; jj<masterthread->ConstSize; jj++) for(uint jj=0; jj<masterthread->ConstSize; jj++)
{ {
workerthreads[nbthreads].Fct[ii].AddConstant(masterthread->Const Names[jj], masterthread->ConstValues[jj]); workerthreads[nbthreads].Fct[ii].AddConstant(masterthread->Const Names[jj], masterthread->ConstValues[jj]);
} }
//Add predefined constatnts: //Add predefined constatnts:
for(uint kk=0; kk<masterthread->Nb_Sliders; kk++) for(uint kk=0; kk<masterthread->Nb_Sliders; kk++)
{ {
workerthreads[nbthreads].Fct[ii].AddConstant(masterthread->Slide rNames[kk], masterthread->SliderValues[kk]); workerthreads[nbthreads].Fct[ii].AddConstant(masterthread->Slide rNames[kk], masterthread->SliderValues[kk]);
} }
} }
for(uint ii=0; ii<masterthread->FunctSize; ii++) for(uint ii=0; ii<masterthread->FunctSize; ii++)
{ {
for(uint jj=0; jj<ii; jj++) for(uint jj=0; jj<ii; jj++)
if(masterthread->UsedFunct2[ii*masterthread->FunctSize+jj]) if(masterthread->UsedFunct2[ii*masterthread->FunctSize+jj])
workerthreads[nbthreads].Fct[ii].AddFunction(masterthread->F unctNames[jj], workerthreads[nbthreads].Fct[jj]); workerthreads[nbthreads].Fct[ii].AddFunction(masterthread->F unctNames[jj], workerthreads[nbthreads].Fct[jj]);
if ((masterthread->stdError.iErrorIndex = workerthreads[nbthreads].F ct[ii].Parse(masterthread->Functs[ii],"u,v,t")) >= 0) if ((masterthread->stdError.iErrorIndex = workerthreads[nbthreads].F ct[ii].Parse(masterthread->Functs[ii],"u,v,t")) >= 0)
{ {
masterthread->stdError.strError = masterthread->Functs[ii]; masterthread->stdError.strError = masterthread->Functs[ii];
return masterthread->stdError; return masterthread->stdError;
} }
workerthreads[nbthreads].Fct[ii].AllocateStackMemory(Stack_Factor); workerthreads[nbthreads].Fct[ii].AllocateStackMemory(Stack_Factor, n bvariables);
} }
} }
for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++) for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++)
{ {
//Add defined constantes: //Add defined constantes:
for(uint i=0; i<masterthread->componentsNumber; i++) for(uint i=0; i<masterthread->componentsNumber; i++)
{ {
workerthreads[nbthreads].param4D = masterthread->param4D; workerthreads[nbthreads].param4D = masterthread->param4D;
workerthreads[nbthreads].param3d_C = masterthread->param3d_C;
workerthreads[nbthreads].param4d_C = masterthread->param4d_C;
workerthreads[nbthreads].myParserX[i].AddConstant("pi", PI); workerthreads[nbthreads].myParserX[i].AddConstant("pi", PI);
workerthreads[nbthreads].myParserY[i].AddConstant("pi", PI); workerthreads[nbthreads].myParserY[i].AddConstant("pi", PI);
workerthreads[nbthreads].myParserZ[i].AddConstant("pi", PI); workerthreads[nbthreads].myParserZ[i].AddConstant("pi", PI);
workerthreads[nbthreads].myParserW[i].AddConstant("pi", PI); workerthreads[nbthreads].myParserW[i].AddConstant("pi", PI);
workerthreads[nbthreads].myParserX[i].AddFunction("NoiseW",Turbulenc eWorley2, 6); workerthreads[nbthreads].myParserX[i].AddFunction("NoiseW",Turbulenc eWorley2, 6);
workerthreads[nbthreads].myParserX[i].AddFunction("NoiseP",Turbulenc ePerlin2, 6); workerthreads[nbthreads].myParserX[i].AddFunction("NoiseP",Turbulenc ePerlin2, 6);
workerthreads[nbthreads].myParserY[i].AddFunction("NoiseW",Turbulenc eWorley2, 6); workerthreads[nbthreads].myParserY[i].AddFunction("NoiseW",Turbulenc eWorley2, 6);
workerthreads[nbthreads].myParserY[i].AddFunction("NoiseP",Turbulenc ePerlin2, 6); workerthreads[nbthreads].myParserY[i].AddFunction("NoiseP",Turbulenc ePerlin2, 6);
workerthreads[nbthreads].myParserZ[i].AddFunction("NoiseW",Turbulenc eWorley2, 6); workerthreads[nbthreads].myParserZ[i].AddFunction("NoiseW",Turbulenc eWorley2, 6);
workerthreads[nbthreads].myParserZ[i].AddFunction("NoiseP",Turbulenc ePerlin2, 6); workerthreads[nbthreads].myParserZ[i].AddFunction("NoiseP",Turbulenc ePerlin2, 6);
skipping to change at line 871 skipping to change at line 1065
{ {
if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j]) if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j])
workerthreads[nbthreads].myParserX[i].AddFunction(masterthre ad->FunctNames[j], workerthreads[nbthreads].Fct[j]); workerthreads[nbthreads].myParserX[i].AddFunction(masterthre ad->FunctNames[j], workerthreads[nbthreads].Fct[j]);
if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j+1]) if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j+1])
workerthreads[nbthreads].myParserY[i].AddFunction(masterthre ad->FunctNames[j], workerthreads[nbthreads].Fct[j]); workerthreads[nbthreads].myParserY[i].AddFunction(masterthre ad->FunctNames[j], workerthreads[nbthreads].Fct[j]);
if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j+2]) if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j+2])
workerthreads[nbthreads].myParserZ[i].AddFunction(masterthre ad->FunctNames[j], workerthreads[nbthreads].Fct[j]); workerthreads[nbthreads].myParserZ[i].AddFunction(masterthre ad->FunctNames[j], workerthreads[nbthreads].Fct[j]);
if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j+3]) if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j+3])
workerthreads[nbthreads].myParserW[i].AddFunction(masterthre ad->FunctNames[j], workerthreads[nbthreads].Fct[j]); workerthreads[nbthreads].myParserW[i].AddFunction(masterthre ad->FunctNames[j], workerthreads[nbthreads].Fct[j]);
} }
} }
} }
for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++) for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++)
{ {
for(uint index=0; index< masterthread->componentsNumber; index++) for(uint index=0; index< masterthread->componentsNumber; index++)
{ {
if ((masterthread->stdError.iErrorIndex = workerthreads[nbthreads].m yParserX[index].Parse(masterthread->ParamStructs[index].fx, "u,v,t")) >= 0) if ((masterthread->stdError.iErrorIndex = workerthreads[nbthreads].m yParserX[index].Parse(masterthread->ParamStructs[index].fx, "u,v,t")) >= 0)
{ {
masterthread->stdError.strError = masterthread->ParamStructs[ind ex].fx; masterthread->stdError.strError = masterthread->ParamStructs[ind ex].fx;
return masterthread->stdError; return masterthread->stdError;
skipping to change at line 903 skipping to change at line 1096
if(param4D == 1) if(param4D == 1)
if ((masterthread->stdError.iErrorIndex = workerthreads[nbthread s].myParserW[index].Parse(masterthread->ParamStructs[index].fw, "u,v,t")) >= 0) if ((masterthread->stdError.iErrorIndex = workerthreads[nbthread s].myParserW[index].Parse(masterthread->ParamStructs[index].fw, "u,v,t")) >= 0)
{ {
masterthread->stdError.strError = masterthread->ParamStructs [index].fw; masterthread->stdError.strError = masterthread->ParamStructs [index].fw;
return masterthread->stdError; return masterthread->stdError;
} }
} }
} }
return NodError; return NodError;
} }
ErrorMessage Par3D::parse_expression2_C()
{
ErrorMessage NodError;
for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++)
{
//Functions:
for(uint ij=0; ij<masterthread->FunctSize; ij++)
{
workerthreads[nbthreads].Fct_C[ij].AddConstant("pi", PI);
}
for(uint ii=0; ii<masterthread->FunctSize; ii++)
{
for(uint jj=0; jj<masterthread->ConstSize; jj++)
{
workerthreads[nbthreads].Fct_C[ii].AddConstant(masterthread->Con
stNames[jj], masterthread->ConstValues[jj]);
}
//Add predefined constatnts:
for(uint kk=0; kk<masterthread->Nb_Sliders; kk++)
{
workerthreads[nbthreads].Fct_C[ii].AddConstant(masterthread->Sli
derNames[kk], masterthread->SliderValues[kk]);
}
}
for(uint ii=0; ii<masterthread->FunctSize; ii++)
{
for(uint jj=0; jj<ii; jj++)
if(masterthread->UsedFunct2[ii*masterthread->FunctSize+jj])
workerthreads[nbthreads].Fct_C[ii].AddFunction(masterthread-
>FunctNames[jj], workerthreads[nbthreads].Fct_C[jj]);
if ((masterthread->stdError.iErrorIndex = workerthreads[nbthreads].F
ct_C[ii].Parse(masterthread->Functs[ii],"u,v,t,Z")) >= 0)
{
masterthread->stdError.strError = masterthread->Functs[ii];
return masterthread->stdError;
}
workerthreads[nbthreads].Fct_C[ii].AllocateStackMemory(Stack_Factor,
nbvariables);
}
}
for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++)
{
//Add defined constantes:
for(uint i=0; i<masterthread->componentsNumber; i++)
{
workerthreads[nbthreads].param4D = masterthread->param4D;
workerthreads[nbthreads].param3d_C = masterthread->param3d_C;
workerthreads[nbthreads].param4d_C = masterthread->param4d_C;
workerthreads[nbthreads].myParserX_C[i].AddConstant("pi", PI);
workerthreads[nbthreads].myParserY_C[i].AddConstant("pi", PI);
workerthreads[nbthreads].myParserZ_C[i].AddConstant("pi", PI);
workerthreads[nbthreads].myParserW_C[i].AddConstant("pi", PI);
for(uint j=0; j<masterthread->ConstSize; j++)
{
workerthreads[nbthreads].myParserX_C[i].AddConstant(masterthread
->ConstNames[j], masterthread->ConstValues[j]);
workerthreads[nbthreads].myParserY_C[i].AddConstant(masterthread
->ConstNames[j], masterthread->ConstValues[j]);
workerthreads[nbthreads].myParserZ_C[i].AddConstant(masterthread
->ConstNames[j], masterthread->ConstValues[j]);
workerthreads[nbthreads].myParserW_C[i].AddConstant(masterthread
->ConstNames[j], masterthread->ConstValues[j]);
}
//Add predefined sliders constatnts:
for(uint k=0; k<masterthread->Nb_Sliders; k++)
{
workerthreads[nbthreads].myParserX_C[i].AddConstant(masterthread
->SliderNames[k], masterthread->SliderValues[k]);
workerthreads[nbthreads].myParserY_C[i].AddConstant(masterthread
->SliderNames[k], masterthread->SliderValues[k]);
workerthreads[nbthreads].myParserZ_C[i].AddConstant(masterthread
->SliderNames[k], masterthread->SliderValues[k]);
workerthreads[nbthreads].myParserW_C[i].AddConstant(masterthread
->SliderNames[k], masterthread->SliderValues[k]);
}
}
// Add defined functions :
for(uint i=0; i<masterthread->componentsNumber; i++)
{
for(uint j=0; j<masterthread->FunctSize; j++)
{
if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j])
workerthreads[nbthreads].myParserX_C[i].AddFunction(masterth
read->FunctNames[j], workerthreads[nbthreads].Fct_C[j]);
if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j+1])
workerthreads[nbthreads].myParserY_C[i].AddFunction(masterth
read->FunctNames[j], workerthreads[nbthreads].Fct_C[j]);
if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j+2])
workerthreads[nbthreads].myParserZ_C[i].AddFunction(masterth
read->FunctNames[j], workerthreads[nbthreads].Fct_C[j]);
if(masterthread->UsedFunct[i*4*masterthread->FunctSize+4*j+3])
workerthreads[nbthreads].myParserW_C[i].AddFunction(masterth
read->FunctNames[j], workerthreads[nbthreads].Fct_C[j]);
}
}
}
for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++)
{
for(uint index=0; index< masterthread->componentsNumber; index++)
{
if ((masterthread->stdError.iErrorIndex = workerthreads[nbthreads].m
yParserX_C[index].Parse(masterthread->ParamStructs[index].fx, "u,v,t,Z")) >= 0)
{
masterthread->stdError.strError = masterthread->ParamStructs[ind
ex].fx;
return masterthread->stdError;
}
if ((masterthread->stdError.iErrorIndex = workerthreads[nbthreads].m
yParserY_C[index].Parse(masterthread->ParamStructs[index].fy, "u,v,t,Z")) >= 0)
{
masterthread->stdError.strError = masterthread->ParamStructs[ind
ex].fy;
return masterthread->stdError;
}
if ((masterthread->stdError.iErrorIndex = workerthreads[nbthreads].m
yParserZ_C[index].Parse(masterthread->ParamStructs[index].fz, "u,v,t,Z")) >= 0)
{
masterthread->stdError.strError = masterthread->ParamStructs[ind
ex].fz;
return masterthread->stdError;
}
if(masterthread->param4d_C)
if ((masterthread->stdError.iErrorIndex = workerthreads[nbthread
s].myParserW_C[index].Parse(masterthread->ParamStructs[index].fw, "u,v,t,Z")) >=
0)
{
masterthread->stdError.strError = masterthread->ParamStructs
[index].fw;
return masterthread->stdError;
}
}
}
return NodError;
}
void Par3D::WorkerThreadCopy(ParWorkerThread *WorkerThreadsTmp) void Par3D::WorkerThreadCopy(ParWorkerThread *WorkerThreadsTmp)
{ {
for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++) for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++)
{ {
WorkerThreadsTmp[nbthreads].Ugrid = masterthread->Ugrid; WorkerThreadsTmp[nbthreads].Ugrid = masterthread->Ugrid;
WorkerThreadsTmp[nbthreads].Vgrid = masterthread->Vgrid; WorkerThreadsTmp[nbthreads].Vgrid = masterthread->Vgrid;
WorkerThreadsTmp[nbthreads].MyIndex = nbthreads+1; WorkerThreadsTmp[nbthreads].MyIndex = nbthreads+1;
WorkerThreadsTmp[nbthreads].param4D = param4D; WorkerThreadsTmp[nbthreads].param4D = param4D;
WorkerThreadsTmp[nbthreads].param3d_C = masterthread->param3d_C;
WorkerThreadsTmp[nbthreads].param4d_C = masterthread->param4d_C;
WorkerThreadsTmp[nbthreads].WorkerThreadsNumber = WorkerThreadsNumber; WorkerThreadsTmp[nbthreads].WorkerThreadsNumber = WorkerThreadsNumber;
} }
} }
ErrorMessage Par3D::ThreadParsersCopy() ErrorMessage Par3D::ThreadParsersCopy()
{ {
for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++) for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++)
{ {
workerthreads[nbthreads].dif_u.clear(); workerthreads[nbthreads].dif_u.clear();
workerthreads[nbthreads].dif_u = masterthread->dif_u; workerthreads[nbthreads].dif_u = masterthread->dif_u;
workerthreads[nbthreads].dif_v.clear(); workerthreads[nbthreads].dif_v.clear();
workerthreads[nbthreads].dif_v = masterthread->dif_v; workerthreads[nbthreads].dif_v = masterthread->dif_v;
workerthreads[nbthreads].u_inf.clear(); workerthreads[nbthreads].u_inf.clear();
workerthreads[nbthreads].u_inf = masterthread->u_inf; workerthreads[nbthreads].u_inf = masterthread->u_inf;
workerthreads[nbthreads].v_inf.clear(); workerthreads[nbthreads].v_inf.clear();
workerthreads[nbthreads].v_inf = masterthread->v_inf; workerthreads[nbthreads].v_inf = masterthread->v_inf;
workerthreads[nbthreads].param4D = masterthread->param4D; workerthreads[nbthreads].param4D = masterthread->param4D;
workerthreads[nbthreads].param3d_C = masterthread->param3d_C;
workerthreads[nbthreads].param4d_C = masterthread->param4d_C;
} }
for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++) for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++)
workerthreads[nbthreads].DeleteWorkerParsers(); workerthreads[nbthreads].DeleteWorkerParsers();
for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++) for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++)
workerthreads[nbthreads].AllocateParsersForWorkerThread(masterthread->co mponentsNumber, masterthread->FunctSize); workerthreads[nbthreads].AllocateParsersForWorkerThread(masterthread->co mponentsNumber, masterthread->FunctSize);
return(parse_expression2()); return((masterthread->param3d_C || masterthread->param4d_C) ? parse_expressi on2_C() : parse_expression2());
} }
uint ParMasterThread::HowManyVariables(std::string NewVariables, int type) uint ParMasterThread::HowManyVariables(std::string NewVariables, int type)
{ {
std::string tmp, tmp2,tmp3; std::string tmp, tmp2,tmp3;
size_t position =0, jpos; size_t position =0, jpos;
uint Nb_variables =0; uint Nb_variables =0;
while( NewVariables!= "") while( NewVariables!= "")
{ {
if((position = NewVariables.find(";")) != string::npos) if((position = NewVariables.find(";")) != string::npos)
{ {
tmp = NewVariables; tmp = NewVariables;
tmp2= tmp3 = (tmp.substr(0,position)); tmp2= tmp3 = (tmp.substr(0,position));
jpos = tmp2.find("="); jpos = tmp2.find("=");
if(type == 1) if(type == 1)
{ {
ConstNames.push_back(tmp2.substr(0,jpos)); ConstNames.push_back(tmp2.substr(0,jpos));
skipping to change at line 1113 skipping to change at line 1422
ParamStructs[Nb_paramfunction].vmin = ParamFct; ParamStructs[Nb_paramfunction].vmin = ParamFct;
break; break;
case 6: case 6:
ParamStructs[Nb_paramfunction].vmax = ParamFct; ParamStructs[Nb_paramfunction].vmax = ParamFct;
break; break;
} }
ParamFct =""; ParamFct ="";
} }
} }
} }
void Par3D::CalculateColorsPoints(struct ComponentInfos *comp, uint index) void Par3D::CalculateColorsPoints(struct ComponentInfos *comp, uint index)
{ {
uint Iprime, Jprime,cmpId=0, K=0; uint Iprime, Jprime,cmpId=0, K=0;
double tmp, ValCol[masterthread->VRgbtSize], val[12]; double tmp, ValCol[masterthread->VRgbtSize], val[12];
std::complex<double> val_C[13];
val[11] = masterthread->stepMorph; val[11] = masterthread->stepMorph;
val[0] = val[1] = val[2] = 0.0; val[0] = val[1] = val[2] = 0.0;
if(comp->ThereisRGBA[index] == true && comp->NoiseParam[comp->ParisoCurrent ComponentIndex].NoiseType == 0) if(comp->ThereisRGBA[index] == true && comp->NoiseParam[comp->ParisoCurrent ComponentIndex].NoiseType == 0)
{ {
uint idx=0; uint idx=0;
for(uint i=0; i < comp->NbComponentsType.size()-1; i++) for(uint i=0; i < comp->NbComponentsType.size()-1; i++)
idx+=comp->NbComponentsType[i]; idx+=comp->NbComponentsType[i];
for(uint i= comp->ParisoVertex[2*idx]; i < NbVertexTmp; i++) for(uint i= comp->ParisoVertex[2*idx]; i < NbVertexTmp; i++)
{ {
skipping to change at line 1180 skipping to change at line 1491
ValCol[li] = masterthread->VRgbtParser[li].Eval(val); ValCol[li] = masterthread->VRgbtParser[li].Eval(val);
} }
if(masterthread->Noise != "") if(masterthread->Noise != "")
tmp = masterthread->NoiseParser->Eval(val); tmp = masterthread->NoiseParser->Eval(val);
else else
tmp =1.0; tmp =1.0;
val[0]= tmp*double(NormVertexTabVector[i*10+7]); val[0]= tmp*double(NormVertexTabVector[i*10+7]);
val[1]= tmp*double(NormVertexTabVector[i*10+8]); val[1]= tmp*double(NormVertexTabVector[i*10+8]);
val[2]= tmp*double(NormVertexTabVector[i*10+9]); val[2]= tmp*double(NormVertexTabVector[i*10+9]);
tmp = masterthread->GradientParser->Eval(val); tmp = masterthread->GradientParser->Eval(val);
tmp = masterthread->GradientParser->Eval(val);
for (uint j=0; j < masterthread->VRgbtSize; j+=5) for (uint j=0; j < masterthread->VRgbtSize; j+=5)
if(tmp < ValCol[j]) if(tmp < ValCol[j])
{ {
float fraction=0; float fraction=0;
if(j>=5 && (ValCol[j] != ValCol[j-5])) if(j>=5 && (ValCol[j] != ValCol[j-5]))
{ {
fraction = (tmp-ValCol[j-5])/(ValCol[j]-ValCol[j-5]); fraction = (tmp-ValCol[j-5])/(ValCol[j]-ValCol[j-5]);
NormVertexTabVector[i*10 ] = float(ValCol[j+1])*(fracti on) + (1-fraction)*float(ValCol[(j-5)+1]); NormVertexTabVector[i*10 ] = float(ValCol[j+1])*(fracti on) + (1-fraction)*float(ValCol[(j-5)+1]);
NormVertexTabVector[i*10+1] = float(ValCol[j+2])*(fracti on) + (1-fraction)*float(ValCol[(j-5)+2]);//float(ValCol[j+2]-ValCol[(j-5)+2])*f raction + float(ValCol[(j-5)+2]); NormVertexTabVector[i*10+1] = float(ValCol[j+2])*(fracti on) + (1-fraction)*float(ValCol[(j-5)+2]);//float(ValCol[j+2]-ValCol[(j-5)+2])*f raction + float(ValCol[(j-5)+2]);
NormVertexTabVector[i*10+2] = float(ValCol[j+3])*(fracti on) + (1-fraction)*float(ValCol[(j-5)+3]);//float(ValCol[j+3]-ValCol[(j-5)+3])*f raction + float(ValCol[(j-5)+3]); NormVertexTabVector[i*10+2] = float(ValCol[j+3])*(fracti on) + (1-fraction)*float(ValCol[(j-5)+3]);//float(ValCol[j+3]-ValCol[(j-5)+3])*f raction + float(ValCol[(j-5)+3]);
skipping to change at line 1262 skipping to change at line 1572
} }
if(masterthread->Noise != "") if(masterthread->Noise != "")
tmp = masterthread->NoiseParser->Eval(val); tmp = masterthread->NoiseParser->Eval(val);
else else
tmp =1.0; tmp =1.0;
val[0]= tmp*double(NormVertexTabVector[i*10+7]); val[0]= tmp*double(NormVertexTabVector[i*10+7]);
val[1]= tmp*double(NormVertexTabVector[i*10+8]); val[1]= tmp*double(NormVertexTabVector[i*10+8]);
val[2]= tmp*double(NormVertexTabVector[i*10+9]); val[2]= tmp*double(NormVertexTabVector[i*10+9]);
val[3]*= tmp; val[3]*= tmp;
val[4]*= tmp; val[4]*= tmp;
NormVertexTabVector[i*10 ] = float(masterthread->RgbtParser[0].Eval if(!masterthread->rgbtnotnull_C)
(val)); {
NormVertexTabVector[i*10+1] = float(masterthread->RgbtParser[1].Eval NormVertexTabVector[i*10 ] = float(masterthread->RgbtParser[0].
(val)); Eval(val));
NormVertexTabVector[i*10+2] = float(masterthread->RgbtParser[2].Eval NormVertexTabVector[i*10+1] = float(masterthread->RgbtParser[1].
(val)); Eval(val));
NormVertexTabVector[i*10+3] = float(masterthread->RgbtParser[3].Eval NormVertexTabVector[i*10+2] = float(masterthread->RgbtParser[2].
(val)); Eval(val));
NormVertexTabVector[i*10+3] = float(masterthread->RgbtParser[3].
Eval(val));
}
else
{
for(uint l=0; l<12; l++)
val_C[l]= std::complex<double> (val[l], 0);
val_C[12]= std::complex<double> (val[3], val[4]);
NormVertexTabVector[i*10 ] = (masterthread->RgbtParser_C[0].Eva
lC(val_C)).real();
NormVertexTabVector[i*10+1] = (masterthread->RgbtParser_C[1].Eva
lC(val_C)).real();
NormVertexTabVector[i*10+2] = (masterthread->RgbtParser_C[2].Eva
lC(val_C)).real();
NormVertexTabVector[i*10+3] = (masterthread->RgbtParser_C[3].Eva
lC(val_C)).real();
}
} }
} }
} }
uint Par3D::CNDCalculation(uint & NbTriangleIsoSurfaceTmp, struct ComponentInfos *comp) uint Par3D::CNDCalculation(uint & NbTriangleIsoSurfaceTmp, struct ComponentInfos *comp)
{ {
uint idmx=0; uint idmx=0;
for(uint i=0; i < comp->NbComponentsType.size()-1; i++) for(uint i=0; i < comp->NbComponentsType.size()-1; i++)
idmx+=comp->NbComponentsType[i]; idmx+=comp->NbComponentsType[i];
uint startpoint=comp->ParisoVertex[2*idmx]; uint startpoint=comp->ParisoVertex[2*idmx];
//In the case the isosurface part of a Pariso object doesn't have a CND cond ition //In the case the isosurface part of a Pariso object doesn't have a CND cond ition
int sz = (comp->ParisoCondition.size() == int sz = (comp->ParisoCondition.size() ==
comp->NbComponentsType[comp->NbComponentsType.size()-1]) ? 0 : idm x; comp->NbComponentsType[comp->NbComponentsType.size()-1]) ? 0 : idm x;
if (masterthread->ParisoCondition == 1) if (masterthread->ParisoCondition == 1)
skipping to change at line 1467 skipping to change at line 1791
uint IndexCprime = (NbVertexTmp-1); uint IndexCprime = (NbVertexTmp-1);
// The original triangle will be replaced by four other triangle s: // The original triangle will be replaced by four other triangle s:
TypeIsoSurfaceTriangleListeCNDVector[i-starttri]=0; TypeIsoSurfaceTriangleListeCNDVector[i-starttri]=0;
/// (A, Bprime, Cprime) /// (A, Bprime, Cprime)
IndexPolyTabVector.push_back(Aindex); IndexPolyTabVector.push_back(Aindex);
IndexPolyTabVector.push_back(IndexBprime); IndexPolyTabVector.push_back(IndexBprime);
IndexPolyTabVector.push_back(IndexCprime); IndexPolyTabVector.push_back(IndexCprime);
(TypeTriangle == 0 || TypeTriangle == 2 || TypeTriangle == 4) ? (TypeTriangle == 0 || TypeTriangle == 2 || TypeTriangle == 4) ?
TypeIsoSurfaceTriangleListeCNDVector.push_back(1) : TypeIsoSurfa ceTriangleListeCNDVector.push_back(-1); TypeIsoSurfaceTriangleListeCNDVector.push_back(1) : TypeIsoSurfa ceTriangleListeCNDVector.push_back(-1);
NbTriangleIsoSurfaceTmp++; NbTriangleIsoSurfaceTmp++;
IndexPolyTabMinVector.push_back(3);
IndexPolyTabMinVector.push_back(Aindex);
IndexPolyTabMinVector.push_back(IndexBprime);
IndexPolyTabMinVector.push_back(IndexCprime);
/// (Bprime, B, C) /// (Bprime, B, C)
IndexPolyTabVector.push_back(IndexBprime); IndexPolyTabVector.push_back(IndexBprime);
IndexPolyTabVector.push_back(Bindex); IndexPolyTabVector.push_back(Bindex);
IndexPolyTabVector.push_back(Cindex); IndexPolyTabVector.push_back(Cindex);
(TypeTriangle == 0 || TypeTriangle == 2 || TypeTriangle == 4) ? (TypeTriangle == 0 || TypeTriangle == 2 || TypeTriangle == 4) ?
TypeIsoSurfaceTriangleListeCNDVector.push_back(-1) : TypeIsoSurf aceTriangleListeCNDVector.push_back(1); TypeIsoSurfaceTriangleListeCNDVector.push_back(-1) : TypeIsoSurf aceTriangleListeCNDVector.push_back(1);
NbTriangleIsoSurfaceTmp++; NbTriangleIsoSurfaceTmp++;
IndexPolyTabMinVector.push_back(3);
IndexPolyTabMinVector.push_back(IndexBprime);
IndexPolyTabMinVector.push_back(Bindex);
IndexPolyTabMinVector.push_back(Cindex);
/// (Bprime, C, Cprime) /// (Bprime, C, Cprime)
IndexPolyTabVector.push_back(IndexBprime); IndexPolyTabVector.push_back(IndexBprime);
IndexPolyTabVector.push_back(Cindex); IndexPolyTabVector.push_back(Cindex);
IndexPolyTabVector.push_back(IndexCprime); IndexPolyTabVector.push_back(IndexCprime);
(TypeTriangle == 0 || TypeTriangle == 2 || TypeTriangle == 4) ? (TypeTriangle == 0 || TypeTriangle == 2 || TypeTriangle == 4) ?
TypeIsoSurfaceTriangleListeCNDVector.push_back(-1) : TypeIsoSurf aceTriangleListeCNDVector.push_back(1); TypeIsoSurfaceTriangleListeCNDVector.push_back(-1) : TypeIsoSurf aceTriangleListeCNDVector.push_back(1);
NbTriangleIsoSurfaceTmp++; NbTriangleIsoSurfaceTmp++;
IndexPolyTabMinVector.push_back(3);
IndexPolyTabMinVector.push_back(IndexBprime);
IndexPolyTabMinVector.push_back(Cindex);
IndexPolyTabMinVector.push_back(IndexCprime);
/// (Bprime, Cprime) --> the border /// (Bprime, Cprime) --> the border
IndexPolyTabVector.push_back(IndexBprime); IndexPolyTabVector.push_back(IndexBprime);
IndexPolyTabVector.push_back(IndexCprime); IndexPolyTabVector.push_back(IndexCprime);
IndexPolyTabVector.push_back(IndexCprime); IndexPolyTabVector.push_back(IndexCprime);
TypeIsoSurfaceTriangleListeCNDVector.push_back(4); /// Type = 4- ->Border TypeIsoSurfaceTriangleListeCNDVector.push_back(4); /// Type = 4- ->Border
NbTriangleIsoSurfaceTmp++; NbTriangleIsoSurfaceTmp++;
IndexPolyTabMinVector.push_back(3);
IndexPolyTabMinVector.push_back(IndexBprime);
IndexPolyTabMinVector.push_back(IndexCprime);
IndexPolyTabMinVector.push_back(IndexCprime);
} }
} }
//*********** //***********
//Reorganize the triangles index: //Reorganize the triangles index:
//*********** //***********
std::vector<uint>NewIndexPolyTabVector; std::vector<uint>NewIndexPolyTabVector;
uint k, l, M, N; uint k, l, M, N;
k = l = M = N = 0; k = l = M = N = 0;
// In case we have a ParIso object, this will save the triangle arrangem ent for the parametric CND // In case we have a ParIso object, this will save the triangle arrangem ent for the parametric CND
for(uint i=0; i<starttri; i++) for(uint i=0; i<starttri; i++)
skipping to change at line 1627 skipping to change at line 1935
{ {
StopCalculations = calculation; StopCalculations = calculation;
masterthread->StopCalculations = StopCalculations; masterthread->StopCalculations = StopCalculations;
for(uint nbthreads=0; nbthreads+1< WorkerThreadsNumber; nbthreads++) for(uint nbthreads=0; nbthreads+1< WorkerThreadsNumber; nbthreads++)
workerthreads[nbthreads].StopCalculations = StopCalculations; workerthreads[nbthreads].StopCalculations = StopCalculations;
} }
void ParWorkerThread::emitMySignal() void ParWorkerThread::emitMySignal()
{ {
emit mySignal(signalVal); emit mySignal(signalVal);
} }
void ParWorkerThread::calcul_objet(uint cmp, uint idx) void ParWorkerThread::ParCompute(uint cmp, uint idx)
{ {
uint NewPosition = 10*idx, id=0; uint NewPosition = 10*idx, id=0;
int PreviousSignal=0; int PreviousSignal=0;
uint OrignbU=uint (std::sqrt(Stack_Factor)); uint OrignbU=uint (std::sqrt(Stack_Factor));
uint OrignbV=OrignbU; uint OrignbV=OrignbU;
uint nbU=OrignbU, nbV=OrignbV; uint nbU=OrignbU, nbV=OrignbV;
uint nbstack=nbU*nbV; uint nbstack=nbU*nbV;
uint Iindice=0, Jindice=0; uint Iindice=0, Jindice=0;
double* vals, res; std::complex<double> valcomplex[4*nbstack];
double *ResX, *ResY, *ResZ, *ResW; double ResX[nbstack], ResY[nbstack], ResZ[nbstack], ResW[nbstack], vals[4*nb
stack];
uint taille=0; uint taille=0;
vals = new double[3*nbstack]; std::complex<double> pc;
ResX = new double[nbstack]; double res;
ResY = new double[nbstack];
ResZ = new double[nbstack];
ResW = new double[nbstack];
if(activeMorph == 1) if(activeMorph == 1)
stepMorph += pace; stepMorph += pace;
iStart = 0; iStart = 0;
iFinish = 0; iFinish = 0;
for(uint i=0; i<Ugrid; i++) for(uint i=0; i<Ugrid; i++)
{ {
if((i% (WorkerThreadsNumber)) == MyIndex ) if((i% (WorkerThreadsNumber)) == MyIndex )
{ {
taille += 1; taille += 1;
} }
if(MyIndex <= (i% (WorkerThreadsNumber))) if(MyIndex <= (i% (WorkerThreadsNumber)))
iFinish += 1; iFinish += 1;
} }
iStart = iFinish - taille; iStart = iFinish - taille;
uint remU= (iFinish-iStart)%nbU; uint remU= (iFinish-iStart)%nbU;
uint remV= Vgrid%nbV; uint remV= Vgrid%nbV;
uint Totalpoints=(iFinish-iStart)*Vgrid; uint Totalpoints=(iFinish-iStart)*Vgrid;
for(uint l=0; l<nbstack; l++) for(uint l=0; l<nbstack; l++)
vals[l*3+2]= stepMorph; vals[l*3+2]= stepMorph;
myParserX[cmp].AllocateStackMemory(Stack_Factor); if(!param3d_C && !param4d_C)
myParserY[cmp].AllocateStackMemory(Stack_Factor); {
myParserZ[cmp].AllocateStackMemory(Stack_Factor); myParserX[cmp].AllocateStackMemory(Stack_Factor, nbvariables);
if(param4D == 1) myParserY[cmp].AllocateStackMemory(Stack_Factor, nbvariables);
myParserW[cmp].AllocateStackMemory(Stack_Factor); myParserZ[cmp].AllocateStackMemory(Stack_Factor, nbvariables);
for(uint i=iStart; i < iFinish ; i+=nbU) if(param4D == 1)
myParserW[cmp].AllocateStackMemory(Stack_Factor, nbvariables);
}
else
{
myParserX_C[cmp].AllocateStackMemory(Stack_Factor, nbvariables);
myParserY_C[cmp].AllocateStackMemory(Stack_Factor, nbvariables);
myParserZ_C[cmp].AllocateStackMemory(Stack_Factor, nbvariables);
if(param4d_C)
myParserW_C[cmp].AllocateStackMemory(Stack_Factor, nbvariables);
}
for(uint il=iStart; il < iFinish ; il+=nbU)
{ {
Iindice = i; Iindice = il;
nbV=OrignbV; nbV=OrignbV;
if((remU>0) && ((Iindice+remU)==(iFinish))) if((remU>0) && ((Iindice+remU)==(iFinish)))
{ {
nbU = remU; nbU = remU;
i= iFinish; il= iFinish;
nbstack = nbU*nbV;
} }
for (uint j=0; j < Vgrid ; j+=nbV) for (uint j=0; j < Vgrid ; j+=nbV)
{ {
Jindice = j; Jindice = j;
nbstack = nbU*nbV; nbstack = nbU*nbV;
if((remV>0) && ((Jindice+remV)==(Vgrid))) if((remV>0) && ((Jindice+remV)==(Vgrid)))
{ {
nbV = remV; nbV = remV;
j= Vgrid; j= Vgrid;
nbstack = nbU*nbV; nbstack = nbU*nbV;
} }
for(uint l=0; l<nbstack; l++) for(uint l=0; l<nbstack; l++)
{ {
vals[l*3 ]= double(Iindice+ uint(l/nbV))*dif_u[cmp]/double(Ugri d-1) + u_inf[cmp]; vals[l*3 ]= double(Iindice+ uint(l/nbV))*dif_u[cmp]/double(Ugri d-1) + u_inf[cmp];
vals[l*3+1]= double(Jindice+(l%nbV))*dif_v[cmp]/double(Vgrid-1) + v_inf[cmp]; vals[l*3+1]= double(Jindice+(l%nbV))*dif_v[cmp]/double(Vgrid-1) + v_inf[cmp];
} }
if(StopCalculations) if(StopCalculations)
return; return;
res = myParserX[cmp].Eval2(vals, 3, ResX, nbstack);
if(int(res) == VAR_OVERFLOW)
{
StopCalculations=true;
return;
}
if(int(res) == IF_FUNCT_ERROR)
{
for(uint l=0; l<nbstack; l++)
ResX[l] = myParserX[cmp].Eval(&(vals[l*3]));
}
res = myParserY[cmp].Eval2(vals, 3, ResY, nbstack); if(!param3d_C && !param4d_C)
if(int(res) == VAR_OVERFLOW)
{ {
StopCalculations=true; res = myParserX[cmp].Eval2(vals, 3, ResX, nbstack);
return; if(int(res) == VAR_OVERFLOW)
} {
if(int(res) == IF_FUNCT_ERROR) StopCalculations=true;
{ return;
for(uint l=0; l<nbstack; l++) }
ResY[l] = myParserY[cmp].Eval(&(vals[l*3])); if(int(res) == IF_FUNCT_ERROR)
} {
for(uint l=0; l<nbstack; l++)
ResX[l] = myParserX[cmp].Eval(&(vals[l*3]));
}
res = myParserZ[cmp].Eval2(vals, 3, ResZ, nbstack); res = myParserY[cmp].Eval2(vals, 3, ResY, nbstack);
if(int(res) == VAR_OVERFLOW) if(int(res) == VAR_OVERFLOW)
{ {
StopCalculations=true; StopCalculations=true;
return; return;
} }
if(int(res) == IF_FUNCT_ERROR)
{
for(uint l=0; l<nbstack; l++)
ResZ[l] = myParserZ[cmp].Eval(&(vals[l*3]));
}
if(param4D == 1) if(int(res) == IF_FUNCT_ERROR)
{ {
res = myParserW[cmp].Eval2(vals, 3, ResW, nbstack); for(uint l=0; l<nbstack; l++)
ResY[l] = myParserY[cmp].Eval(&(vals[l*3]));
}
res = myParserZ[cmp].Eval2(vals, 3, ResZ, nbstack);
if(int(res) == VAR_OVERFLOW) if(int(res) == VAR_OVERFLOW)
{ {
StopCalculations=true; StopCalculations=true;
return; return;
} }
if(int(res) == IF_FUNCT_ERROR) if(int(res) == IF_FUNCT_ERROR)
{ {
for(uint l=0; l<nbstack; l++) for(uint l=0; l<nbstack; l++)
ResW[l] = myParserW[cmp].Eval(&(vals[l*3])); ResZ[l] = myParserZ[cmp].Eval(&(vals[l*3]));
}
if(param4D == 1)
{
res = myParserW[cmp].Eval2(vals, 3, ResW, nbstack);
if(int(res) == VAR_OVERFLOW)
{
StopCalculations=true;
return;
}
if(int(res) == IF_FUNCT_ERROR)
{
for(uint l=0; l<nbstack; l++)
ResW[l] = myParserW[cmp].Eval(&(vals[l*3]));
}
} }
} }
else
{
for(uint l=0; l<nbstack; l++)
{
valcomplex[l*4 ] = std::complex<double>(vals[l*3 ] , 0);
valcomplex[l*4+1] = std::complex<double>(vals[l*3+1] , 0);
valcomplex[l*4+2] = std::complex<double>(vals[l*3+2] , 0);
valcomplex[l*4+3] = std::complex<double>(vals[l*3] , vals[l*
3+1]);
}
for(uint l=0; l<nbstack; l++)
{
pc = (myParserX_C[cmp].EvalC(&valcomplex[l*4]));
ResX[l] = pc.real();
}
for(uint l=0; l<nbstack; l++)
{
pc = (myParserY_C[cmp].EvalC(&valcomplex[l*4]));
ResY[l] = pc.real();
}
for(uint l=0; l<nbstack; l++)
{
pc = (myParserZ_C[cmp].EvalC(&valcomplex[l*4]));
ResZ[l] = pc.real();
}
if(param4d_C)
{
for(uint l=0; l<nbstack; l++)
{
pc = (myParserW_C[cmp].EvalC(&valcomplex[l*4]));
ResW[l] = pc.real();
}
}
}
//Signal emission: //Signal emission:
id+=nbstack; id+=nbstack;
if(MyIndex == 0 && activeMorph != 1) if(MyIndex == 0 && activeMorph != 1)
{ {
signalVal = int((id*100)/Totalpoints); signalVal = int((id*100)/Totalpoints);
if((signalVal - PreviousSignal) > 1 || id==Totalpoints) if((signalVal - PreviousSignal) > 1 || id==Totalpoints)
{ {
PreviousSignal = signalVal; PreviousSignal = signalVal;
emitMySignal(); emitMySignal();
} }
} }
int p=0; int p=0;
for(uint ii=0; ii<nbU; ii++) for(uint ii=0; ii<nbU; ii++)
for(uint jj=0; jj<nbV; jj++) for(uint jj=0; jj<nbV; jj++)
{ {
NormVertexTabVector[(Iindice+ii)*10*Vgrid + 10*(Jindice +jj) +7 +NewPosition] = float(ResX[p]); NormVertexTabVector[(Iindice+ii)*10*Vgrid + 10*(Jindice +jj) +7 +NewPosition] = float(ResX[p]);
NormVertexTabVector[(Iindice+ii)*10*Vgrid + 10*(Jindice +jj) +8 +NewPosition] = float(ResY[p]); NormVertexTabVector[(Iindice+ii)*10*Vgrid + 10*(Jindice +jj) +8 +NewPosition] = float(ResY[p]);
NormVertexTabVector[(Iindice+ii)*10*Vgrid + 10*(Jindice +jj) +9 +NewPosition] = float(ResZ[p]); NormVertexTabVector[(Iindice+ii)*10*Vgrid + 10*(Jindice +jj) +9 +NewPosition] = float(ResZ[p]);
if(param4D == 1) if((param4D == 1) || param4d_C)
ExtraDimensionVector[(Iindice+ii)*Vgrid + (Jindice +jj) + idx] = float(ResW[p]); ExtraDimensionVector[(Iindice+ii)*Vgrid + (Jindice +jj) + idx] = float(ResW[p]);
p++; p++;
} }
} }
} }
delete[] vals;
delete[] ResX;
delete[] ResY;
delete[] ResZ;
delete[] ResW;
} }
void Par3D::emitErrorSignal() void Par3D::emitErrorSignal()
{ {
emit ErrorSignal(int(messageerror)); emit ErrorSignal(int(messageerror));
} }
void Par3D::copycomponent(struct ComponentInfos* copy, struct ComponentInfos* or igin) void Par3D::copycomponent(struct ComponentInfos* copy, struct ComponentInfos* or igin)
{ {
copy->ParisoTriangle = origin->ParisoTriangle; copy->ParisoTriangle = origin->ParisoTriangle;
skipping to change at line 1817 skipping to change at line 2172
uint *PolyNumber, uint *PolyNumber,
uint *VertxNumber, uint *VertxNumber,
ComponentInfos *componentsPt, ComponentInfos *componentsPt,
uint **IndexPolyTabMinPt, uint **IndexPolyTabMinPt,
unsigned int *NbPolyMinPt, unsigned int *NbPolyMinPt,
unsigned int *MinimPolySize unsigned int *MinimPolySize
) )
{ {
uint NbTriangleIsoSurfaceTmp; uint NbTriangleIsoSurfaceTmp;
uint nbline_save=Ugrid, nbcolone_save=Vgrid, NextPosition=0; uint nbline_save=Ugrid, nbcolone_save=Vgrid, NextPosition=0;
bool ParisoType=false;
NbVertexTmp = NbTriangleIsoSurfaceTmp = 0; NbVertexTmp = NbTriangleIsoSurfaceTmp = 0;
componentsPt->updateviewer= false; componentsPt->updateviewer= false;
componentsPt->NbParametricMeshLines=0;
componentsPt->MinParametricMeshLines=0;
componentsPt->ParametricGrid.clear();
clear(components); clear(components);
components->ParisoCondition = componentsPt->ParisoCondition; components->ParisoCondition = componentsPt->ParisoCondition;
if(componentsPt->pariso && componentsPt->ParisoCurrentComponentIndex>0) if(((componentsPt->pariso && componentsPt->ParisoCurrentComponentIndex>0)))
{ {
NbVertexTmp = uint(NormVertexTabVector.size()/10); NbVertexTmp = uint(NormVertexTabVector.size()/10);
NbTriangleIsoSurfaceTmp = uint(IndexPolyTabVector.size()/3); NbTriangleIsoSurfaceTmp = uint(IndexPolyTabVector.size()/3);
copycomponent(components, componentsPt); copycomponent(components, componentsPt);
} }
else else
{ {
if(componentsPt->pariso) if((ParisoType=componentsPt->pariso))
{ {
components->pariso = true; components->pariso = true;
components->ParisoCurrentComponentIndex = componentsPt->ParisoCurren tComponentIndex; components->ParisoCurrentComponentIndex = componentsPt->ParisoCurren tComponentIndex;
components->ParisoNbComponents = componentsPt->ParisoNbComponents; components->ParisoNbComponents = componentsPt->ParisoNbComponents;
} }
NormVertexTabVector.clear(); NormVertexTabVector.clear();
NormVertexTabVector.shrink_to_fit(); NormVertexTabVector.shrink_to_fit();
IndexPolyTabVector.clear(); IndexPolyTabVector.clear();
IndexPolyTabVector.shrink_to_fit(); IndexPolyTabVector.shrink_to_fit();
IndexPolyTabMinVector.clear(); IndexPolyTabMinVector.clear();
skipping to change at line 1900 skipping to change at line 2259
{ {
message += QString(" ==> Mesh generation"); message += QString(" ==> Mesh generation");
emitUpdateMessageSignal(); emitUpdateMessageSignal();
} }
if(param4D == 1) if(param4D == 1)
{ {
Anim_Rot4D (NbVertexTmp); Anim_Rot4D (NbVertexTmp);
} }
calcul_Norm(10*NbVertexTmp); calcul_Norm(10*NbVertexTmp);
make_PolyIndexMin(NbVertexTmp); make_PolyIndexMin(NbVertexTmp, componentsPt);
make_PolyIndexTri(NbVertexTmp); make_PolyIndexTri(NbVertexTmp);
components->ParisoTriangle.push_back(6*NextPosition); //save the startin g position of this component components->ParisoTriangle.push_back(6*NextPosition); //save the startin g position of this component
components->ParisoTriangle.push_back(2*(Ugrid - CutU -1)*(Vgrid - CutV -1)); //save the number of Polygones of this component components->ParisoTriangle.push_back(2*(Ugrid - CutU -1)*(Vgrid - CutV -1)); //save the number of Polygones of this component
NextPosition += (Ugrid - CutU-1)*(Vgrid - CutV-1); NextPosition += (Ugrid - CutU-1)*(Vgrid - CutV-1);
NbVertexTmp += (Ugrid)*(Vgrid); NbVertexTmp += (Ugrid)*(Vgrid);
} }
if(masterthread->activeMorph != 1) if(masterthread->activeMorph != 1)
{ {
message = QString("2) Mesh Processing"); message = QString("2) Mesh Processing");
emitUpdateMessageSignal(); emitUpdateMessageSignal();
} }
//CND calculation for the triangles results: //CND calculation for the triangles results:
CNDCalculation(NbTriangleIsoSurfaceTmp, components); CNDCalculation(NbTriangleIsoSurfaceTmp, components);
// Pigment, Texture and Noise : // Pigment, Texture and Noise :
skipping to change at line 1950 skipping to change at line 2309
CalculateColorsPoints(components, components->ThereisRGBA.size()-1); CalculateColorsPoints(components, components->ThereisRGBA.size()-1);
//revert to their initial values: //revert to their initial values:
if(masterthread->gridnotnull) if(masterthread->gridnotnull)
initialiser_LineColumn(nbline_save, nbcolone_save); initialiser_LineColumn(nbline_save, nbcolone_save);
if(masterthread->activeMorph != 1) if(masterthread->activeMorph != 1)
{ {
message = QString("Threads:"+QString::number(WorkerThreadsNumber)+"; Cmp :"+QString::number(masterthread->componentsNumber)+"; T="+QString::number(ptime. elapsed()/1000.0)+"s"); message = QString("Threads:"+QString::number(WorkerThreadsNumber)+"; Cmp :"+QString::number(masterthread->componentsNumber)+"; T="+QString::number(ptime. elapsed()/1000.0)+"s");
emitUpdateMessageSignal(); emitUpdateMessageSignal();
} }
// 3) Nb Poly & Vertex : // 3) Nb Poly & Vertex :
*PolyNumber = uint(IndexPolyTabVector.size());//3*NbTriangleIsoSurfaceT
mp;
*VertxNumber = uint(NormVertexTabVector.size()/10);//NbVertexTmp;
*NbPolyMinPt = uint(IndexPolyTabMinVector.size());
NormVertexTabVector.resize(NormVertexTabVector.size()+ (12+60+36)*10); // To
add memory space to store the cube 12 vertices (three quads)
uint startpl = 0;
uint actualpointindice=0;
if(!ParisoType)
{ {
*PolyNumber = uint(IndexPolyTabVector.size());//3*NbTriangleIsoSurf
aceTmp;
*VertxNumber = uint(NormVertexTabVector.size()/10);//NbVertexTmp;
*NbPolyMinPt = uint(IndexPolyTabMinVector.size());//NbPolyMinimalTop
ology;
NormVertexTabVector.resize(NormVertexTabVector.size()+ (12+60+36)*10); /
/ To add memory space to store the cube 12 vertices (three quads)
uint startpl = 0;
uint actualpointindice=0;
for (uint i = 0; i < *NbPolyMinPt; i++) for (uint i = 0; i < *NbPolyMinPt; i++)
{ {
uint polysize = IndexPolyTabMinVector[startpl++]; uint polysize = IndexPolyTabMinVector[startpl++];
for (uint j = 0; j < polysize; j++) for (uint j = 0; j < polysize; j++)
{ {
actualpointindice = IndexPolyTabMinVector[startpl]; actualpointindice = IndexPolyTabMinVector[startpl];
IndexPolyTabVector.push_back(actualpointindice); IndexPolyTabVector.push_back(actualpointindice);
startpl++; startpl++;
} }
i += polysize; i += polysize;
} }
IndexPolyTabMinVector2.clear(); IndexPolyTabMinVector2.clear();
for (uint i = 0; i < *NbPolyMinPt; i++) for (uint i = 0; i < *NbPolyMinPt; i++)
{ {
uint polysize = IndexPolyTabMinVector[i]; uint polysize = IndexPolyTabMinVector[i];
IndexPolyTabMinVector2.push_back(polysize); IndexPolyTabMinVector2.push_back(polysize);
i += polysize; i += polysize;
} }
}
*MinimPolySize = IndexPolyTabVector.size() - *PolyNumber; *MinimPolySize = IndexPolyTabVector.size() - *PolyNumber;
if(!ParisoType)
{
*NbPolyMinPt = uint(IndexPolyTabMinVector2.size()); *NbPolyMinPt = uint(IndexPolyTabMinVector2.size());
*IndexPolyTabMinPt = IndexPolyTabMinVector2.data(); *IndexPolyTabMinPt = IndexPolyTabMinVector2.data();
*NormVertexTabPt = NormVertexTabVector.data();
*IndexPolyTabPt = IndexPolyTabVector.data();
} }
else
{
*NbPolyMinPt = uint(IndexPolyTabMinVector.size());
*IndexPolyTabMinPt = IndexPolyTabMinVector.data();
}
*NormVertexTabPt = NormVertexTabVector.data();
*IndexPolyTabPt = IndexPolyTabVector.data();
copycomponent(componentsPt, components); copycomponent(componentsPt, components);
componentsPt->Interleave = true; componentsPt->Interleave = true;
if(componentsPt->ParisoCurrentComponentIndex != (componentsPt->ParisoNbCompo nents-1)) if(componentsPt->ParisoCurrentComponentIndex != (componentsPt->ParisoNbCompo nents-1))
componentsPt->ParisoCurrentComponentIndex += 1; componentsPt->ParisoCurrentComponentIndex += 1;
else else
componentsPt->ParisoCurrentComponentIndex = 0; componentsPt->ParisoCurrentComponentIndex = 0;
InitShowComponent(componentsPt); InitShowComponent(componentsPt);
componentsPt->updateviewer = true; componentsPt->updateviewer = true;
} }
void Par3D::InitShowComponent(struct ComponentInfos *cpInfos) void Par3D::InitShowComponent(struct ComponentInfos *cpInfos)
{ {
cpInfos->ShowParIsoCmp.clear(); cpInfos->ShowParIsoCmp.clear();
for(uint i=0; i<cpInfos->NbComponentsType[cpInfos->NbComponentsType.size()-1 ]; i++) for(uint i=0; i<cpInfos->NbComponentsType[cpInfos->NbComponentsType.size()-1 ]; i++)
cpInfos->ShowParIsoCmp.push_back(true); cpInfos->ShowParIsoCmp.push_back(true);
} }
void Par3D::make_PolyIndexMin(uint index) void Par3D::make_PolyIndexMin(uint index, ComponentInfos *cp)
{ {
uint k=0; cp->NbParametricMeshLines += (Ugrid+Vgrid);
for (uint i=0; i+CutU+1 < Ugrid ; i++) cp->MinParametricMeshLines += 2*Ugrid*Vgrid;
for (uint j=0; j+CutV+1< Vgrid ; j++) cp->ParametricGrid.push_back(Ugrid);
cp->ParametricGrid.push_back(Vgrid);
for (uint i=0; i+CutU < Ugrid ; i++)
{
IndexPolyTabMinVector.push_back(Vgrid);
for (uint j=0; j+CutV< Vgrid ; j++)
{ {
IndexPolyTabMinVector.push_back(4);
IndexPolyTabMinVector.push_back(i*Vgrid + j+index); IndexPolyTabMinVector.push_back(i*Vgrid + j+index);
IndexPolyTabMinVector.push_back((i+1)*Vgrid + j +index);
IndexPolyTabMinVector.push_back((i+1)*Vgrid + (j+1)+index);
IndexPolyTabMinVector.push_back(i*Vgrid + (j+1)+index);
k+=5;
} }
}
for (uint i=0; i+CutV < Vgrid ; i++)
{
IndexPolyTabMinVector.push_back(Ugrid);
for (uint j=0; j+CutU< Ugrid ; j++)
{
IndexPolyTabMinVector.push_back(i + j*Vgrid + index);
}
}
} }
void Par3D::make_PolyIndexTri(uint index) void Par3D::make_PolyIndexTri(uint index)
{ {
uint k=0; uint k=0;
for (uint i=0; i+CutU+1< Ugrid; i++) for (uint i=0; i+CutU+1< Ugrid; i++)
for (uint j=0; j+CutV+1< Vgrid; j++) for (uint j=0; j+CutV+1< Vgrid; j++)
{ {
IndexPolyTabVector.push_back(i*Vgrid + j+index); IndexPolyTabVector.push_back(i*Vgrid + j+index);
IndexPolyTabVector.push_back((i+1)*Vgrid + j +index); IndexPolyTabVector.push_back((i+1)*Vgrid + j +index);
 End of changes. 111 change blocks. 
224 lines changed or deleted 649 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)