From e27838ef23dcc83246106f7079cec68d5f6b0dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Tue, 15 Feb 2022 09:53:57 +0100 Subject: [PATCH 01/41] Cleanup OpenMP detection in cmake-library --- cmake-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-library b/cmake-library index d0220925..44f67614 160000 --- a/cmake-library +++ b/cmake-library @@ -1 +1 @@ -Subproject commit d02209259a1920d50671c0b1bc84a3783a5bb7d0 +Subproject commit 44f676147ec1f4671a99cbd0d29f9090878433f9 From 1122479e9927b78579a51a3553aa153ac44d80f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 08:58:54 +0100 Subject: [PATCH 02/41] Removed globbing for compile files and headers in OpenMesh Core --- src/OpenMesh/Core/CMakeLists.txt | 142 +++++++++++++++++++++++++++---- 1 file changed, 126 insertions(+), 16 deletions(-) diff --git a/src/OpenMesh/Core/CMakeLists.txt b/src/OpenMesh/Core/CMakeLists.txt index 7a5269cf..7af0a558 100644 --- a/src/OpenMesh/Core/CMakeLists.txt +++ b/src/OpenMesh/Core/CMakeLists.txt @@ -5,24 +5,134 @@ include_directories ( ${CMAKE_CURRENT_SOURCE_DIR} ) -# source code directories -set (directories - . - Geometry - IO - IO/exporter - IO/importer - IO/reader - IO/writer - Mesh - Mesh/gen - System - Utils +set ( headers +Geometry/Config.hh +Geometry/EigenVectorT.hh +Geometry/LoopSchemeMaskT.hh +Geometry/MathDefs.hh +Geometry/NormalConeT.hh +Geometry/NormalConeT_impl.hh +Geometry/Plane3d.hh +Geometry/QuadricT.hh +Geometry/Vector11T.hh +Geometry/VectorT.hh +Geometry/VectorT_inc.hh +IO/BinaryHelper.hh +IO/IOInstances.hh +IO/IOManager.hh +IO/MeshIO.hh +IO/OFFFormat.hh +IO/OMFormat.hh +IO/OMFormatT_impl.hh +IO/Options.hh +IO/SR_binary.hh +IO/SR_binary_spec.hh +IO/SR_rbo.hh +IO/SR_store.hh +IO/SR_types.hh +IO/StoreRestore.hh +IO/exporter/BaseExporter.hh +IO/exporter/ExporterT.hh +IO/importer/BaseImporter.hh +IO/importer/ImporterT.hh +IO/reader/BaseReader.hh +IO/reader/OBJReader.hh +IO/reader/OFFReader.hh +IO/reader/OMReader.hh +IO/reader/PLYReader.hh +IO/reader/STLReader.hh +IO/writer/BaseWriter.hh +IO/writer/OBJWriter.hh +IO/writer/OFFWriter.hh +IO/writer/OMWriter.hh +IO/writer/PLYWriter.hh +IO/writer/STLWriter.hh +IO/writer/VTKWriter.hh +Mesh/ArrayItems.hh +Mesh/ArrayKernel.hh +Mesh/ArrayKernelT_impl.hh +Mesh/AttribKernelT.hh +Mesh/Attributes.hh +Mesh/BaseKernel.hh +Mesh/BaseMesh.hh +Mesh/Casts.hh +Mesh/CirculatorsT.hh +Mesh/DefaultPolyMesh.hh +Mesh/DefaultTriMesh.hh +Mesh/FinalMeshItemsT.hh +Mesh/Handles.hh +Mesh/IteratorsT.hh +Mesh/PolyConnectivity.hh +Mesh/PolyConnectivity_inline_impl.hh +Mesh/PolyMeshT.hh +Mesh/PolyMeshT_impl.hh +Mesh/PolyMesh_ArrayKernelT.hh +Mesh/SmartHandles.hh +Mesh/SmartRange.hh +Mesh/Status.hh +Mesh/Tags.hh +Mesh/Traits.hh +Mesh/TriConnectivity.hh +Mesh/TriMeshT.hh +Mesh/TriMeshT_impl.hh +Mesh/TriMesh_ArrayKernelT.hh +Mesh/gen/circulators_header.hh +Mesh/gen/circulators_template.hh +Mesh/gen/footer.hh +Mesh/gen/iterators_header.hh +Mesh/gen/iterators_template.hh +System/OpenMeshDLLMacros.hh +System/compiler.hh +System/config.hh +System/mostream.hh +System/omstream.hh +Utils/AutoPropertyHandleT.hh +Utils/BaseProperty.hh +Utils/Endian.hh +Utils/GenProg.hh +Utils/HandleToPropHandle.hh +Utils/Noncopyable.hh +Utils/Predicates.hh +Utils/Property.hh +Utils/PropertyContainer.hh +Utils/PropertyCreator.hh +Utils/PropertyManager.hh +Utils/RandomNumberGenerator.hh +Utils/SingletonT.hh +Utils/SingletonT_impl.hh +Utils/color_cast.hh +Utils/typename.hh +Utils/vector_cast.hh +Utils/vector_traits.hh ) -# collect all header and source files -vci_append_files (headers "*.hh" ${directories}) -vci_append_files (sources "*.cc" ${directories}) +set ( sources +IO/BinaryHelper.cc +IO/IOManager.cc +IO/OMFormat.cc +IO/reader/BaseReader.cc +IO/reader/OBJReader.cc +IO/reader/OFFReader.cc +IO/reader/OMReader.cc +IO/reader/PLYReader.cc +IO/reader/STLReader.cc +IO/writer/BaseWriter.cc +IO/writer/OBJWriter.cc +IO/writer/OFFWriter.cc +IO/writer/OMWriter.cc +IO/writer/PLYWriter.cc +IO/writer/STLWriter.cc +IO/writer/VTKWriter.cc +Mesh/ArrayKernel.cc +Mesh/BaseKernel.cc +Mesh/PolyConnectivity.cc +Mesh/TriConnectivity.cc +System/omstream.cc +Utils/BaseProperty.cc +Utils/Endian.cc +Utils/PropertyCreator.cc +Utils/RandomNumberGenerator.cc +) # Disable Library installation when not building OpenMesh on its own but as part of another project! if ( NOT ${CMAKE_PROJECT_NAME} MATCHES "OpenMesh") From 18bc53814a74880daca7d1ddf0ac446dba8f1791 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 09:03:19 +0100 Subject: [PATCH 03/41] Removed globbing for compile files and headers in OpenMesh Tools --- src/OpenMesh/Tools/CMakeLists.txt | 95 +++++++++++++++++++++++++++++-- 1 file changed, 91 insertions(+), 4 deletions(-) diff --git a/src/OpenMesh/Tools/CMakeLists.txt b/src/OpenMesh/Tools/CMakeLists.txt index 0170e2b8..cf8e58fd 100644 --- a/src/OpenMesh/Tools/CMakeLists.txt +++ b/src/OpenMesh/Tools/CMakeLists.txt @@ -18,12 +18,99 @@ set (directories VDPM ) -# collect all header and source files -vci_append_files (headers "*.hh" ${directories}) -vci_append_files (sources "*.cc" ${directories}) +set ( headers +Decimater/BaseDecimaterT.hh +Decimater/BaseDecimaterT_impl.hh +Decimater/CollapseInfoT.hh +Decimater/DecimaterT.hh +Decimater/DecimaterT_impl.hh +Decimater/McDecimaterT.hh +Decimater/McDecimaterT_impl.hh +Decimater/MixedDecimaterT.hh +Decimater/MixedDecimaterT_impl.hh +Decimater/ModAspectRatioT.hh +Decimater/ModAspectRatioT_impl.hh +Decimater/ModBaseT.hh +Decimater/ModEdgeLengthT.hh +Decimater/ModEdgeLengthT_impl.hh +Decimater/ModHausdorffT.hh +Decimater/ModHausdorffT_impl.hh +Decimater/ModIndependentSetsT.hh +Decimater/ModNormalDeviationT.hh +Decimater/ModNormalFlippingT.hh +Decimater/ModProgMeshT.hh +Decimater/ModProgMeshT_impl.hh +Decimater/ModQuadricT.hh +Decimater/ModQuadricT_impl.hh +Decimater/ModRoundnessT.hh +Decimater/Observer.hh +Dualizer/meshDualT.hh +Smoother/JacobiLaplaceSmootherT.hh +Smoother/JacobiLaplaceSmootherT_impl.hh +Smoother/LaplaceSmootherT.hh +Smoother/LaplaceSmootherT_impl.hh +Smoother/SmootherT.hh +Smoother/SmootherT_impl.hh +Smoother/smooth_mesh.hh +Subdivider/Adaptive/Composite/CompositeT.hh +Subdivider/Adaptive/Composite/CompositeT_impl.hh +Subdivider/Adaptive/Composite/CompositeTraits.hh +Subdivider/Adaptive/Composite/RuleInterfaceT.hh +Subdivider/Adaptive/Composite/RulesT.hh +Subdivider/Adaptive/Composite/RulesT_impl.hh +Subdivider/Adaptive/Composite/Traits.hh +Subdivider/Uniform/Composite/CompositeT.hh +Subdivider/Uniform/Composite/CompositeT_impl.hh +Subdivider/Uniform/Composite/CompositeTraits.hh +Subdivider/Uniform/CatmullClarkT.hh +Subdivider/Uniform/CatmullClarkT_impl.hh +Subdivider/Uniform/CompositeLoopT.hh +Subdivider/Uniform/CompositeSqrt3T.hh +Subdivider/Uniform/LongestEdgeT.hh +Subdivider/Uniform/LoopT.hh +Subdivider/Uniform/MidpointT.hh +Subdivider/Uniform/ModifiedButterFlyT.hh +Subdivider/Uniform/Sqrt3InterpolatingSubdividerLabsikGreinerT.hh +Subdivider/Uniform/Sqrt3T.hh +Subdivider/Uniform/SubdividerT.hh +Utils/Config.hh +Utils/GLConstAsString.hh +Utils/Gnuplot.hh +Utils/HeapT.hh +Utils/MeshCheckerT.hh +Utils/MeshCheckerT_impl.hh +Utils/NumLimitsT.hh +Utils/StripifierT.hh +Utils/StripifierT_impl.hh +Utils/TestingFramework.hh +Utils/Timer.hh +Utils/conio.hh +VDPM/MeshTraits.hh +VDPM/StreamingDef.hh +VDPM/VFront.hh +VDPM/VHierarchy.hh +VDPM/VHierarchyNode.hh +VDPM/VHierarchyNodeIndex.hh +VDPM/VHierarchyWindow.hh +VDPM/ViewingParameters.hh +) + + +set ( sources +Decimater/Observer.cc +Utils/Gnuplot.cc +Utils/Timer.cc +Utils/conio.cc +VDPM/VFront.cc +VDPM/VHierarchy.cc +VDPM/VHierarchyNodeIndex.cc +VDPM/VHierarchyWindow.cc +VDPM/ViewingParameters.cc +) + IF(WIN32 AND NOT MINGW) - vci_append_files (sources "*.c" ${directories}) + list(APPEND sources "Utils/getopt.c") ENDIF(WIN32 AND NOT MINGW) # Disable Library installation when not building OpenMesh on its own but as part of another project! From 777f58f75e15ee0128ea8d19cfe4814788d91479 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 09:14:33 +0100 Subject: [PATCH 04/41] Set include directories for tools and core per target and not globally --- src/OpenMesh/Core/CMakeLists.txt | 23 ++++++++++++++---- src/OpenMesh/Tools/CMakeLists.txt | 39 ++++++++++++++----------------- 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/src/OpenMesh/Core/CMakeLists.txt b/src/OpenMesh/Core/CMakeLists.txt index 7af0a558..977e2188 100644 --- a/src/OpenMesh/Core/CMakeLists.txt +++ b/src/OpenMesh/Core/CMakeLists.txt @@ -1,10 +1,5 @@ include (VCICommon) -include_directories ( - ../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - set ( headers Geometry/Config.hh Geometry/EigenVectorT.hh @@ -145,13 +140,31 @@ if (WIN32) if ( OPENMESH_BUILD_SHARED ) add_definitions( -DOPENMESHDLL -DBUILDOPENMESHDLL) vci_add_library (OpenMeshCore SHARED ${sources} ${headers}) + + target_include_directories(OpenMeshCore PUBLIC + $ + $) + else() # OpenMesh has no dll exports so we have to build a static library on windows vci_add_library (OpenMeshCore STATIC ${sources} ${headers}) + + target_include_directories(OpenMeshCoreStatic PUBLIC + $ + $) endif() else () vci_add_library (OpenMeshCore SHAREDANDSTATIC ${sources} ${headers}) + + target_include_directories(OpenMeshCore PUBLIC + $ + $) + + target_include_directories(OpenMeshCoreStatic PUBLIC + $ + $) + set_target_properties (OpenMeshCore PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} ) endif () diff --git a/src/OpenMesh/Tools/CMakeLists.txt b/src/OpenMesh/Tools/CMakeLists.txt index cf8e58fd..91e3b692 100644 --- a/src/OpenMesh/Tools/CMakeLists.txt +++ b/src/OpenMesh/Tools/CMakeLists.txt @@ -1,23 +1,5 @@ include (VCICommon) -include_directories ( - ../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - -# source code directories -set (directories - . - Decimater - Dualizer - Smoother - Subdivider/Adaptive/Composite - Subdivider/Uniform/Composite - Subdivider/Uniform - Utils - VDPM -) - set ( headers Decimater/BaseDecimaterT.hh Decimater/BaseDecimaterT_impl.hh @@ -124,13 +106,30 @@ if (WIN32) if ( OPENMESH_BUILD_SHARED ) add_definitions( -DOPENMESHDLL -DBUILDOPENMESHDLL) vci_add_library (OpenMeshTools SHARED ${sources} ${headers}) + + target_include_directories(OpenMeshTools PUBLIC + $ + $) else() # OpenMesh has no dll exports so we have to build a static library on windows vci_add_library (OpenMeshTools STATIC ${sources} ${headers}) + + target_include_directories(OpenMeshToolsStatic PUBLIC + $ + $) endif() else () vci_add_library (OpenMeshTools SHAREDANDSTATIC ${sources} ${headers}) + + target_include_directories(OpenMeshTools PUBLIC + $ + $) + + target_include_directories(OpenMeshToolsStatic PUBLIC + $ + $) + set_target_properties (OpenMeshTools PROPERTIES VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} ) endif () @@ -208,10 +207,6 @@ install(FILES Utils/getopt.h DESTINATION include/OpenMesh/Tools/Utils) endif () -target_include_directories(OpenMeshTools PUBLIC - $ - $) - install(TARGETS OpenMeshTools EXPORT OpenMeshConfig ARCHIVE DESTINATION ${VCI_PROJECT_LIBDIR} LIBRARY DESTINATION ${VCI_PROJECT_LIBDIR} From a81865c6ffa3699c25a31cef2b7d774773b2e5cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 09:24:18 +0100 Subject: [PATCH 05/41] Use implicit include directories via target link libraries for building apps --- .../Apps/Decimating/DecimaterGui/CMakeLists.txt | 5 ----- .../Decimating/commandlineDecimater/CMakeLists.txt | 5 ----- src/OpenMesh/Apps/Dualizer/CMakeLists.txt | 4 ---- src/OpenMesh/Apps/ProgViewer/CMakeLists.txt | 6 ------ src/OpenMesh/Apps/QtViewer/CMakeLists.txt | 10 ---------- src/OpenMesh/Apps/Smoothing/CMakeLists.txt | 5 ----- .../Apps/Subdivider/SubdividerGui/CMakeLists.txt | 5 ----- .../commandlineAdaptiveSubdivider/CMakeLists.txt | 5 ----- .../Subdivider/commandlineSubdivider/CMakeLists.txt | 5 ----- src/OpenMesh/Apps/VDProgMesh/Analyzer/CMakeLists.txt | 5 ----- .../Apps/VDProgMesh/Synthesizer/CMakeLists.txt | 5 ----- .../Apps/VDProgMesh/mkbalancedpm/CMakeLists.txt | 5 ----- src/OpenMesh/Apps/mconvert/CMakeLists.txt | 4 ---- 13 files changed, 69 deletions(-) diff --git a/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt b/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt index d6230e7e..a9a46e38 100644 --- a/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt +++ b/src/OpenMesh/Apps/Decimating/DecimaterGui/CMakeLists.txt @@ -1,10 +1,5 @@ include (VCICommon) -include_directories ( - ../../../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - set (headers ../DecimaterViewerWidget.hh ../../QtViewer/QGLViewerWidget.hh diff --git a/src/OpenMesh/Apps/Decimating/commandlineDecimater/CMakeLists.txt b/src/OpenMesh/Apps/Decimating/commandlineDecimater/CMakeLists.txt index de6118f3..00b06a5a 100644 --- a/src/OpenMesh/Apps/Decimating/commandlineDecimater/CMakeLists.txt +++ b/src/OpenMesh/Apps/Decimating/commandlineDecimater/CMakeLists.txt @@ -1,10 +1,5 @@ include (VCICommon) -include_directories ( - ../../../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - vci_add_executable (commandlineDecimater ../decimater.cc) target_link_libraries (commandlineDecimater diff --git a/src/OpenMesh/Apps/Dualizer/CMakeLists.txt b/src/OpenMesh/Apps/Dualizer/CMakeLists.txt index d4cbac17..51b6fe47 100644 --- a/src/OpenMesh/Apps/Dualizer/CMakeLists.txt +++ b/src/OpenMesh/Apps/Dualizer/CMakeLists.txt @@ -1,9 +1,5 @@ include (VCICommon) -include_directories ( - ../../.. -) - vci_add_executable (Dualizer dualizer.cc) target_link_libraries (Dualizer diff --git a/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt b/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt index 2a3e2daf..3fea20a6 100644 --- a/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt +++ b/src/OpenMesh/Apps/ProgViewer/CMakeLists.txt @@ -1,11 +1,5 @@ include (VCICommon) -include_directories ( - ../../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - - set( headers ProgViewerWidget.hh ../QtViewer/QGLViewerWidget.hh diff --git a/src/OpenMesh/Apps/QtViewer/CMakeLists.txt b/src/OpenMesh/Apps/QtViewer/CMakeLists.txt index 38fb3e33..fd401fb5 100644 --- a/src/OpenMesh/Apps/QtViewer/CMakeLists.txt +++ b/src/OpenMesh/Apps/QtViewer/CMakeLists.txt @@ -1,15 +1,5 @@ include (VCICommon) -include_directories ( - ../../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - -# source code directories -set (directories - . -) - set (sources MeshViewerWidget.cc QGLViewerWidget.cc diff --git a/src/OpenMesh/Apps/Smoothing/CMakeLists.txt b/src/OpenMesh/Apps/Smoothing/CMakeLists.txt index e3c24bf8..3c2520f4 100644 --- a/src/OpenMesh/Apps/Smoothing/CMakeLists.txt +++ b/src/OpenMesh/Apps/Smoothing/CMakeLists.txt @@ -1,10 +1,5 @@ include (VCICommon) -include_directories ( - ../../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - vci_add_executable (Smoothing smooth.cc) target_link_libraries (Smoothing diff --git a/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt b/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt index b981841b..7cb64773 100644 --- a/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt +++ b/src/OpenMesh/Apps/Subdivider/SubdividerGui/CMakeLists.txt @@ -1,10 +1,5 @@ include (VCICommon) -include_directories ( - ../../../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - set (headers ../MeshViewerWidget.hh ../SubdivideWidget.hh diff --git a/src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/CMakeLists.txt b/src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/CMakeLists.txt index b89243b0..456476d3 100644 --- a/src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/CMakeLists.txt +++ b/src/OpenMesh/Apps/Subdivider/commandlineAdaptiveSubdivider/CMakeLists.txt @@ -1,10 +1,5 @@ include (VCICommon) -include_directories ( - ../../../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - vci_add_executable (commandlineAdaptiveSubdivider ../adaptive_subdivider.cc) target_link_libraries (commandlineAdaptiveSubdivider diff --git a/src/OpenMesh/Apps/Subdivider/commandlineSubdivider/CMakeLists.txt b/src/OpenMesh/Apps/Subdivider/commandlineSubdivider/CMakeLists.txt index d341ad6b..1c9ce524 100644 --- a/src/OpenMesh/Apps/Subdivider/commandlineSubdivider/CMakeLists.txt +++ b/src/OpenMesh/Apps/Subdivider/commandlineSubdivider/CMakeLists.txt @@ -1,10 +1,5 @@ include (VCICommon) -include_directories ( - ../../../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - vci_add_executable (commandlineSubdivider ../subdivider.cc) target_link_libraries (commandlineSubdivider diff --git a/src/OpenMesh/Apps/VDProgMesh/Analyzer/CMakeLists.txt b/src/OpenMesh/Apps/VDProgMesh/Analyzer/CMakeLists.txt index 6b73f101..1519d104 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Analyzer/CMakeLists.txt +++ b/src/OpenMesh/Apps/VDProgMesh/Analyzer/CMakeLists.txt @@ -1,10 +1,5 @@ include (VCICommon) -include_directories ( - ../../../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - vci_add_executable (Analyzer vdpmanalyzer.cc) target_link_libraries (Analyzer diff --git a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt index 1cc83663..983cd2ab 100644 --- a/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt +++ b/src/OpenMesh/Apps/VDProgMesh/Synthesizer/CMakeLists.txt @@ -1,10 +1,5 @@ include (VCICommon) -include_directories ( - ../../../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - set (headers VDPMSynthesizerViewerWidget.hh ) diff --git a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/CMakeLists.txt b/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/CMakeLists.txt index 7d8e1a10..0f61f634 100644 --- a/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/CMakeLists.txt +++ b/src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/CMakeLists.txt @@ -1,10 +1,5 @@ include (VCICommon) -include_directories ( - ../../../.. - ${CMAKE_CURRENT_SOURCE_DIR} -) - vci_add_executable (mkbalancedpm mkbalancedpm.cc) target_link_libraries (mkbalancedpm diff --git a/src/OpenMesh/Apps/mconvert/CMakeLists.txt b/src/OpenMesh/Apps/mconvert/CMakeLists.txt index 2aa7f742..b05d1d17 100644 --- a/src/OpenMesh/Apps/mconvert/CMakeLists.txt +++ b/src/OpenMesh/Apps/mconvert/CMakeLists.txt @@ -1,9 +1,5 @@ include (VCICommon) -include_directories ( - ../../.. -) - vci_add_executable (mconvert mconvert.cc) target_link_libraries (mconvert From 09267c3e3d8efedd19e395a75aad3129fc0fd347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 09:29:19 +0100 Subject: [PATCH 06/41] Fixed win32 static part --- src/OpenMesh/Core/CMakeLists.txt | 15 +++++---------- src/OpenMesh/Tools/CMakeLists.txt | 12 ++++-------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/OpenMesh/Core/CMakeLists.txt b/src/OpenMesh/Core/CMakeLists.txt index 977e2188..46f0beb6 100644 --- a/src/OpenMesh/Core/CMakeLists.txt +++ b/src/OpenMesh/Core/CMakeLists.txt @@ -140,20 +140,15 @@ if (WIN32) if ( OPENMESH_BUILD_SHARED ) add_definitions( -DOPENMESHDLL -DBUILDOPENMESHDLL) vci_add_library (OpenMeshCore SHARED ${sources} ${headers}) - - target_include_directories(OpenMeshCore PUBLIC - $ - $) - else() - # OpenMesh has no dll exports so we have to build a static library on windows vci_add_library (OpenMeshCore STATIC ${sources} ${headers}) - - target_include_directories(OpenMeshCoreStatic PUBLIC - $ - $) endif() + target_include_directories(OpenMeshCore PUBLIC + $ + $) + + else () vci_add_library (OpenMeshCore SHAREDANDSTATIC ${sources} ${headers}) diff --git a/src/OpenMesh/Tools/CMakeLists.txt b/src/OpenMesh/Tools/CMakeLists.txt index 91e3b692..1c90491e 100644 --- a/src/OpenMesh/Tools/CMakeLists.txt +++ b/src/OpenMesh/Tools/CMakeLists.txt @@ -106,19 +106,15 @@ if (WIN32) if ( OPENMESH_BUILD_SHARED ) add_definitions( -DOPENMESHDLL -DBUILDOPENMESHDLL) vci_add_library (OpenMeshTools SHARED ${sources} ${headers}) - - target_include_directories(OpenMeshTools PUBLIC - $ - $) else() # OpenMesh has no dll exports so we have to build a static library on windows vci_add_library (OpenMeshTools STATIC ${sources} ${headers}) - - target_include_directories(OpenMeshToolsStatic PUBLIC - $ - $) endif() + target_include_directories(OpenMeshTools PUBLIC + $ + $) + else () vci_add_library (OpenMeshTools SHAREDANDSTATIC ${sources} ${headers}) From 3f2b96d73e38ffc86e07f5ebcec1502a9ede4cf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 10:07:08 +0100 Subject: [PATCH 07/41] Removed extra include directive --- src/OpenMesh/Core/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/OpenMesh/Core/CMakeLists.txt b/src/OpenMesh/Core/CMakeLists.txt index 46f0beb6..832e2ff0 100644 --- a/src/OpenMesh/Core/CMakeLists.txt +++ b/src/OpenMesh/Core/CMakeLists.txt @@ -259,10 +259,6 @@ install(DIRECTORY IO/ PATTERN "Debian*" EXCLUDE ) endif () -target_include_directories(OpenMeshCore PUBLIC - $ - $) - install(TARGETS OpenMeshCore EXPORT OpenMeshConfig ARCHIVE DESTINATION ${VCI_PROJECT_LIBDIR} LIBRARY DESTINATION ${VCI_PROJECT_LIBDIR} From 049f2834f6d112d2ac8ba4f25dc7379747ee7047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 10:07:25 +0100 Subject: [PATCH 08/41] Cosmetics --- src/OpenMesh/Tools/CMakeLists.txt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/OpenMesh/Tools/CMakeLists.txt b/src/OpenMesh/Tools/CMakeLists.txt index 1c90491e..08baecbd 100644 --- a/src/OpenMesh/Tools/CMakeLists.txt +++ b/src/OpenMesh/Tools/CMakeLists.txt @@ -186,9 +186,8 @@ else() endif() if (NOT APPLE AND NOT ${OPENMESH_NO_INSTALL_HEADERS}) - -# Install Header Files -install(DIRECTORY . + # Install Header Files + install(DIRECTORY . DESTINATION include/OpenMesh/Tools FILES_MATCHING PATTERN "*.hh" @@ -198,9 +197,8 @@ install(DIRECTORY . PATTERN "Templates" EXCLUDE PATTERN "Debian*" EXCLUDE) -#install the config file -install(FILES Utils/getopt.h DESTINATION include/OpenMesh/Tools/Utils) - + #install the config file + install(FILES Utils/getopt.h DESTINATION include/OpenMesh/Tools/Utils) endif () install(TARGETS OpenMeshTools EXPORT OpenMeshConfig From 7ccfc169a0d02bfab2ec0d19b75b4d46af59fd7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 10:07:39 +0100 Subject: [PATCH 09/41] Updated changelog --- Doc/changelog.docu | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index 857f45d4..ec0f2ac3 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -8,6 +8,11 @@ 9.1 (?/?/?) +Build System +
    +
  • Removed globbing for Core and Tools library include and source files
  • +
  • Removed global includes from App builds
  • +
From 4a9fb88bfdc8071fba648f1208423f12d1814011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 10:10:19 +0100 Subject: [PATCH 10/41] Removed unnecessary include directories --- src/Unittests/CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Unittests/CMakeLists.txt b/src/Unittests/CMakeLists.txt index 0c2a61d4..d6dcebaf 100644 --- a/src/Unittests/CMakeLists.txt +++ b/src/Unittests/CMakeLists.txt @@ -1,10 +1,5 @@ include (VCICommon) -include_directories ( - .. - ${CMAKE_CURRENT_SOURCE_DIR} -) - if ( NOT DEFINED OPENMESH_BUILD_UNIT_TESTS) set( OPENMESH_BUILD_UNIT_TESTS false CACHE BOOL "Enable or disable unit test builds in OpenMesh." ) endif() From 878474a0aa7de58b1bf7b151bfb2e6a207a59c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 10:14:10 +0100 Subject: [PATCH 11/41] Removed globbing for unittest files --- src/Unittests/CMakeLists.txt | 64 +++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/src/Unittests/CMakeLists.txt b/src/Unittests/CMakeLists.txt index d6dcebaf..133fd41c 100644 --- a/src/Unittests/CMakeLists.txt +++ b/src/Unittests/CMakeLists.txt @@ -1,5 +1,68 @@ include (VCICommon) +set( UNITTEST_SRC +unittests.cc +unittests_add_face.cc +unittests_boundary.cc +unittests_centroid_calculations.cc +unittests_convert_meshes.cc +unittests_cpp_11_features.cc +unittests_decimater.cc +unittests_delete_face.cc +unittests_eigen3_type.cc +unittests_faceless_mesh.cc +unittests_mc_decimater.cc +unittests_mesh_cast.cc +unittests_mesh_dual.cc +unittests_mesh_type.cc +unittests_mixed_decimater.cc +unittests_normal_calculations.cc +unittests_polymesh_collapse.cc +unittests_polymesh_vec2i.cc +unittests_property.cc +unittests_propertymanager.cc +unittests_randomNumberGenerator.cc +unittests_read_write_OBJ.cc +unittests_read_write_OFF.cc +unittests_read_write_OM.cc +unittests_read_write_PLY.cc +unittests_read_write_STL.cc +unittests_set_positions_directly.cc +unittests_smart_handles.cc +unittests_smart_ranges.cc +unittests_smarttagger.cc +unittests_smoother.cc +unittests_split_copy.cc +unittests_split_edge_copy.cc +unittests_sr_binary.cc +unittests_stripifier.cc +unittests_subdivider_adaptive.cc +unittests_subdivider_uniform.cc +unittests_trimesh_circulator_current_halfedge_handle_replacement.cc +unittests_trimesh_circulator_face_edge.cc +unittests_trimesh_circulator_face_face.cc +unittests_trimesh_circulator_face_halfedge.cc +unittests_trimesh_circulator_face_vertex.cc +unittests_trimesh_circulator_halfedge_loop.cc +unittests_trimesh_circulator_vertex_edge.cc +unittests_trimesh_circulator_vertex_face.cc +unittests_trimesh_circulator_vertex_ihalfedge.cc +unittests_trimesh_circulator_vertex_ohalfedge.cc +unittests_trimesh_circulator_vertex_vertex.cc +unittests_trimesh_collapse.cc +unittests_trimesh_garbage_collection.cc +unittests_trimesh_iterators.cc +unittests_trimesh_others.cc +unittests_trimesh_ranges.cc +unittests_trimesh_split.cc +unittests_trimesh_vec2i.cc +unittests_tutorials.cc +unittests_vdpm.cc +unittests_vector_type.cc +) + + + if ( NOT DEFINED OPENMESH_BUILD_UNIT_TESTS) set( OPENMESH_BUILD_UNIT_TESTS false CACHE BOOL "Enable or disable unit test builds in OpenMesh." ) endif() @@ -30,7 +93,6 @@ if ( OPENMESH_BUILD_UNIT_TESTS ) endif() # Create new target named unittests_hexmeshing - FILE(GLOB UNITTEST_SRC *.cc) # Create unittest executable vci_add_executable(unittests ${UNITTEST_SRC}) vci_add_executable(unittests_customvec ${UNITTEST_SRC}) From 9202308922ae4c9047d4a2a63778d161c2e747e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 13:05:55 +0100 Subject: [PATCH 12/41] Moved inl file to hh --- src/OpenMesh/Core/CMakeLists.txt | 14 +------------- src/OpenMesh/Core/IO/SR_binary_spec.hh | 2 +- ...tor_of_bool.inl => SR_binary_vector_of_bool.hh} | 0 3 files changed, 2 insertions(+), 14 deletions(-) rename src/OpenMesh/Core/IO/{SR_binary_vector_of_bool.inl => SR_binary_vector_of_bool.hh} (100%) diff --git a/src/OpenMesh/Core/CMakeLists.txt b/src/OpenMesh/Core/CMakeLists.txt index 832e2ff0..ab741c44 100644 --- a/src/OpenMesh/Core/CMakeLists.txt +++ b/src/OpenMesh/Core/CMakeLists.txt @@ -22,6 +22,7 @@ IO/OMFormatT_impl.hh IO/Options.hh IO/SR_binary.hh IO/SR_binary_spec.hh +IO/SR_binary_vector_of_bool.hh IO/SR_rbo.hh IO/SR_store.hh IO/SR_types.hh @@ -244,19 +245,6 @@ install(DIRECTORY . #install the config file install(FILES System/config.h DESTINATION include/OpenMesh/Core/System) -#install inlined Files from IO -install(DIRECTORY IO/ - DESTINATION include/OpenMesh/Core/IO - FILES_MATCHING - PATTERN "*.inl" - PATTERN "CVS" EXCLUDE - PATTERN ".svn" EXCLUDE - PATTERN "reader" EXCLUDE - PATTERN "writer" EXCLUDE - PATTERN "importer" EXCLUDE - PATTERN "exporter" EXCLUDE - PATTERN "tmp" EXCLUDE - PATTERN "Debian*" EXCLUDE ) endif () install(TARGETS OpenMeshCore EXPORT OpenMeshConfig diff --git a/src/OpenMesh/Core/IO/SR_binary_spec.hh b/src/OpenMesh/Core/IO/SR_binary_spec.hh index 2e8a34c0..014c11fc 100644 --- a/src/OpenMesh/Core/IO/SR_binary_spec.hh +++ b/src/OpenMesh/Core/IO/SR_binary_spec.hh @@ -424,7 +424,7 @@ struct binary< std::vector< T >, typename std::enable_if +#include // ---------------------------------------------------------------------------- diff --git a/src/OpenMesh/Core/IO/SR_binary_vector_of_bool.inl b/src/OpenMesh/Core/IO/SR_binary_vector_of_bool.hh similarity index 100% rename from src/OpenMesh/Core/IO/SR_binary_vector_of_bool.inl rename to src/OpenMesh/Core/IO/SR_binary_vector_of_bool.hh From cd26cd20e0a388ee70a69c266ce6451071d5180c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 13:25:25 +0100 Subject: [PATCH 13/41] Removed duplicate cmake code Prefer GLVND OpenGL --- src/OpenMesh/Apps/CMakeLists.txt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/OpenMesh/Apps/CMakeLists.txt b/src/OpenMesh/Apps/CMakeLists.txt index ebf10ff9..59dca6ae 100644 --- a/src/OpenMesh/Apps/CMakeLists.txt +++ b/src/OpenMesh/Apps/CMakeLists.txt @@ -37,6 +37,8 @@ if ( BUILD_APPS ) endif() + set( OpenGL_GL_PREFERENCE GLVND) + # find needed packages for gui applications find_package (OpenGL) @@ -70,17 +72,12 @@ if ( BUILD_APPS ) # Add ui apps as dependency before fixbundle - if ( WIN32 AND NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles") + # Required on Windows (NOTMINGW) and APPLE + if ( APPLE OR (WIN32 AND NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles") ) # let bundle generation depend on all targets add_dependencies (fixbundle DecimaterGui ProgViewer QtViewer SubdividerGui Synthesizer) endif() - # Add ui apps as dependency before fixbundle - if ( APPLE) - # let bundle generation depend on all targets - add_dependencies (fixbundle DecimaterGui ProgViewer QtViewer SubdividerGui Synthesizer) - endif() - if ( WIN32 ) FILE(GLOB files_install_app_dlls "${CMAKE_BINARY_DIR}/Build/*.dll" ) INSTALL(FILES ${files_install_app_dlls} DESTINATION . ) From 6e17383b4942a24aa53c2da6f155d1e4425d19ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Wed, 23 Feb 2022 13:27:46 +0100 Subject: [PATCH 14/41] Removed some duplicate code --- src/OpenMesh/Apps/CMakeLists.txt | 13 ++----------- src/OpenMesh/Core/CMakeLists.txt | 10 +--------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/OpenMesh/Apps/CMakeLists.txt b/src/OpenMesh/Apps/CMakeLists.txt index 59dca6ae..787a1734 100644 --- a/src/OpenMesh/Apps/CMakeLists.txt +++ b/src/OpenMesh/Apps/CMakeLists.txt @@ -23,20 +23,11 @@ if ( BUILD_APPS ) add_subdirectory (VDProgMesh/Analyzer) # Add non ui apps as dependency before fixbundle - if ( WIN32 ) - if ( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" ) - # let bundle generation depend on all targets + if ( APPLE OR (WIN32 AND NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" ) ) + # let bundle generation depend on all targets add_dependencies (fixbundle commandlineDecimater Dualizer mconvert Smoothing commandlineAdaptiveSubdivider commandlineSubdivider mkbalancedpm Analyzer ) - endif() endif() - # Add non ui apps as dependency before fixbundle - if ( APPLE) - # let bundle generation depend on all targets - add_dependencies (fixbundle commandlineDecimater Dualizer mconvert Smoothing commandlineAdaptiveSubdivider commandlineSubdivider mkbalancedpm Analyzer ) - endif() - - set( OpenGL_GL_PREFERENCE GLVND) # find needed packages for gui applications diff --git a/src/OpenMesh/Core/CMakeLists.txt b/src/OpenMesh/Core/CMakeLists.txt index ab741c44..48f55474 100644 --- a/src/OpenMesh/Core/CMakeLists.txt +++ b/src/OpenMesh/Core/CMakeLists.txt @@ -172,18 +172,10 @@ endif () # Add core as dependency before fixbundle if ( (${CMAKE_PROJECT_NAME} MATCHES "OpenMesh") AND BUILD_APPS ) - if ( WIN32 ) - if ( NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" ) + if ( APPLE OR (WIN32 AND NOT "${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles" ) ) add_dependencies (fixbundle OpenMeshCore) - endif() endif() - # Add core as dependency before fixbundle - if ( APPLE ) - # let bundle generation depend on targets - add_dependencies (fixbundle OpenMeshCore) - endif () - endif() # if we build debug and release in the same dir, we want to install both! From 7ff3a839f361bb533348148a6c63260a2c05c139 Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 24 Feb 2022 15:30:46 +0100 Subject: [PATCH 15/41] Updated cmake-library --- cmake-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-library b/cmake-library index 44f67614..4fb3a241 160000 --- a/cmake-library +++ b/cmake-library @@ -1 +1 @@ -Subproject commit 44f676147ec1f4671a99cbd0d29f9090878433f9 +Subproject commit 4fb3a2414f350f4f4a278dc8e9d01a1bb0b2f70d From 825fb041e729baad352d64c368e3c399d84c6c7c Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 25 Feb 2022 09:26:00 +0100 Subject: [PATCH 16/41] cmake-library update --- cmake-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-library b/cmake-library index 4fb3a241..2f76d639 160000 --- a/cmake-library +++ b/cmake-library @@ -1 +1 @@ -Subproject commit 4fb3a2414f350f4f4a278dc8e9d01a1bb0b2f70d +Subproject commit 2f76d6392feed1abe0d21627ac715a2ec7b96a41 From dbcb0bf50cff107ffacdaed25aca0f159d934967 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 25 Feb 2022 09:39:48 +0100 Subject: [PATCH 17/41] Updated cmake-library --- cmake-library | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake-library b/cmake-library index 2f76d639..9e180cdb 160000 --- a/cmake-library +++ b/cmake-library @@ -1 +1 @@ -Subproject commit 2f76d6392feed1abe0d21627ac715a2ec7b96a41 +Subproject commit 9e180cdb4df1d8370ccd9aeee1499709441dbdd1 From 7e670896a6fd81dac6eb52e8fff27f36fefa1086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 7 Mar 2022 10:30:52 +0100 Subject: [PATCH 18/41] - added param 'texture_file' to the Options class, it specifies the path to the texture file - added param 'material_file_extension' to the Options class, it specifies the material file suffix, default is ".mat" as it was before, we needed it becuase Blender expects ".mtl" - removed default and copy constructor and destructor as well as assignment operator, because these are not necessary here, see https://en.cppreference.com/w/cpp/language/rule_of_three (Thanks to Philipp Auersperg-Castell for the patch ) --- Doc/changelog.docu | 6 ++++ src/OpenMesh/Core/IO/Options.hh | 35 +++++++----------------- src/OpenMesh/Core/IO/writer/OBJWriter.cc | 17 ++++++++---- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index ec0f2ac3..5011ac96 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -8,6 +8,12 @@ 9.1 (?/?/?) +IO +
    +
  • OBJ writer: Added param 'texture_file' to the Options class, it specifies the path to the texture file (Thanks to Philipp Auersperg-Castell for the patch)
  • +
  • OBJ writer: added param 'material_file_extension' to the Options class, it specifies the material file suffix, default is ".mat" as it was before. (Thanks to Philipp Auersperg-Castell for the patch)
  • +
+ Build System
  • Removed globbing for Core and Tools library include and source files
  • diff --git a/src/OpenMesh/Core/IO/Options.hh b/src/OpenMesh/Core/IO/Options.hh index 3b5967a2..a459e3e0 100644 --- a/src/OpenMesh/Core/IO/Options.hh +++ b/src/OpenMesh/Core/IO/Options.hh @@ -115,31 +115,24 @@ public: TexCoordST = 0x8000 ///< Write texture coordinates as ST instead of UV }; + /// Texture filename. This will be written as + /// map_Kd in the OBJ writer into the material file. + std::string texture_file ; + + /// Filename extension for material files when writing OBJs + /// default is currently .mat + std::string material_file_extension; + public: /// Default constructor - Options() : flags_( Default ) + Options() : texture_file(""), material_file_extension(".mat"), flags_( Default ) { } - - /// Copy constructor - Options(const Options& _opt) : flags_(_opt.flags_) - { } - - - /// Initializing constructor setting a single option - Options(Flag _flg) : flags_( _flg) - { } - - - /// Initializing constructor setting multiple options + /// Initializing constructor setting multiple options Options(const value_type _flgs) : flags_( _flgs) { } - - ~Options() - { } - /// Restore state after default constructor. void cleanup(void) { flags_ = Default; } @@ -154,17 +147,9 @@ public: public: - //@{ - /// Copy options defined in _rhs. - - Options& operator = ( const Options& _rhs ) - { flags_ = _rhs.flags_; return *this; } - Options& operator = ( const value_type _rhs ) { flags_ = _rhs; return *this; } - //@} - //@{ /// Unset options defined in _rhs. diff --git a/src/OpenMesh/Core/IO/writer/OBJWriter.cc b/src/OpenMesh/Core/IO/writer/OBJWriter.cc index da706f99..145df5dc 100644 --- a/src/OpenMesh/Core/IO/writer/OBJWriter.cc +++ b/src/OpenMesh/Core/IO/writer/OBJWriter.cc @@ -195,6 +195,9 @@ writeMaterial(std::ostream& _out, BaseExporter& _be, Options _opt) const _out << "illum 1" << '\n'; } + if (_opt.texture_file != "") { + _out << "map_Kd " << _opt.texture_file << std::endl; + } return true; } @@ -219,8 +222,10 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec _out.precision(_precision); // check exporter features - if (!check( _be, _opt)) - return false; + if (!check( _be, _opt)) { + return false; + } + // No binary mode for OBJ if ( _opt.check(Options::Binary) ) { @@ -240,9 +245,9 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec } //create material file if needed - if ( _opt.check(Options::FaceColor) ){ + if ( _opt.check(Options::FaceColor) || _opt.texture_file != ""){ - std::string matFile = path_ + objName_ + ".mat"; + std::string matFile = path_ + objName_ + _opt.material_file_extension; std::fstream matStream(matFile.c_str(), std::ios_base::out ); @@ -262,8 +267,8 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec _out << _be.n_faces() << " faces" << '\n'; // material file - if (useMatrial && _opt.check(Options::FaceColor) ) - _out << "mtllib " << objName_ << ".mat" << '\n'; + if ( (useMatrial && _opt.check(Options::FaceColor)) || _opt.texture_file != "") + _out << "mtllib " << objName_ << _opt.material_file_extension << '\n'; std::map texMap; //collect Texturevertices from halfedges From cd1db1184ccb700e7ef4d66653f9355bc8b77898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 7 Mar 2022 13:23:01 +0100 Subject: [PATCH 19/41] Relaxed cppcheck --- CI/ci-cppcheck.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CI/ci-cppcheck.sh b/CI/ci-cppcheck.sh index 7e73ab35..df127aaf 100755 --- a/CI/ci-cppcheck.sh +++ b/CI/ci-cppcheck.sh @@ -32,7 +32,7 @@ echo "CPPCHECK Summary" echo "==============================================================================" echo -e "${NC}" -MAX_COUNT=23 +MAX_COUNT=33 if [ $COUNT -gt $MAX_COUNT ]; then echo -e ${WARNING} From b2bb6a32a75be3b362a0fefc7a4a6b1b5f92e547 Mon Sep 17 00:00:00 2001 From: Martin Heistermann Date: Wed, 6 Apr 2022 17:16:59 +0200 Subject: [PATCH 20/41] Fix some "unused parameter" warnings. --- src/OpenMesh/Core/IO/SR_binary_spec.hh | 2 +- src/OpenMesh/Core/IO/SR_binary_vector_of_bool.hh | 2 +- src/OpenMesh/Core/IO/writer/PLYWriter.hh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenMesh/Core/IO/SR_binary_spec.hh b/src/OpenMesh/Core/IO/SR_binary_spec.hh index 014c11fc..4d2b3bf3 100644 --- a/src/OpenMesh/Core/IO/SR_binary_spec.hh +++ b/src/OpenMesh/Core/IO/SR_binary_spec.hh @@ -330,7 +330,7 @@ struct binary< std::vector< T >, typename std::enable_if::is_streamable; - static size_t size_of(bool _store_size = true) + static size_t size_of(bool /*_store_size*/ = true) { return IO::UnknownSize; } static size_t size_of(const value_type& _v, bool _store_size = true) diff --git a/src/OpenMesh/Core/IO/SR_binary_vector_of_bool.hh b/src/OpenMesh/Core/IO/SR_binary_vector_of_bool.hh index 2896bb47..70e06e3f 100644 --- a/src/OpenMesh/Core/IO/SR_binary_vector_of_bool.hh +++ b/src/OpenMesh/Core/IO/SR_binary_vector_of_bool.hh @@ -6,7 +6,7 @@ template <> struct binary< std::vector > static const bool is_streamable = true; - static size_t size_of(bool _store_size = true) { return UnknownSize; } + static size_t size_of(bool /*_store_size*/ = true) { return UnknownSize; } static size_t size_of(const value_type& _v, bool _store_size = true) { size_t size = _v.size() / 8 + ((_v.size() % 8)!=0); diff --git a/src/OpenMesh/Core/IO/writer/PLYWriter.hh b/src/OpenMesh/Core/IO/writer/PLYWriter.hh index c6fd0730..af190c13 100644 --- a/src/OpenMesh/Core/IO/writer/PLYWriter.hh +++ b/src/OpenMesh/Core/IO/writer/PLYWriter.hh @@ -135,7 +135,7 @@ private: writeValue(_type, _out, _value); } template - void writeProxy(ValueType _type, std::ostream& _out, T _value, OpenMesh::GenProg::FalseType /*_binary*/) const + void writeProxy(ValueType /*_type*/, std::ostream& _out, T _value, OpenMesh::GenProg::FalseType /*_binary*/) const { _out << " " << _value; } From ef337959b84ccb2f650877f16ebf1e78f7131811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 11 Apr 2022 10:12:46 +0200 Subject: [PATCH 21/41] Update debian package generation --- .gitignore | 10 +++++++++- .gitlab-ci.yml | 13 +++++++++++++ CI/gitlab-ci/ci-master.yml | 13 +++++++++++++ debian/changelog | 6 ++++++ debian/compat | 2 +- debian/control | 6 +++--- debian/rules | 8 +++----- 7 files changed, 48 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index d0f731ed..7aca3f2a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,12 @@ build* # ignore mac temporal files .DS_Store .idea -cmake-build*/ \ No newline at end of file +cmake-build*/ +*.substvars +debian/tmp +debian/files +debian/stamp* +debian/stamp* +debian/.debhelper +debian/libopenmesh* +obj-x86_64-linux-gnu diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 871ee8a8..a23585cd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1034,4 +1034,17 @@ trigger_openmesh-python-rebuild: script: - "curl -X POST -F token=b63ed804ada51d7d1ffe5d6ea0dfa2 -F ref=track-OM-master https://www.graphics.rwth-aachen.de:9000/api/v4/projects/1024/trigger/pipeline" +Debian: + stage: deploy + only: + - master + script: dpkg-buildpackage + tags: + - Linux + - stretch + dependencies: [] + artifacts: + paths: + - libopenmesh*.deb + diff --git a/CI/gitlab-ci/ci-master.yml b/CI/gitlab-ci/ci-master.yml index d107ca40..388e7571 100644 --- a/CI/gitlab-ci/ci-master.yml +++ b/CI/gitlab-ci/ci-master.yml @@ -45,3 +45,16 @@ trigger_openmesh-python-rebuild: script: - "curl -X POST -F token=b63ed804ada51d7d1ffe5d6ea0dfa2 -F ref=track-OM-master https://www.graphics.rwth-aachen.de:9000/api/v4/projects/1024/trigger/pipeline" +Debian: + stage: deploy + only: + - master + script: dpkg-buildpackage + tags: + - Linux + - stretch + dependencies: [] + artifacts: + paths: + - libopenmesh*.deb + diff --git a/debian/changelog b/debian/changelog index 0dd1d85a..0512ff16 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +openmesh (9.1) bullseye; urgency=medium + + * New uppstream version + + -- Jan Moebius Mon, 11 Apr 2022 09:47:33 +0200 + openmesh (2.0-0~ppa1~maverick1) maverick; urgency=low * First maverick version of the official openmesh v2 release. diff --git a/debian/compat b/debian/compat index 7f8f011e..f599e28b 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +10 diff --git a/debian/control b/debian/control index 3e08a5e6..b8e73ddf 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: openmesh Section: libs Priority: optional Maintainer: Jean Pierre Charalambos -Build-Depends: cdbs, debhelper (>= 7), cmake, libqt4-dev, libqt4-opengl-dev, freeglut3-dev, libfreetype6-dev, libgomp1, doxygen +Build-Depends: cdbs, debhelper (>= 7), cmake, libqt5opengl5-dev, freeglut3-dev, libfreetype6-dev, libgomp1, doxygen Standards-Version: 3.9.1 Homepage: http://www.openmesh.org @@ -23,8 +23,8 @@ Description: OpenMesh is a generic and efficient data structure for representing Package: libopenmesh-dev Section: libdevel Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libopenmesh (= ${binary:Version}), libqt4-dev, libqt4-opengl-dev, freeglut3-dev, libfreetype6-dev -Suggests: qt4-designer(>= 4.5), qt4-dev-tools (>= 4.5), libopenmesh-doc, libopenmesh-apps +Depends: ${shlibs:Depends}, ${misc:Depends}, libopenmesh (= ${binary:Version}), libqt5opengl5-dev, freeglut3-dev, libfreetype6-dev +Suggests: libopenmesh-doc, libopenmesh-apps Description: OpenMesh is a generic and efficient data structure for representing and manipulating polygonal meshes. OpenMesh provides the following features: . diff --git a/debian/rules b/debian/rules index 4bc4bb6f..0f839415 100755 --- a/debian/rules +++ b/debian/rules @@ -9,13 +9,11 @@ build/libopenmesh-doc:: cp -r $(DEB_BUILDDIR)/Build/share/OpenMesh/Doc/html debian/tmp/usr/share/doc/OpenMesh install/libopenmesh:: - ln -sf libOpenMeshCore.so.2.0 debian/tmp/usr/lib/OpenMesh/libOpenMeshCore.so.2 - ln -sf libOpenMeshTools.so.2.0 debian/tmp/usr/lib/OpenMesh/libOpenMeshTools.so.2 - dh_install -plibopenmesh debian/tmp/usr/lib/OpenMesh/lib*.so.* /usr/lib/ + dh_install -plibopenmesh debian/tmp/usr/lib/lib*.so.* /usr/lib/ install/libopenmesh-dev:: - dh_install -plibopenmesh-dev debian/tmp/usr/lib/OpenMesh/lib*.so /usr/lib/ - dh_install -plibopenmesh-dev debian/tmp/usr/lib/OpenMesh/lib*.a /usr/lib/ + dh_install -plibopenmesh-dev debian/tmp/usr/lib/lib*.so /usr/lib/ + dh_install -plibopenmesh-dev debian/tmp/usr/lib/lib*.a /usr/lib/ dh_install -plibopenmesh-dev --autodest debian/tmp/usr/include/OpenMesh install/libopenmesh-apps:: From 1a0093c68fbf9d8e4a63b13d2802347ccb981f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 11 Apr 2022 12:04:20 +0200 Subject: [PATCH 22/41] Don't sign debian packages --- .gitlab-ci.yml | 2 +- CI/gitlab-ci/ci-master.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a23585cd..17a6beef 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1038,7 +1038,7 @@ Debian: stage: deploy only: - master - script: dpkg-buildpackage + script: dpkg-buildpackage --no-sign tags: - Linux - stretch diff --git a/CI/gitlab-ci/ci-master.yml b/CI/gitlab-ci/ci-master.yml index 388e7571..2d80275a 100644 --- a/CI/gitlab-ci/ci-master.yml +++ b/CI/gitlab-ci/ci-master.yml @@ -49,7 +49,7 @@ Debian: stage: deploy only: - master - script: dpkg-buildpackage + script: dpkg-buildpackage --no-sign tags: - Linux - stretch From 1e4f44bd6be790cdaaf4e514113709030bb7af51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 11 Apr 2022 12:04:46 +0200 Subject: [PATCH 23/41] Removed the cpp11 builds for qt 5.15.1 --- .gitlab-ci.yml | 224 ----------------------------------------- CI/gitlab-ci/linux.yml | 2 - 2 files changed, 226 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 17a6beef..9202b292 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -257,230 +257,6 @@ test-release-clang-cpp11-qt6.1.2: -#----------- Job Informations: -# Type: Build: debug -# OS: Linux -# Compiler: gcc -# Language: cpp11 -# QT Version: qt5.15.1 - -build-debug-gcc-cpp11-qt5.15.1: - stage: build - script: "CI/ci-linux-build.sh" - #image: gitlab.vci.rwth-aachen.de:4567/docker/docker/docker-openmesh-container - tags: - - Linux - - stretch - variables: - COMPILER: "gcc" - LANGUAGE: "cpp11" - BUILD_TYPE: "debug" - QTVERSION: "qt5.15.1" - IWYU: "no" - VECTORCHECKS: "yes" - artifacts: - paths: - - build-gcc-cpp11-qt5.15.1-debug-vectorchecks/ - -#----------- Job Informations: -# Type: Test: debug -# OS: Linux -# Compiler: gcc -# Language: cpp11 - -test-debug-gcc-cpp11-qt5.15.1: - stage: test - script: "CI/ci-linux-test.sh" - #image: gitlab.vci.rwth-aachen.de:4567/docker/docker/docker-openmesh-container - tags: - - Linux - - stretch - - MultiThreads - variables: - COMPILER: "gcc" - LANGUAGE: "cpp11" - BUILD_TYPE: "debug" - QTVERSION: "qt5.15.1" - IWYU: "no" - VECTORCHECKS: "yes" - dependencies: [build-debug-gcc-cpp11-qt5.15.1] - needs: [build-debug-gcc-cpp11-qt5.15.1] - artifacts: - reports: - junit: - - build-gcc-cpp11-qt5.15.1-debug-vectorchecks/Unittests/report.xml - - build-gcc-cpp11-qt5.15.1-debug-vectorchecks/Unittests/report-customvec.xml - - build-gcc-cpp11-qt5.15.1-debug-vectorchecks/Unittests/report-doublevec.xml - - -#----------- Job Informations: -# Type: Build: release -# OS: Linux -# Compiler: gcc -# Language: cpp11 -# QT Version: qt5.15.1 - -build-release-gcc-cpp11-qt5.15.1: - stage: build - script: "CI/ci-linux-build.sh" - #image: gitlab.vci.rwth-aachen.de:4567/docker/docker/docker-openmesh-container - tags: - - Linux - - stretch - variables: - COMPILER: "gcc" - LANGUAGE: "cpp11" - BUILD_TYPE: "release" - QTVERSION: "qt5.15.1" - IWYU: "no" - VECTORCHECKS: "yes" - artifacts: - paths: - - build-gcc-cpp11-qt5.15.1-release-vectorchecks/ - -#----------- Job Informations: -# Type: Test: release -# OS: Linux -# Compiler: gcc -# Language: cpp11 - -test-release-gcc-cpp11-qt5.15.1: - stage: test - script: "CI/ci-linux-test.sh" - #image: gitlab.vci.rwth-aachen.de:4567/docker/docker/docker-openmesh-container - tags: - - Linux - - stretch - - MultiThreads - variables: - COMPILER: "gcc" - LANGUAGE: "cpp11" - BUILD_TYPE: "release" - QTVERSION: "qt5.15.1" - IWYU: "no" - VECTORCHECKS: "yes" - dependencies: [build-release-gcc-cpp11-qt5.15.1] - needs: [build-release-gcc-cpp11-qt5.15.1] - artifacts: - reports: - junit: - - build-gcc-cpp11-qt5.15.1-release-vectorchecks/Unittests/report.xml - - build-gcc-cpp11-qt5.15.1-release-vectorchecks/Unittests/report-customvec.xml - - build-gcc-cpp11-qt5.15.1-release-vectorchecks/Unittests/report-doublevec.xml - - -#----------- Job Informations: -# Type: Build: debug -# OS: Linux -# Compiler: clang -# Language: cpp11 -# QT Version: qt5.15.1 - -build-debug-clang-cpp11-qt5.15.1: - stage: build - script: "CI/ci-linux-build.sh" - #image: gitlab.vci.rwth-aachen.de:4567/docker/docker/docker-openmesh-container - tags: - - Linux - - stretch - variables: - COMPILER: "clang" - LANGUAGE: "cpp11" - BUILD_TYPE: "debug" - QTVERSION: "qt5.15.1" - IWYU: "no" - VECTORCHECKS: "yes" - artifacts: - paths: - - build-clang-cpp11-qt5.15.1-debug-vectorchecks/ - -#----------- Job Informations: -# Type: Test: debug -# OS: Linux -# Compiler: clang -# Language: cpp11 - -test-debug-clang-cpp11-qt5.15.1: - stage: test - script: "CI/ci-linux-test.sh" - #image: gitlab.vci.rwth-aachen.de:4567/docker/docker/docker-openmesh-container - tags: - - Linux - - stretch - - MultiThreads - variables: - COMPILER: "clang" - LANGUAGE: "cpp11" - BUILD_TYPE: "debug" - QTVERSION: "qt5.15.1" - IWYU: "no" - VECTORCHECKS: "yes" - dependencies: [build-debug-clang-cpp11-qt5.15.1] - needs: [build-debug-clang-cpp11-qt5.15.1] - artifacts: - reports: - junit: - - build-clang-cpp11-qt5.15.1-debug-vectorchecks/Unittests/report.xml - - build-clang-cpp11-qt5.15.1-debug-vectorchecks/Unittests/report-customvec.xml - - build-clang-cpp11-qt5.15.1-debug-vectorchecks/Unittests/report-doublevec.xml - - -#----------- Job Informations: -# Type: Build: release -# OS: Linux -# Compiler: clang -# Language: cpp11 -# QT Version: qt5.15.1 - -build-release-clang-cpp11-qt5.15.1: - stage: build - script: "CI/ci-linux-build.sh" - #image: gitlab.vci.rwth-aachen.de:4567/docker/docker/docker-openmesh-container - tags: - - Linux - - stretch - variables: - COMPILER: "clang" - LANGUAGE: "cpp11" - BUILD_TYPE: "release" - QTVERSION: "qt5.15.1" - IWYU: "no" - VECTORCHECKS: "yes" - artifacts: - paths: - - build-clang-cpp11-qt5.15.1-release-vectorchecks/ - -#----------- Job Informations: -# Type: Test: release -# OS: Linux -# Compiler: clang -# Language: cpp11 - -test-release-clang-cpp11-qt5.15.1: - stage: test - script: "CI/ci-linux-test.sh" - #image: gitlab.vci.rwth-aachen.de:4567/docker/docker/docker-openmesh-container - tags: - - Linux - - stretch - - MultiThreads - variables: - COMPILER: "clang" - LANGUAGE: "cpp11" - BUILD_TYPE: "release" - QTVERSION: "qt5.15.1" - IWYU: "no" - VECTORCHECKS: "yes" - dependencies: [build-release-clang-cpp11-qt5.15.1] - needs: [build-release-clang-cpp11-qt5.15.1] - artifacts: - reports: - junit: - - build-clang-cpp11-qt5.15.1-release-vectorchecks/Unittests/report.xml - - build-clang-cpp11-qt5.15.1-release-vectorchecks/Unittests/report-customvec.xml - - build-clang-cpp11-qt5.15.1-release-vectorchecks/Unittests/report-doublevec.xml - - #----------- Job Informations: # Type: Build: debug # OS: Linux diff --git a/CI/gitlab-ci/linux.yml b/CI/gitlab-ci/linux.yml index c1f133e8..abb53a8b 100644 --- a/CI/gitlab-ci/linux.yml +++ b/CI/gitlab-ci/linux.yml @@ -15,8 +15,6 @@ cppcheck: {linux-template-job.yml, COMPILER=gcc, LANGUAGE=cpp11, QT_VERSION=qt6.1.2} {linux-template-job.yml, COMPILER=clang, LANGUAGE=cpp11, QT_VERSION=qt6.1.2} -{linux-template-job.yml, COMPILER=gcc, LANGUAGE=cpp11, QT_VERSION=qt5.15.1} -{linux-template-job.yml, COMPILER=clang, LANGUAGE=cpp11, QT_VERSION=qt5.15.1} {linux-template-job.yml, COMPILER=gcc, LANGUAGE=cpp14, QT_VERSION=qt5.15.1} {linux-template-job.yml, COMPILER=clang, LANGUAGE=cpp14, QT_VERSION=qt5.15.1} From 4a67600686b2b92e8e01858015af401411ffc8ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 11 Apr 2022 13:37:35 +0200 Subject: [PATCH 24/41] Try to get deb artifacts --- .gitlab-ci.yml | 2 +- CI/gitlab-ci/ci-master.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9202b292..d6c9efec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -821,6 +821,6 @@ Debian: dependencies: [] artifacts: paths: - - libopenmesh*.deb + - ../libopenmesh*.deb diff --git a/CI/gitlab-ci/ci-master.yml b/CI/gitlab-ci/ci-master.yml index 2d80275a..07d743b1 100644 --- a/CI/gitlab-ci/ci-master.yml +++ b/CI/gitlab-ci/ci-master.yml @@ -56,5 +56,5 @@ Debian: dependencies: [] artifacts: paths: - - libopenmesh*.deb + - ../libopenmesh*.deb From d50cad4640d6d3657c4d0188fbf27ff38e4bfdca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Mon, 11 Apr 2022 15:23:21 +0200 Subject: [PATCH 25/41] Next deb try --- .gitlab-ci.yml | 9 +++++++-- CI/gitlab-ci/ci-master.yml | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d6c9efec..1e344ca5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -814,13 +814,18 @@ Debian: stage: deploy only: - master - script: dpkg-buildpackage --no-sign + script: + - mkdir .OpenMesh + - cp -r * .OpenMesh + - mv .OpenMesh OpenMesh + - cd OpenMesh + - dpkg-buildpackage --no-sign tags: - Linux - stretch dependencies: [] artifacts: paths: - - ../libopenmesh*.deb + - libopenmesh*.deb diff --git a/CI/gitlab-ci/ci-master.yml b/CI/gitlab-ci/ci-master.yml index 07d743b1..a71c0cce 100644 --- a/CI/gitlab-ci/ci-master.yml +++ b/CI/gitlab-ci/ci-master.yml @@ -49,12 +49,17 @@ Debian: stage: deploy only: - master - script: dpkg-buildpackage --no-sign + script: + - mkdir .OpenMesh + - cp -r * .OpenMesh + - mv .OpenMesh OpenMesh + - cd OpenMesh + - dpkg-buildpackage --no-sign tags: - Linux - stretch dependencies: [] artifacts: paths: - - ../libopenmesh*.deb + - libopenmesh*.deb From 06b945d475cdfdac6f3212d8127528a6dea2b914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 5 May 2022 14:33:15 +0200 Subject: [PATCH 26/41] ModEdgeLength Fix incompatibility with Eigen vector type closes #81 --- .../Tools/Decimater/ModEdgeLengthT_impl.hh | 2 +- src/Unittests/unittests_eigen3_type.cc | 138 ++++++++++++++++++ 2 files changed, 139 insertions(+), 1 deletion(-) diff --git a/src/OpenMesh/Tools/Decimater/ModEdgeLengthT_impl.hh b/src/OpenMesh/Tools/Decimater/ModEdgeLengthT_impl.hh index 6897fe36..60f9fd5f 100644 --- a/src/OpenMesh/Tools/Decimater/ModEdgeLengthT_impl.hh +++ b/src/OpenMesh/Tools/Decimater/ModEdgeLengthT_impl.hh @@ -72,7 +72,7 @@ ModEdgeLengthT::ModEdgeLengthT(MeshT &_mesh, float _edge_length, template float ModEdgeLengthT::collapse_priority(const CollapseInfo& _ci) { - typename Mesh::Scalar sqr_length = (_ci.p0 - _ci.p1).sqrnorm(); + typename Mesh::Scalar sqr_length = sqrnorm(_ci.p0 - _ci.p1); return ( (sqr_length <= sqr_edge_length_) ? sqr_length : float(Base::ILLEGAL_COLLAPSE)); } diff --git a/src/Unittests/unittests_eigen3_type.cc b/src/Unittests/unittests_eigen3_type.cc index 32be1046..1eaf7159 100644 --- a/src/Unittests/unittests_eigen3_type.cc +++ b/src/Unittests/unittests_eigen3_type.cc @@ -9,10 +9,13 @@ #include #include #include +#include #include #include +#include + struct EigenTraits : OpenMesh::DefaultTraits { using Point = Eigen::Vector3d; using Normal = Eigen::Vector3d; @@ -266,6 +269,141 @@ TEST_F(OpenMeshEigenTest, Decimater) { EXPECT_EQ(1052u, mesh_.n_faces()) << "The number of faces after decimation is not correct!"; } +// Test decimation with Eigen as vector type +TEST_F(OpenMeshEigenTest, DecimaterWithEdgeLength) { + mesh_.clear(); + + bool ok = OpenMesh::IO::read_mesh(mesh_, "cube1.off"); + + EXPECT_TRUE(ok); + + EXPECT_EQ(7526u , mesh_.n_vertices()) << "The number of loaded vertices is not correct!"; + EXPECT_EQ(22572u, mesh_.n_edges()) << "The number of loaded edges is not correct!"; + EXPECT_EQ(15048u, mesh_.n_faces()) << "The number of loaded faces is not correct!"; + + mesh_.update_normals(); + + OpenMesh::Decimater::DecimaterT decimater(mesh_); + OpenMesh::Decimater::ModEdgeLengthT::Handle hModEdgeLength; // use a the edge length module + OpenMesh::Decimater::ModNormalDeviationT::Handle hModNormalDeviation; // also use normal deviation module as binary check + decimater.add(hModEdgeLength); + decimater.module(hModEdgeLength).set_edge_length(30.0); + decimater.add(hModNormalDeviation); + + decimater.module(hModNormalDeviation).set_normal_deviation(50); + decimater.initialize(); + size_t removedVertices = decimater.decimate_to(2); + mesh_.garbage_collection(); + + EXPECT_EQ(0u, removedVertices) << "The number of remove vertices is not correct!"; + EXPECT_EQ( 7526u, mesh_.n_vertices()) << "The number of vertices after decimation is not correct!"; + EXPECT_EQ(22572u, mesh_.n_edges()) << "The number of edges after decimation is not correct!"; + EXPECT_EQ(15048u, mesh_.n_faces()) << "The number of faces after decimation is not correct!"; +} + +TEST_F(OpenMeshEigenTest, Subdivider_Sqrt3) { + mesh_.clear(); + + // Add some vertices + Mesh::VertexHandle vhandle[9]; + + vhandle[0] = mesh_.add_vertex(EigenTriMesh::Point(0, 0, 0)); + vhandle[1] = mesh_.add_vertex(EigenTriMesh::Point(0, 1, 0)); + vhandle[2] = mesh_.add_vertex(EigenTriMesh::Point(0, 2, 0)); + vhandle[3] = mesh_.add_vertex(EigenTriMesh::Point(1, 0, 0)); + vhandle[4] = mesh_.add_vertex(EigenTriMesh::Point(1, 1, 0)); + vhandle[5] = mesh_.add_vertex(EigenTriMesh::Point(1, 2, 0)); + vhandle[6] = mesh_.add_vertex(EigenTriMesh::Point(2, 0, 0)); + vhandle[7] = mesh_.add_vertex(EigenTriMesh::Point(2, 1, 0)); + vhandle[8] = mesh_.add_vertex(EigenTriMesh::Point(2, 2, 0)); + + // Add eight faces + std::vector face_vhandles; + + face_vhandles.push_back(vhandle[0]); + face_vhandles.push_back(vhandle[4]); + face_vhandles.push_back(vhandle[3]); + + mesh_.add_face(face_vhandles); + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[0]); + face_vhandles.push_back(vhandle[1]); + face_vhandles.push_back(vhandle[4]); + + mesh_.add_face(face_vhandles); + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[1]); + face_vhandles.push_back(vhandle[2]); + face_vhandles.push_back(vhandle[4]); + + mesh_.add_face(face_vhandles); + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[2]); + face_vhandles.push_back(vhandle[5]); + face_vhandles.push_back(vhandle[4]); + + mesh_.add_face(face_vhandles); + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[3]); + face_vhandles.push_back(vhandle[7]); + face_vhandles.push_back(vhandle[6]); + + mesh_.add_face(face_vhandles); + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[3]); + face_vhandles.push_back(vhandle[4]); + face_vhandles.push_back(vhandle[7]); + + mesh_.add_face(face_vhandles); + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[4]); + face_vhandles.push_back(vhandle[8]); + face_vhandles.push_back(vhandle[7]); + + mesh_.add_face(face_vhandles); + face_vhandles.clear(); + + face_vhandles.push_back(vhandle[4]); + face_vhandles.push_back(vhandle[5]); + face_vhandles.push_back(vhandle[8]); + + mesh_.add_face(face_vhandles); + + // Test setup: + // 6 === 7 === 8 + // | / | / | + // | / | / | + // | / | / | + // 3 === 4 === 5 + // | / | \ | + // | / | \ | + // | / | \ | + // 0 === 1 === 2 + + // Initialize subdivider + OpenMesh::Subdivider::Uniform::Sqrt3T sqrt3; + + // Check setup + EXPECT_EQ(9u, mesh_.n_vertices() ) << "Wrong number of vertices"; + EXPECT_EQ(8u, mesh_.n_faces() ) << "Wrong number of faces"; + + // Execute 3 subdivision steps + sqrt3.attach(mesh_); + sqrt3( 3 ); + sqrt3.detach(); + + // Check setup + EXPECT_EQ(121u, mesh_.n_vertices() ) << "Wrong number of vertices after subdivision with sqrt3"; + EXPECT_EQ(216u, mesh_.n_faces() ) << "Wrong number of faces after subdivision with sqrt3"; +} + + } #endif From f8ca3fa281afcc962cdecf6d92d3c05e33346235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 5 May 2022 14:34:19 +0200 Subject: [PATCH 27/41] Updated chaneglog --- Doc/changelog.docu | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index 5011ac96..b398883e 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -8,6 +8,12 @@ 9.1 (?/?/?) +Tools +
      +
    • Decimater: Fixed incompatibility with Eigen vector type
    • +
    + + IO
    • OBJ writer: Added param 'texture_file' to the Options class, it specifies the path to the texture file (Thanks to Philipp Auersperg-Castell for the patch)
    • From 86acc5fde6c01ce30337df180a10ac32f6891159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 5 May 2022 14:51:43 +0200 Subject: [PATCH 28/41] Removed debug output --- src/Unittests/unittests_trimesh_ranges.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Unittests/unittests_trimesh_ranges.cc b/src/Unittests/unittests_trimesh_ranges.cc index 9a3811bc..e770fcd8 100644 --- a/src/Unittests/unittests_trimesh_ranges.cc +++ b/src/Unittests/unittests_trimesh_ranges.cc @@ -93,6 +93,7 @@ void compare_ranges(RangeT1&& range1, RangeT2&& range2, int offset, bool reverse size_t n = vec1.size(); +/* std::cout << "Vec1 elements: "; for (auto el : vec1) std::cout << el.idx() << " "; @@ -102,6 +103,7 @@ void compare_ranges(RangeT1&& range1, RangeT2&& range2, int offset, bool reverse for (auto el : vec2) std::cout << el.idx() << " "; std::cout << std::endl; +*/ for (size_t i = 0; i < n; ++i) { From 3e19748a1bd44e59e89d093700ff36081570e4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 5 May 2022 15:42:17 +0200 Subject: [PATCH 29/41] More sqrnorm fixes --- src/OpenMesh/Tools/Decimater/ModAspectRatioT_impl.hh | 8 ++++---- src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh | 12 ++++++------ src/OpenMesh/Tools/Decimater/ModRoundnessT.hh | 8 ++++---- .../Tools/Subdivider/Uniform/LongestEdgeT.hh | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/OpenMesh/Tools/Decimater/ModAspectRatioT_impl.hh b/src/OpenMesh/Tools/Decimater/ModAspectRatioT_impl.hh index 0546d540..b18761ff 100644 --- a/src/OpenMesh/Tools/Decimater/ModAspectRatioT_impl.hh +++ b/src/OpenMesh/Tools/Decimater/ModAspectRatioT_impl.hh @@ -68,16 +68,16 @@ typename ModAspectRatioT::Scalar ModAspectRatioT::aspectRatio( Point d1 = _v1 - _v2; // finds the max squared edge length - Scalar l2, maxl2 = d0.sqrnorm(); - if ((l2 = d1.sqrnorm()) > maxl2) + Scalar l2, maxl2 = sqrnorm(d0); + if ((l2 = sqrnorm(d1)) > maxl2) maxl2 = l2; // keep searching for the max squared edge length d1 = _v2 - _v0; - if ((l2 = d1.sqrnorm()) > maxl2) + if ((l2 = sqrnorm(d1)) > maxl2) maxl2 = l2; // squared area of the parallelogram spanned by d0 and d1 - Scalar a2 = (d0 % d1).sqrnorm(); + Scalar a2 = sqrnorm(d0 % d1); // the area of the triangle would be // sqrt(a2)/2 or length * height / 2 diff --git a/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh b/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh index 1fd30e01..fc12d1b6 100644 --- a/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh +++ b/src/OpenMesh/Tools/Decimater/ModHausdorffT_impl.hh @@ -76,7 +76,7 @@ distPointTriangleSquared( const Point& _p, const Point v0v1 = _v1 - _v0; const Point v0v2 = _v2 - _v0; const Point n = v0v1 % v0v2; // not normalized ! - const Scalar d = n.sqrnorm(); + const Scalar d = sqrnorm(n); // Check if the triangle is degenerated @@ -88,9 +88,9 @@ distPointTriangleSquared( const Point& _p, // these are not needed for every point, should still perform // better with many points against one triangle const Point v1v2 = _v2 - _v1; - const Scalar inv_v0v2_2 = static_cast(1.0) / v0v2.sqrnorm(); - const Scalar inv_v0v1_2 = static_cast(1.0) / v0v1.sqrnorm(); - const Scalar inv_v1v2_2 = static_cast(1.0) / v1v2.sqrnorm(); + const Scalar inv_v0v2_2 = static_cast(1.0) / sqrnorm(v0v2); + const Scalar inv_v0v1_2 = static_cast(1.0) / sqrnorm(v0v1); + const Scalar inv_v1v2_2 = static_cast(1.0) / sqrnorm(v1v2); Point v0p = _p - _v0; @@ -177,10 +177,10 @@ distPointTriangleSquared( const Point& _p, } } else { // Calculate the distance to an interior point of the triangle - return ( (_p - n*((n|v0p) * invD)) - _p).sqrnorm(); + return sqrnorm( (_p - n*((n|v0p) * invD)) - _p); } - return (v0p - _p).sqrnorm(); + return sqrnorm(v0p - _p); } diff --git a/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh b/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh index fe58d10c..568083a9 100644 --- a/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh +++ b/src/OpenMesh/Tools/Decimater/ModRoundnessT.hh @@ -287,10 +287,10 @@ public: // specific methods Vec3f vecAB = B-A; // compute squared values to avoid sqrt-computations - value_type aa = (B-C).sqrnorm(); - value_type bb = vecAC.sqrnorm(); - value_type cc = vecAB.sqrnorm(); - value_type AA = cross(vecAC,vecAB).sqrnorm(); // without factor 1/4 **) + value_type aa = sqrnorm(B-C); + value_type bb = sqrnorm(vecAC); + value_type cc = sqrnorm(vecAB); + value_type AA = sqrnorm(cross(vecAC,vecAB)); // without factor 1/4 **) if ( AA < epsilon ) return 0.0; diff --git a/src/OpenMesh/Tools/Subdivider/Uniform/LongestEdgeT.hh b/src/OpenMesh/Tools/Subdivider/Uniform/LongestEdgeT.hh index 2da6d333..d6358ee6 100644 --- a/src/OpenMesh/Tools/Subdivider/Uniform/LongestEdgeT.hh +++ b/src/OpenMesh/Tools/Subdivider/Uniform/LongestEdgeT.hh @@ -160,7 +160,7 @@ protected: const typename MeshType::Point to = _m.point(_m.to_vertex_handle(_m.halfedge_handle(*eit,0))); const typename MeshType::Point from = _m.point(_m.from_vertex_handle(_m.halfedge_handle(*eit,0))); - real_t length = (to - from).sqrnorm(); + real_t length = sqrnorm(to - from); // Only push the edges that need to be split if ( length > max_edge_length_squared_ ) @@ -187,7 +187,7 @@ protected: typename MeshType::EdgeHandle eh = _m.edge_handle(*voh_it); const typename MeshType::Point to = _m.point(_m.to_vertex_handle(*voh_it)); const typename MeshType::Point from = _m.point(_m.from_vertex_handle(*voh_it)); - real_t length = (to - from).sqrnorm(); + real_t length = sqrnorm(to - from); // Only push the edges that need to be split if ( length > max_edge_length_squared_ ) From 7a5aa1835b53f0195df9e339d6864a408dbff81c Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Wed, 25 May 2022 13:55:52 +0200 Subject: [PATCH 30/41] use calc_face_normal if no normal property is available --- src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh b/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh index c98f2bed..96a00cd1 100644 --- a/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh +++ b/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh @@ -401,8 +401,8 @@ calc_halfedge_normal(HalfedgeHandle _heh, const double _feature_angle) const } Normal n(0,0,0); - for(unsigned int i=0; i Date: Thu, 21 Jul 2022 09:14:00 +0200 Subject: [PATCH 31/41] Removed Debian packaging. Will be handled by Debian maintainers from now --- debian/changelog | 52 ------------------------------------- debian/compat | 1 - debian/control | 67 ------------------------------------------------ debian/copyright | 54 -------------------------------------- debian/rules | 23 ----------------- 5 files changed, 197 deletions(-) delete mode 100644 debian/changelog delete mode 100644 debian/compat delete mode 100644 debian/control delete mode 100644 debian/copyright delete mode 100755 debian/rules diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 0512ff16..00000000 --- a/debian/changelog +++ /dev/null @@ -1,52 +0,0 @@ -openmesh (9.1) bullseye; urgency=medium - - * New uppstream version - - -- Jan Moebius Mon, 11 Apr 2022 09:47:33 +0200 - -openmesh (2.0-0~ppa1~maverick1) maverick; urgency=low - - * First maverick version of the official openmesh v2 release. - * Adding libxi-dev, libxmu-dev dependencies to build the apps. - - -- Jean Pierre Charalambos Sun, 02 Jan 2011 10:29:02 -0500 - -openmesh (2.0~svn216-0~ppa3~karmic1) karmic; urgency=low - - * Fix UPSTREAM SVN REPOSITORY in rules. Thanks to Jan Möbius. - - -- Jean Pierre Charalambos Wed, 11 Nov 2009 17:14:27 -0500 - -openmesh (2.0~svn216-0~ppa2~karmic1) karmic; urgency=low - - * Same as first karmic version but this one includes the changelog from Jaunty versions - * Karmic versions fix PACKAGE name in rules from libopenmesh to openmesh - * Karmic versions remove debian directory from svn export - * It remains to fix a SONAMES warning. Maybe it has to see with the upper case letters usage? - - -- Jean Pierre Charalambos Thu, 05 Nov 2009 14:53:02 -0500 - -openmesh (2.0~svn216-0~ppa1~karmic1) karmic; urgency=low - - * Fisrt karmic version - * New upstream SVN snapshot taken from revision 216 - - -- Jean Pierre Charalambos Tue, 03 Nov 2009 21:32:38 -0500 - -openmesh (2.0~svn177-0~ppa2~jaunty1) jaunty; urgency=low - - * Adding the documentation package. - - -- Jean Pierre Charalambos Thu, 25 Jun 2009 20:07:43 -0500 - -openmesh (2.0~svn177-0~ppa1~jaunty1) jaunty; urgency=low - - * New upstream SVN snapshot. - * Splitting the library into libopenmesh and libopenmesh-dev, after - fixes to SONAMES added at this upstream revision. - * No documentation added yet. - * Removing r167 packages from the ppa because they do not conform with - packaging sources directly imported from SVN. According to debian - policies, in this case get-orig-source must be used. - - -- Jean Pierre Charalambos Wed, 24 Jun 2009 22:26:31 -0500 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index f599e28b..00000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -10 diff --git a/debian/control b/debian/control deleted file mode 100644 index b8e73ddf..00000000 --- a/debian/control +++ /dev/null @@ -1,67 +0,0 @@ -Source: openmesh -Section: libs -Priority: optional -Maintainer: Jean Pierre Charalambos -Build-Depends: cdbs, debhelper (>= 7), cmake, libqt5opengl5-dev, freeglut3-dev, libfreetype6-dev, libgomp1, doxygen -Standards-Version: 3.9.1 -Homepage: http://www.openmesh.org - -Package: libopenmesh -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends} -Description: OpenMesh is a generic and efficient data structure for representing - and manipulating polygonal meshes. OpenMesh provides the following features: - . - * Representation of arbitrary polygonal and pure triangle meshes. - * Explicit representation of vertices, halfedges, edges and faces. - * Fast neighborhood access, especially the one-ring neighborhood. - * Highly customizable. - . - This package contains the shared library needed to run programs using - OpenMesh. - -Package: libopenmesh-dev -Section: libdevel -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libopenmesh (= ${binary:Version}), libqt5opengl5-dev, freeglut3-dev, libfreetype6-dev -Suggests: libopenmesh-doc, libopenmesh-apps -Description: OpenMesh is a generic and efficient data structure for representing - and manipulating polygonal meshes. OpenMesh provides the following features: - . - * Representation of arbitrary polygonal and pure triangle meshes. - * Explicit representation of vertices, halfedges, edges and faces. - * Fast neighborhood access, especially the one-ring neighborhood. - * Highly customizable. - . - This package contains all supplementary files (static library and headers) - you need to develop your own programs using the OpenMesh library. - -Package: libopenmesh-apps -Architecture: any -Depends: ${shlibs:Depends}, ${misc:Depends}, libopenmesh (= ${binary:Version}) -Description: OpenMesh is a generic and efficient data structure for representing - and manipulating polygonal meshes. OpenMesh provides the following features: - . - * Representation of arbitrary polygonal and pure triangle meshes. - * Explicit representation of vertices, halfedges, edges and faces. - * Fast neighborhood access, especially the one-ring neighborhood. - * Highly customizable. - . - This package contains some binary applications that show some features of the - OpenMesh library. - -Package: libopenmesh-doc -Architecture: all -Depends: ${misc:Depends} -Section: doc -Suggests: libopenmesh-dev (= ${binary:Version}), libopenmesh-apps (= ${binary:Version}) -Description: OpenMesh is a generic and efficient data structure for representing - and manipulating polygonal meshes. OpenMesh provides the following features: - . - * Representation of arbitrary polygonal and pure triangle meshes. - * Explicit representation of vertices, halfedges, edges and faces. - * Fast neighborhood access, especially the one-ring neighborhood. - * Highly customizable. - . - This package constains the API documentation of the OpenMesh library in HTML - format. diff --git a/debian/copyright b/debian/copyright deleted file mode 100644 index 752af39e..00000000 --- a/debian/copyright +++ /dev/null @@ -1,54 +0,0 @@ -This package was debianized by: - - Jean Pierre Charalambos on Sun, 21 Jun 2009 17:49:34 -0500 - -It was downloaded from: - - http://www.openmesh.org - -Upstream Author: - - Computer Graphics Group, RWTH Aachen - -Copyright: - - Copyright (C) 2001-2015 by Computer Graphics Group, RWTH-Aachen University - -License: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER - OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - -On Debian systems, the complete text of the BSD License can be -found in `/usr/share/common-licenses/BSD '. - -The Debian packaging is: - - Copyright C) 2009, Jean Pierre Charalambos - -and is licensed under the GPL, see above. diff --git a/debian/rules b/debian/rules deleted file mode 100755 index 0f839415..00000000 --- a/debian/rules +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/make -f - -include /usr/share/cdbs/1/rules/debhelper.mk -include /usr/share/cdbs/1/class/cmake.mk - -build/libopenmesh-doc:: - cd $(DEB_BUILDDIR) && $(MAKE) doc - mkdir -p debian/tmp/usr/share/doc/ - cp -r $(DEB_BUILDDIR)/Build/share/OpenMesh/Doc/html debian/tmp/usr/share/doc/OpenMesh - -install/libopenmesh:: - dh_install -plibopenmesh debian/tmp/usr/lib/lib*.so.* /usr/lib/ - -install/libopenmesh-dev:: - dh_install -plibopenmesh-dev debian/tmp/usr/lib/lib*.so /usr/lib/ - dh_install -plibopenmesh-dev debian/tmp/usr/lib/lib*.a /usr/lib/ - dh_install -plibopenmesh-dev --autodest debian/tmp/usr/include/OpenMesh - -install/libopenmesh-apps:: - dh_install -plibopenmesh-apps debian/tmp/usr/bin/* /usr/lib/OpenMesh/Apps - -install/libopenmesh-doc:: - dh_install -plibopenmesh-doc debian/tmp/usr/share/doc/* From f8703479d7d3d1f65f70cad5933d74f8165eaa4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 21 Jul 2022 09:18:19 +0200 Subject: [PATCH 32/41] Notes about the debian packaging added --- Doc/changelog.docu | 1 + README.md | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/Doc/changelog.docu b/Doc/changelog.docu index b398883e..a3c9b1fa 100644 --- a/Doc/changelog.docu +++ b/Doc/changelog.docu @@ -22,6 +22,7 @@ Build System
        +
      • Removed Debian packaging as this will be handled by Debian Maintainers and would interfere with their repo. (Thanks to Dima Kogan for the Packaging!!)
      • Removed globbing for Core and Tools library include and source files
      • Removed global includes from App builds
      diff --git a/README.md b/README.md index b487a6ca..11155d6f 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,11 @@ The following binaries are created from the latest master. They are automaticall [Download (M1) ](https://gitlab.vci.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse?job=macos-M1-cpp14-release) +### Debian + +OpenMesh is about to get into the Debian repository. The debian packaging is available on [salsa.debian.org](https://salsa.debian.org/science-team/openmesh) + + ## Download Sources [ Download Sources](https://gitlab.vci.rwth-aachen.de:9000/OpenMesh/OpenMesh/-/jobs/artifacts/master/browse?job=Sources ) From 8e90455fb8720acfbfc70907402c7e1d4f2d5aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 21 Jul 2022 10:46:49 +0200 Subject: [PATCH 33/41] Don't dd Documentation to source tarball --- CI/ci-source.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/CI/ci-source.sh b/CI/ci-source.sh index e791fddc..53308933 100755 --- a/CI/ci-source.sh +++ b/CI/ci-source.sh @@ -1,14 +1,6 @@ # This script just creates compressed files of OpenMesh sources -# Create Build directory and Build documentation -mkdir build-doc - -cd build-doc -cmake .. -make doc -cd .. - # Extract Version Information VERSION=OpenMesh-$(cat CMakeLists.txt | grep VERSION | grep -v cmake | grep -v CMAKE | tr -d "VERSION=" | tr -d " ") @@ -27,8 +19,6 @@ mv src $VERSION/ mv cmake-library $VERSION/ mv openmesh.pc.in $VERSION/ -mv build-doc/Build/share/OpenMesh/Doc/html/ $VERSION/Documentation - tar cjf $VERSION.tar.bz2 $VERSION tar czf $VERSION.tar.gz $VERSION zip -9 -q -r $VERSION.zip $VERSION From ad9eb8b48d3539bf34721389e932008f5725e4cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20M=C3=B6bius?= Date: Thu, 21 Jul 2022 13:15:28 +0200 Subject: [PATCH 34/41] Disable debian package build --- .gitlab-ci.yml | 34 +++++++++++++++++----------------- CI/gitlab-ci/ci-master.yml | 34 +++++++++++++++++----------------- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e344ca5..4feb3435 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -810,22 +810,22 @@ trigger_openmesh-python-rebuild: script: - "curl -X POST -F token=b63ed804ada51d7d1ffe5d6ea0dfa2 -F ref=track-OM-master https://www.graphics.rwth-aachen.de:9000/api/v4/projects/1024/trigger/pipeline" -Debian: - stage: deploy - only: - - master - script: - - mkdir .OpenMesh - - cp -r * .OpenMesh - - mv .OpenMesh OpenMesh - - cd OpenMesh - - dpkg-buildpackage --no-sign - tags: - - Linux - - stretch - dependencies: [] - artifacts: - paths: - - libopenmesh*.deb +#Debian: +# stage: deploy +# only: +# - master +# script: +# - mkdir .OpenMesh +# - cp -r * .OpenMesh +# - mv .OpenMesh OpenMesh +# - cd OpenMesh +# - dpkg-buildpackage --no-sign +# tags: +# - Linux +# - stretch +# dependencies: [] +# artifacts: +# paths: +# - libopenmesh*.deb diff --git a/CI/gitlab-ci/ci-master.yml b/CI/gitlab-ci/ci-master.yml index a71c0cce..c0e412b6 100644 --- a/CI/gitlab-ci/ci-master.yml +++ b/CI/gitlab-ci/ci-master.yml @@ -45,21 +45,21 @@ trigger_openmesh-python-rebuild: script: - "curl -X POST -F token=b63ed804ada51d7d1ffe5d6ea0dfa2 -F ref=track-OM-master https://www.graphics.rwth-aachen.de:9000/api/v4/projects/1024/trigger/pipeline" -Debian: - stage: deploy - only: - - master - script: - - mkdir .OpenMesh - - cp -r * .OpenMesh - - mv .OpenMesh OpenMesh - - cd OpenMesh - - dpkg-buildpackage --no-sign - tags: - - Linux - - stretch - dependencies: [] - artifacts: - paths: - - libopenmesh*.deb +#Debian: +# stage: deploy +# only: +# - master +# script: +# - mkdir .OpenMesh +# - cp -r * .OpenMesh +# - mv .OpenMesh OpenMesh +# - cd OpenMesh +# - dpkg-buildpackage --no-sign +# tags: +# - Linux +# - stretch +# dependencies: [] +# artifacts: +# paths: +# - libopenmesh*.deb From d554a90d4301f1086047ae348c69d4348e74c1ce Mon Sep 17 00:00:00 2001 From: Martin Heistermann Date: Mon, 29 Aug 2022 18:28:04 +0200 Subject: [PATCH 35/41] OBJWriter performance: Add map from color to material index, avoids quadratic performance --- src/OpenMesh/Core/IO/writer/OBJWriter.cc | 35 +++++++++++++++--------- src/OpenMesh/Core/IO/writer/OBJWriter.hh | 2 ++ 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/OpenMesh/Core/IO/writer/OBJWriter.cc b/src/OpenMesh/Core/IO/writer/OBJWriter.cc index 145df5dc..97c0a00f 100644 --- a/src/OpenMesh/Core/IO/writer/OBJWriter.cc +++ b/src/OpenMesh/Core/IO/writer/OBJWriter.cc @@ -130,26 +130,31 @@ write(const std::string& _filename, BaseExporter& _be, Options _opt, std::stream size_t _OBJWriter_::getMaterial(OpenMesh::Vec3f _color) const { - for (size_t i=0; i < material_.size(); i++) - if(material_[i] == _color) - return i; + auto idx_it = material_idx_.find(_color); + if (idx_it != material_idx_.end()) { + return idx_it->second; + } else { + size_t idx = material_.size(); + material_.push_back(_color); + material_idx_[_color] = idx; - //not found add new material - material_.push_back( _color ); - return material_.size()-1; + return idx; + } } //----------------------------------------------------------------------------- size_t _OBJWriter_::getMaterial(OpenMesh::Vec4f _color) const { - for (size_t i=0; i < materialA_.size(); i++) - if(materialA_[i] == _color) - return i; - - //not found add new material - materialA_.push_back( _color ); - return materialA_.size()-1; + auto idx_it = materialA_idx_.find(_color); + if (idx_it != materialA_idx_.end()) { + return idx_it->second; + } else { + size_t idx = materialA_.size(); + materialA_.push_back(_color); + materialA_idx_[_color] = idx; + return idx; + } } //----------------------------------------------------------------------------- @@ -162,7 +167,9 @@ writeMaterial(std::ostream& _out, BaseExporter& _be, Options _opt) const OpenMesh::Vec4f cA; material_.clear(); + material_idx_.clear(); materialA_.clear(); + materialA_idx_.clear(); //iterate over faces for (size_t i=0, nF=_be.n_faces(); i material_; + mutable std::map< OpenMesh::Vec3f, size_t> material_idx_; mutable std::vector< OpenMesh::Vec4f > materialA_; + mutable std::map< OpenMesh::Vec4f, size_t> materialA_idx_; size_t getMaterial(OpenMesh::Vec3f _color) const; From de1b03bf024bcb5186f7d91f4153124ccad87853 Mon Sep 17 00:00:00 2001 From: Martin Heistermann Date: Thu, 13 Oct 2022 15:07:59 +0200 Subject: [PATCH 36/41] Add missing include. --- src/OpenMesh/Core/IO/Options.hh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OpenMesh/Core/IO/Options.hh b/src/OpenMesh/Core/IO/Options.hh index a459e3e0..05461d43 100644 --- a/src/OpenMesh/Core/IO/Options.hh +++ b/src/OpenMesh/Core/IO/Options.hh @@ -51,6 +51,7 @@ // OpenMesh #include +#include //== NAMESPACES ============================================================== From 121ff40b1996035c50bbc837eb17879a4674bb9f Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Wed, 23 Nov 2022 11:37:36 +0100 Subject: [PATCH 37/41] in calc_normal for EdgeHandle average incident face normals instead of incident vertex normals --- src/OpenMesh/Core/Mesh/PolyMeshT.hh | 8 +------- src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh | 26 ++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/OpenMesh/Core/Mesh/PolyMeshT.hh b/src/OpenMesh/Core/Mesh/PolyMeshT.hh index b6c70bb7..a09bbf8c 100644 --- a/src/OpenMesh/Core/Mesh/PolyMeshT.hh +++ b/src/OpenMesh/Core/Mesh/PolyMeshT.hh @@ -456,13 +456,7 @@ public: } /// calculated and returns the average of the two vertex normals - Normal calc_normal(EdgeHandle _eh) const - { - HalfedgeHandle _heh = this->halfedge_handle(_eh, 0); - VertexHandle vh0 = this->from_vertex_handle(_heh); - VertexHandle vh1 = this->to_vertex_handle(_heh); - return 0.5 * (this->calc_normal(vh0) + this->calc_normal(vh1)); - } + Normal calc_normal(EdgeHandle _eh) const; /** defines a consistent representation of a sector geometry: the halfedge _in_heh defines the sector orientation diff --git a/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh b/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh index 96a00cd1..e998dcc9 100644 --- a/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh +++ b/src/OpenMesh/Core/Mesh/PolyMeshT_impl.hh @@ -109,7 +109,7 @@ PolyMeshT::calc_face_normal_impl(FaceHandle _fh, PointIs3DTag) const { assert(this->halfedge_handle(_fh).is_valid()); ConstFaceVertexIter fv_it(this->cfv_iter(_fh)); - + // Safeguard for 1-gons if (!(++fv_it).is_valid()) return Normal(0, 0, 0); @@ -140,7 +140,7 @@ PolyMeshT::calc_face_normal_impl(FaceHandle _fh, PointIs3DTag) const } const typename vector_traits::value_type length = norm(n); - + // The expression ((n *= (1.0/norm)),n) is used because the OpenSG // vector class does not return self after component-wise // self-multiplication with a scalar!!! @@ -424,6 +424,28 @@ calc_normal(HalfedgeHandle _heh, const double _feature_angle) const //----------------------------------------------------------------------------- +template +typename PolyMeshT::Normal +PolyMeshT:: +calc_normal(EdgeHandle _eh) const +{ + Normal n(0); + for (int i = 0; i < 2; ++i) + { + const auto heh = this->halfedge_handle(_eh, i); + const auto fh = this->face_handle(heh); + if (fh.is_valid()) + n += calc_normal(fh); + } + const auto length = norm(n); + if (length != 0) + n /= length; + return n; +} + +//----------------------------------------------------------------------------- + + template bool PolyMeshT:: From 1f096271290d2d94453a266a839a167bd9135dd8 Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Mon, 6 Feb 2023 16:50:05 +0100 Subject: [PATCH 38/41] only read custom properties if the option includes Option::Custom --- src/OpenMesh/Core/IO/reader/OMReader.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/OpenMesh/Core/IO/reader/OMReader.cc b/src/OpenMesh/Core/IO/reader/OMReader.cc index b9b9cb4d..f782b641 100644 --- a/src/OpenMesh/Core/IO/reader/OMReader.cc +++ b/src/OpenMesh/Core/IO/reader/OMReader.cc @@ -406,7 +406,8 @@ bool _OMReader_::read_binary_vertex_chunk(std::istream &_is, BaseImporter &_bi, { Chunk::PropertyName property_type; bytes_ += restore(_is, property_type, _swap); - add_generic_property(property_type, _bi); + if (_opt.check(Options::Custom)) + add_generic_property(property_type, _bi); } bytes_ += restore_binary_custom_data(_is, _bi.kernel()->_get_vprop(property_name_), header_.n_vertices_, _swap); @@ -563,7 +564,8 @@ bool _OMReader_::read_binary_face_chunk(std::istream &_is, BaseImporter &_bi, Op { Chunk::PropertyName property_type; bytes_ += restore(_is, property_type, _swap); - add_generic_property(property_type, _bi); + if (_opt.check(Options::Custom)) + add_generic_property(property_type, _bi); } bytes_ += restore_binary_custom_data(_is, _bi.kernel()->_get_fprop(property_name_), header_.n_faces_, _swap); @@ -604,7 +606,8 @@ bool _OMReader_::read_binary_edge_chunk(std::istream &_is, BaseImporter &_bi, Op { Chunk::PropertyName property_type; bytes_ += restore(_is, property_type, _swap); - add_generic_property(property_type, _bi); + if (_opt.check(Options::Custom)) + add_generic_property(property_type, _bi); } bytes_ += restore_binary_custom_data(_is, _bi.kernel()->_get_eprop(property_name_), header_.n_edges_, _swap); @@ -654,7 +657,8 @@ bool _OMReader_::read_binary_halfedge_chunk(std::istream &_is, BaseImporter &_bi { Chunk::PropertyName property_type; bytes_ += restore(_is, property_type, _swap); - add_generic_property(property_type, _bi); + if (_opt.check(Options::Custom)) + add_generic_property(property_type, _bi); } bytes_ += restore_binary_custom_data(_is, _bi.kernel()->_get_hprop(property_name_), 2 * header_.n_edges_, _swap); @@ -689,7 +693,7 @@ bool _OMReader_::read_binary_halfedge_chunk(std::istream &_is, BaseImporter &_bi { int next_id_0 = -1; int to_vertex_id_0 = -1; - int face_id_0 = -1; + int face_id_0 = -1; bytes_ += restore( _is, next_id_0, OMFormat::Chunk::Integer_Size(chunk_header_.bits_), _swap ); bytes_ += restore( _is, to_vertex_id_0, OMFormat::Chunk::Integer_Size(chunk_header_.bits_), _swap ); bytes_ += restore( _is, face_id_0, OMFormat::Chunk::Integer_Size(chunk_header_.bits_), _swap ); @@ -745,7 +749,7 @@ bool _OMReader_::read_binary_halfedge_chunk(std::istream &_is, BaseImporter &_bi //----------------------------------------------------------------------------- -bool _OMReader_::read_binary_mesh_chunk(std::istream &_is, BaseImporter &_bi, Options & /* _opt */, bool _swap) const +bool _OMReader_::read_binary_mesh_chunk(std::istream &_is, BaseImporter &_bi, Options& _opt , bool _swap) const { using OMFormat::Chunk; @@ -760,7 +764,8 @@ bool _OMReader_::read_binary_mesh_chunk(std::istream &_is, BaseImporter &_bi, Op { Chunk::PropertyName property_type; bytes_ += restore(_is, property_type, _swap); - add_generic_property(property_type, _bi); + if (_opt.check(Options::Custom)) + add_generic_property(property_type, _bi); } bytes_ += restore_binary_custom_data(_is, _bi.kernel()->_get_mprop(property_name_), 1, _swap); From 0cdab1cade68d3a0aa2e49c010720619dfdc76bb Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Mon, 6 Feb 2023 16:50:23 +0100 Subject: [PATCH 39/41] adapt unit tests to require specifying Options::Custom when writing and reading custom properties --- src/Unittests/unittests_read_write_OM.cc | 48 +++++++++++++++--------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/src/Unittests/unittests_read_write_OM.cc b/src/Unittests/unittests_read_write_OM.cc index 6ba3b741..e18e47b0 100644 --- a/src/Unittests/unittests_read_write_OM.cc +++ b/src/Unittests/unittests_read_write_OM.cc @@ -365,7 +365,9 @@ TEST_F(OpenMeshReadWriteOM, WriteTriangleVertexBoolProperty) { mesh.property(prop,v3) = true; // save - bool ok = OpenMesh::IO::write_mesh(mesh,filename); + OpenMesh::IO::Options opts = OpenMesh::IO::Options::Custom; + + bool ok = OpenMesh::IO::write_mesh(mesh, filename, opts); EXPECT_TRUE(ok) << "Unable to write "<idx() != mesh.property(vertexProp,*vIter)); - EXPECT_FALSE(wrong) << "min one vertex has worng vertex property"; + EXPECT_FALSE(wrong) << "min one vertex has wrong vertex property"; } From ebb000e1670547e7bb42e132512b260a5abe26e4 Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Wed, 8 Feb 2023 10:25:15 +0100 Subject: [PATCH 40/41] add IO::Options::Custom to reading and writing in unittests_tutorials.cc --- src/Unittests/unittests_tutorials.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Unittests/unittests_tutorials.cc b/src/Unittests/unittests_tutorials.cc index 01881b0f..309d354e 100644 --- a/src/Unittests/unittests_tutorials.cc +++ b/src/Unittests/unittests_tutorials.cc @@ -781,14 +781,15 @@ TEST_F(OpenMeshTutorials, storing_custom_properties) { EXPECT_TRUE(mesh.mproperty(mprop_map).persistent()) << "property should be persistent"; // write mesh - bool ok = OpenMesh::IO::write_mesh( mesh, "persistence-check.om" ); + IO::Options opts(IO::Options::Custom); + bool ok = OpenMesh::IO::write_mesh(mesh, "persistence-check.om", opts); EXPECT_TRUE(ok) << "Cannot write mesh to file 'persistent-check.om'"; // clear mesh mesh.clear(); //Read back mesh - ok = OpenMesh::IO::read_mesh( mesh, "persistence-check.om" ); + ok = OpenMesh::IO::read_mesh(mesh, "persistence-check.om", opts); EXPECT_TRUE(ok) << "Cannot read mesh from file 'persistence-check.om'"; // check props From 7f3e219b31842ff923e7dd7df36b09d9b01b1d3c Mon Sep 17 00:00:00 2001 From: Max Lyon Date: Wed, 8 Feb 2023 13:56:05 +0100 Subject: [PATCH 41/41] add missing OpenMesh:: namespace --- src/Unittests/unittests_tutorials.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Unittests/unittests_tutorials.cc b/src/Unittests/unittests_tutorials.cc index 309d354e..fab485ac 100644 --- a/src/Unittests/unittests_tutorials.cc +++ b/src/Unittests/unittests_tutorials.cc @@ -781,7 +781,7 @@ TEST_F(OpenMeshTutorials, storing_custom_properties) { EXPECT_TRUE(mesh.mproperty(mprop_map).persistent()) << "property should be persistent"; // write mesh - IO::Options opts(IO::Options::Custom); + OpenMesh::IO::Options opts(OpenMesh::IO::Options::Custom); bool ok = OpenMesh::IO::write_mesh(mesh, "persistence-check.om", opts); EXPECT_TRUE(ok) << "Cannot write mesh to file 'persistent-check.om'";