CDlgOffsetValue extend;
extend.DoModal();
const int nTrip=2;
UF_UI_mask_t tripels[nTrip];
tripels[0].object_type=UF_solid_type;
tripels[0].object_subtype=UF_solid_body_subtype;
tripels[0].solid_type=UF_UI_SEL_FEATURE_SOLID_BODY;
tripels[1].object_type=UF_solid_type;
tripels[1].object_subtype=UF_solid_body_subtype;
tripels[1].solid_type=UF_UI_SEL_FEATURE_SOLID_BODY;
uc1601("Please select solid body....",0);
tag_t* bodies;
int nBody=0;
int response=SelectByClass(tripels,2,&bodies,nBody);
if(response!=3||nBody==0) return;
CSolidObj analysis(*bodies);
for(int i=1;i!=nBody;++i)
{
analysis.addOneObject(*(bodies+i));
}
double minCorner[3]={0,0,0},maxCorner[3]={0,0,0};
double tempValue1[3]={0,0,0},tempValue2[3]={0,0,0};
for(int j=0;j!=3;++j)
{
tempValue1[j]=analysis.limit[j]-extend.offsetValue;
tempValue2[j]=analysis.limit[j+3]+extend.offsetValue;
}
//mapWcsToCsys(tempValue1,minCorner);
//mapWcsToCsys(tempValue2,maxCorner);
/*
UF_CURVE_line_t lineInfo[3],lineInfoOfCsys[3];
lineInfo[0].start_point[0]=minCorner[0];
lineInfo[0].start_point[1]=0;
lineInfo[0].start_point[2]=0;
lineInfo[0].end_point[0]=maxCorner[0];
lineInfo[0].end_point[1]=0;
lineInfo[0].end_point[2]=0;
lineInfo[1].start_point[0]=0;
lineInfo[1].start_point[1]=minCorner[1];
lineInfo[1].start_point[2]=0;
lineInfo[1].end_point[0]=0;
lineInfo[1].end_point[1]=maxCorner[1];
lineInfo[1].end_point[2]=0;
lineInfo[2].start_point[0]=0;
lineInfo[2].start_point[1]=0;
lineInfo[2].start_point[2]=minCorner[2];
lineInfo[2].end_point[0]=0;
lineInfo[2].end_point[1]=0;
lineInfo[2].end_point[2]=maxCorner[2];
for(int j=0;j!=3;++j)
{
mapWcsToCsys(lineInfo[j].start_point,lineInfoOfCsys[j].start_point);
mapWcsToCsys(lineInfo[j].end_point,lineInfoOfCsys[j].end_point);
}
*/
double wcsOfLine1[2][3]={{0,0,0},{0,0,0}};
double wcsOfLine2[2][3]={{0,0,0},{0,0,0}};
double wcsOfLine3[2][3]={{0,0,0},{0,0,0}};
double csysOfLine1[2][3]={{0,0,0},{0,0,0}};
double csysOfLine2[2][3]={{0,0,0},{0,0,0}};
double csysOfLine3[2][3]={{0,0,0},{0,0,0}};
wcsOfLine1[0][0]=tempValue1[0];
wcsOfLine1[0][1]=0;
wcsOfLine1[0][2]=0;
wcsOfLine1[1][0]=tempValue2[0];
wcsOfLine1[1][1]=0;
wcsOfLine1[1][2]=0;
wcsOfLine2[0][0]=0;
wcsOfLine2[0][1]=tempValue1[1];
wcsOfLine2[0][2]=0;
wcsOfLine2[1][0]=0;
wcsOfLine2[1][1]=tempValue2[1];
wcsOfLine2[1][2]=0;
wcsOfLine3[0][0]=0;
wcsOfLine3[0][1]=0;
wcsOfLine3[0][2]=tempValue1[2];
wcsOfLine3[1][0]=0;
wcsOfLine3[1][1]=0;
wcsOfLine3[1][2]=tempValue2[2];
mapWcsToCsys(wcsOfLine1[0],csysOfLine1[0]);
mapWcsToCsys(wcsOfLine1[1],csysOfLine1[1]);
mapWcsToCsys(wcsOfLine2[0],csysOfLine2[0]);
mapWcsToCsys(wcsOfLine2[1],csysOfLine2[1]);
mapWcsToCsys(wcsOfLine3[0],csysOfLine3[0]);
mapWcsToCsys(wcsOfLine3[1],csysOfLine3[1]);
UF_CURVE_line_t lineInfo[3];
lineInfo[0].start_point[0]=csysOfLine1[0][0];
lineInfo[0].start_point[1]=csysOfLine1[0][1];
lineInfo[0].start_point[2]=csysOfLine1[0][2];
lineInfo[0].end_point[0]=csysOfLine1[1][0];
lineInfo[0].end_point[1]=csysOfLine1[1][1];
lineInfo[0].end_point[2]=csysOfLine1[1][2];
lineInfo[1].start_point[0]=csysOfLine2[0][0];
lineInfo[1].start_point[1]=csysOfLine2[0][1];
lineInfo[1].start_point[2]=csysOfLine2[0][2];
lineInfo[1].end_point[0]=csysOfLine2[1][0];
lineInfo[1].end_point[1]=csysOfLine2[1][1];
lineInfo[1].end_point[2]=csysOfLine2[1][2];
lineInfo[2].start_point[0]=csysOfLine3[0][0];
lineInfo[2].start_point[1]=csysOfLine3[0][1];
lineInfo[2].start_point[2]=csysOfLine3[0][2];
lineInfo[2].end_point[0]=csysOfLine3[1][0];
lineInfo[2].end_point[1]=csysOfLine3[1][1];
lineInfo[2].end_point[2]=csysOfLine3[1][2];
/*
char temp[200]="";
sprintf(temp,"wcsline1_pt1:%.2f,%.2f,%.2f\nline1_pt2:%.2f,%.2f,%.2f",
wcsOfLine1[0][0],wcsOfLine1[0][1],wcsOfLine1[0][2],
wcsOfLine1[1][0],wcsOfLine1[1][1],wcsOfLine1[1][2]);
lineInfo[0].start_point[0],lineInfo[0].start_point[1],lineInfo[0].start_point[2],
lineInfo[0].end_point[0],lineInfo[0].end_point[1],lineInfo[0].end_point[2]);
uc1601(temp,1);
return; |