} // for iLstIndexIn
}
+
+/*
void ManualContourModel_Box::ShiftValues( std::vector<double> *lstInX,
std::vector<double> *lstInY,
std::vector<double> *lstInZ,
} // if sizeLstIndexIn
}
+*/
+
+
+
+void ManualContourModel_Box::ShiftValues( std::vector<double> *lstInX,
+ std::vector<double> *lstInY,
+ std::vector<double> *lstInZ,
+ std::vector<int> *lstIndexsIn )
+{
+ int iLstIndexIn,sizeLstIndexIn=lstIndexsIn->size();
+ int ii, iGeneral=0;
+ int size,size2;
+ double dist,distMin;
+ int i,iBack;
+ int ig;
+ double dx,dy,dz;
+ std::vector<double> LstTmpX;
+ std::vector<double> LstTmpY;
+ std::vector<double> LstTmpZ;
+ if (sizeLstIndexIn>=2)
+ {
+
+ for (iLstIndexIn=0; iLstIndexIn<sizeLstIndexIn-1; iLstIndexIn++)
+ {
+ size = (*lstIndexsIn)[iLstIndexIn];
+ size2 = (*lstIndexsIn)[iLstIndexIn+1];
+ //find min distance and iBack
+ distMin = 10000000;
+ iBack = 0;
+
+
+ for (ig=0; ig<size; ig++)
+ {
+ dist=0;
+ for ( i=0 ; i<size2 ; i++ )
+ {
+ dx = (*lstInX)[iGeneral+i]-(*lstInX)[iGeneral+size+(i+ig)%size];
+ dy = (*lstInY)[iGeneral+i]-(*lstInY)[iGeneral+size+(i+ig)%size];
+ dz = (*lstInZ)[iGeneral+i]-(*lstInZ)[iGeneral+size+(i+ig)%size];
+ dist= dist + sqrt( dx*dx + dy*dy + dz*dz );
+ } // for i size2
+
+ if ( dist<distMin )
+ {
+ iBack = ig+size;
+ distMin = dist;
+ }
+
+ } // for ig size
+
+
+printf("EED ManualContourModel_Box::ShiftValues px=%f py=%f pz=%f iBack=%d/%d size=%d distMin=%f \n", (*lstInX)[iGeneral] , (*lstInY)[iGeneral] , (*lstInZ)[iGeneral], iBack, size2,size, distMin);
+
+ if (iBack!=0)
+ {
+ LstTmpX.clear();
+ LstTmpY.clear();
+ LstTmpZ.clear();
+ for (i=0 ; i<size2 ; i++)
+ {
+ ii= (i+iBack)%size2;
+ LstTmpX.push_back( (*lstInX)[iGeneral+size+ii] );
+ LstTmpY.push_back( (*lstInY)[iGeneral+size+ii] );
+ LstTmpZ.push_back( (*lstInZ)[iGeneral+size+ii] );
+ } // for i
+ for (i=0 ; i<size2 ; i++)
+ {
+ (*lstInX)[iGeneral+size+i] = LstTmpX[i];
+ (*lstInY)[iGeneral+size+i] = LstTmpY[i];
+ (*lstInZ)[iGeneral+size+i] = LstTmpZ[i];
+ } // for i
+ }
+ iGeneral=iGeneral+size;
+ } // for iLstIndexIn
+
+
+ } // if sizeLstIndexIn
+
+}
+
+
+
if (bbGetInputDoubleContour()==1)
{
ClockwisePoints( &lstInX , &lstInY , &lstInZ , &lstIndexsIn );
- ShiftValues( &lstInX , &lstInY , &lstInZ , &lstIndexsIn );
+// ShiftValues( &lstInX , &lstInY , &lstInZ , &lstIndexsIn );
} // DoubleContour
int i,size=lstIndexsIn.size();
int iGeneral=0;
bbSetOutputLstIndexsOut(lstIndexsOut);
} else {
RedistributionPoints(&lstOutX,&lstOutY,&lstOutZ,&lstIndexsOut);
+ ShiftValues( &lstOutX, &lstOutY, &lstOutZ, &lstIndexsOut );
///////////// Second Step Transpose the vectors
lstInX.clear();
lstInY.clear();