diff --git a/src/external/e57.cmake b/src/external/e57.cmake index 44bf91b392..0742b37dfd 100644 --- a/src/external/e57.cmake +++ b/src/external/e57.cmake @@ -4,7 +4,7 @@ option(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBE57 "Allow download and use of libE57Format source" ON) -set(LIBE57_VER 2.3.0) +set(LIBE57_VER 3.1.1) if (TARGET XercesC::XercesC) if(MESHLAB_ALLOW_DOWNLOAD_SOURCE_LIBE57) @@ -15,7 +15,7 @@ if (TARGET XercesC::XercesC) set(LIBE57_LINK https://github.com/asmaloney/libE57Format/archive/refs/tags/v${LIBE57_VER}.zip https://www.meshlab.net/data/libs/libE57Format-${LIBE57_VER}.zip) - set(LIBE57_MD5 958ada3883f9b60195f79bbab156f3e3) + set(LIBE57_MD5 1da204e43a2e2e1ca5d23deb77dd8b8e) download_and_unzip( NAME "LibE57" MD5 ${LIBE57_MD5} diff --git a/src/meshlabplugins/io_e57/io_e57.cpp b/src/meshlabplugins/io_e57/io_e57.cpp index c9b0553c69..13f13b2a79 100755 --- a/src/meshlabplugins/io_e57/io_e57.cpp +++ b/src/meshlabplugins/io_e57/io_e57.cpp @@ -257,7 +257,7 @@ void E57IOPlugin::save(const QString& formatName, const QString& fileName, MeshM E57_WRAPPER(fileWriter.IsOpen(), "Error while opening E57 file for writing!"); scanHeader.guid = QUuid::createUuid().toString(QUuid::WithBraces).toStdString(); - scanHeader.pointsSize = static_cast(totalPoints); + scanHeader.pointCount = static_cast(totalPoints); e57::Translation translation; e57::Quaternion quaternion; @@ -289,21 +289,21 @@ void E57IOPlugin::save(const QString& formatName, const QString& fileName, MeshM scanHeader.pointFields.cartesianZField = true; if ((mask & Mask::IOM_VERTNORMAL) != 0) { - scanHeader.pointFields.normalX = true; - scanHeader.pointFields.normalY = true; - scanHeader.pointFields.normalZ = true; + scanHeader.pointFields.normalXField = true; + scanHeader.pointFields.normalYField = true; + scanHeader.pointFields.normalZField = true; } if ((mask & Mask::IOM_VERTCOLOR) != 0) { scanHeader.pointFields.isColorInvalidField = false; scanHeader.pointFields.colorRedField = true; scanHeader.pointFields.colorGreenField = true; scanHeader.pointFields.colorBlueField = true; - scanHeader.colorLimits.colorRedMinimum = e57::E57_UINT8_MIN; - scanHeader.colorLimits.colorRedMaximum = e57::E57_UINT8_MAX; - scanHeader.colorLimits.colorGreenMinimum = e57::E57_UINT8_MIN; - scanHeader.colorLimits.colorGreenMaximum = e57::E57_UINT8_MAX; - scanHeader.colorLimits.colorBlueMinimum = e57::E57_UINT8_MIN; - scanHeader.colorLimits.colorBlueMaximum = e57::E57_UINT8_MAX; + scanHeader.colorLimits.colorRedMinimum = e57::UINT8_MIN; + scanHeader.colorLimits.colorRedMaximum = std::numeric_limits::max(); + scanHeader.colorLimits.colorGreenMinimum = e57::UINT8_MIN; + scanHeader.colorLimits.colorGreenMaximum = std::numeric_limits::max(); + scanHeader.colorLimits.colorBlueMinimum = e57::UINT8_MIN; + scanHeader.colorLimits.colorBlueMaximum = std::numeric_limits::max(); } if ((mask & Mask::IOM_VERTQUALITY) != 0) { float min = std::numeric_limits::max(); diff --git a/src/meshlabplugins/io_e57/io_e57.h b/src/meshlabplugins/io_e57/io_e57.h index 753266d51a..944c2ab117 100755 --- a/src/meshlabplugins/io_e57/io_e57.h +++ b/src/meshlabplugins/io_e57/io_e57.h @@ -58,13 +58,13 @@ namespace vcg { std::vector sphericalInvalidState; // Intensity - std::vector intensity; /* Quality */ + std::vector intensity; /* Quality */ std::vector intensityInvalid; // Colors - std::vector colorRed; - std::vector colorGreen; - std::vector colorBlue; + std::vector colorRed; + std::vector colorGreen; + std::vector colorBlue; std::vector colorInvalid; // Normals @@ -136,8 +136,8 @@ namespace vcg { } } - if (scanHeader.pointFields.normalX && scanHeader.pointFields.normalY && - scanHeader.pointFields.normalZ) { + if (scanHeader.pointFields.normalXField && scanHeader.pointFields.normalYField && + scanHeader.pointFields.normalZField) { normalX.resize(buffSize); normalY.resize(buffSize); normalZ.resize(buffSize);