"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pariso/isosurface/Iso3D.cpp" between
mathmod-10.1-source.zip and mathmod-11.0-source.zip

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

Iso3D.cpp  (mathmod-10.1-source):Iso3D.cpp  (mathmod-11.0-source)
/*************************************************************************** /***************************************************************************
* Copyright (C) 2020 by Abderrahman Taha * * Copyright (C) 2021 by Abderrahman Taha *
* * * *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
skipping to change at line 35 skipping to change at line 35
static uint NbPolyMin; static uint NbPolyMin;
static Voxel *GridVoxelVarPt; static Voxel *GridVoxelVarPt;
static double *Results; static double *Results;
static uint NbVertexTmp = 0; static uint NbVertexTmp = 0;
static std::vector<float> NormOriginaltmpVector; static std::vector<float> NormOriginaltmpVector;
uint NbTriangleIsoSurface,NbPointIsoMap; uint NbTriangleIsoSurface,NbPointIsoMap;
uint OrignbX, OrignbY, OrignbZ; uint OrignbX, OrignbY, OrignbZ;
uint Stack_Factor=OrignbX*OrignbY*OrignbZ; uint Stack_Factor=OrignbX*OrignbY*OrignbZ;
std::vector<float> NormVertexTabVector; std::vector<float> NormVertexTabVector;
std::vector<uint> IndexPolyTabMinVector; std::vector<uint> IndexPolyTabMinVector;
std::vector<uint> IndexPolyTabMinVector2;
std::vector<uint> IndexPolyTabVector; std::vector<uint> IndexPolyTabVector;
static CellNoise *NoiseFunction = new CellNoise(); static CellNoise *NoiseFunction = new CellNoise();
static ImprovedNoise *PNoise = new ImprovedNoise(4., 4., 4.); static ImprovedNoise *PNoise = new ImprovedNoise(4., 4., 4.);
static QElapsedTimer times; static QElapsedTimer times;
static double IsoComponentId=0; static double IsoComponentId=0;
static int nbvariables=0; static int nbvariables=0;
double CurrentIsoCmpId(const double* p) double CurrentIsoCmpId(const double* p)
{ {
return((int (p[0]))== 0 ? IsoComponentId:0); return((int (p[0]))== 0 ? IsoComponentId:0);
} }
extern double TurbulenceWorley(const double *p) extern double TurbulenceWorley(const double *p)
{ {
return double ( return double (
NoiseFunction->CellNoiseFunc( NoiseFunction->CellNoiseFunc(
float (p[0]), float (p[0]),
float (p[1]), float (p[1]),
float (p[2]), float (p[2]),
int (p[3]), int (p[3]),
int (p[4]), int (p[4]),
int (p[5])) int (p[5]))
skipping to change at line 107 skipping to change at line 109
} }
void Iso3D::BuildIso() void Iso3D::BuildIso()
{ {
IsoBuild( IsoBuild(
&(localScene->ArrayNorVer_localPt), &(localScene->ArrayNorVer_localPt),
&(localScene->PolyIndices_localPt), &(localScene->PolyIndices_localPt),
&localScene->PolyNumber, &localScene->PolyNumber,
&(localScene->VertxNumber), &(localScene->VertxNumber),
&(localScene->PolyIndices_localPtMin), &(localScene->PolyIndices_localPtMin),
&(localScene->NbPolygnNbVertexPtMin), &(localScene->NbPolygnNbVertexPtMin),
&(localScene->NbPolygnNbVertexPtMinSize),
&(localScene->componentsinfos)); &(localScene->componentsinfos));
} }
IsoMasterThread::IsoMasterThread() IsoMasterThread::IsoMasterThread()
{ {
ParisoCondition = -1; ParisoCondition = -1;
ImplicitFunction = "cos(x) + cos(y) + cos(z)"; ImplicitFunction = "cos(x) + cos(y) + cos(z)";
XlimitSup = "4"; XlimitSup = "4";
YlimitSup = "4"; YlimitSup = "4";
ZlimitSup = "4"; ZlimitSup = "4";
XlimitInf = "-4"; XlimitInf = "-4";
skipping to change at line 434 skipping to change at line 437
} }
NewVariables = ""; NewVariables = "";
Nb_variables++; Nb_variables++;
} }
} }
return Nb_variables; return Nb_variables;
} }
uint IsoMasterThread::HowManyIsosurface(std::string ImplicitFct, uint type) uint IsoMasterThread::HowManyIsosurface(std::string ImplicitFct, uint type)
{ {
std::string tmp, tmp2; std::string tmp, tmp2;
size_t position =0, jpos; size_t position =0;
uint Nb_implicitfunction =0; uint Nb_implicitfunction =0;
if(type ==0) if(type ==0)
{ {
ImplicitStructs[0].fxyz = ImplicitFct; ImplicitStructs[0].fxyz = ImplicitFct;
while( ImplicitFct!= "") while( ImplicitFct!= "")
{ {
if((position = ImplicitFct.find(";")) !=std::string::npos ) if((position = ImplicitFct.find(";")) !=std::string::npos )
{ {
tmp = ImplicitFct; tmp = ImplicitFct;
ImplicitStructs[Nb_implicitfunction].fxyz = (tmp.substr(0,positi on)); ImplicitStructs[Nb_implicitfunction].fxyz = (tmp.substr(0,positi on));
Nb_implicitfunction++; Nb_implicitfunction++;
tmp2 = ImplicitFct.substr(position+1, jpos=ImplicitFct.length()- 1); tmp2 = ImplicitFct.substr(position+1, ImplicitFct.length()-1);
ImplicitFct = tmp2; ImplicitFct = tmp2;
} }
else else
{ {
ImplicitStructs[Nb_implicitfunction].fxyz = ImplicitFct; ImplicitStructs[Nb_implicitfunction].fxyz = ImplicitFct;
ImplicitFct =""; ImplicitFct ="";
} }
} }
return Nb_implicitfunction; return Nb_implicitfunction;
} }
else if(type == 1) //xmin else if(type == 1) //xmin
{ {
ImplicitStructs[0].xmin = ImplicitFct; ImplicitStructs[0].xmin = ImplicitFct;
while( ImplicitFct!= "") while( ImplicitFct!= "")
{ {
if((position = ImplicitFct.find(";")) != std::string::npos) if((position = ImplicitFct.find(";")) != std::string::npos)
{ {
tmp = ImplicitFct; tmp = ImplicitFct;
ImplicitStructs[Nb_implicitfunction].xmin = (tmp.substr(0,positi on)); ImplicitStructs[Nb_implicitfunction].xmin = (tmp.substr(0,positi on));
Nb_implicitfunction++; Nb_implicitfunction++;
tmp2 = ImplicitFct.substr(position+1, jpos=ImplicitFct.length()- 1); tmp2 = ImplicitFct.substr(position+1, ImplicitFct.length()-1);
ImplicitFct = tmp2; ImplicitFct = tmp2;
} }
else else
{ {
ImplicitStructs[Nb_implicitfunction].xmin = ImplicitFct; ImplicitStructs[Nb_implicitfunction].xmin = ImplicitFct;
ImplicitFct =""; ImplicitFct ="";
} }
} }
return Nb_implicitfunction; return Nb_implicitfunction;
} }
else if(type == 2) //xmax else if(type == 2) //xmax
{ {
ImplicitStructs[0].xmax = ImplicitFct; ImplicitStructs[0].xmax = ImplicitFct;
while( ImplicitFct!= "") while( ImplicitFct!= "")
{ {
if((position = ImplicitFct.find(";")) != std::string::npos) if((position = ImplicitFct.find(";")) != std::string::npos)
{ {
tmp = ImplicitFct; tmp = ImplicitFct;
ImplicitStructs[Nb_implicitfunction].xmax = (tmp.substr(0,positi on)); ImplicitStructs[Nb_implicitfunction].xmax = (tmp.substr(0,positi on));
Nb_implicitfunction++; Nb_implicitfunction++;
tmp2 = ImplicitFct.substr(position+1, jpos=ImplicitFct.length()- 1); tmp2 = ImplicitFct.substr(position+1, ImplicitFct.length()-1);
ImplicitFct = tmp2; ImplicitFct = tmp2;
} }
else else
{ {
ImplicitStructs[Nb_implicitfunction].xmax = ImplicitFct; ImplicitStructs[Nb_implicitfunction].xmax = ImplicitFct;
ImplicitFct =""; ImplicitFct ="";
} }
} }
return Nb_implicitfunction; return Nb_implicitfunction;
} }
else if(type == 3) //ymin else if(type == 3) //ymin
{ {
ImplicitStructs[0].ymin = ImplicitFct; ImplicitStructs[0].ymin = ImplicitFct;
while( ImplicitFct!= "") while( ImplicitFct!= "")
{ {
if((position = ImplicitFct.find(";")) != std::string::npos) if((position = ImplicitFct.find(";")) != std::string::npos)
{ {
tmp = ImplicitFct; tmp = ImplicitFct;
ImplicitStructs[Nb_implicitfunction].ymin = (tmp.substr(0,positi on)); ImplicitStructs[Nb_implicitfunction].ymin = (tmp.substr(0,positi on));
Nb_implicitfunction++; Nb_implicitfunction++;
tmp2 = ImplicitFct.substr(position+1, jpos=ImplicitFct.length()- 1); tmp2 = ImplicitFct.substr(position+1, ImplicitFct.length()-1);
ImplicitFct = tmp2; ImplicitFct = tmp2;
} }
else else
{ {
ImplicitStructs[Nb_implicitfunction].ymin = ImplicitFct; ImplicitStructs[Nb_implicitfunction].ymin = ImplicitFct;
ImplicitFct =""; ImplicitFct ="";
} }
} }
return Nb_implicitfunction; return Nb_implicitfunction;
} }
else if(type == 4) //ymax else if(type == 4) //ymax
{ {
ImplicitStructs[0].ymax = ImplicitFct; ImplicitStructs[0].ymax = ImplicitFct;
while( ImplicitFct!= "") while( ImplicitFct!= "")
{ {
if((position = ImplicitFct.find(";")) != std::string::npos) if((position = ImplicitFct.find(";")) != std::string::npos)
{ {
tmp = ImplicitFct; tmp = ImplicitFct;
ImplicitStructs[Nb_implicitfunction].ymax = (tmp.substr(0,positi on)); ImplicitStructs[Nb_implicitfunction].ymax = (tmp.substr(0,positi on));
Nb_implicitfunction++; Nb_implicitfunction++;
tmp2 = ImplicitFct.substr(position+1, jpos=ImplicitFct.length()- 1); tmp2 = ImplicitFct.substr(position+1, ImplicitFct.length()-1);
ImplicitFct = tmp2; ImplicitFct = tmp2;
} }
else else
{ {
ImplicitStructs[Nb_implicitfunction].ymax = ImplicitFct; ImplicitStructs[Nb_implicitfunction].ymax = ImplicitFct;
ImplicitFct =""; ImplicitFct ="";
} }
} }
return Nb_implicitfunction; return Nb_implicitfunction;
} }
else if(type == 5) //zmin else if(type == 5) //zmin
{ {
ImplicitStructs[0].zmin = ImplicitFct; ImplicitStructs[0].zmin = ImplicitFct;
while( ImplicitFct!= "") while( ImplicitFct!= "")
{ {
if((position = ImplicitFct.find(";")) != std::string::npos) if((position = ImplicitFct.find(";")) != std::string::npos)
{ {
tmp = ImplicitFct; tmp = ImplicitFct;
ImplicitStructs[Nb_implicitfunction].zmin = (tmp.substr(0,positi on)); ImplicitStructs[Nb_implicitfunction].zmin = (tmp.substr(0,positi on));
Nb_implicitfunction++; Nb_implicitfunction++;
tmp2 = ImplicitFct.substr(position+1, jpos=ImplicitFct.length()- 1); tmp2 = ImplicitFct.substr(position+1, ImplicitFct.length()-1);
ImplicitFct = tmp2; ImplicitFct = tmp2;
} }
else else
{ {
ImplicitStructs[Nb_implicitfunction].zmin = ImplicitFct; ImplicitStructs[Nb_implicitfunction].zmin = ImplicitFct;
ImplicitFct =""; ImplicitFct ="";
} }
} }
return Nb_implicitfunction; return Nb_implicitfunction;
} }
else if(type == 6) //zmax else if(type == 6) //zmax
{ {
ImplicitStructs[0].zmax = ImplicitFct; ImplicitStructs[0].zmax = ImplicitFct;
while( ImplicitFct!= "") while( ImplicitFct!= "")
{ {
if((position = ImplicitFct.find(";")) != std::string::npos) if((position = ImplicitFct.find(";")) != std::string::npos)
{ {
tmp = ImplicitFct; tmp = ImplicitFct;
ImplicitStructs[Nb_implicitfunction].zmax = (tmp.substr(0,positi on)); ImplicitStructs[Nb_implicitfunction].zmax = (tmp.substr(0,positi on));
Nb_implicitfunction++; Nb_implicitfunction++;
tmp2 = ImplicitFct.substr(position+1, jpos=ImplicitFct.length()- 1); tmp2 = ImplicitFct.substr(position+1, ImplicitFct.length()-1);
ImplicitFct = tmp2; ImplicitFct = tmp2;
} }
else else
{ {
ImplicitStructs[Nb_implicitfunction].zmax = ImplicitFct; ImplicitStructs[Nb_implicitfunction].zmax = ImplicitFct;
ImplicitFct =""; ImplicitFct ="";
} }
} }
return Nb_implicitfunction; return Nb_implicitfunction;
} }
else if(type == 8) //Cnd else if(type == 8) //Cnd
{ {
ImplicitStructs[0].cnd = ImplicitFct; ImplicitStructs[0].cnd = ImplicitFct;
while( ImplicitFct!= "") while( ImplicitFct!= "")
{ {
if((position = ImplicitFct.find(";")) != std::string::npos) if((position = ImplicitFct.find(";")) != std::string::npos)
{ {
tmp = ImplicitFct; tmp = ImplicitFct;
ImplicitStructs[Nb_implicitfunction].cnd = (tmp.substr(0,positio n)); ImplicitStructs[Nb_implicitfunction].cnd = (tmp.substr(0,positio n));
Nb_implicitfunction++; Nb_implicitfunction++;
tmp2 = ImplicitFct.substr(position+1, jpos=ImplicitFct.length()- 1); tmp2 = ImplicitFct.substr(position+1, ImplicitFct.length()-1);
ImplicitFct = tmp2; ImplicitFct = tmp2;
} }
else else
{ {
ImplicitStructs[Nb_implicitfunction].cnd = ImplicitFct; ImplicitStructs[Nb_implicitfunction].cnd = ImplicitFct;
ImplicitFct =""; ImplicitFct ="";
} }
} }
return Nb_implicitfunction; return Nb_implicitfunction;
} }
skipping to change at line 627 skipping to change at line 630
masterthread->z_Step[IsoIndex] = (masterthread->zLocal2[IsoIndex*maxgridval] -(masterthread->z_Inf[IsoIndex]=masterthread->zInfParser[IsoIndex].Eval(vals)))/ (limitZ-1); masterthread->z_Step[IsoIndex] = (masterthread->zLocal2[IsoIndex*maxgridval] -(masterthread->z_Inf[IsoIndex]=masterthread->zInfParser[IsoIndex].Eval(vals)))/ (limitZ-1);
for (uint i= 1; i < limitX; i++) for (uint i= 1; i < limitX; i++)
masterthread->xLocal2[IsoIndex*maxgridval+i] = masterthread->xLocal2[Iso Index*maxgridval+i-1] - masterthread->x_Step[IsoIndex]; masterthread->xLocal2[IsoIndex*maxgridval+i] = masterthread->xLocal2[Iso Index*maxgridval+i-1] - masterthread->x_Step[IsoIndex];
for (uint j= 1; j < limitY; j++) for (uint j= 1; j < limitY; j++)
masterthread->yLocal2[IsoIndex*maxgridval+j] = masterthread->yLocal2[Iso Index*maxgridval+j-1] - masterthread->y_Step[IsoIndex]; masterthread->yLocal2[IsoIndex*maxgridval+j] = masterthread->yLocal2[Iso Index*maxgridval+j-1] - masterthread->y_Step[IsoIndex];
for (uint k= 1; k < limitZ; k++) for (uint k= 1; k < limitZ; k++)
masterthread->zLocal2[IsoIndex*maxgridval+k] = masterthread->zLocal2[Iso Index*maxgridval+k-1] - masterthread->z_Step[IsoIndex]; masterthread->zLocal2[IsoIndex*maxgridval+k] = masterthread->zLocal2[Iso Index*maxgridval+k-1] - masterthread->z_Step[IsoIndex];
for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++) for(uint nbthreads=0; nbthreads+1<WorkerThreadsNumber; nbthreads++)
{ {
for (uint k= 0; k < limitX; k++) for (uint k= 0; k < limitX; k++)
{
workerthreads[nbthreads].xLocal2[IsoIndex*maxgridval+k] = masterthre ad->xLocal2[IsoIndex*maxgridval+k]; workerthreads[nbthreads].xLocal2[IsoIndex*maxgridval+k] = masterthre ad->xLocal2[IsoIndex*maxgridval+k];
}
for (uint k= 0; k < limitY; k++) for (uint k= 0; k < limitY; k++)
{
workerthreads[nbthreads].yLocal2[IsoIndex*maxgridval+k] = masterthre ad->yLocal2[IsoIndex*maxgridval+k]; workerthreads[nbthreads].yLocal2[IsoIndex*maxgridval+k] = masterthre ad->yLocal2[IsoIndex*maxgridval+k];
}
for (uint k= 0; k < limitZ; k++) for (uint k= 0; k < limitZ; k++)
{
workerthreads[nbthreads].zLocal2[IsoIndex*maxgridval+k] = masterthre ad->zLocal2[IsoIndex*maxgridval+k]; workerthreads[nbthreads].zLocal2[IsoIndex*maxgridval+k] = masterthre ad->zLocal2[IsoIndex*maxgridval+k];
}
} }
} }
void IsoWorkerThread::VoxelEvaluation(uint IsoIndex) void IsoWorkerThread::VoxelEvaluation(uint IsoIndex)
{ {
double* vals; double* vals;
double* Res; double* Res;
uint maxgrscalemaxgr = GridVal*GridVal; uint maxgrscalemaxgr = GridVal*GridVal;
const uint limitY = XYZgrid, limitZ = XYZgrid; const uint limitY = XYZgrid, limitZ = XYZgrid;
uint I, J, IJK; uint I, J, IJK;
uint id=0; uint id=0;
skipping to change at line 662 skipping to change at line 659
vals = new double[nbvar*nbstack]; vals = new double[nbvar*nbstack];
Res = new double[nbstack]; Res = new double[nbstack];
vals[3] = stepMorph; vals[3] = stepMorph;
//vals[4] = double(MyIndex); //vals[4] = double(MyIndex);
uint taille=0; uint taille=0;
iStart = 0; iStart = 0;
iFinish = 0; iFinish = 0;
for(uint i=0; i<XYZgrid; i++) for(uint i=0; i<XYZgrid; 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;
for(uint l=0; l<nbstack; l++) for(uint l=0; l<nbstack; l++)
vals[l*nbvar+3]= stepMorph; vals[l*nbvar+3]= stepMorph;
for(uint l=0; l<nbstack; l++) for(uint l=0; l<nbstack; l++)
vals[l*nbvar+7]=GridVal; vals[l*nbvar+7]=GridVal;
uint remX= (iFinish-iStart)%nbX; uint remX= (iFinish-iStart)%nbX;
uint remY= limitY%nbY; uint remY= limitY%nbY;
uint remZ= limitZ%nbZ; uint remZ= limitZ%nbZ;
uint Totalpoints=(iFinish-iStart)*limitY*limitZ; uint Totalpoints=(iFinish-iStart)*limitY*limitZ;
implicitFunctionParser[IsoIndex].AllocateStackMemory(Stack_Factor, nbvariabl es); implicitFunctionParser[IsoIndex].AllocateStackMemory(Stack_Factor, nbvariabl es);
for(uint i=iStart; i<iFinish; i+=nbX ) for(uint i=iStart; i<iFinish; i+=nbX )
{ {
Iindice = i; Iindice = i;
nbY=OrignbY; nbY=OrignbY;
nbZ=OrignbZ;
if((remX>0) && ((Iindice+remX)==(iFinish))) if((remX>0) && ((Iindice+remX)==(iFinish)))
{ {
nbX = remX; nbX = remX;
i= iFinish; i= iFinish;
} }
I = Iindice*maxgrscalemaxgr; I = Iindice*maxgrscalemaxgr;
for(uint j=0; j<limitY; j+=nbY) for(uint j=0; j<limitY; j+=nbY)
{ {
Jindice = j; Jindice = j;
nbZ=OrignbZ; nbZ=OrignbZ;
skipping to change at line 1378 skipping to change at line 1371
{ {
StopCalculations = calculation; StopCalculations = calculation;
masterthread->StopCalculations = calculation; masterthread->StopCalculations = calculation;
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 Iso3D::copycomponent(struct ComponentInfos* copy, struct ComponentInfos* or igin) void Iso3D::copycomponent(struct ComponentInfos* copy, struct ComponentInfos* or igin)
{ {
copy->ParisoTriangle = origin->ParisoTriangle; copy->ParisoTriangle = origin->ParisoTriangle;
copy->ParisoVertex = origin->ParisoVertex; copy->ParisoVertex = origin->ParisoVertex;
copy->NbComponents = origin->NbComponents; copy->NbComponentsType = origin->NbComponentsType;
copy->ParisoCurrentComponentIndex = origin->ParisoCurrentComponentIndex; copy->ParisoCurrentComponentIndex = origin->ParisoCurrentComponentIndex;
copy->ParisoNbComponents = origin->ParisoNbComponents; copy->ParisoNbComponents = origin->ParisoNbComponents;
copy->Interleave = origin->Interleave; copy->Interleave = origin->Interleave;
copy->pariso = origin->pariso; copy->pariso = origin->pariso;
copy->updateviewer = origin->updateviewer; copy->updateviewer = origin->updateviewer;
copy->ThereisCND = origin->ThereisCND; copy->ThereisCND = origin->ThereisCND;
copy->ParisoCondition = origin->ParisoCondition; copy->ParisoCondition = origin->ParisoCondition;
copy->ThereisRGBA = origin->ThereisRGBA; copy->ThereisRGBA = origin->ThereisRGBA;
copy->NbTrianglesVerifyCND = origin->NbTrianglesVerifyCND; copy->NbTrianglesVerifyCND = origin->NbTrianglesVerifyCND;
copy->NbTrianglesNoCND = origin->NbTrianglesNoCND; copy->NbTrianglesNoCND = origin->NbTrianglesNoCND;
skipping to change at line 1403 skipping to change at line 1396
copy->NoiseParam[i] = origin->NoiseParam[i]; copy->NoiseParam[i] = origin->NoiseParam[i];
} }
} }
void Iso3D::IsoBuild ( void Iso3D::IsoBuild (
float **NormVertexTabVectorPt, float **NormVertexTabVectorPt,
uint **IndexPolyTabPt, uint **IndexPolyTabPt,
unsigned int *PolyNumber, unsigned int *PolyNumber,
uint *VertexNumberpt, uint *VertexNumberpt,
uint **IndexPolyTabMinPt, uint **IndexPolyTabMinPt,
unsigned int *VertxNumber, unsigned int *VertxNumber,
unsigned int *MinimPolySize,
struct ComponentInfos * componentsPt struct ComponentInfos * componentsPt
) )
{ {
uint NbTriangleIsoSurfaceTmp, PreviousGridVal=masterthread->XYZgrid; uint NbTriangleIsoSurfaceTmp, PreviousGridVal=masterthread->XYZgrid;
NbPointIsoMap= 0; NbPointIsoMap= 0;
NbVertexTmp = NbTriangleIsoSurfaceTmp = 0; NbVertexTmp = NbTriangleIsoSurfaceTmp = 0;
componentsPt->updateviewer= false; componentsPt->updateviewer= false;
clear(components); clear(components);
components->ParisoCondition = componentsPt->ParisoCondition; components->ParisoCondition = componentsPt->ParisoCondition;
if(componentsPt->pariso && componentsPt->ParisoCurrentComponentIndex>0) if(componentsPt->pariso && componentsPt->ParisoCurrentComponentIndex>0)
skipping to change at line 1466 skipping to change at line 1460
emitErrorSignal(); emitErrorSignal();
return; return;
} }
Results = new (std::nothrow) double[masterthread->GridVal*masterthread->Grid Val*masterthread->GridVal]; Results = new (std::nothrow) double[masterthread->GridVal*masterthread->Grid Val*masterthread->GridVal];
if (!Results) if (!Results)
{ {
messageerror = MEM_OVERFLOW; messageerror = MEM_OVERFLOW;
emitErrorSignal(); emitErrorSignal();
return; return;
} }
components->NbComponents.push_back(masterthread->componentsNumber); components->NbComponentsType.push_back(masterthread->componentsNumber);
stopcalculations(false); stopcalculations(false);
if(masterthread->activeMorph != 1) if(masterthread->activeMorph != 1)
{ {
times.restart(); times.restart();
} }
// generate Isosurface for all the implicit formulas // generate Isosurface for all the implicit formulas
for(uint fctnb= 0; fctnb< masterthread->componentsNumber; fctnb++) for(uint fctnb= 0; fctnb< masterthread->componentsNumber; fctnb++)
{ {
if(masterthread->activeMorph != 1) if(masterthread->activeMorph != 1)
{ {
skipping to change at line 1615 skipping to change at line 1609
components->NoiseParam[components->ParisoCurrentComponentIndex].NoiseSha pe = 1; components->NoiseParam[components->ParisoCurrentComponentIndex].NoiseSha pe = 1;
CalculateColorsPoints(components, components->ThereisRGBA.size()-1); CalculateColorsPoints(components, components->ThereisRGBA.size()-1);
*PolyNumber = uint(IndexPolyTabVector.size()); *PolyNumber = uint(IndexPolyTabVector.size());
*VertexNumberpt = uint(NormVertexTabVector.size()/10); *VertexNumberpt = uint(NormVertexTabVector.size()/10);
*VertxNumber = uint(IndexPolyTabMinVector.size()); *VertxNumber = uint(IndexPolyTabMinVector.size());
if(masterthread->activeMorph != 1) if(masterthread->activeMorph != 1)
{ {
message = QString("Thr:"+QString::number(WorkerThreadsNumber)+"; Cmp:"+Q String::number(masterthread->componentsNumber)+"; T="+QString::number(times.elap sed()/1000.0)+"s"); message = QString("Thr:"+QString::number(WorkerThreadsNumber)+"; Cmp:"+Q String::number(masterthread->componentsNumber)+"; T="+QString::number(times.elap sed()/1000.0)+"s");
emitUpdateMessageSignal(); emitUpdateMessageSignal();
} }
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 < *VertxNumber; i++)
{
uint polysize = IndexPolyTabMinVector[startpl++];
for (uint j = 0; j < polysize; j++)
{
actualpointindice = IndexPolyTabMinVector[startpl];
IndexPolyTabVector.push_back(actualpointindice);
startpl++;
}
i += polysize;
}
IndexPolyTabMinVector2.clear();
for (uint i = 0; i < IndexPolyTabMinVector.size(); i++)
{
uint polysize = IndexPolyTabMinVector[i];
IndexPolyTabMinVector2.push_back(polysize);
i += polysize;
}
*MinimPolySize = IndexPolyTabVector.size() - *PolyNumber;
*VertxNumber = uint(IndexPolyTabMinVector2.size());
*IndexPolyTabMinPt = IndexPolyTabMinVector2.data();
*NormVertexTabVectorPt = NormVertexTabVector.data(); *NormVertexTabVectorPt = NormVertexTabVector.data();
*IndexPolyTabPt = IndexPolyTabVector.data(); *IndexPolyTabPt = IndexPolyTabVector.data();
*IndexPolyTabMinPt = IndexPolyTabMinVector.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);
Setgrid(PreviousGridVal); Setgrid(PreviousGridVal);
componentsPt->updateviewer = true; componentsPt->updateviewer = true;
} }
void Iso3D::InitShowComponent(struct ComponentInfos *cpInfos)
{
cpInfos->ShowParIsoCmp.clear();
uint idx =0;
for(uint i=0; i<cpInfos->NbComponentsType.size(); i++)
idx+=cpInfos->NbComponentsType[i];
for(uint i=0; i<idx; i++)
cpInfos->ShowParIsoCmp.push_back(true);
}
void Iso3D::Setgrid(uint NewGridVal) void Iso3D::Setgrid(uint NewGridVal)
{ {
if(masterthread->gridnotnull) if(masterthread->gridnotnull)
{ {
masterthread->XYZgrid = NewGridVal; masterthread->XYZgrid = NewGridVal;
for(uint th=0; th+1 < WorkerThreadsNumber; th++) for(uint th=0; th+1 < WorkerThreadsNumber; th++)
workerthreads[th].XYZgrid = NewGridVal; workerthreads[th].XYZgrid = NewGridVal;
} }
} }
void Iso3D::CalculateColorsPoints(struct ComponentInfos* comp, uint index) void Iso3D::CalculateColorsPoints(struct ComponentInfos* comp, uint index)
skipping to change at line 1648 skipping to change at line 1683
uint cmpId=0, K=0; uint cmpId=0, K=0;
double tmp, double tmp,
*ValCol, *ValCol,
val[16]; val[16];
ValCol = new double[masterthread->VRgbtSize]; ValCol = new double[masterthread->VRgbtSize];
val[3] = masterthread->stepMorph; val[3] = 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->NbComponents.size()-1; i++) for(uint i=0; i < comp->NbComponentsType.size()-1; i++)
idx+=comp->NbComponents[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++)
{ {
if((i >= uint(comp->ParisoVertex[2*(cmpId+idx)]))) if((i >= uint(comp->ParisoVertex[2*(cmpId+idx)])))
{ {
K = cmpId; K = cmpId;
if((masterthread->componentsNumber-1)>cmpId) if((masterthread->componentsNumber-1)>cmpId)
{ {
cmpId++; cmpId++;
} }
} }
skipping to change at line 1731 skipping to change at line 1766
NormVertexTabVector[i*10+1] = float(ValCol[j+2]); NormVertexTabVector[i*10+1] = float(ValCol[j+2]);
NormVertexTabVector[i*10+2] = float(ValCol[j+3]); NormVertexTabVector[i*10+2] = float(ValCol[j+3]);
NormVertexTabVector[i*10+3] = float(ValCol[j+4]); NormVertexTabVector[i*10+3] = float(ValCol[j+4]);
j = masterthread->VRgbtSize; j = masterthread->VRgbtSize;
} }
} }
} }
else if(comp->ThereisRGBA[index] == true && comp->NoiseParam[comp->ParisoCu rrentComponentIndex].NoiseType == 1) else if(comp->ThereisRGBA[index] == true && comp->NoiseParam[comp->ParisoCu rrentComponentIndex].NoiseType == 1)
{ {
uint idx=0; uint idx=0;
for(uint i=0; i < comp->NbComponents.size()-1; i++) for(uint i=0; i < comp->NbComponentsType.size()-1; i++)
idx+=comp->NbComponents[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++)
{ {
if((i >= uint(comp->ParisoVertex[2*(cmpId+idx)]))) if((i >= uint(comp->ParisoVertex[2*(cmpId+idx)])))
{ {
K = cmpId; K = cmpId;
if((masterthread->componentsNumber-1)>cmpId) if((masterthread->componentsNumber-1)>cmpId)
{ {
cmpId++; cmpId++;
} }
} }
skipping to change at line 1793 skipping to change at line 1828
NormVertexTabVector[i*10+1] = float(masterthread->RgbtParser[1].Eval (val)); NormVertexTabVector[i*10+1] = float(masterthread->RgbtParser[1].Eval (val));
NormVertexTabVector[i*10+2] = float(masterthread->RgbtParser[2].Eval (val)); NormVertexTabVector[i*10+2] = float(masterthread->RgbtParser[2].Eval (val));
NormVertexTabVector[i*10+3] = float(masterthread->RgbtParser[3].Eval (val)); NormVertexTabVector[i*10+3] = float(masterthread->RgbtParser[3].Eval (val));
} }
} }
delete[] ValCol; delete[] ValCol;
} }
uint Iso3D::CNDCalculation(uint & NbTriangleIsoSurfaceTmp, struct ComponentInfos *comp) uint Iso3D::CNDCalculation(uint & NbTriangleIsoSurfaceTmp, struct ComponentInfos *comp)
{ {
uint idpx=0; uint idpx=0;
for(uint i=0; i < comp->NbComponents.size()-1; i++) for(uint i=0; i < comp->NbComponentsType.size()-1; i++)
idpx+=comp->NbComponents[i]; idpx+=comp->NbComponentsType[i];
uint startpoint=comp->ParisoVertex[2*idpx]; uint startpoint=comp->ParisoVertex[2*idpx];
//In the case the parametric part of a Pariso object doesn't have a CND cond ition //In the case the parametric part of a Pariso object doesn't have a CND cond ition
int sz = (comp->ParisoCondition.size() == int sz = (comp->ParisoCondition.size() ==
comp->NbComponents[comp->NbComponents.size()-1]) ? 0 : idpx; comp->NbComponentsType[comp->NbComponentsType.size()-1]) ? 0 : idp x;
if (masterthread->ParisoCondition == 1) if (masterthread->ParisoCondition == 1)
{ {
double vals[4]; double vals[4];
std::vector<int> PointVerifyCond; std::vector<int> PointVerifyCond;
vals[3] = masterthread->stepMorph; vals[3] = masterthread->stepMorph;
for(uint i= startpoint; i < NbVertexTmp; i++) for(uint i= startpoint; i < NbVertexTmp; i++)
{ {
vals[0] = double(NormVertexTabVector[i*10+7]); vals[0] = double(NormVertexTabVector[i*10+7]);
vals[1] = double(NormVertexTabVector[i*10+8]); vals[1] = double(NormVertexTabVector[i*10+8]);
vals[2] = double(NormVertexTabVector[i*10+9]); vals[2] = double(NormVertexTabVector[i*10+9]);
skipping to change at line 1832 skipping to change at line 1867
{ {
NormVertexTabVector[i*10 ] = 0.9f; NormVertexTabVector[i*10 ] = 0.9f;
NormVertexTabVector[i*10+1] = 0.1f; NormVertexTabVector[i*10+1] = 0.1f;
NormVertexTabVector[i*10+2] = 0.9; NormVertexTabVector[i*10+2] = 0.9;
NormVertexTabVector[i*10+3] = 1.0; NormVertexTabVector[i*10+3] = 1.0;
} }
} }
uint Aindex, Bindex, Cindex; uint Aindex, Bindex, Cindex;
uint nbtriangle = NbTriangleIsoSurfaceTmp; uint nbtriangle = NbTriangleIsoSurfaceTmp;
uint mdx=0; uint mdx=0;
for(uint id=0; id < comp->NbComponents.size()-1; id++) for(uint id=0; id < comp->NbComponentsType.size()-1; id++)
mdx+=comp->NbComponents[id]; mdx+=comp->NbComponentsType[id];
uint starttri = uint(comp->ParisoTriangle[2*mdx]/3); uint starttri = uint(comp->ParisoTriangle[2*mdx]/3);
std::vector<int> TypeIsoSurfaceTriangleListeCNDVector (NbTriangleIsoSurf aceTmp-starttri, 1); std::vector<int> TypeIsoSurfaceTriangleListeCNDVector (NbTriangleIsoSurf aceTmp-starttri, 1);
for(uint i= starttri; i < nbtriangle; i++) for(uint i= starttri; i < nbtriangle; i++)
{ {
Aindex = IndexPolyTabVector[3*i ]; Aindex = IndexPolyTabVector[3*i ];
Bindex = IndexPolyTabVector[3*i + 1]; Bindex = IndexPolyTabVector[3*i + 1];
Cindex = IndexPolyTabVector[3*i + 2]; Cindex = IndexPolyTabVector[3*i + 2];
int TypeTriangle = -1; int TypeTriangle = -1;
if((PointVerifyCond[Aindex-startpoint] == 8) || if((PointVerifyCond[Aindex-startpoint] == 8) ||
(PointVerifyCond[Bindex-startpoint] == 8) || (PointVerifyCond[Bindex-startpoint] == 8) ||
skipping to change at line 2240 skipping to change at line 2275
NbTriangleIsoSurface++; NbTriangleIsoSurface++;
} }
} }
} }
} }
return 1; return 1;
} }
uint Iso3D::PointEdgeComputation(uint isoindex) uint Iso3D::PointEdgeComputation(uint isoindex)
{ {
uint index, i_Start, i_End, j_Start, j_End, k_Start, k_End, i, j, k; uint i_Start, i_End, j_Start, j_End, k_Start, k_End, i, j, k;
double vals[7], IsoValue_1, IsoValue_2, rapport; double vals[7], IsoValue_1, IsoValue_2, rapport;
double factor; double factor;
uint maxgridval=masterthread->GridVal; uint maxgridval=masterthread->GridVal;
uint maxgrscalemaxgr = maxgridval*maxgridval; uint maxgrscalemaxgr = maxgridval*maxgridval;
uint I, J, JK, IJK, IPLUSONEJK, IMINUSONEJK, uint I, J, JK, IJK, IPLUSONEJK, IMINUSONEJK,
IJPLUSONEK, IJMINUSONEK, IMINUSONEJMINUSONEK, IsoValue=0, NbPointIsoMap _local=0; IJPLUSONEK, IJMINUSONEK, IMINUSONEJMINUSONEK, IsoValue=0, NbPointIsoMap _local=0;
/// We have to compute the edges for the Grid limits ie: i=0, j=0 and k=0 /// We have to compute the edges for the Grid limits ie: i=0, j=0 and k=0
i_Start = 1/*+masterthread->iStart*/; i_Start = 1/*+masterthread->iStart*/;
j_Start = 1; j_Start = 1;
skipping to change at line 2281 skipping to change at line 2316
IMINUSONEJMINUSONEK = IMINUSONEJK - maxgridval; IMINUSONEJMINUSONEK = IMINUSONEJK - maxgridval;
IsoValue_1 = Results[IJK]; IsoValue_1 = Results[IJK];
/// First Case P(i+1)(j)(k) /// First Case P(i+1)(j)(k)
IsoValue_2 = Results[IPLUSONEJK]; IsoValue_2 = Results[IPLUSONEJK];
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0 ) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0 )
{ {
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i] - factor * masterthread->x_Step[isoindex]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i] - factor * masterthread->x_Step[isoindex];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k];
///========================================================= ==/// ///========================================================= ==///
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
skipping to change at line 2317 skipping to change at line 2351
NbPointIsoMap_local++; NbPointIsoMap_local++;
} }
///+++++++++++++++++++++++++++++++++++++++++ ///+++++++++++++++++++++++++++++++++++++++++
/// Second Case P(i)(j+1)(k) /// Second Case P(i)(j+1)(k)
IsoValue_2 = Results[IJPLUSONEK]; IsoValue_2 = Results[IJPLUSONEK];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local ;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j] - factor * masterthread->y_Step[isoindex]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j] - factor * masterthread->y_Step[isoindex];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
skipping to change at line 2352 skipping to change at line 2385
NbPointIsoMap_local++; NbPointIsoMap_local++;
} }
// Third Case P(i)(j)(k+1) // Third Case P(i)(j)(k+1)
IsoValue_2 = Results[IJK+1]; IsoValue_2 = Results[IJK+1];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k] - factor * masterthread->z_Step[isoindex]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k] - factor * masterthread->z_Step[isoindex];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
// save The reference to this point // save The reference to this point
skipping to change at line 2398 skipping to change at line 2430
{ {
JK = J +k; JK = J +k;
IsoValue_1 = Results[JK]; IsoValue_1 = Results[JK];
IsoValue_2 = Results[maxgrscalemaxgr+JK]; IsoValue_2 = Results[maxgrscalemaxgr+JK];
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValue_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValue_1) != 0.0)
{ {
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridVal+i ] - factor * masterthread->x_Step[isoindex]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridVal+i ] - factor * masterthread->x_Step[isoindex];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridVal+j ]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridVal+j ];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridVal+k ]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridVal+k ];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
skipping to change at line 2441 skipping to change at line 2472
} }
// Second Case P(0)(j+1)(k) // Second Case P(0)(j+1)(k)
if ( j != (masterthread->XYZgrid -1)) if ( j != (masterthread->XYZgrid -1))
{ {
IsoValue_2 = Results[JK+maxgridval]; IsoValue_2 = Results[JK+maxgridval];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j] - factor *masterthread->y_Step[isoindex]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j] - factor *masterthread->y_Step[isoindex];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
// save The reference to this point // save The reference to this point
skipping to change at line 2474 skipping to change at line 2504
} /// If ( j != nb_colon -1) ... } /// If ( j != nb_colon -1) ...
// Third Case P(0)(j)(k+1) // Third Case P(0)(j)(k+1)
if ( k != (masterthread->XYZgrid-1)) if ( k != (masterthread->XYZgrid-1))
{ {
IsoValue_2 = Results[JK+1]; IsoValue_2 = Results[JK+1];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k] - factor * masterthread->z_Step[isoindex]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k] - factor * masterthread->z_Step[isoindex];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
skipping to change at line 2524 skipping to change at line 2553
IsoValue_1 = Results[JK]; IsoValue_1 = Results[JK];
// Second Case P(i)(j+1)(k) // Second Case P(i)(j+1)(k)
if ( j != (masterthread->XYZgrid -1)) if ( j != (masterthread->XYZgrid -1))
{ {
IsoValue_2 = Results[JK+maxgridval]; IsoValue_2 = Results[JK+maxgridval];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j] - factor *masterthread->y_Step[isoindex]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j] - factor *masterthread->y_Step[isoindex];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
skipping to change at line 2569 skipping to change at line 2597
} /// End of if (j != nb_colon -1)... } /// End of if (j != nb_colon -1)...
// Third Case P(i)(j)(k+1) // Third Case P(i)(j)(k+1)
if ( k != (masterthread->XYZgrid -1)) if ( k != (masterthread->XYZgrid -1))
{ {
IsoValue_2 = Results[JK+1]; IsoValue_2 = Results[JK+1];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k] - factor * masterthread->z_Step[isoindex]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k] - factor * masterthread->z_Step[isoindex];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
skipping to change at line 2626 skipping to change at line 2653
// First Case P(i+1)(j)(k) // First Case P(i+1)(j)(k)
if( i != (masterthread->XYZgrid -1)) if( i != (masterthread->XYZgrid -1))
{ {
IsoValue_2 = Results[(i+1)*maxgrscalemaxgr+k]; IsoValue_2 = Results[(i+1)*maxgrscalemaxgr+k];
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i] - factor * masterthread->x_Step[isoindex]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i] - factor * masterthread->x_Step[isoindex];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
skipping to change at line 2659 skipping to change at line 2685
} }
} /// End of if ( i != nb_ligne -1)... } /// End of if ( i != nb_ligne -1)...
// Second Case P(i)(j+1)(k) // Second Case P(i)(j+1)(k)
IsoValue_2 = Results[i*maxgrscalemaxgr+maxgridval+k]; IsoValue_2 = Results[i*maxgrscalemaxgr+maxgridval+k];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValue_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValue_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridVal+i ]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridVal+i ];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridVal+j ] - factor * masterthread->y_Step[isoindex]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridVal+j ] - factor * masterthread->y_Step[isoindex];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridVal+k ]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridVal+k ];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
skipping to change at line 2701 skipping to change at line 2726
} }
// Third Case P(i)(j)(k+1) // Third Case P(i)(j)(k+1)
if(k != (masterthread->XYZgrid -1)) if(k != (masterthread->XYZgrid -1))
{ {
IsoValue_2 = Results[i*maxgrscalemaxgr+k+1]; IsoValue_2 = Results[i*maxgrscalemaxgr+k+1];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k] - factor * masterthread->z_Step[isoindex]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k] - factor * masterthread->z_Step[isoindex];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
skipping to change at line 2744 skipping to change at line 2768
IsoValue_1 = Results[i*maxgrscalemaxgr+j*maxgridval+k]; IsoValue_1 = Results[i*maxgrscalemaxgr+j*maxgridval+k];
// First Case P(i+1)(j)(k) // First Case P(i+1)(j)(k)
if( i != (masterthread->XYZgrid-1)) if( i != (masterthread->XYZgrid-1))
{ {
IsoValue_2 = Results[(i+1)*maxgrscalemaxgr+j*maxgridval+k]; IsoValue_2 = Results[(i+1)*maxgrscalemaxgr+j*maxgridval+k];
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i] - factor * masterthread->x_Step[isoindex]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i] - factor * masterthread->x_Step[isoindex];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
// save The reference to this point // save The reference to this point
skipping to change at line 2785 skipping to change at line 2808
} /// End of if( i != (nb_ligne-1))... } /// End of if( i != (nb_ligne-1))...
// Third Case P(i)(j)(k+1) // Third Case P(i)(j)(k+1)
if( k != (masterthread->XYZgrid -1)) if( k != (masterthread->XYZgrid -1))
{ {
IsoValue_2 = Results[i*maxgrscalemaxgr+j*maxgridval+k+1]; IsoValue_2 = Results[i*maxgrscalemaxgr+j*maxgridval+k+1];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k] - factor * masterthread->z_Step[isoindex]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k] - factor * masterthread->z_Step[isoindex];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
// save The reference to this point // save The reference to this point
skipping to change at line 2835 skipping to change at line 2857
{ {
IsoValue_1 = Results[i*maxgrscalemaxgr+j*maxgridval]; IsoValue_1 = Results[i*maxgrscalemaxgr+j*maxgridval];
// First Case P(i+1)(j)(k) // First Case P(i+1)(j)(k)
if(i != (masterthread->XYZgrid -1)) if(i != (masterthread->XYZgrid -1))
{ {
IsoValue_2 = Results[(i+1)*maxgrscalemaxgr+j*maxgridval]; IsoValue_2 = Results[(i+1)*maxgrscalemaxgr+j*maxgridval];
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i] - factor * masterthread->x_Step[isoindex]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i] - factor * masterthread->x_Step[isoindex];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
// save The reference to this point // save The reference to this point
skipping to change at line 2866 skipping to change at line 2887
} /// End of if(i != (nb_ligne -1)) } /// End of if(i != (nb_ligne -1))
// Second Case P(i)(j+1)(k) // Second Case P(i)(j+1)(k)
if(j != masterthread->XYZgrid -1) if(j != masterthread->XYZgrid -1)
{ {
IsoValue_2 = Results[i*maxgrscalemaxgr+(j+1)*maxgridval]; IsoValue_2 = Results[i*maxgrscalemaxgr+(j+1)*maxgridval];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j] - factor * masterthread->y_Step[isoindex]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j] - factor * masterthread->y_Step[isoindex];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
// save The reference to this point // save The reference to this point
skipping to change at line 2894 skipping to change at line 2914
} }
NbPointIsoMap_local++; NbPointIsoMap_local++;
} }
}/// End of if(j != nb_colon -1)... }/// End of if(j != nb_colon -1)...
// Third Case P(i)(j)(k+1) // Third Case P(i)(j)(k+1)
IsoValue_2 = Results[i*maxgrscalemaxgr+j*maxgridval+1]; IsoValue_2 = Results[i*maxgrscalemaxgr+j*maxgridval+1];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValue_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValue_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridVal+i ]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridVal+i ];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridVal+j ]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridVal+j ];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridVal+k ] - factor * masterthread->z_Step[isoindex]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridVal+k ] - factor * masterthread->z_Step[isoindex];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
// save The reference to this point // save The reference to this point
skipping to change at line 2943 skipping to change at line 2962
{ {
IsoValue_1 = Results[i*maxgrscalemaxgr+j*maxgridval+k]; IsoValue_1 = Results[i*maxgrscalemaxgr+j*maxgridval+k];
// First Case P(i+1)(j)(k) // First Case P(i+1)(j)(k)
if( i != (masterthread->XYZgrid -1) ) if( i != (masterthread->XYZgrid -1) )
{ {
IsoValue_2 = Results[(i+1)*maxgrscalemaxgr+j*maxgridval+k]; IsoValue_2 = Results[(i+1)*maxgrscalemaxgr+j*maxgridval+k];
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i] - factor * masterthread->x_Step[isoindex]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i] - factor * masterthread->x_Step[isoindex];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
// save The reference to this point // save The reference to this point
GridVoxelVarPt[i*maxgrscalemaxgr+j*maxgridval+k].Edge_Points [0] = NbPointIsoMap_local; GridVoxelVarPt[i*maxgrscalemaxgr+j*maxgridval+k].Edge_Points [0] = NbPointIsoMap_local;
skipping to change at line 2983 skipping to change at line 3001
} /// End of if(i != nb_ligne-1)... } /// End of if(i != nb_ligne-1)...
// Second Case P(i)(j+1)(k) // Second Case P(i)(j+1)(k)
if( j != (masterthread->XYZgrid -1) ) if( j != (masterthread->XYZgrid -1) )
{ {
IsoValue_2 = Results[i*maxgrscalemaxgr+(j+1)*maxgridval+k]; IsoValue_2 = Results[i*maxgrscalemaxgr+(j+1)*maxgridval+k];
// Edge Point computation and save in IsoPointMap // Edge Point computation and save in IsoPointMap
if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0) if(IsoValue_1 * IsoValue_2 <= 0 && (rapport=IsoValue_2 - IsoValu e_1) != 0.0)
{ {
factor = (IsoValue - IsoValue_1)/rapport; factor = (IsoValue - IsoValue_1)/rapport;
index = 10*NbPointIsoMap_local;
vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i]; vals[0] = masterthread->xLocal2[isoindex*masterthread->GridV al+i];
vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j] - factor * masterthread->y_Step[isoindex]; vals[1] = masterthread->yLocal2[isoindex*masterthread->GridV al+j] - factor * masterthread->y_Step[isoindex];
vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k]; vals[2] = masterthread->zLocal2[isoindex*masterthread->GridV al+k];
for(int iter=0; iter<7; iter++) for(int iter=0; iter<7; iter++)
NormVertexTabVector.push_back(1.0); NormVertexTabVector.push_back(1.0);
NormVertexTabVector.push_back(float(vals[0])); NormVertexTabVector.push_back(float(vals[0]));
NormVertexTabVector.push_back(float(vals[1])); NormVertexTabVector.push_back(float(vals[1]));
NormVertexTabVector.push_back(float(vals[2])); NormVertexTabVector.push_back(float(vals[2]));
// save The reference to this point // save The reference to this point
 End of changes. 54 change blocks. 
52 lines changed or deleted 69 lines changed or added

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