From c48cb4da97f6da4673c59bc7018f4a26cfb3d698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=CA=B3=20Pierre-=C3=89douard=20Cailliau?= Date: Sun, 23 Jan 2022 00:14:43 +0100 Subject: [PATCH] The element MLMatrix44 is a list, so values are separed by spaces and carriage return are ignored. --- src/meshlabplugins/io_base/load_project.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/meshlabplugins/io_base/load_project.cpp b/src/meshlabplugins/io_base/load_project.cpp index c07b4e8e9..469dc09c6 100644 --- a/src/meshlabplugins/io_base/load_project.cpp +++ b/src/meshlabplugins/io_base/load_project.cpp @@ -230,20 +230,10 @@ std::vector loadMLP( vcg::Matrix44f trm; if (tr.childNodes().size() == 1) { if (!binary) { - QStringList rows = tr.firstChild().nodeValue().split("\n", QString::SkipEmptyParts); - int i = 0; - for (const QString& row : qAsConst(rows)){ - if (rows.size() > 0) { - QStringList values = row.split(" ", QString::SkipEmptyParts); - int j = 0; - for (const QString& value : qAsConst(values)) { - if (i < 4 && j < 4) { - md.mm()->cm.Tr[i][j] = value.toFloat(); - j++; - } - } - i++; - } + auto const & values = tr.childNodes(); + auto * v = md.mm()->cm.V(); + for (auto index = 0u; index < values.length(); ++index) { + v[index] = values.item(index).nodeName().toFloat(); } } else {