Commit dfbf0d92 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

binary import/export for SLF

parent 897b97cb
......@@ -532,9 +532,9 @@ bool exportPlySLFgenericBin(typename PFP::MAP& map, const typename PFP::TVEC3& p
std::string tmp ;
tmp = std::string("ply") ;
out.write(tmp,tmp.length()*sizeof(char)) ;
out.write(tmp.c_str(),tmp.length()*sizeof(char)) ;
tmp = std::string("format binary_little_endian 1.0") ;
out.write(tmp,tmp.length()*sizeof(char)) ;
out.write(tmp.c_str(),tmp.length()*sizeof(char)) ;
std::stringstream header ;
header << "comment ply SLF (K. Vanhoey generic format): SLF_" << ((extension == ".plyPTMext") ? "PTMext" : "SHreal") << std::endl ;
......
......@@ -816,6 +816,16 @@ bool MeshTablesSurface<PFP>::importPlySLFgenericBin(const std::string& filename,
return false ;
}
buff = new char[31] ;
fp.read(buff, 31) ;
std::string tag(buff) ;
delete[] buff ;
if (tag != std::string("format binary_little_endian 1.0")) // verify file type
{
CGoGNerr << filename << " is not a little endian file !" << CGoGNout ;
return false ;
}
// read CHNum
unsigned int CHNum ;
fp.read((char*)&CHNum, sizeof(unsigned int)) ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment