1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
Plane::Plane(CPP_Sequence *seqPlane){
CPP_Sequence *seqTemp3;
char sBuff[32768];
float minX,minY,maxX,maxY,midX,midY,deltaX,deltaY;
int k;
minX=minY=maxX=maxY=midX=midY=deltaX=deltaY=0.0f;
Point *pPoint=NULL;
seqPlane->item(0x30060042)->stringCopy(sBuff);
numPoints=0;
minX= maxX=minY= maxY=midX=midY=deltaX=deltaY=0.0f;
if (strncmp(sBuff,"CLOSED_PLANAR",13)==0){
// cout << "\n" << sBuff;
numPoints=atoi(seqPlane->item(0x30060046)->stringCopy(sBuff));
// cout << " Plane " << " contains " << numPoints << " points \n";
pPoint = new Point[numPoints];
if (pPoint ==NULL){
cout << "\nInsufficient memory for points\n";
}
cout << "Reading in " << numPoints << " points" << endl;
seqPlane->item(0x30060050)->stringCopy(sBuff);
for (k=0;k<numPoints;k++){
if (k==0){
pPoint[0].x = (float)atof(strtok(sBuff,"\\"));
maxX = minX = pPoint[0].x;
}
else{
pPoint[k].x = (float)atof(strtok(NULL,"\\"));
}
pPoint[k].y = (float)atof(strtok(NULL,"\\"));
maxY = minY = pPoint[0].y;
pPoint[k].z = (float)atof(strtok(NULL,"\\"));
cout << "\nCoordinate " << k+1 << " is (" << pPoint[k].x << ", "<< pPoint[k].y << ", " << pPoint[k].z << ")";
}
|