Skip to content

Commit

Permalink
Merge pull request #1697 from DGtal-team/Winding
Browse files Browse the repository at this point in the history
Winding number from libigl in DGtal
  • Loading branch information
dcoeurjo authored Mar 9, 2024
2 parents 59c55c2 + 98042e3 commit f49e724
Show file tree
Hide file tree
Showing 73 changed files with 8,930 additions and 476 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
TESTBLACKLIST: "(testLinearStructure|testIntegerConverter|testArithmeticalDSSComputerOnSurfels)"
CONFIG_GLOBAL: -DBUILD_EXAMPLES=true -DBUILD_TESTING=true -DDGTAL_RANDOMIZED_TESTING_THRESHOLD=10 -DWITH_EIGEN=true
CONFIG_LINUX: -DWITH_OPENMP=true -DWITH_GMP=true -DWITH_FFTW3=true -DWARNING_AS_ERROR=ON -DWITH_HDF5=true -DWITH_QGLVIEWER=true -DWITH_CAIRO=true -DWITH_ITK=true -DDGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS=true -DBUILD_POLYSCOPE_EXAMPLES=true
CONFIG_MAC: -DWITH_GMP=true -DBUILD_POLYSCOPE_EXAMPLES=true
CONFIG_LINUX: -DWITH_OPENMP=true -DWITH_GMP=true -DWITH_FFTW3=true -DWITH_CGAL=true -DWITH_LIBIGL=true -DWARNING_AS_ERROR=ON -DWITH_HDF5=true -DWITH_QGLVIEWER=true -DWITH_CAIRO=true -DWITH_ITK=true -DDGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS=true -DBUILD_POLYSCOPE_EXAMPLES=true
CONFIG_MAC: -DWITH_GMP=true -DBUILD_POLYSCOPE_EXAMPLES=true -DWITH_CGAL=true -DWITH_LIBIGL=true
CONFIG_WINDOWS: -DWITH_OPENMP=true -DENABLE_CONAN=true #-DWITH_FFTW3=true #-DWITH_CAIRO=true #-DWITH_ITK=true -DWITH_GMP=true

jobs:
Expand All @@ -33,11 +33,11 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install zsh libqglviewer-dev-qt5 libboost-dev ninja-build libhdf5-serial-dev libboost-dev libcairo2-dev libgmp-dev libfftw3-dev libinsighttoolkit4-dev xorg-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
sudo apt-get install zsh libqglviewer-dev-qt5 libboost-dev libcgal-dev ninja-build libhdf5-serial-dev libboost-dev libcairo2-dev libgmp-dev libfftw3-dev libinsighttoolkit4-dev xorg-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
- name: Install macOS deps
if: matrix.os == 'macOS-latest'
run: brew install boost ninja gmp libomp
run: brew install boost ninja gmp libomp cgal

- name: Install conan
if: matrix.os == 'windows-latest'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/buildAndDocumentation-PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ env:
BUILD_TYPE: Debug
TESTBLACKLIST: "(testLinearStructure|testIntegerConverter|testArithmeticalDSSComputerOnSurfels)"
CONFIG_GLOBAL: -DBUILD_EXAMPLES=true -DBUILD_TESTING=true -DDGTAL_RANDOMIZED_TESTING_THRESHOLD=10 -DWITH_EIGEN=true
CONFIG_LINUX: -DUSE_CCACHE=YES -DWITH_OPENMP=true -DWITH_GMP=true -DWITH_FFTW3=true -DWARNING_AS_ERROR=ON -DWITH_HDF5=true -DWITH_QGLVIEWER=true -DWITH_CAIRO=true -DWITH_ITK=true -DDGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS=true -DBUILD_POLYSCOPE_EXAMPLES=true
CONFIG_MAC: -DUSE_CCACHE=YES -DWITH_GMP=true -DBUILD_POLYSCOPE_EXAMPLES=true
CONFIG_LINUX: -DUSE_CCACHE=YES -DWITH_OPENMP=true -DWITH_GMP=true -DWITH_CGAL=true -DWITH_LIBIGL=true -DWITH_FFTW3=true -DWARNING_AS_ERROR=ON -DWITH_HDF5=true -DWITH_QGLVIEWER=true -DWITH_CAIRO=true -DWITH_ITK=true -DDGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS=true -DBUILD_POLYSCOPE_EXAMPLES=true
CONFIG_MAC: -DUSE_CCACHE=YES -DWITH_GMP=true -DBUILD_POLYSCOPE_EXAMPLES=true -DWITH_CGAL=true -DWITH_LIBIGL=true
CONFIG_WINDOWS: -DWITH_OPENMP=true -DENABLE_CONAN=true #-DWITH_FFTW3=true #-DWITH_CAIRO=true #-DWITH_ITK=true -DWITH_GMP=true

jobs:
Expand All @@ -34,11 +34,11 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install ccache zsh libqglviewer-dev-qt5 libboost-dev ninja-build libhdf5-serial-dev libboost-dev libcairo2-dev libgmp-dev libfftw3-dev libinsighttoolkit4-dev xorg-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
sudo apt-get install ccache zsh libqglviewer-dev-qt5 libcgal-dev libboost-dev ninja-build libhdf5-serial-dev libboost-dev libcairo2-dev libgmp-dev libfftw3-dev libinsighttoolkit4-dev xorg-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
- name: Install macOS deps
if: matrix.os == 'macOS-latest'
run: brew install boost ninja gmp libomp ccache
run: brew install boost ninja gmp libomp ccache cgal

- name: Install conan
if: matrix.os == 'windows-latest'
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
[#1689](https://github.com/DGtal-team/DGtal/pull/1689))
- Faster build using CPM for dependency download and ccache with the cmake `USE_CCACHE=YES`option
(ccache must be installed). (David Coeurjolly, [#1696](https://github.com/DGtal-team/DGtal/pull/1696))
- Better documentation style using doxygen-awesome.css. (David Coeurjolly,
[#1697](https://github.com/DGtal-team/DGtal/pull/1697))

- *Geometry*
- New implicit shape from point cloud using LibIGL Winding Numbers. (David Coeurjolly,
[#1697](https://github.com/DGtal-team/DGtal/pull/1697))

## Changes
- *General*
Expand Down Expand Up @@ -68,6 +73,8 @@
[#1691](https://github.com/DGtal-team/DGtal/pull/1691))
- Cleanup of cmake targets when BUILD_TESTING is disabled (David Coeurjolly
[#1698](https://github.com/DGtal-team/DGtal/pull/1698))
- Cleanup of the cmake script for dependency discovery (David Coeurjolly,
[#1697](https://github.com/DGtal-team/DGtal/pull/1697))
- Cleaning up unnecessary ModuleSRC.cmake files (David Coeurjolly
[#1711](https://github.com/DGtal-team/DGtal/pull/1711))
- Fixing install path of CPM in the DGtalConfig.cmake.in (David Coeurjolly,
Expand Down
37 changes: 29 additions & 8 deletions cmake/CheckDGtalOptionalDependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ option(WITH_ITK "With Insight Toolkit ITK." OFF)
option(WITH_CAIRO "With CairoGraphics." OFF)
option(WITH_HDF5 "With HDF5." OFF)
option(WITH_QGLVIEWER "With LibQGLViewer for 3D visualization (Qt5 required)." OFF)
option(WITH_PATATE "With Patate library for geometry processing (Eigen required)." OFF)
option(WITH_PATATE "With Patate library for geometry processing." OFF)
option(WITH_FFTW3 "With FFTW3 discrete Fourier Transform library." OFF)
option(WITH_LIBIGL "With libIGL (with copyleft/CGAL included)." OFF)

#----------------------------------
# Removing -frounding-math compile flag for clang
Expand Down Expand Up @@ -96,6 +97,14 @@ else (WITH_FFTW3)
message(STATUS " WITH_FFTW3 false (FFTW3 discrete Fourier transform library)")
endif()


if (WITH_LIBIGL)
set(LIST_OPTION ${LIST_OPTION} [FFTW3]\ )
message(STATUS " WITH_LIBIGL true (libIGL)")
else (WITH_LIBIGL)
message(STATUS " WITH_LIBIGL false (libIGL)")
endif()

message(STATUS "")
message(STATUS "Checking the dependencies: ")

Expand Down Expand Up @@ -327,10 +336,10 @@ endif()
# -----------------------------------------------------------------------------
set(CGAL_FOUND_DGTAL 0)
if(WITH_CGAL)
if(WITH_GMP AND WITH_EIGEN)
if(WITH_GMP)
message(STATUS "GMP and Eigen3 detected for CGAL.")
else()
message(FATAL_ERROR "CGAL needs GMP and Eigen3. You must activate WITH_GMP and WITH_EIGEN flags and have the associated package installed.")
message(FATAL_ERROR "CGAL needs GMP. You must activate the WITH_GMP flag and have the associated package installed.")
endif()

find_package(CGAL COMPONENTS Core)
Expand All @@ -354,11 +363,6 @@ endif()
# -----------------------------------------------------------------------------
set(PATATE_FOUND_DGTAL 0)
if(WITH_PATATE)
if(WITH_EIGEN)
message(STATUS "Eigen3 detected for PATATE.")
else()
message(FATAL_ERROR "PATATE needs Eigen3. You must activate WITH_EIGEN flags and have the associated package installed.")
endif()
find_package(Patate)
if(PATATE_FOUND)
target_include_directories(DGtal PUBLIC ${PATATE_INCLUDE_DIR})
Expand Down Expand Up @@ -406,4 +410,21 @@ if(WITH_FFTW3)

endif()

# -----------------------------------------------------------------------------
# Look for libigl.
# (They are not compulsory).
# -----------------------------------------------------------------------------
if(WITH_LIBIGL)
if (WITH_CGAL)
message(STATUS "DGtal/CGAL enabled.")
else()
message(FATAL_ERROR "LIBIGL requires CGAL. Please if the `WITH_CGAL=true` cmake flag.")
endif()
include(cmake/deps/libigl.cmake)
target_compile_definitions(DGtal PUBLIC -DWITH_LIBIGL)
set(DGtalLibDependencies ${DGtalLibDependencies} igl::core)
set(LIBIGL_FOUND_DGTAL 1)

endif()

message(STATUS "-------------------------------------------------------------------------------")
8 changes: 5 additions & 3 deletions cmake/DGtalConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ set(WITH_EIGEN 1)
include(eigen)
set(DGtalLibDependencies ${DGtalLibDependencies} Eigen3::Eigen)

if (@LIBIGL_FOUND_DGTAL@)
include(libigl)
set(WITH_LIBIGL 1)
set(DGtalLibDependencies ${DGtalLibDependencies} igl::core)
endif()

if(@GMP_FOUND_DGTAL@) #if GMP_FOUND_DGTAL
find_package(GMP REQUIRED
Expand Down Expand Up @@ -108,9 +113,6 @@ if(@OPENMP_FOUND_DGTAL@) #if OPENMP_FOUND_DGTAL
set(WITH_OPENMP 1)
endif()




if(@CGAL_FOUND_DGTAL@) #if CGAL_FOUND_DGTAL
find_dependency(CGAL COMPONENTS Core
@CGAL_HINTS@
Expand Down
1 change: 1 addition & 0 deletions cmake/DGtalConfigGenerator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ set(_find_cmake_files
"${PROJECT_SOURCE_DIR}/cmake/FindQGLVIEWER.cmake"
"${PROJECT_SOURCE_DIR}/cmake/FindGMP.cmake"
"${PROJECT_SOURCE_DIR}/cmake/deps/eigen.cmake"
"${PROJECT_SOURCE_DIR}/cmake/deps/libigl.cmake"
"${PROJECT_SOURCE_DIR}/cmake/CPM.cmake"
)
file(COPY ${_find_cmake_files}
Expand Down
3 changes: 1 addition & 2 deletions cmake/GeneratorSpecific.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ if (BUILD_TESTING)
set(DGTAL_MYHEADERS "")
FILE(GLOB_RECURSE DGTAL_MYHEADERS ${CMAKE_CURRENT_SOURCE_DIR}/cmake/*.cmake.in)
add_custom_target(cmake.in SOURCES ${DGTAL_MYHEADERS})
set(DGTAL_MYHEADERS "")

set(DGTAL_MYHEADERS "")
FILE(GLOB_RECURSE DGTAL_MYHEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/DGtal//base/*h)
add_custom_target(_base SOURCES ${DGTAL_MYHEADERS})
set(DGTAL_MYHEADERS "")
Expand Down
29 changes: 29 additions & 0 deletions cmake/deps/libigl.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#
# Copyright 2019 Adobe. All rights reserved.
# This file is licensed to you under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. You may obtain a copy
# of the License at http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under
# the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
# OF ANY KIND, either express or implied. See the License for the specific language
# governing permissions and limitations under the License.
#
if(TARGET igl::core)
return()
endif()

message(STATUS "Third-party (external): creating target 'igl::core'")

include(eigen)
option(LIBIGL_INSTALL "Enable installation of libigl targets" ON)

include(CPM)
CPMAddPackage(
NAME libigl
GITHUB_REPOSITORY libigl/libigl
VERSION 2.5.0
OPTIONS LIBIGL_WITH_CGAL
)

set_target_properties(igl_core PROPERTIES FOLDER third_party/libigl)
Loading

0 comments on commit f49e724

Please sign in to comment.