Commit 38f91aa0 authored by Kenneth Vanhoey's avatar Kenneth Vanhoey

export pour SLF generique (rangement à venir)

parent 62b16433
...@@ -103,7 +103,7 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const char* filename, const typ ...@@ -103,7 +103,7 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const char* filename, const typ
* @return true * @return true
*/ */
template <typename PFP> template <typename PFP>
bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename PFP::TVEC3& position, const typename PFP::TVEC3 frame[3], const typename PFP::TVEC3 colorPTM[6], const FunctorSelect& good) ; bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename PFP::TVEC3& position, const typename PFP::TVEC3 frame[3], const typename PFP::TVEC3 colorPTM[6], const FunctorSelect& good = allDarts) ;
} // namespace Export } // namespace Export
......
...@@ -387,9 +387,14 @@ bool exportPlySLF(typename PFP::MAP& map, const char* filename, const typename P ...@@ -387,9 +387,14 @@ bool exportPlySLF(typename PFP::MAP& map, const char* filename, const typename P
coefs[i] = map.template getAttribute<VEC3>(VERTEX,name.str()) ; coefs[i] = map.template getAttribute<VEC3>(VERTEX,name.str()) ;
} }
std::string file(filename) ;
size_t pos = file.rfind(".") ; // position of "." in filename
std::cout << file << " ; " << pos << std::endl ;
std::string extension = file.substr(pos) ;
out << "ply" << std::endl ; out << "ply" << std::endl ;
out << "format ascii 1.0" << std::endl ; out << "format ascii 1.0" << std::endl ;
out << "comment ply SLF (K. Vanhoey generic format)" << std::endl ; out << "comment ply SLF (K. Vanhoey generic format): SLF_" << ((extension == ".plyPTMext") ? "PTMext" : "SHreal") << std::endl ;
out << "element vertex " << vertices.size() << std::endl ; out << "element vertex " << vertices.size() << std::endl ;
out << "property float x" << std::endl ; out << "property float x" << std::endl ;
out << "property float y" << std::endl ; out << "property float y" << std::endl ;
......
...@@ -682,7 +682,7 @@ bool MeshTablesSurface<PFP>::importPlyPTMgeneric(const std::string& filename, st ...@@ -682,7 +682,7 @@ bool MeshTablesSurface<PFP>::importPlyPTMgeneric(const std::string& filename, st
binormal = true ; binormal = true ;
else if (tag == std::string("nx") || tag == std::string("ny") || tag == std::string("nz")) else if (tag == std::string("nx") || tag == std::string("ny") || tag == std::string("nz"))
normal = true ; normal = true ;
else if (tag.substr(2,2) == std::string("_a")) if (tag.substr(0,1) == std::string("C") && tag.substr(2,1) == std::string("_"))
++nbCoefsPerPol ; ++nbCoefsPerPol ;
} while (tag != std::string("face")) ; } while (tag != std::string("face")) ;
unsigned int nbRemainders = nbProps ; // # remaining properties unsigned int nbRemainders = nbProps ; // # remaining properties
...@@ -758,7 +758,7 @@ bool MeshTablesSurface<PFP>::importPlyPTMgeneric(const std::string& filename, st ...@@ -758,7 +758,7 @@ bool MeshTablesSurface<PFP>::importPlyPTMgeneric(const std::string& filename, st
// Read faces index // Read faces index
m_nbEdges.reserve(m_nbFaces) ; m_nbEdges.reserve(m_nbFaces) ;
m_emb.reserve(3*m_nbFaces) ; m_emb.reserve(3 * m_nbFaces) ;
for (unsigned int i = 0 ; i < m_nbFaces ; ++i) for (unsigned int i = 0 ; i < m_nbFaces ; ++i)
{ {
// read the indices of vertices for current face // read the indices of vertices for current face
......
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