Cleanup debug output

This commit is contained in:
Jan Möbius
2023-02-28 09:13:26 +01:00
parent d89152ebf5
commit aad3dd0b30
3 changed files with 6 additions and 23 deletions

View File

@@ -439,21 +439,11 @@ public:
{ {
OpenMesh::MPropHandleT< std::map< int, std::string > > property; 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") ) { if ( !mesh_.get_property_handle(property,"TextureMapping") ) {
std::cerr << "Added Texturemapping property" << std::endl;
mesh_.add_property(property,"TextureMapping"); mesh_.add_property(property,"TextureMapping");
} }
if ( mesh_.property(property).find( _id ) == mesh_.property(property).end() ) { if ( mesh_.property(property).find( _id ) == mesh_.property(property).end() ) {
std::cerr << "Added Texture file " << _name << std::endl;
mesh_.property(property)[_id] = _name; mesh_.property(property)[_id] = _name;
} }
} }

View File

@@ -1351,21 +1351,16 @@ bool _PLYReader_::can_u_read(std::istream& _is) const {
if (keyword == "comment") { if (keyword == "comment") {
std::getline(_is, line); 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) { 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::string filename = line.substr(13);
std::cerr << "Filename : " << filename << std::endl; // This trim is required especially on windows as
std::cerr << "Filename size : " << filename.size() << std::endl; // we can run into problems with line endings on
// files from different platforms.
trim(filename); trim(filename);
std::cerr << "Trimmed : " << filename << std::endl;
std::cerr << "Trimmed size : " << filename.size() << std::endl;
texture_files_.push_back(filename); texture_files_.push_back(filename);
} }
} else if (keyword == "element") { } else if (keyword == "element") {

View File

@@ -532,10 +532,8 @@ TEST_F(OpenMeshReadWritePLY, LoadPLYFromMeshLabWithFaceTexCoord) {
mesh_.get_property_handle(property, "TextureMapping"); mesh_.get_property_handle(property, "TextureMapping");
EXPECT_EQ(mesh_.property(property).size(), 2u) << "Wrong texture number"; 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"; 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)[0] << std::endl;
std::cerr << mesh_.property(property)[1] << 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_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_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"; EXPECT_TRUE((mesh_.property(property)[1] == std::string("tex_1.jpg"))) << "Wrong texture name";