Commit c4a630cd authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

update on import/export of ply data

parent f639e248
......@@ -281,9 +281,12 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*
{
// ascii vertices
for(unsigned int i = 0; i < vertices.size(); ++i)
{
for (typename std::vector<typename PFP::TVEC3* >::const_iterator attrHandler = attributeHandlers.begin() ; attrHandler != attributeHandlers.end() ; ++attrHandler)
if ((*attrHandler)->isValid() && (*attrHandler)->getOrbit() == VERTEX)
out << (*(*attrHandler))[vertices[i]] << std::endl ;
out << (*(*attrHandler))[vertices[i]] ;
out << std::endl ;
}
// ascii faces
for(unsigned int i = 0; i < facesSize.size(); ++i)
......@@ -299,17 +302,19 @@ bool exportPLYnew(typename PFP::MAP& map, const std::vector<typename PFP::TVEC3*
// binary vertices
for(unsigned int i = 0; i < vertices.size(); ++i)
for (typename std::vector<typename PFP::TVEC3*>::const_iterator attrHandler = attributeHandlers.begin() ; attrHandler != attributeHandlers.end() ; ++attrHandler)
{
if ((*attrHandler)->isValid() && (*attrHandler)->getOrbit() == VERTEX)
{
const typename PFP::VEC3& v = (*(*attrHandler))[vertices[i]] ;
out.write((char*)(&(v[0])), sizeof(v)) ;
}
}
// binary faces
for(unsigned int i = 0; i < facesSize.size(); ++i)
{
uint8_t nbe = facesSize[i] ;
out.write((char*)(&nbe), sizeof(unsigned char)) ;
out.write((char*)(&nbe), sizeof(uint8_t)) ;
out.write((char*)(&(facesIdx[i][0])), facesSize[i] * sizeof(facesIdx[i][0])) ;
}
}
......
......@@ -52,7 +52,7 @@ namespace Import
namespace ImportSurfacique
{
enum ImportType { UNKNOWNSURFACE, TRIAN, TRIANBGZ, MESHBIN, PLY, /*PLYPTM, PLYSLFgeneric, PLYSLFgenericBin, */OFF, OBJ, VRML, AHEM };
enum ImportType { UNKNOWNSURFACE, TRIAN, TRIANBGZ, MESHBIN, PLY, /*PLYPTM, */PLYSLFgeneric, PLYSLFgenericBin, OFF, OBJ, VRML, AHEM };
}
namespace ImportVolumique
......@@ -115,10 +115,10 @@ public:
bool importPly(const std::string& filename, std::vector<std::string>& attrNames);
/* bool importPlyPTM(const std::string& filename, std::vector<std::string>& attrNames);
// bool importPlyPTM(const std::string& filename, std::vector<std::string>& attrNames);
bool importPlySLFgeneric(const std::string& filename, std::vector<std::string>& attrNames);
bool importPlySLFgenericBin(const std::string& filename, std::vector<std::string>& attrNames);
*/
#ifdef WITH_ASSIMP
bool importASSIMP(const std::string& filename, std::vector<std::string>& attrNames);
#endif
......
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