diff --git a/build/.gitignore b/build/.gitignore deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/include/Algo/Export/export.h b/include/Algo/Export/export.h index 1142600878f24825e8cb2776a34a73147bc73ced..0dab9fa781a48521e651d01c49c307cd50fb989f 100644 --- a/include/Algo/Export/export.h +++ b/include/Algo/Export/export.h @@ -103,7 +103,7 @@ bool exportPlyPTMgeneric(typename PFP::MAP& map, const char* filename, const typ * @return true */ template -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 diff --git a/include/Algo/Export/export.hpp b/include/Algo/Export/export.hpp index 4223f59820e8407979768eb105521876f66b81f8..c40ff67bfa5c400c267ff3d69620dca15b74f85a 100644 --- a/include/Algo/Export/export.hpp +++ b/include/Algo/Export/export.hpp @@ -387,9 +387,14 @@ bool exportPlySLF(typename PFP::MAP& map, const char* filename, const typename P coefs[i] = map.template getAttribute(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 << "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 << "property float x" << std::endl ; out << "property float y" << std::endl ; diff --git a/include/Algo/Import/import2tablesSurface.hpp b/include/Algo/Import/import2tablesSurface.hpp index 2ab448441af2f766439a25e1421f4cb6a32a44a6..d8e1e1a2b1c2e0f4f9af62f3b5b66f420ef00fd5 100644 --- a/include/Algo/Import/import2tablesSurface.hpp +++ b/include/Algo/Import/import2tablesSurface.hpp @@ -682,7 +682,7 @@ bool MeshTablesSurface::importPlyPTMgeneric(const std::string& filename, st binormal = true ; else if (tag == std::string("nx") || tag == std::string("ny") || tag == std::string("nz")) 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 ; } while (tag != std::string("face")) ; unsigned int nbRemainders = nbProps ; // # remaining properties @@ -758,7 +758,7 @@ bool MeshTablesSurface::importPlyPTMgeneric(const std::string& filename, st // Read faces index 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) { // read the indices of vertices for current face