Skip to content

Commit

Permalink
update libE57 to version 3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
alemuntoni committed Jun 3, 2024
1 parent b5c7e64 commit 58352ad
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions src/external/e57.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}
Expand Down
20 changes: 10 additions & 10 deletions src/meshlabplugins/io_e57/io_e57.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int64_t>(totalPoints);
scanHeader.pointCount = static_cast<int64_t>(totalPoints);

e57::Translation translation;
e57::Quaternion quaternion;
Expand Down Expand Up @@ -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<uint8_t>::max();
scanHeader.colorLimits.colorGreenMinimum = e57::UINT8_MIN;
scanHeader.colorLimits.colorGreenMaximum = std::numeric_limits<uint8_t>::max();
scanHeader.colorLimits.colorBlueMinimum = e57::UINT8_MIN;
scanHeader.colorLimits.colorBlueMaximum = std::numeric_limits<uint8_t>::max();
}
if ((mask & Mask::IOM_VERTQUALITY) != 0) {
float min = std::numeric_limits<float>::max();
Expand Down
12 changes: 6 additions & 6 deletions src/meshlabplugins/io_e57/io_e57.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ namespace vcg {
std::vector<int8_t> sphericalInvalidState;

// Intensity
std::vector<float> intensity; /* Quality */
std::vector<double> intensity; /* Quality */
std::vector<int8_t> intensityInvalid;

// Colors
std::vector<uint8_t> colorRed;
std::vector<uint8_t> colorGreen;
std::vector<uint8_t> colorBlue;
std::vector<uint16_t> colorRed;
std::vector<uint16_t> colorGreen;
std::vector<uint16_t> colorBlue;
std::vector<int8_t> colorInvalid;

// Normals
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 58352ad

Please sign in to comment.