From 41d547d2dc6ea52707972682158013f16fba3a39 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 19 May 2021 13:11:17 +0200 Subject: [PATCH 1/5] partial fix #967 --- .../ml_shared_data_context.cpp | 25 ++++++++++++------- .../filter_camera/filter_camera.cpp | 14 +++++------ 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/common/ml_shared_data_context/ml_shared_data_context.cpp b/src/common/ml_shared_data_context/ml_shared_data_context.cpp index 23899066f..081c90a89 100644 --- a/src/common/ml_shared_data_context/ml_shared_data_context.cpp +++ b/src/common/ml_shared_data_context/ml_shared_data_context.cpp @@ -134,11 +134,15 @@ void MLPoliciesStandAloneFunctions::maskMeaninglessAttributesPerPrimitiveModalit } } -void MLPoliciesStandAloneFunctions::updatedRendAttsAccordingToPriorities(const MLRenderingData::PRIMITIVE_MODALITY pm,const MLRenderingData::RendAtts& updated,const MLRenderingData::RendAtts& current,MLRenderingData::RendAtts& result) +void MLPoliciesStandAloneFunctions::updatedRendAttsAccordingToPriorities( + const MLRenderingData::PRIMITIVE_MODALITY pm, + const MLRenderingData::RendAtts& updated, //from the result of the filter + const MLRenderingData::RendAtts& current, //from the current model + MLRenderingData::RendAtts& result) //returned final result { - MLRenderingData::RendAtts filteredupdated = updated; - MLRenderingData::RendAtts tmp = current; - tmp[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION] |= filteredupdated[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION]; + MLRenderingData::RendAtts filteredupdated = updated; + MLRenderingData::RendAtts tmp = current; // tmp will be then saved in returned + tmp[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION] |= filteredupdated[MLRenderingData::ATT_NAMES::ATT_VERTPOSITION]; if ((pm == MLRenderingData::PR_WIREFRAME_TRIANGLES) || (pm == MLRenderingData::PR_WIREFRAME_EDGES)) { tmp[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] = false; @@ -146,15 +150,18 @@ void MLPoliciesStandAloneFunctions::updatedRendAttsAccordingToPriorities(const M } else { + //vert normal shading if in current or in updated tmp[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL] |= filteredupdated[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL]; - tmp[MLRenderingData::ATT_NAMES::ATT_FACENORMAL] = (tmp[MLRenderingData::ATT_NAMES::ATT_FACENORMAL] || filteredupdated[MLRenderingData::ATT_NAMES::ATT_FACENORMAL]) && !(filteredupdated[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL]); +// tmp[MLRenderingData::ATT_NAMES::ATT_FACENORMAL] = (tmp[MLRenderingData::ATT_NAMES::ATT_FACENORMAL] || filteredupdated[MLRenderingData::ATT_NAMES::ATT_FACENORMAL]) && !(filteredupdated[MLRenderingData::ATT_NAMES::ATT_VERTNORMAL]); + //face normal shading if in current and in updated + tmp[MLRenderingData::ATT_NAMES::ATT_FACENORMAL] = (tmp[MLRenderingData::ATT_NAMES::ATT_FACENORMAL] && filteredupdated[MLRenderingData::ATT_NAMES::ATT_FACENORMAL]); } - + tmp[MLRenderingData::ATT_NAMES::ATT_VERTCOLOR] |= filteredupdated[MLRenderingData::ATT_NAMES::ATT_VERTCOLOR]; tmp[MLRenderingData::ATT_NAMES::ATT_FACECOLOR] = (tmp[MLRenderingData::ATT_NAMES::ATT_FACECOLOR] || filteredupdated[MLRenderingData::ATT_NAMES::ATT_FACECOLOR]) && !(filteredupdated[MLRenderingData::ATT_NAMES::ATT_VERTCOLOR]); - tmp[MLRenderingData::ATT_NAMES::ATT_WEDGETEXTURE] |= filteredupdated[MLRenderingData::ATT_NAMES::ATT_WEDGETEXTURE]; - tmp[MLRenderingData::ATT_NAMES::ATT_VERTTEXTURE] = (tmp[MLRenderingData::ATT_NAMES::ATT_VERTTEXTURE] || filteredupdated[MLRenderingData::ATT_NAMES::ATT_VERTTEXTURE]) && !(filteredupdated[MLRenderingData::ATT_NAMES::ATT_WEDGETEXTURE]); - result = tmp; + tmp[MLRenderingData::ATT_NAMES::ATT_WEDGETEXTURE] |= filteredupdated[MLRenderingData::ATT_NAMES::ATT_WEDGETEXTURE]; + tmp[MLRenderingData::ATT_NAMES::ATT_VERTTEXTURE] = (tmp[MLRenderingData::ATT_NAMES::ATT_VERTTEXTURE] || filteredupdated[MLRenderingData::ATT_NAMES::ATT_VERTTEXTURE]) && !(filteredupdated[MLRenderingData::ATT_NAMES::ATT_WEDGETEXTURE]); + result = tmp; } void MLPoliciesStandAloneFunctions::suggestedDefaultPerViewRenderingData(MeshModel* meshmodel,MLRenderingData& dtout, size_t minpolnumpersmoothshading) diff --git a/src/meshlabplugins/filter_camera/filter_camera.cpp b/src/meshlabplugins/filter_camera/filter_camera.cpp index b7cad21af..3a4204a12 100644 --- a/src/meshlabplugins/filter_camera/filter_camera.cpp +++ b/src/meshlabplugins/filter_camera/filter_camera.cpp @@ -74,13 +74,13 @@ QString FilterCameraPlugin::filterName(ActionIDType filterId) const QString FilterCameraPlugin::filterInfo(ActionIDType filterId) const { switch(filterId) { - case FP_SET_MESH_CAMERA : return QString("This filter allows one to set a shot for the current mesh"); - case FP_SET_RASTER_CAMERA : return QString("This filter allows one to set a shot for the current mesh"); - case FP_QUALITY_FROM_CAMERA : return QString("Compute vertex quality using the camera definition, according to viewing angle or distance"); - case FP_CAMERA_ROTATE : return QString("Rotate the camera, or all the cameras of the project. The selected raster is the reference if viewpoint rotation is selected."); - case FP_CAMERA_SCALE : return QString("Scale the camera, or all the cameras of the project. The selected raster is the reference if viewpoint scaling is selected."); - case FP_CAMERA_TRANSLATE : return QString("Translate the camera, or all the cameras of the project."); - case FP_CAMERA_TRANSFORM : return QString("Transform the camera extrinsics, or all the cameras of the project."); + case FP_SET_MESH_CAMERA : return QString("This filter allows one to set a shot for the current mesh"); + case FP_SET_RASTER_CAMERA : return QString("This filter allows one to set a shot for the current mesh"); + case FP_QUALITY_FROM_CAMERA : return QString("Compute vertex quality using the camera definition, according to viewing angle or distance"); + case FP_CAMERA_ROTATE : return QString("Rotate the camera, or all the cameras of the project. The selected raster is the reference if viewpoint rotation is selected."); + case FP_CAMERA_SCALE : return QString("Scale the camera, or all the cameras of the project. The selected raster is the reference if viewpoint scaling is selected."); + case FP_CAMERA_TRANSLATE : return QString("Translate the camera, or all the cameras of the project."); + case FP_CAMERA_TRANSFORM : return QString("Transform the camera extrinsics, or all the cameras of the project."); case FP_ORIENT_NORMALS_WITH_CAMERAS:return QString("Reorient vertex normals using cameras. For this filter to work the mesh needs to have the attribute 'correspondences' which is only created when loading Bundler files (.out projects)"); default : assert(0); } From e85076149c0f2ba80c9efb089fcd381b301cfede Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 19 May 2021 14:33:12 +0200 Subject: [PATCH 2/5] fix snap --- snapcraft.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/snapcraft.yaml b/snapcraft.yaml index 95d4da7d5..bcb9ba386 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -29,10 +29,12 @@ apps: parts: meshlab: - plugin: [qmake, cmake] - qt-version: qt5 + #plugin: qmake + #qt-version: qt5 + #source: https://github.com/cnr-isti-vclab/meshlab.git source: https://github.com/cnr-isti-vclab/meshlab.git build-snaps: [cmake] + plugin: cmake build-packages: - cmake - qt5-default From 62afaa8b58749b0deaae926c7b985eb7390c040e Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 19 May 2021 14:48:23 +0200 Subject: [PATCH 3/5] glew fix for wayland --- src/common/GLExtensionsManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/GLExtensionsManager.cpp b/src/common/GLExtensionsManager.cpp index 985260d56..e9aa7134e 100644 --- a/src/common/GLExtensionsManager.cpp +++ b/src/common/GLExtensionsManager.cpp @@ -61,7 +61,7 @@ void GLExtensionsManager::initializeGLextensions() if (!glewInitialized) { glewExperimental = GL_TRUE; GLenum err = glewInit(); - if (err != GLEW_OK && err != GLEW_ERROR_NO_GLX_DISPLAY) { + if (err != GLEW_OK) { throw MLException(QString("GLEW initialization failed: %1\n") .arg((const char *)glewGetErrorString(err))); } From 806e28411fe1b6f35d93df8564207ad144358d42 Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 19 May 2021 15:24:38 +0200 Subject: [PATCH 4/5] fix snapcraft build using recent cmake --- snapcraft.yaml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/snapcraft.yaml b/snapcraft.yaml index bcb9ba386..4c3f1d275 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -28,15 +28,29 @@ apps: - mount-observe parts: - meshlab: - #plugin: qmake - #qt-version: qt5 - #source: https://github.com/cnr-isti-vclab/meshlab.git - source: https://github.com/cnr-isti-vclab/meshlab.git - build-snaps: [cmake] + cmake: + source: https://github.com/Kitware/CMake + source-type: git + source-depth: 1 plugin: cmake + stage-packages: + - libssl-dev + override-build: | + mkdir -p build + cd build + cmake \ + -DCMAKE_INSTALL_PREFIX=$SNAPCRAFT_STAGE/cmake \ + $SNAPCRAFT_PART_SRC + make -j 4 + make install + + meshlab: + after: [cmake] + plugin: qmake + qt-version: qt5 + source: https://github.com/cnr-isti-vclab/meshlab.git build-packages: - - cmake + #- cmake - qt5-default - qttools5-dev-tools - qtdeclarative5-dev From 4676ca5cb66d3b8c4eda0edf0b6bb8ffff7e41cf Mon Sep 17 00:00:00 2001 From: alemuntoni Date: Wed, 19 May 2021 16:08:42 +0200 Subject: [PATCH 5/5] revert to cmake minimum 3.10 --- snapcraft.yaml | 19 +------------------ src/CMakeLists.txt | 2 +- src/vcglib | 2 +- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/snapcraft.yaml b/snapcraft.yaml index 4c3f1d275..ced5a0837 100644 --- a/snapcraft.yaml +++ b/snapcraft.yaml @@ -28,29 +28,12 @@ apps: - mount-observe parts: - cmake: - source: https://github.com/Kitware/CMake - source-type: git - source-depth: 1 - plugin: cmake - stage-packages: - - libssl-dev - override-build: | - mkdir -p build - cd build - cmake \ - -DCMAKE_INSTALL_PREFIX=$SNAPCRAFT_STAGE/cmake \ - $SNAPCRAFT_PART_SRC - make -j 4 - make install - meshlab: - after: [cmake] plugin: qmake qt-version: qt5 source: https://github.com/cnr-isti-vclab/meshlab.git build-packages: - #- cmake + - cmake - qt5-default - qttools5-dev-tools - qtdeclarative5-dev diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cb359792c..22d8ad439 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,7 +2,7 @@ # Copyright 2019, 2021, Visual Computing Lab, ISTI - Italian National Research Council # SPDX-License-Identifier: BSL-1.0 -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.10) project(MeshLab) ### Build options diff --git a/src/vcglib b/src/vcglib index c150c3f6b..5c0ea8b20 160000 --- a/src/vcglib +++ b/src/vcglib @@ -1 +1 @@ -Subproject commit c150c3f6b66edbb21e96d02d373af264b44afdc2 +Subproject commit 5c0ea8b20ea95adfc3a443ef60e02ee54057ec41