From aad3dd0b30209c29810b1a44b35ec765322a874d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 28 Feb 2023 09:13:26 +0100 Subject: [PATCH] Cleanup debug output --- src/OpenMesh/Core/IO/importer/ImporterT.hh | 10 ---------- src/OpenMesh/Core/IO/reader/PLYReader.cc | 17 ++++++----------- src/Unittests/unittests_read_write_PLY.cc | 2 -- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/src/OpenMesh/Core/IO/importer/ImporterT.hh b/src/OpenMesh/Core/IO/importer/ImporterT.hh index c937eed1..8eef9e1b 100644 --- a/src/OpenMesh/Core/IO/importer/ImporterT.hh +++ b/src/OpenMesh/Core/IO/importer/ImporterT.hh @@ -439,21 +439,11 @@ public: { OpenMesh::MPropHandleT< std::map< int, std::string > > property; - std::cerr <<"HALLOOOOOOOOOOOO" << std::endl; - std::cerr << "ID: " << _id << std::endl; - std::cerr << "name: " << _name << std::endl; - std::cerr << "name size: " << _name.size() << std::endl; - std::cerr << "name front: " << _name.front() << std::endl; - std::cerr << "name back: " << _name.back() << std::endl; - - std::cerr << "add_texture_information " << _id << " name : " << _name << std::endl; if ( !mesh_.get_property_handle(property,"TextureMapping") ) { - std::cerr << "Added Texturemapping property" << std::endl; mesh_.add_property(property,"TextureMapping"); } if ( mesh_.property(property).find( _id ) == mesh_.property(property).end() ) { - std::cerr << "Added Texture file " << _name << std::endl; mesh_.property(property)[_id] = _name; } } diff --git a/src/OpenMesh/Core/IO/reader/PLYReader.cc b/src/OpenMesh/Core/IO/reader/PLYReader.cc index e3dbd040..a3542dad 100644 --- a/src/OpenMesh/Core/IO/reader/PLYReader.cc +++ b/src/OpenMesh/Core/IO/reader/PLYReader.cc @@ -1351,21 +1351,16 @@ bool _PLYReader_::can_u_read(std::istream& _is) const { if (keyword == "comment") { std::getline(_is, line); - // TextureFile + // Meshlab puts texture filenames as comments + // We collect them into a vector and add them in the + // given order to our mesh to keep the indices. if (line.rfind(" TextureFile ", 0) == 0) { - std::cerr << "Comment: " << std::endl; - std::cerr << "Line is : " << line << std::endl; - std::cerr << "Size is : " << line.size() << std::endl; - std::string filename = line.substr(13); - std::cerr << "Filename : " << filename << std::endl; - std::cerr << "Filename size : " << filename.size() << std::endl; - + // This trim is required especially on windows as + // we can run into problems with line endings on + // files from different platforms. trim(filename); - std::cerr << "Trimmed : " << filename << std::endl; - std::cerr << "Trimmed size : " << filename.size() << std::endl; - texture_files_.push_back(filename); } } else if (keyword == "element") { diff --git a/src/Unittests/unittests_read_write_PLY.cc b/src/Unittests/unittests_read_write_PLY.cc index 362ce548..b60ff406 100644 --- a/src/Unittests/unittests_read_write_PLY.cc +++ b/src/Unittests/unittests_read_write_PLY.cc @@ -532,10 +532,8 @@ TEST_F(OpenMeshReadWritePLY, LoadPLYFromMeshLabWithFaceTexCoord) { mesh_.get_property_handle(property, "TextureMapping"); EXPECT_EQ(mesh_.property(property).size(), 2u) << "Wrong texture number"; EXPECT_EQ(mesh_.property(property).count(0), 1u) << "Could not find texture with id 0"; - std::cerr << "DEBUGGING OUTPUT : " << std::endl; std::cerr << mesh_.property(property)[0] << std::endl; std::cerr << mesh_.property(property)[1] << std::endl; - std::cerr << "DEBUGGING OUTPUT : " << std::endl; EXPECT_TRUE((mesh_.property(property)[0] == std::string("tex_0.jpg"))) << "Wrong texture name"; EXPECT_EQ(mesh_.property(property).count(1), 1u) << "Could not find texture with id 1"; EXPECT_TRUE((mesh_.property(property)[1] == std::string("tex_1.jpg"))) << "Wrong texture name";