while(TRUE)
{
ar.ReadString(buf);
if(!strnicmp(buf,"POINT",sizeof("POINT")-1))
DataType=TPOINT;
else if(!strnicmp(buf,"POLYGON",sizeof("POLYGON")-1))
{
DataType=TPOLYGON;
strcpy(temp,buf);
PointNum=atoi(&(temp[7]));
}
else if(buf=="" )
continue;
else if(!strnicmp(buf,"END",sizeof("END")-1))
break;
else if(!strnicmp(buf,"VIEW",sizeof("VIEW")-1))
{
float vx,vy,vz;
sscanf(buf.Right(buf.GetLength()-4) ,"%f %f %f",&vx,&vy,&vz);
ViewPoint[0]=vx;
ViewPoint[1]=vy;
ViewPoint[2]=vz;
}
else
switch(DataType)
{
case TPOINT:
NewPoint.Read(buf);
Points.AddTail(NewPoint);
break;
case TPOLYGON:
NewPolygon=new CPolygon(PointNum);
NewPolygon->Read(buf);
Polygons.AddTail(*NewPolygon);
delete NewPolygon;
break;
}
}
上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页