64,565
社区成员
发帖
与我相关
我的任务
分享
vector<CAA::pc>* CGetPointsCloud::MyGetRegPoints(int IMx,int IMy,int Ptdentity)
{
//*******获取文件名
char* m1="D:\\test2\\";
char* type=".dat";
char* fh="_";
char*path=NULL;
char temp[80];
_snprintf(temp,79,"%s%d%s%d%s%d%s",m1,Ptdentity,fh,IMx,fh,IMy,type);temp[79]=0;
path=(char *)temp;
vector<pc> *IPtCloud=new vector<pointcloud>;
FILE *RegFile=fopen(path,"rb+");
if(RegFile!=NULL)
{
fseek(RegFile,0,SEEK_END);
long flength=ftell(RegFile);
long Isize=sizeof(pointcloud);
int headsize=sizeof(head);
int ptlength=(flength-headsize)/Isize;
fseek(RegFile,headsize,0);
for(int k=0;k<ptlength;k++)
{
pointcloud Pttemp;
fread(&Pttemp,sizeof(pointcloud),1,RegFile);
IPtCloud->push_back(Pttemp);//错误********
}
fclose(RegFile);
}
return IPtCloud;
}
vector<CAA::pc>* PointsResult=NULL;
CAA * m_GetPointsCloud=new CGetPointsCloud;
PointsResult=m_GetPointsCloud->MyGetRegPoints(Mx,My, PointDensity);
delete PointsResult;