lstInconsistentContourID.clear();
// First Step Spline Interpolation
- std::vector<double> lstInX=bbGetInputLstControlPointsX();
- std::vector<double> lstInY=bbGetInputLstControlPointsY();
- std::vector<double> lstInZ=bbGetInputLstControlPointsZ();
+ std::vector<double> lstInX = bbGetInputLstControlPointsX();
+ std::vector<double> lstInY = bbGetInputLstControlPointsY();
+ std::vector<double> lstInZ = bbGetInputLstControlPointsZ();
if ( (lstInX.size()!=lstInY.size()) || (lstInY.size()!=lstInZ.size()) )
{
printf("Warnning !! .. ManualContourModel_Box: The list X Y Z, no have the same number of elements \n");
return;
}
- std::vector<int> lstIndexsIn=bbGetInputLstIndexsIn();
+ std::vector<int> lstIndexsIn = bbGetInputLstIndexsIn();
std::vector<int> lstIndexsOut;
std::vector<double> lstOutX;
std::vector<double> lstOutY;
lstIndexsIn.push_back( lstInX.size() );
}
+ // Step 0. Clean lstIndexIn
+ int i,size = lstIndexsIn.size();
+ for (i=size-1 ; i>=0; i--)
+ {
+ if (lstIndexsIn[i]==0)
+ {
+ lstIndexsIn.erase( lstIndexsIn.begin()+i );
+ } // if
+ } // for i
+
// Step 1. All contours the same clockwise direction (Control Points)
if (bbGetInputDoubleContour()==1)
{
ClockwisePoints( &lstInX , &lstInY , &lstInZ , &lstIndexsIn );
// ShiftValues( &lstInX , &lstInY , &lstInZ , &lstIndexsIn );
} // DoubleContour
- int i,size = lstIndexsIn.size();
+ size = lstIndexsIn.size();
int iGeneral= 0;
// Step 2. Spline interpolation of control points
// Step 3.1 Linear Normalice points around contours
RedistributionPoints(&lstOutX,&lstOutY,&lstOutZ,&lstIndexsOut);
//EED 01/2021
- // Step 3.2 Shift points to find minimun acumulate distance
- ShiftValues( &lstOutX, &lstOutY, &lstOutZ, &lstIndexsOut );
+ // Step 3.2 Shift points to find minimun acumulate distance
+ if (bbGetInputOpenClose()==true)
+ {
+ ShiftValues( &lstOutX, &lstOutY, &lstOutZ, &lstIndexsOut );
+ } // if OpenClose
// Step 3.3. SIN Normalice points around contours
- if (bbGetInputParam().size()>=1)
+ if (bbGetInputParam().size()==2)
{
- if (bbGetInputParam()[0]==1)
+ if (bbGetInputParam()[0]==1) // type param 1
{
- RedistributionPointsAllContours_SIN( &lstOutX,&lstOutY,&lstOutZ,&lstIndexsOut);
- ShiftValues( &lstOutX, &lstOutY, &lstOutZ, &lstIndexsOut );
- } // if 1
+ if (bbGetInputOpenClose()==true)
+ {
+ RedistributionPointsAllContours_SIN( &lstOutX,&lstOutY,&lstOutZ,&lstIndexsOut);
+ ShiftValues( &lstOutX, &lstOutY, &lstOutZ, &lstIndexsOut );
+ } // if OpenClose
+ } // if type param = 1
} // if size
// Step 3.4 Transpose the vectors
lstInX.clear();