Commit c4a630cd authored by Kenneth Vanhoey's avatar Kenneth Vanhoey
Browse files

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