From ca67ac5c1fe865dfe074b50e55e96ed34a7446d9 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 7 Mar 2019 09:40:08 +0100 Subject: [PATCH 1/5] Remove all mentions of BLAS, LAPACK, and TAUCS in our CMake scripts --- Installation/CMakeLists.txt | 4 +- Installation/INSTALL.md | 8 - .../modules/CGAL_Locate_CGAL_TAUCS.cmake | 121 ----- Installation/cmake/modules/CGAL_UseBLAS.cmake | 36 -- .../cmake/modules/CGAL_UseLAPACK.cmake | 41 -- .../cmake/modules/CGAL_UseTAUCS.cmake | 31 -- Installation/cmake/modules/FindBLAS.cmake | 498 ------------------ Installation/cmake/modules/FindF2C.cmake | 5 - Installation/cmake/modules/FindLAPACK.cmake | 324 ------------ Installation/cmake/modules/FindTAUCS.cmake | 129 ----- .../modules/config/support/test_ATLAS.cpp | 47 -- .../modules/config/support/test_BLAS.cpp | 88 ---- .../modules/config/support/test_LAPACK.cpp | 83 --- Installation/include/CGAL/auto_link/LAPACK.h | 106 ---- Installation/include/CGAL/auto_link/TAUCS.h | 50 -- 15 files changed, 2 insertions(+), 1569 deletions(-) delete mode 100644 Installation/cmake/modules/CGAL_Locate_CGAL_TAUCS.cmake delete mode 100644 Installation/cmake/modules/CGAL_UseBLAS.cmake delete mode 100644 Installation/cmake/modules/CGAL_UseLAPACK.cmake delete mode 100644 Installation/cmake/modules/CGAL_UseTAUCS.cmake delete mode 100644 Installation/cmake/modules/FindBLAS.cmake delete mode 100644 Installation/cmake/modules/FindLAPACK.cmake delete mode 100644 Installation/cmake/modules/FindTAUCS.cmake delete mode 100644 Installation/cmake/modules/config/support/test_ATLAS.cpp delete mode 100644 Installation/cmake/modules/config/support/test_BLAS.cpp delete mode 100644 Installation/cmake/modules/config/support/test_LAPACK.cpp delete mode 100644 Installation/include/CGAL/auto_link/LAPACK.h delete mode 100644 Installation/include/CGAL/auto_link/TAUCS.h diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 0a1e33d64ab..af2c268deca 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -567,8 +567,8 @@ message("== Detect external libraries ==") # Remarks: # External libs configured when Qt5 lib of cgal are required # Coin is used in KDS, but no FindCoin or FindCOIN exists -# There exists FindF2C, FindIPE, FindMKL, but they are only used to support supporting libs -list (INSERT CGAL_SUPPORTING_3RD_PARTY_LIBRARIES 0 GMP MPFR ZLIB OpenGL LEDA MPFI RS RS3 OpenNL Eigen3 BLAS LAPACK ESBTL Coin3D NTL IPE) +# There exists FindIPE, FindMKL, but they are only used to support supporting libs +list (INSERT CGAL_SUPPORTING_3RD_PARTY_LIBRARIES 0 GMP MPFR ZLIB OpenGL LEDA MPFI RS RS3 OpenNL Eigen3 ESBTL Coin3D NTL IPE) if (NOT WIN32) # GMPXX is not supported on WIN32 machines list (INSERT CGAL_SUPPORTING_3RD_PARTY_LIBRARIES 1 GMPXX) diff --git a/Installation/INSTALL.md b/Installation/INSTALL.md index 5161bfe0e2d..2286a6a787f 100644 --- a/Installation/INSTALL.md +++ b/Installation/INSTALL.md @@ -76,14 +76,6 @@ CGAL packages, some are only needed for demos. * Surface Reconstruction from Point Sets http://eigen.tuxfamily.org - - BLAS, LAPACK, ATLAS - Required by the packages (if EIGEN is not available): - * Estimation of Local Differential Properties of Point-Sampled Surfaces - * Approximation of Ridges and Umbilics on Triangulated Surface Meshes - * Planar Parameterization of Triangulated Surface Meshes - http://www.netlib.org/blas/, http://www.netlib.org/lapack/ - or precompiled version that can be downloaded with CGAL-x.y-Setup.exe - - MPFI Required by the package: * Algebraic Kernel diff --git a/Installation/cmake/modules/CGAL_Locate_CGAL_TAUCS.cmake b/Installation/cmake/modules/CGAL_Locate_CGAL_TAUCS.cmake deleted file mode 100644 index ca4470a2124..00000000000 --- a/Installation/cmake/modules/CGAL_Locate_CGAL_TAUCS.cmake +++ /dev/null @@ -1,121 +0,0 @@ -# Find TAUCS library shipped with CGAL -# -# This module searches for TAUCS in CGAL "auxiliary" folder -# and in in $CGAL_TAUCS_DIR environment variable. -# -# This module sets the following variables: -# CGAL_TAUCS_FOUND - set to true if TAUCS library shipped with CGAL -# is found -# CGAL_TAUCS_PLATFORM - name of TAUCS subfolder corresponding to the current compiler -# CGAL_TAUCS_INCLUDE_DIR - list of folders (using full path name) containing -# TAUCS (and optionaly BLAS and LAPACK) headers -# CGAL_TAUCS_LIBRARIES_DIR -list of folders (using full path name) containing -# TAUCS (and optionaly BLAS and LAPACK) libraries - -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake) - -if ( NOT CGAL_TAUCS_FOUND ) - - # - # Find out TAUCS name for the current platform. - # This code is a translation of TAUCS "configure" script. - # - - # The first task is to figure out CMAKE_SYSTEM_NAME - # (on unix this is uname -s, for windows it is Windows). - #message("DEBUG: CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}") - #message("DEBUG: CMAKE_SYSTEM_PROCESSOR = ${CMAKE_SYSTEM_PROCESSOR}") - set( CGAL_TAUCS_PLATFORM "${CMAKE_SYSTEM_NAME}" ) - - # Convert to lower case - STRING(TOLOWER "${CGAL_TAUCS_PLATFORM}" CGAL_TAUCS_PLATFORM) - - # Sometimes uname returns a value that is - # inconsistent with the way CGAL_TAUCS_PLATFORM is set. For example, on - # Solaris, CGAL_TAUCS_PLATFORM=solaris but uname returns SunOS. - if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "sunos" ) - set( CGAL_TAUCS_PLATFORM "solaris" ) - endif() - if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "windows" ) - set( CGAL_TAUCS_PLATFORM "win32" ) - endif() - - # LS 2007: added "darwin_intel" for Intel Macs. - # "darwin" = original Darwin platform = PowerPC architecture. - if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "darwin" ) - # CMAKE_SYSTEM_PROCESSOR=uname -p - if ( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "i386" ) - set( CGAL_TAUCS_PLATFORM "darwin_intel" ) - endif() - endif() - - # LS 2007: append "64" if 64 bits processor (tested on Linux only) - - if ( ${CGAL_TAUCS_PLATFORM} STREQUAL "linux" ) - # CMAKE_SYSTEM_PROCESSOR=uname -p - if ( ${CMAKE_SYSTEM_PROCESSOR} MATCHES ".*64.*" ) - set( CGAL_TAUCS_PLATFORM "${CGAL_TAUCS_PLATFORM}64" ) - endif() - endif() - - #message("DEBUG: CGAL_TAUCS_PLATFORM = ${CGAL_TAUCS_PLATFORM}") - - - # - # Search for TAUCS folder. - # - - #message("DEBUG: CGAL_INSTALLATION_PACKAGE_DIR = ${CGAL_INSTALLATION_PACKAGE_DIR}") - - # VC++ uses auto-link, thus we search for a folder containing the output of - # build_taucs_win32_for_CGAL.bat/build_taucs_win64_for_CGAL.bat, - # ie TAUCS libraries compiled for all Windows runtimes. - if ( MSVC ) - - # Check $CGAL_TAUCS_DIR environment variable - fetch_env_var(CGAL_TAUCS_DIR) - #message("DEBUG: CGAL_TAUCS_DIR = ${CGAL_TAUCS_DIR}") - if (NOT "${CGAL_TAUCS_DIR}" STREQUAL "" AND EXISTS ${CGAL_TAUCS_DIR}) - - set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_TAUCS_DIR}/include") - set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_DIR}/lib" ) - set( CGAL_TAUCS_FOUND TRUE ) - - # Else, search for TAUCS in CGAL "auxiliary" folder - elseif ( EXISTS "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/include/taucs.h" AND - EXISTS "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/lib" ) - - set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/include") - set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/taucs/lib" ) - set( CGAL_TAUCS_FOUND TRUE ) - - endif() - - # On Unix, search for TAUCS "taucs_full" folder - else ( MSVC ) - - # Check $CGAL_TAUCS_DIR environment variable - fetch_env_var(CGAL_TAUCS_DIR) - #message("DEBUG: CGAL_TAUCS_DIR = ${CGAL_TAUCS_DIR}") - if (NOT "${CGAL_TAUCS_DIR}" STREQUAL "" AND EXISTS ${CGAL_TAUCS_DIR}) - - set( CGAL_TAUCS_INCLUDE_DIR "${CGAL_TAUCS_DIR}/build/${CGAL_TAUCS_PLATFORM}" - "${CGAL_TAUCS_DIR}/src" ) - set( CGAL_TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_DIR}/external/lib/${CGAL_TAUCS_PLATFORM}" - "${CGAL_TAUCS_DIR}/lib/${CGAL_TAUCS_PLATFORM}" ) - set( CGAL_TAUCS_FOUND TRUE ) - - endif() - - endif ( MSVC ) - - # Add variables to cache - set( CGAL_TAUCS_DIR "${CGAL_TAUCS_DIR}" - CACHE PATH "Directory containing BLAS, LAPACK and TAUCS" ) - - #message("DEBUG: CGAL_TAUCS_INCLUDE_DIR = ${CGAL_TAUCS_INCLUDE_DIR}") - #message("DEBUG: CGAL_TAUCS_LIBRARIES_DIR = ${CGAL_TAUCS_LIBRARIES_DIR}") - #message("DEBUG: CGAL_TAUCS_FOUND = ${CGAL_TAUCS_FOUND}") - -endif ( NOT CGAL_TAUCS_FOUND ) - diff --git a/Installation/cmake/modules/CGAL_UseBLAS.cmake b/Installation/cmake/modules/CGAL_UseBLAS.cmake deleted file mode 100644 index 941b795ba78..00000000000 --- a/Installation/cmake/modules/CGAL_UseBLAS.cmake +++ /dev/null @@ -1,36 +0,0 @@ -# This module setups the compiler for the BLAS libraries. -# It assumes that find_package(BLAS) was already called. - -if ( BLAS_FOUND AND NOT BLAS_SETUP ) - - message( STATUS "UseBLAS" ) - message( STATUS "BLAS include: ${BLAS_INCLUDE_DIR}" ) - include_directories ( SYSTEM ${BLAS_INCLUDE_DIR} ) - - message( STATUS "BLAS definitions: ${BLAS_DEFINITIONS}" ) - add_definitions( ${BLAS_DEFINITIONS} ) - if ( "${BLAS_DEFINITIONS}" MATCHES ".*BLAS_USE_F2C.*" ) - add_definitions( "-DCGAL_USE_F2C" ) - endif() - - if (BLAS_LIBRARIES_DIR) - message( STATUS "BLAS library directories: ${BLAS_LIBRARIES_DIR}" ) - link_directories( ${BLAS_LIBRARIES_DIR} ) - endif() - if (BLAS_LIBRARIES) - message( STATUS "BLAS libraries: ${BLAS_LIBRARIES}" ) - link_libraries( ${BLAS_LIBRARIES} ) - endif() - - message( STATUS "BLAS link flags: ${BLAS_LINKER_FLAGS}" ) - if ( BUILD_SHARED_LIBS ) - uniquely_add_flags( CMAKE_SHARED_LINKER_FLAGS ${BLAS_LINKER_FLAGS} ) - else() - uniquely_add_flags( CMAKE_MODULE_LINKER_FLAGS ${BLAS_LINKER_FLAGS} ) - endif() - - # Setup is done - set ( BLAS_SETUP TRUE ) - -endif() - diff --git a/Installation/cmake/modules/CGAL_UseLAPACK.cmake b/Installation/cmake/modules/CGAL_UseLAPACK.cmake deleted file mode 100644 index 89790863a72..00000000000 --- a/Installation/cmake/modules/CGAL_UseLAPACK.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# This module setups the compiler for the LAPACK libraries. -# It assumes that find_package(LAPACK) was already called. - -if ( LAPACK_FOUND AND NOT LAPACK_SETUP ) - - message( STATUS "UseLAPACK" ) - message( STATUS "LAPACK include: ${LAPACK_INCLUDE_DIR}" ) - include_directories ( SYSTEM ${LAPACK_INCLUDE_DIR} ) - - message( STATUS "LAPACK definitions: ${LAPACK_DEFINITIONS}" ) - add_definitions( ${LAPACK_DEFINITIONS} ) - if ( "${LAPACK_DEFINITIONS}" MATCHES ".*LAPACK_USE_F2C.*" ) - add_definitions( "-DCGAL_USE_F2C" ) - endif() - - if (LAPACK_LIBRARIES_DIR) - message( STATUS "LAPACK library directories: ${LAPACK_LIBRARIES_DIR}" ) - link_directories( ${LAPACK_LIBRARIES_DIR} ) - endif() - if (LAPACK_LIBRARIES) - message( STATUS "LAPACK libraries: ${LAPACK_LIBRARIES}" ) - link_libraries( ${LAPACK_LIBRARIES} ) - endif() - - message( STATUS "LAPACK link flags: ${LAPACK_LINKER_FLAGS}" ) - if ( BUILD_SHARED_LIBS ) - uniquely_add_flags( CMAKE_SHARED_LINKER_FLAGS ${LAPACK_LINKER_FLAGS} ) - else() - uniquely_add_flags( CMAKE_MODULE_LINKER_FLAGS ${LAPACK_LINKER_FLAGS} ) - endif() - - # LAPACK requires BLAS - include( ${BLAS_USE_FILE} ) - - # Setup is done - set ( LAPACK_SETUP TRUE ) - - add_definitions(-DCGAL_LAPACK_ENABLED) - -endif() - diff --git a/Installation/cmake/modules/CGAL_UseTAUCS.cmake b/Installation/cmake/modules/CGAL_UseTAUCS.cmake deleted file mode 100644 index b980dee1d31..00000000000 --- a/Installation/cmake/modules/CGAL_UseTAUCS.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# This module setups the compiler for the TAUCS libraries. -# It assumes that find_package(TAUCS) was already called. - -if ( TAUCS_FOUND AND NOT TAUCS_SETUP ) - - message( STATUS "UseTAUCS" ) - message( STATUS "TAUCS include: ${TAUCS_INCLUDE_DIR}" ) - include_directories ( SYSTEM ${TAUCS_INCLUDE_DIR} ) - - message( STATUS "TAUCS definitions: ${TAUCS_DEFINITIONS}" ) - add_definitions( ${TAUCS_DEFINITIONS} "-DCGAL_USE_TAUCS" ) - - if (TAUCS_LIBRARIES_DIR) - message( STATUS "TAUCS library directories: ${TAUCS_LIBRARIES_DIR}" ) - link_directories( ${TAUCS_LIBRARIES_DIR} ) - endif() - if (TAUCS_LIBRARIES) - message( STATUS "TAUCS libraries: ${TAUCS_LIBRARIES}" ) - link_libraries( ${TAUCS_LIBRARIES} ) - endif() - - # TAUCS requires BLAS and LAPACK - include( ${LAPACK_USE_FILE} ) - - # Setup is done - set ( TAUCS_SETUP TRUE ) - - add_definitions(-DCGAL_TAUCS_ENABLED) - -endif() - diff --git a/Installation/cmake/modules/FindBLAS.cmake b/Installation/cmake/modules/FindBLAS.cmake deleted file mode 100644 index 34f5bb5fdf2..00000000000 --- a/Installation/cmake/modules/FindBLAS.cmake +++ /dev/null @@ -1,498 +0,0 @@ -# Find BLAS library -# -# This module finds an installed library that implements the BLAS -# linear-algebra interface (see http://www.netlib.org/blas/). -# The list of libraries searched for is mainly taken -# from the autoconf macro file, acx_blas.m4 (distributed at -# http://ac-archive.sourceforge.net/ac-archive/acx_blas.html). -# -# This module sets the following variables: -# BLAS_FOUND - set to true if a library implementing the BLAS interface -# is found -# BLAS_INCLUDE_DIR - Directories containing the BLAS header files -# BLAS_DEFINITIONS - Compilation options to use BLAS -# BLAS_LINKER_FLAGS - Linker flags to use BLAS (excluding -l -# and -L). -# BLAS_LIBRARIES_DIR - Directories containing the BLAS libraries. -# May be null if BLAS_LIBRARIES contains libraries name using full path. -# BLAS_LIBRARIES - List of libraries to link against BLAS interface. -# May be null if the compiler supports auto-link (e.g. VC++). -# BLAS_USE_FILE - The name of the cmake module to include to compile -# applications or libraries using BLAS. -# -# This module was modified by CGAL team: -# - find BLAS library shipped with TAUCS -# - find libraries for a C++ compiler, instead of Fortran -# - added BLAS_INCLUDE_DIR, BLAS_DEFINITIONS and BLAS_LIBRARIES_DIR -# - removed BLAS95_LIBRARIES -# -# TODO (CGAL): -# - find CBLAS (http://www.netlib.org/cblas) on Unix? - - -include(CheckFunctionExists) - -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake) - - -# This macro checks for the existence of the combination of fortran libraries -# given by _list. If the combination is found, this macro checks (using the -# check_function_exists macro) whether can link against that library -# combination using the name of a routine given by _name using the linker -# flags given by _flags. If the combination of libraries is found and passes -# the link test, LIBRARIES is set to the list of complete library paths that -# have been found and DEFINITIONS to the required definitions. -# Otherwise, LIBRARIES is set to FALSE. -# N.B. _prefix is the prefix applied to the names of all cached variables that -# are generated internally and marked advanced by this macro. -macro(check_fortran_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _path) - #message("DEBUG: check_fortran_libraries(${_list} in ${_path})") - - # Check for the existence of the libraries given by _list - set(_libraries_found TRUE) - set(_libraries_work FALSE) - set(${DEFINITIONS} "") - set(${LIBRARIES} "") - set(_combined_name) - foreach(_library ${_list}) - set(_combined_name ${_combined_name}_${_library}) - - if(_libraries_found) - # search first in ${_path} - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS ${_path} NO_DEFAULT_PATH - ) - # if not found, search in environment variables and system - if ( WIN32 ) - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS ENV LIB - ) - elseif ( APPLE ) - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH - ) - else () - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH - ) - endif() - #message("DEBUG: find_library(${_library}) = ${${_prefix}_${_library}_LIBRARY}") - mark_as_advanced(${_prefix}_${_library}_LIBRARY) - set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) - set(_libraries_found ${${_prefix}_${_library}_LIBRARY}) - endif(_libraries_found) - endforeach(_library ${_list}) - if(_libraries_found) - set(_libraries_found ${${LIBRARIES}}) - endif() - - # Test this combination of libraries with the Fortran/f2c interface. - # We test the Fortran interface first as it is well standardized. - if(_libraries_found AND NOT _libraries_work) - set(${DEFINITIONS} "-D${_prefix}_USE_F2C") - set(${LIBRARIES} ${_libraries_found}) - # Some C++ linkers require the f2c library to link with Fortran libraries. - # I do not know which ones, thus I just add the f2c library if it is available. - find_package( F2C QUIET ) - if ( F2C_FOUND ) - set(${DEFINITIONS} ${${DEFINITIONS}} ${F2C_DEFINITIONS}) - set(${LIBRARIES} ${${LIBRARIES}} ${F2C_LIBRARIES}) - endif() - set(CMAKE_REQUIRED_DEFINITIONS ${${DEFINITIONS}}) - set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}}) - #message("DEBUG: CMAKE_REQUIRED_DEFINITIONS = ${CMAKE_REQUIRED_DEFINITIONS}") - #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - # Check if function exists with f2c calling convention (ie a trailing underscore) - check_function_exists(${_name}_ ${_prefix}_${_name}_${_combined_name}_f2c_WORKS) - #message("DEBUG: check_function_exists(${_name}_) = ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS}") - set(CMAKE_REQUIRED_DEFINITIONS} "") - set(CMAKE_REQUIRED_LIBRARIES "") - mark_as_advanced(${_prefix}_${_name}_${_combined_name}_f2c_WORKS) - set(_libraries_work ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS}) - endif(_libraries_found AND NOT _libraries_work) - - # If not found, test this combination of libraries with a C interface. - # A few implementations (ie ACML) provide a C interface. Unfortunately, there is no standard. - if(_libraries_found AND NOT _libraries_work) - set(${DEFINITIONS} "") - set(${LIBRARIES} ${_libraries_found}) - set(CMAKE_REQUIRED_DEFINITIONS "") - set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}}) - #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - check_function_exists(${_name} ${_prefix}_${_name}${_combined_name}_WORKS) - #message("DEBUG: check_function_exists(${_name}) = ${${_prefix}_${_name}${_combined_name}_WORKS}") - set(CMAKE_REQUIRED_LIBRARIES "") - mark_as_advanced(${_prefix}_${_name}${_combined_name}_WORKS) - set(_libraries_work ${${_prefix}_${_name}${_combined_name}_WORKS}) - endif(_libraries_found AND NOT _libraries_work) - - # on failure - if(NOT _libraries_work) - set(${DEFINITIONS} "") - set(${LIBRARIES} FALSE) - endif() - #message("DEBUG: ${DEFINITIONS} = ${${DEFINITIONS}}") - #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") -endmacro(check_fortran_libraries) - - -# -# main -# - -# Is it already configured? -if (BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES) - - set(BLAS_FOUND TRUE) - -else() - - # reset variables - set( BLAS_INCLUDE_DIR "" ) - set( BLAS_DEFINITIONS "" ) - set( BLAS_LINKER_FLAGS "" ) - set( BLAS_LIBRARIES "" ) - set( BLAS_LIBRARIES_DIR "" ) - - # Look first for the TAUCS library distributed with CGAL in auxiliary/taucs. - # Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR. - include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake) - - # Search for BLAS in CGAL_TAUCS_INCLUDE_DIR/CGAL_TAUCS_LIBRARIES_DIR (TAUCS shipped with CGAL)... - if(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED) - - # if VC++: done - set( BLAS_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}" ) - set( BLAS_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" ) - - # ...else search for BLAS in $BLAS_LIB_DIR environment variable - else(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED) - - # - # Search for BLAS in possible libraries - # in $BLAS_LIB_DIR environment variable and in usual places. - # - - # Read environment variables - fetch_env_var(BLAS_LIB_DIR) - fetch_env_var(MKL_LIB_DIR) - - # BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "cblas;f77blas;atlas" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in PhiPACK libraries? (requires generic BLAS lib, too) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "sgemm;dgemm;blas" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in Alpha CXML library? - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "cxml" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in Alpha DXML library? (now called CXML, see above) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "dxml" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in Sun Performance library? - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "-xlic_lib=sunperf" - "sunperf;sunmath" - "${BLAS_LIB_DIR}" - ) - if(BLAS_LIBRARIES) - # Extra linker flag - set(BLAS_LINKER_FLAGS "-xlic_lib=sunperf") - endif() - endif() - - # BLAS in SCSL library? (SGI/Cray Scientific Library) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "scsl" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in SGIMATH library? - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "complib.sgimath" - "${BLAS_LIB_DIR}" - ) - endif() - - # BLAS in IBM ESSL library? (requires generic BLAS lib, too) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "essl;blas" - "${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl 10 library? - # TODO: add shared variants - if (WIN32) - # intel mkl library? (static, 32bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - SGEMM - "" - "mkl_intel_c;mkl_intel_thread;mkl_core;libiomp5md" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl library? (static, ia64 and em64t 64 bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - SGEMM - "" - "mkl_intel_lp64;mkl_intel_thread_lp64;mkl_core;libiomp5md" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - else(WIN32) - # intel mkl library? (static, 32bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_intel;mkl_intel_thread;mkl_core;iomp5;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl library? (static, ia64 and em64t 64 bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_intel_lp64;mkl_intel_thread_lp64;mkl_core;iomp5;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - endif (WIN32) - - # older versions of intel mkl libs - - # intel mkl library? (shared) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl;guide;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl library? (static, 32bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_ia32;guide;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl library? (static, ia64 64bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_ipf;guide;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - # intel mkl library? (static, em64t 64bit) - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "mkl_em64t;guide;pthread" - "${MKL_LIB_DIR} ${BLAS_LIB_DIR}" - ) - endif() - - #BLAS in acml library? - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "acml" - "${BLAS_LIB_DIR}" - ) - endif() - - # Apple BLAS library? - if(NOT BLAS_LIBRARIES) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "Accelerate" - "${BLAS_LIB_DIR}" - ) - endif() - - if ( NOT BLAS_LIBRARIES ) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "vecLib" - "${BLAS_LIB_DIR}" - ) - endif ( NOT BLAS_LIBRARIES ) - - # Generic BLAS library? - # This configuration *must* be the last try as this library is notably slow. - if ( NOT BLAS_LIBRARIES ) - check_fortran_libraries( - BLAS_DEFINITIONS - BLAS_LIBRARIES - BLAS - sgemm - "" - "blas" - "${BLAS_LIB_DIR}" - ) - endif() - - endif(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED) - - if(BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES) - set(BLAS_FOUND TRUE) - else() - set(BLAS_FOUND FALSE) - endif() - - if(NOT BLAS_FIND_QUIETLY) - if(BLAS_FOUND) - message(STATUS "A library with BLAS API found.") - else(BLAS_FOUND) - if(BLAS_FIND_REQUIRED) - message(FATAL_ERROR "A required library with BLAS API not found. Please specify library location.") - else() - message(STATUS "A library with BLAS API not found. Please specify library location.") - endif() - endif(BLAS_FOUND) - endif(NOT BLAS_FIND_QUIETLY) - - # Add variables to cache - set( BLAS_INCLUDE_DIR "${BLAS_INCLUDE_DIR}" - CACHE PATH "Directories containing the BLAS header files" FORCE ) - set( BLAS_DEFINITIONS "${BLAS_DEFINITIONS}" - CACHE STRING "Compilation options to use BLAS" FORCE ) - set( BLAS_LINKER_FLAGS "${BLAS_LINKER_FLAGS}" - CACHE STRING "Linker flags to use BLAS" FORCE ) - set( BLAS_LIBRARIES "${BLAS_LIBRARIES}" - CACHE FILEPATH "BLAS libraries name" FORCE ) - set( BLAS_LIBRARIES_DIR "${BLAS_LIBRARIES_DIR}" - CACHE PATH "Directories containing the BLAS libraries" FORCE ) - - #message("DEBUG: BLAS_INCLUDE_DIR = ${BLAS_INCLUDE_DIR}") - #message("DEBUG: BLAS_DEFINITIONS = ${BLAS_DEFINITIONS}") - #message("DEBUG: BLAS_LINKER_FLAGS = ${BLAS_LINKER_FLAGS}") - #message("DEBUG: BLAS_LIBRARIES = ${BLAS_LIBRARIES}") - #message("DEBUG: BLAS_LIBRARIES_DIR = ${BLAS_LIBRARIES_DIR}") - #message("DEBUG: BLAS_FOUND = ${BLAS_FOUND}") - -endif(BLAS_LIBRARIES_DIR OR BLAS_LIBRARIES) - -if(BLAS_FOUND) - set(BLAS_USE_FILE "CGAL_UseBLAS") -endif(BLAS_FOUND) diff --git a/Installation/cmake/modules/FindF2C.cmake b/Installation/cmake/modules/FindF2C.cmake index 105a31632d2..c7fe3712365 100644 --- a/Installation/cmake/modules/FindF2C.cmake +++ b/Installation/cmake/modules/FindF2C.cmake @@ -13,12 +13,7 @@ else(F2C_LIBRARIES) set(F2C_DEFINITIONS) - # F2C shipped with CGAL (as part of TAUCS)? - # If found, we will search for f2c library in ${CGAL_TAUCS_LIBRARIES_DIR}. - include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake) - find_library(F2C_LIBRARIES NAMES f2c g2c vcf2c - PATHS ${CGAL_TAUCS_LIBRARIES_DIR} DOC "F2C library" ) diff --git a/Installation/cmake/modules/FindLAPACK.cmake b/Installation/cmake/modules/FindLAPACK.cmake deleted file mode 100644 index 8612095f14e..00000000000 --- a/Installation/cmake/modules/FindLAPACK.cmake +++ /dev/null @@ -1,324 +0,0 @@ -# Find LAPACK library -# -# This module finds an installed library that implements the LAPACK -# linear-algebra interface (see http://www.netlib.org/lapack/). -# The approach follows mostly that taken for the autoconf macro file, acx_lapack.m4 -# (distributed at http://ac-archive.sourceforge.net/ac-archive/acx_lapack.html). -# -# This module sets the following variables: -# LAPACK_FOUND - set to true if a library implementing the LAPACK interface -# is found -# LAPACK_INCLUDE_DIR - Directories containing the LAPACK header files -# LAPACK_DEFINITIONS - Compilation options to use LAPACK -# LAPACK_LINKER_FLAGS - Linker flags to use LAPACK (excluding -l -# and -L). -# LAPACK_LIBRARIES_DIR - Directories containing the LAPACK libraries. -# May be null if LAPACK_LIBRARIES contains libraries name using full path. -# LAPACK_LIBRARIES - List of libraries to link against LAPACK interface. -# May be null if the compiler supports auto-link (e.g. VC++). -# LAPACK_USE_FILE - The name of the cmake module to include to compile -# applications or libraries using LAPACK. -# -# This module was modified by CGAL team: -# - find LAPACK library shipped with TAUCS -# - find libraries for a C++ compiler, instead of Fortran -# - added LAPACK_INCLUDE_DIR, LAPACK_DEFINITIONS and LAPACK_LIBRARIES_DIR -# - removed LAPACK95_LIBRARIES -# -# TODO (CGAL): -# - find CLAPACK (http://www.netlib.org/clapack) on Unix? - - -include(CheckFunctionExists) - -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Macros.cmake) - - -# This macro checks for the existence of the combination of fortran libraries -# given by _list. If the combination is found, this macro checks (using the -# check_function_exists macro) whether can link against that library -# combination using the name of a routine given by _name using the linker -# flags given by _flags. If the combination of libraries is found and passes -# the link test, LIBRARIES is set to the list of complete library paths that -# have been found and DEFINITIONS to the required definitions. -# Otherwise, LIBRARIES is set to FALSE. -# N.B. _prefix is the prefix applied to the names of all cached variables that -# are generated internally and marked advanced by this macro. -macro(check_lapack_libraries DEFINITIONS LIBRARIES _prefix _name _flags _list _blas _path) - #message("DEBUG: check_lapack_libraries(${_list} in ${_path} with ${_blas})") - - # Check for the existence of the libraries given by _list - set(_libraries_found TRUE) - set(_libraries_work FALSE) - set(${DEFINITIONS} "") - set(${LIBRARIES} "") - set(_combined_name) - foreach(_library ${_list}) - set(_combined_name ${_combined_name}_${_library}) - - if(_libraries_found) - # search first in ${_path} - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS ${_path} NO_DEFAULT_PATH - ) - # if not found, search in environment variables and system - if ( WIN32 ) - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS ENV LIB - ) - elseif ( APPLE ) - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV DYLD_LIBRARY_PATH - ) - else () - find_library(${_prefix}_${_library}_LIBRARY - NAMES ${_library} - PATHS /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH - ) - endif() - #message("DEBUG: find_library(${_library}) = ${${_prefix}_${_library}_LIBRARY}") - mark_as_advanced(${_prefix}_${_library}_LIBRARY) - set(${LIBRARIES} ${${LIBRARIES}} ${${_prefix}_${_library}_LIBRARY}) - set(_libraries_found ${${_prefix}_${_library}_LIBRARY}) - endif(_libraries_found) - endforeach(_library ${_list}) - if(_libraries_found) - set(_libraries_found ${${LIBRARIES}}) - endif() - - # Test this combination of libraries with the Fortran/f2c interface. - # We test the Fortran interface first as it is well standardized. - if(_libraries_found AND NOT _libraries_work) - set(${DEFINITIONS} "-D${_prefix}_USE_F2C") - set(${LIBRARIES} ${_libraries_found}) - # Some C++ linkers require the f2c library to link with Fortran libraries. - # I do not know which ones, thus I just add the f2c library if it is available. - find_package( F2C QUIET ) - if ( F2C_FOUND ) - set(${DEFINITIONS} ${${DEFINITIONS}} ${F2C_DEFINITIONS}) - set(${LIBRARIES} ${${LIBRARIES}} ${F2C_LIBRARIES}) - endif() - set(CMAKE_REQUIRED_DEFINITIONS ${${DEFINITIONS}}) - set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas}) - #message("DEBUG: CMAKE_REQUIRED_DEFINITIONS = ${CMAKE_REQUIRED_DEFINITIONS}") - #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - # Check if function exists with f2c calling convention (ie a trailing underscore) - check_function_exists(${_name}_ ${_prefix}_${_name}_${_combined_name}_f2c_WORKS) - #message("DEBUG: check_function_exists(${_name}_) = ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS}") - set(CMAKE_REQUIRED_DEFINITIONS} "") - set(CMAKE_REQUIRED_LIBRARIES "") - mark_as_advanced(${_prefix}_${_name}_${_combined_name}_f2c_WORKS) - set(_libraries_work ${${_prefix}_${_name}_${_combined_name}_f2c_WORKS}) - endif(_libraries_found AND NOT _libraries_work) - - # If not found, test this combination of libraries with a C interface. - # A few implementations (ie ACML) provide a C interface. Unfortunately, there is no standard. - if(_libraries_found AND NOT _libraries_work) - set(${DEFINITIONS} "") - set(${LIBRARIES} ${_libraries_found}) - set(CMAKE_REQUIRED_DEFINITIONS "") - set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_blas}) - #message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") - check_function_exists(${_name} ${_prefix}_${_name}${_combined_name}_WORKS) - #message("DEBUG: check_function_exists(${_name}) = ${${_prefix}_${_name}${_combined_name}_WORKS}") - set(CMAKE_REQUIRED_LIBRARIES "") - mark_as_advanced(${_prefix}_${_name}${_combined_name}_WORKS) - set(_libraries_work ${${_prefix}_${_name}${_combined_name}_WORKS}) - endif(_libraries_found AND NOT _libraries_work) - - # on failure - if(NOT _libraries_work) - set(${DEFINITIONS} "") - set(${LIBRARIES} FALSE) - endif() - #message("DEBUG: ${DEFINITIONS} = ${${DEFINITIONS}}") - #message("DEBUG: ${LIBRARIES} = ${${LIBRARIES}}") -endmacro(check_lapack_libraries) - - -# -# main -# - -# LAPACK requires BLAS -if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) - find_package(BLAS) -else() - find_package(BLAS REQUIRED) -endif() - -if (NOT BLAS_FOUND) - - message(STATUS "LAPACK requires BLAS.") - set(LAPACK_FOUND FALSE) - -# Is it already configured? -elseif (LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES) - - set(LAPACK_FOUND TRUE) - -else() - - # reset variables - set( LAPACK_INCLUDE_DIR "" ) - set( LAPACK_DEFINITIONS "" ) - set( LAPACK_LINKER_FLAGS "" ) # unused (yet) - set( LAPACK_LIBRARIES "" ) - set( LAPACK_LIBRARIES_DIR "" ) - - # Look first for the TAUCS library distributed with CGAL in auxiliary/taucs. - # Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR. - include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake) - - # Search for LAPACK in CGAL_TAUCS_INCLUDE_DIR/CGAL_TAUCS_LIBRARIES_DIR (TAUCS shipped with CGAL)... - if(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED) - - # if VC++: done - set( LAPACK_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}" ) - set( LAPACK_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" ) - - # ...else in $LAPACK_LIB_DIR environment variable - else(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED) - - # - # Search for LAPACK in possible libraries - # in $LAPACK_LIB_DIR environment variable and in usual places. - # - - # Read environment variables - fetch_env_var(LAPACK_LIB_DIR) - fetch_env_var(MKL_LIB_DIR) - - #intel mkl 10 lapack? - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "mkl_core" - "${BLAS_LIBRARIES}" - "${MKL_LIB_DIR} ${LAPACK_LIB_DIR}" - ) - endif() - - # older versions of intel mkl lapack? - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "mkl_lapack" - "${BLAS_LIBRARIES}" - "${MKL_LIB_DIR} ${LAPACK_LIB_DIR}" - ) - endif() - - - #acml lapack? - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "acml" - "${BLAS_LIBRARIES}" - "${LAPACK_LIB_DIR}" - ) - endif() - - # Apple LAPACK library? - if(NOT LAPACK_LIBRARIES) - check_lapack_libraries( - LAPACK_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "Accelerate" - "${BLAS_LIBRARIES}" - "${LAPACK_LIB_DIR}" - ) - endif() - - if ( NOT LAPACK_LIBRARIES ) - check_lapack_libraries( - LAPACK_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "vecLib" - "${BLAS_LIBRARIES}" - "${LAPACK_LIB_DIR}" - ) - endif ( NOT LAPACK_LIBRARIES ) - - # Generic LAPACK library? - # This configuration *must* be the last try as this library is notably slow. - if ( NOT LAPACK_LIBRARIES ) - check_lapack_libraries( - LAPACK_DEFINITIONS - LAPACK_LIBRARIES - LAPACK - cheev - "" - "lapack" - "${BLAS_LIBRARIES}" - "${LAPACK_LIB_DIR}" - ) - endif() - - endif(CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED) - - if(LAPACK_LIBRARIES_DIR OR LAPACK_LIBRARIES) - set(LAPACK_FOUND TRUE) - else() - set(LAPACK_FOUND FALSE) - endif() - - if(NOT LAPACK_FIND_QUIETLY) - if(LAPACK_FOUND) - message(STATUS "A library with LAPACK API found.") - else(LAPACK_FOUND) - if(LAPACK_FIND_REQUIRED) - message(FATAL_ERROR "A required library with LAPACK API not found. Please specify library location.") - else() - message(STATUS "A library with LAPACK API not found. Please specify library location.") - endif() - endif(LAPACK_FOUND) - endif(NOT LAPACK_FIND_QUIETLY) - - # Add variables to cache - set( LAPACK_INCLUDE_DIR "${LAPACK_INCLUDE_DIR}" - CACHE PATH "Directories containing the LAPACK header files" FORCE ) - set( LAPACK_DEFINITIONS "${LAPACK_DEFINITIONS}" - CACHE STRING "Compilation options to use LAPACK" FORCE ) - set( LAPACK_LINKER_FLAGS "${LAPACK_LINKER_FLAGS}" - CACHE STRING "Linker flags to use LAPACK" FORCE ) - set( LAPACK_LIBRARIES "${LAPACK_LIBRARIES}" - CACHE FILEPATH "LAPACK libraries name" FORCE ) - set( LAPACK_LIBRARIES_DIR "${LAPACK_LIBRARIES_DIR}" - CACHE PATH "Directories containing the LAPACK libraries" FORCE ) - - #message("DEBUG: LAPACK_INCLUDE_DIR = ${LAPACK_INCLUDE_DIR}") - #message("DEBUG: LAPACK_DEFINITIONS = ${LAPACK_DEFINITIONS}") - #message("DEBUG: LAPACK_LINKER_FLAGS = ${LAPACK_LINKER_FLAGS}") - #message("DEBUG: LAPACK_LIBRARIES = ${LAPACK_LIBRARIES}") - #message("DEBUG: LAPACK_LIBRARIES_DIR = ${LAPACK_LIBRARIES_DIR}") - #message("DEBUG: LAPACK_FOUND = ${LAPACK_FOUND}") - -endif(NOT BLAS_FOUND) - -if(LAPACK_FOUND) - set(LAPACK_USE_FILE "CGAL_UseLAPACK") -endif(LAPACK_FOUND) diff --git a/Installation/cmake/modules/FindTAUCS.cmake b/Installation/cmake/modules/FindTAUCS.cmake deleted file mode 100644 index f45c51dd9d6..00000000000 --- a/Installation/cmake/modules/FindTAUCS.cmake +++ /dev/null @@ -1,129 +0,0 @@ -# This module finds the TAUCS libraries. -# -# This module sets the following variables: -# TAUCS_FOUND - Set to true if headers and libraries are found -# TAUCS_INCLUDE_DIR - Directories containing the TAUCS header files -# TAUCS_DEFINITIONS - Compilation options to use TAUCS -# TAUCS_LIBRARIES_DIR - Directories containing the TAUCS libraries. -# May be null if TAUCS_LIBRARIES contains libraries name using full path. -# TAUCS_LIBRARIES - TAUCS libraries name. -# May be null if the compiler supports auto-link (e.g. VC++). -# TAUCS_USE_FILE - The name of the cmake module to include to compile -# applications or libraries using TAUCS. - -include(${CMAKE_CURRENT_LIST_DIR}/CGAL_GeneratorSpecificSettings.cmake) - -# TAUCS requires LAPACK -if(TAUCS_FIND_QUIETLY OR NOT TAUCS_FIND_REQUIRED) - find_package(LAPACK) -else() - find_package(LAPACK REQUIRED) -endif() - -if (NOT LAPACK_FOUND) - - message(STATUS "TAUCS requires LAPACK and BLAS.") - set(TAUCS_FOUND FALSE) - -# Is it already configured? -elseif (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES_DIR) - - set(TAUCS_FOUND TRUE) - -elseif (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES) - - set(TAUCS_FOUND TRUE) - -else() - - # reset variables - set( TAUCS_DEFINITIONS "" ) # unused (yet) - set( TAUCS_LIBRARIES "" ) - set( TAUCS_LIBRARIES_DIR "" ) - - # Look first for the TAUCS library distributed with CGAL in auxiliary/taucs. - # Set CGAL_TAUCS_FOUND, CGAL_TAUCS_INCLUDE_DIR and CGAL_TAUCS_LIBRARIES_DIR. - include(${CMAKE_CURRENT_LIST_DIR}/CGAL_Locate_CGAL_TAUCS.cmake) - - # Search for TAUCS headers in ${CGAL_TAUCS_INCLUDE_DIR} (TAUCS shipped with CGAL), - # else in $TAUCS_INC_DIR environment variable. - if( CGAL_TAUCS_FOUND ) - set( TAUCS_INCLUDE_DIR "${CGAL_TAUCS_INCLUDE_DIR}" ) - else() - find_path(TAUCS_INCLUDE_DIR - NAMES taucs.h - HINTS ${CGAL_TAUCS_INCLUDE_DIR} - ENV TAUCS_DIR - ENV TAUCS_INC_DIR - PATH_SUFFIXES taucs include - ) - endif() - - # Search for TAUCS libraries in ${CGAL_TAUCS_LIBRARIES_DIR} (TAUCS shipped with CGAL), - # else in $TAUCS_LIB_DIR environment variable. - if( CGAL_TAUCS_FOUND AND CGAL_AUTO_LINK_ENABLED ) - # if VC++: done - set( TAUCS_LIBRARIES_DIR "${CGAL_TAUCS_LIBRARIES_DIR}" ) - else() - find_library(TAUCS_LIBRARY - NAMES "taucs" - PATHS ${CGAL_TAUCS_LIBRARIES_DIR} - ENV TAUCS_DIR - ENV TAUCS_LIB_DIR - PATH_SUFFIXES taucs lib - DOC "TAUCS library" - ) - find_library(METIS_LIBRARY - NAMES "metis" - PATHS ${CGAL_TAUCS_LIBRARIES_DIR} - ENV TAUCS - ENV TAUCS_LIB_DIR - PATH_SUFFIXES taucs lib - DOC "Metis library" - ) - if(TAUCS_LIBRARY AND METIS_LIBRARY) - set( TAUCS_LIBRARIES "${TAUCS_LIBRARY};${METIS_LIBRARY}" ) - endif() - endif() - - if (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES_DIR) - set(TAUCS_FOUND TRUE) - elseif (TAUCS_INCLUDE_DIR AND TAUCS_LIBRARIES) - set(TAUCS_FOUND TRUE) - else() - set(TAUCS_FOUND FALSE) - endif() - - if(NOT TAUCS_FIND_QUIETLY) - if(TAUCS_FOUND) - message(STATUS "TAUCS libraries found.") - else(TAUCS_FOUND) - if(TAUCS_FIND_REQUIRED) - message(FATAL_ERROR "TAUCS libraries not found. Please specify libraries location.") - else() - message(STATUS "TAUCS libraries not found. Please specify libraries location.") - endif() - endif(TAUCS_FOUND) - endif(NOT TAUCS_FIND_QUIETLY) - - # Add variables to cache - set( TAUCS_INCLUDE_DIR "${TAUCS_INCLUDE_DIR}" - CACHE PATH "Directories containing the TAUCS header files" FORCE ) - set( TAUCS_DEFINITIONS "${TAUCS_DEFINITIONS}" - CACHE STRING "Compilation options to use TAUCS" FORCE ) - set( TAUCS_LIBRARIES "${TAUCS_LIBRARIES}" - CACHE FILEPATH "TAUCS libraries name" FORCE ) - set( TAUCS_LIBRARIES_DIR "${TAUCS_LIBRARIES_DIR}" - CACHE PATH "Directories containing the TAUCS libraries" FORCE ) - - #message("DEBUG: TAUCS_INCLUDE_DIR = ${TAUCS_INCLUDE_DIR}") - #message("DEBUG: TAUCS_DEFINITIONS = ${TAUCS_DEFINITIONS}") - #message("DEBUG: TAUCS_LIBRARIES = ${TAUCS_LIBRARIES}") - #message("DEBUG: TAUCS_LIBRARIES_DIR = ${TAUCS_LIBRARIES_DIR}") - #message("DEBUG: TAUCS_FOUND = ${TAUCS_FOUND}") - -endif(NOT LAPACK_FOUND) - -if(TAUCS_FOUND) - set(TAUCS_USE_FILE "CGAL_UseTAUCS") -endif(TAUCS_FOUND) diff --git a/Installation/cmake/modules/config/support/test_ATLAS.cpp b/Installation/cmake/modules/config/support/test_ATLAS.cpp deleted file mode 100644 index ab0a40ee9e1..00000000000 --- a/Installation/cmake/modules/config/support/test_ATLAS.cpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Laurent Saboret - -// Test if the LAPACK subset in ATLAS is available - - -#include - -extern "C" { - // Fortran interface taken from ATLAS/interfaces/lapack/F77/src/dpotrf.f - extern void dpotrf_(char *uplo, int *n, double *a, int *lda, int *info); -} - - -int main() -{ - // Call dpotrf_() Lapack routine (Cholesky factorization) - int sn_size = 0; - int lda = 1; - int info; - dpotrf_((char*)"LOWER", - &sn_size, - NULL, - &lda, - &info); - - std::cout << "ok for ATLAS" << std::endl; - - return 0; -} diff --git a/Installation/cmake/modules/config/support/test_BLAS.cpp b/Installation/cmake/modules/config/support/test_BLAS.cpp deleted file mode 100644 index bd2d3739bb7..00000000000 --- a/Installation/cmake/modules/config/support/test_BLAS.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $ID$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Laurent Saboret - -// Test if BLAS is available - -// blaswrap.h maps CBLAS function names to BLAS standard Fortran interface. -#ifdef CGAL_USE_CBLASWRAP - #ifndef CGAL_USE_F2C - #define CGAL_USE_F2C - #endif - #include -#endif - -#include - -extern "C" { - // Fortran interface (taken from www.netlib.org/clapack)... - void dgemm_(char* transa, char* transb, int* m, - int* n, int* k, - double* alpha, - double* a, int* lda, double* b, int* ldb, - double* beta, - double* c, int* ldc); - // ... or C interface (taken from AMD Core Math Library) - void dgemm (char transa, char transb, int m, - int n, int k, - double alpha, - double* a, int lda, double* b, int ldb, - double beta, - double* c, int ldc); -} - -namespace CGAL { namespace BLAS { - -inline -void dgemm (char* transa, char* transb, int* m, - int* n, int* k, - double* alpha, - double* a, int* lda, double* b, int* ldb, - double* beta, - double* c, int* ldc) -{ -#ifdef CGAL_USE_F2C - ::dgemm_(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc); -#else - ::dgemm (*transa, *transb, *m, *n, *k, *alpha, a, *lda, b, *ldb, *beta, c, *ldc); -#endif -} - -} } - -int main() -{ - char S[2] = "N"; - double A = 2.0; - double B = 3.0; - double C = 5.0; - double alpha = 7.0; - double beta = 11.0; - int n = 1; - int ld = 1; - - CGAL::BLAS::dgemm(S,S, &n,&n,&n, &alpha, &A,&ld, &B,&ld, &beta, &C,&ld); - if(C == 97.0) { - std::cout << "ok for BLAS" << std::endl; - return 0; - } - else { - return 1; - } -} diff --git a/Installation/cmake/modules/config/support/test_LAPACK.cpp b/Installation/cmake/modules/config/support/test_LAPACK.cpp deleted file mode 100644 index 2580e8eec4d..00000000000 --- a/Installation/cmake/modules/config/support/test_LAPACK.cpp +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France). -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Marc Pouget - -// Test if LAPACK is available - -#include -#include - -extern "C" { - // taken from acml.h -void dgelss(int m, int n, int nrhs, - double *a, int lda, double *b, int ldb, double *sing, - double rcond, int *irank, int *info); - -void dgelss_(int *m, int *n, int *nrhs, - double *a, int *lda, double *b, int *ldb, double * - s, double *rcond, int *rank, double *work, int *lwork, - int *info); -} - -namespace CGAL { namespace LAPACK { - -inline -void dgelss(int *m, int *n, int *nrhs, - double *a, int *lda, double *b, int *ldb, double * - s, double *rcond, int *rank, double *work, int *lwork, - int *info) -{ -#ifdef CGAL_USE_F2C - ::dgelss_(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, info); -#else - ::dgelss(*m, *n, *nrhs, a, *lda, b, *ldb, s, *rcond, rank, info); -#endif -} - -} } - -int main() -{ - double M=1, B=1; - int m = 1, - n = 1, - nrhs = 1, - lda = m, - ldb = m, - rank, - lwork = 5*m, - info; - //c style - double * sing_values = new double[n]; // * sing_values = (double*) malloc(n*sizeof(double)); - double* work = new double[lwork]; // (double*) malloc(lwork*sizeof(double)); - - double rcond = -1; - - CGAL::LAPACK::dgelss(&m, &n, &nrhs, &M, &lda, &B, &ldb, sing_values, - &rcond, &rank, work, &lwork, &info); - assert(info==0); - assert(B==1.); - //clean up - delete sing_values; - delete work; - - std::cout << "ok for lapack" << std::endl; - - return 0; -} diff --git a/Installation/include/CGAL/auto_link/LAPACK.h b/Installation/include/CGAL/auto_link/LAPACK.h deleted file mode 100644 index d3214586555..00000000000 --- a/Installation/include/CGAL/auto_link/LAPACK.h +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) 1997-2004 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Laurent Saboret - -#ifndef CGAL_AUTO_LINK_LAPACK_H -#define CGAL_AUTO_LINK_LAPACK_H - -#include - -// Skip the whole file if auto-link is off -#if !defined(CGAL_NO_AUTOLINK_LAPACK) && !defined(CGAL_NO_AUTOLINK) - - -#if defined(_WIN32) && !defined(_WIN64) // if Windows 32 bits - -// CGAL ships with ATLAS for Windows 32 bits, i.e this set of libraries (e.g. for VC++ 8 /MD): -// liblapack.lib libf77blas.lib libcblas.lib libatlas.lib vcf2c-vc80-mt.lib -// -// Notes: - Order matters. -// - Libraries with no "vc" toolset are compiled by gcc/g77. They are -// compatible with VC++ 7.1, 8.0 and 9.0, and with all VC++ runtimes. -// - Tested with 7.1, 8.0 and 9.0. - -#define CGAL_LIB_NAME liblapack -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME libf77blas -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME libcblas -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME libatlas -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME vcf2c -#define CGAL_AUTO_LINK_NOMANGLE -#include - -// ATLAS provides BLAS and LAPACK standard Fortran interface -#ifndef CGAL_USE_F2C - #define CGAL_USE_F2C -#endif - -#endif // Win32 - - -#ifdef _WIN64 // if Windows 64 bits - -// ATLAS is not compatible with Win64, thus CGAL ships with CLAPACK and CBLAS. -// VC++ >= 8.0 is compatible with Windows 64 bits. -// The set set of libraries is (e.g. for VC++ 8 /MD): -// clapack-vc80-mt.lib blas-vc80-mt.lib vcf2c-vc80-mt.lib -// -// Notes: - Order matters. -// - Tested with VC++ 8.0 and 9.0. - -#define CGAL_LIB_NAME clapack -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME blas -#define CGAL_AUTO_LINK_NOMANGLE -#include - -#define CGAL_LIB_NAME vcf2c -#define CGAL_AUTO_LINK_NOMANGLE -#include - -// CLAPACK provides LAPACK standard Fortran interface. -// blaswrap.h maps CBLAS function names to BLAS standard Fortran interface. -#ifndef CGAL_USE_F2C - #define CGAL_USE_F2C -#endif -#include - -#endif // _WIN64 - - -#endif // CGAL_NO_AUTOLINK_LAPACK && CGAL_NO_AUTOLINK - -#endif // CGAL_AUTO_LINK_LAPACK_H diff --git a/Installation/include/CGAL/auto_link/TAUCS.h b/Installation/include/CGAL/auto_link/TAUCS.h deleted file mode 100644 index 9896f412ef9..00000000000 --- a/Installation/include/CGAL/auto_link/TAUCS.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 1997-2004 -// Utrecht University (The Netherlands), -// ETH Zurich (Switzerland), -// INRIA Sophia-Antipolis (France), -// Max-Planck-Institute Saarbruecken (Germany), -// and Tel-Aviv University (Israel). All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Laurent Saboret - -#ifndef CGAL_AUTO_LINK_TAUCS_H -#define CGAL_AUTO_LINK_TAUCS_H - -#include - -// Skip the whole file if auto-link is off -#if !defined(CGAL_NO_AUTOLINK_TAUCS) && !defined(CGAL_NO_AUTOLINK) - -# if defined(_WIN32) || defined(_WIN64) - -# define CGAL_LIB_NAME libtaucs -# define CGAL_AUTO_LINK_NOMANGLE -# include - -# define CGAL_LIB_NAME libmetis -# define CGAL_AUTO_LINK_NOMANGLE -# include - -// Link with LAPACK, BLAS and F2C -# include - -# endif // Win32|Win64 - -#endif // CGAL_NO_AUTOLINK_TAUCS && CGAL_NO_AUTOLINK - -#endif // CGAL_AUTO_LINK_TAUCS_H From 86faeb7fa559e805722def565d83ddab30ae71c5 Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Fri, 8 Mar 2019 09:46:36 +0100 Subject: [PATCH 2/5] Remove deprecated functions/tests of PSP after 2 releases --- .../include/CGAL/bilateral_smooth_point_set.h | 73 ---- .../include/CGAL/compute_average_spacing.h | 59 --- .../CGAL/edge_aware_upsample_point_set.h | 111 ----- .../include/CGAL/estimate_scale.h | 249 ----------- .../include/CGAL/grid_simplify_point_set.h | 59 --- .../CGAL/hierarchy_simplify_point_set.h | 80 ---- .../include/CGAL/jet_estimate_normals.h | 115 ----- .../include/CGAL/jet_smooth_point_set.h | 111 ----- .../include/CGAL/mst_orient_normals.h | 68 --- .../include/CGAL/pca_estimate_normals.h | 71 --- .../include/CGAL/random_simplify_point_set.h | 54 --- .../include/CGAL/remove_outliers.h | 76 ---- .../include/CGAL/structure_point_set.h | 90 ---- .../include/CGAL/vcm_estimate_normals.h | 351 --------------- .../wlop_simplify_and_regularize_point_set.h | 102 +---- .../Point_set_processing_3/CMakeLists.txt | 19 - .../deprecated_analysis_test.cmd | 1 - .../deprecated_analysis_test.cpp | 139 ------ .../deprecated_bilateral_smoothing_test.cmd | 1 - .../deprecated_bilateral_smoothing_test.cpp | 157 ------- .../deprecated_edge_aware_upsample_test.cmd | 1 - .../deprecated_edge_aware_upsample_test.cpp | 168 -------- ...precated_hierarchy_simplification_test.cpp | 87 ---- ...deprecated_jet_pointer_as_property_map.cpp | 48 --- .../deprecated_normal_estimation_test.cmd | 1 - .../deprecated_normal_estimation_test.cpp | 407 ------------------ .../deprecated_read_test.cpp | 121 ------ ...recated_read_test_with_different_pmaps.cpp | 340 --------------- .../deprecated_remove_outliers_test.cmd | 1 - .../deprecated_remove_outliers_test.cpp | 144 ------- .../deprecated_smoothing_test.cmd | 1 - .../deprecated_smoothing_test.cpp | 140 ------ .../deprecated_structuring_test.cpp | 146 ------- .../deprecated_vcm_all_test.cpp | 104 ----- .../deprecated_vcm_plane_test.cpp | 44 -- ...ated_wlop_simplify_and_regularize_test.cmd | 1 - ...ated_wlop_simplify_and_regularize_test.cpp | 170 -------- 37 files changed, 1 insertion(+), 3909 deletions(-) delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_analysis_test.cmd delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_analysis_test.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_bilateral_smoothing_test.cmd delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_bilateral_smoothing_test.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_edge_aware_upsample_test.cmd delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_edge_aware_upsample_test.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_hierarchy_simplification_test.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_jet_pointer_as_property_map.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_normal_estimation_test.cmd delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_normal_estimation_test.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_read_test.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_read_test_with_different_pmaps.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_remove_outliers_test.cmd delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_remove_outliers_test.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_smoothing_test.cmd delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_smoothing_test.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_structuring_test.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_vcm_all_test.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_vcm_plane_test.cpp delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_wlop_simplify_and_regularize_test.cmd delete mode 100644 Point_set_processing_3/test/Point_set_processing_3/deprecated_wlop_simplify_and_regularize_test.cpp diff --git a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h index da0d9c43a97..768c0827eee 100644 --- a/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/bilateral_smooth_point_set.h @@ -670,79 +670,6 @@ bilateral_smooth_point_set( return bilateral_smooth_point_set (points, k, CGAL::Point_set_processing_3::parameters::all_default(points)); } - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::bilateral_smooth_point_set(), please update your code") -double -bilateral_smooth_point_set( - ForwardIterator first, ///< forward iterator on the first input point. - ForwardIterator beyond, ///< past-the-end iterator. - PointMap point_map, ///< point property map. - NormalMap normal_map, ///< normal property map. - unsigned int k, ///< size of the neighborhood for the implicit surface patch fitting. - ///< The larger the value is, the smoother the result will be. - typename Kernel::FT sharpness_angle, ///< controls the sharpness of the result. - ///< The larger the value is, the smoother the result will be. - ///< The range of possible value is [0, 90]. - const Kernel& /*kernel*/) ///< geometric traits. -{ - CGAL::Iterator_range points = CGAL::make_range (first, beyond); - return bilateral_smooth_point_set - (points, - k, - CGAL::parameters::point_map(point_map).normal_map(normal_map) - .sharpness_angle(sharpness_angle).geom_traits(Kernel())); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::bilateral_smooth_point_set(), please update your code") -double -bilateral_smooth_point_set( - ForwardIterator first, ///< forward iterator to the first input point. - ForwardIterator beyond, ///< past-the-end iterator. - PointMap point_map, ///< property map OutputIterator -> Point_3. - NormalMap normal_map, ///< property map ForwardIterator -> Vector_3. - const unsigned int k, ///< number of neighbors. - double sharpness_angle ///< control sharpness(0-90) -) ///< property map OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points = CGAL::make_range (first, beyond); - return bilateral_smooth_point_set - (points, - k, - CGAL::parameters::point_map(point_map).normal_map(normal_map).sharpness_angle(sharpness_angle)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::bilateral_smooth_point_set(), please update your code") -double -bilateral_smooth_point_set( - ForwardIterator first, ///< forward iterator to the first input point. - ForwardIterator beyond, ///< past-the-end iterator. - const unsigned int k, ///< number of neighbors. - double sharpness_angle, ///< control sharpness(0-90) - NormalMap normal_map) ///< property map OutputIterator -> Vector_3. -{ - CGAL::Iterator_range points = CGAL::make_range (first, beyond); - return bilateral_smooth_point_set - (points, - k, - CGAL::parameters::normal_map(normal_map).sharpness_angle(sharpness_angle)); -} -#endif // CGAL_NO_DEPRECATED_CODE /// \endcond diff --git a/Point_set_processing_3/include/CGAL/compute_average_spacing.h b/Point_set_processing_3/include/CGAL/compute_average_spacing.h index a1807ac9f08..f3d17d44302 100644 --- a/Point_set_processing_3/include/CGAL/compute_average_spacing.h +++ b/Point_set_processing_3/include/CGAL/compute_average_spacing.h @@ -291,65 +291,6 @@ compute_average_spacing( return compute_average_spacing (points, k, CGAL::Point_set_processing_3::parameters::all_default(points)); } - - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::compute_average_spacing(), please update your code") -typename Kernel::FT -compute_average_spacing( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of InputIterator -> Point_3 - unsigned int k, ///< number of neighbors. - const Kernel& /*kernel*/) ///< geometric traits. -{ - return compute_average_spacing( - CGAL::make_range (first,beyond), - k, - CGAL::parameters::point_map (point_map).geom_traits (Kernel())); -} - - - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::compute_average_spacing(), please update your code") -typename Kernel_traits::value_type>::Kernel::FT -compute_average_spacing( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of InputIterator -> Point_3 - unsigned int k) ///< number of neighbors -{ - return compute_average_spacing( - CGAL::make_range (first,beyond), - k, - CGAL::parameters::point_map (point_map)); -} - -// deprecated API -template < typename ConcurrencyTag, typename InputIterator > -typename Kernel_traits::value_type>::Kernel::FT -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::compute_average_spacing(), please update your code") -compute_average_spacing( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond, ///< past-the-end iterator over the input points. - unsigned int k) ///< number of neighbors. -{ - return compute_average_spacing( - CGAL::make_range (first,beyond), k); -} -#endif // CGAL_NO_DEPRECATED_CODE - /// \endcond diff --git a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h index 13874b85ef2..034ee036f89 100644 --- a/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h +++ b/Point_set_processing_3/include/CGAL/edge_aware_upsample_point_set.h @@ -599,117 +599,6 @@ edge_aware_upsample_point_set( return edge_aware_upsample_point_set (points, output, CGAL::Point_set_processing_3::parameters::all_default(points)); } - - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::edge_aware_upsample_point_set(), please update your code") -OutputIterator -edge_aware_upsample_point_set( - ForwardIterator first, ///< forward iterator on the first input point. - ForwardIterator beyond, ///< past-the-end iterator. - OutputIterator output, ///< output iterator where output points and normals - ///< are put. - PointMap point_map, ///< point property map. - NormalMap normal_map, ///< vector property map. - const typename Kernel::FT sharpness_angle, ///< - ///< controls the preservation of sharp features. - ///< The larger the value is, - ///< the smoother the result will be. - ///< The range of possible values is `[0, 90]`. - ///< See section \ref Point_set_processing_3Upsample_Parameter2 - ///< for an example. - typename Kernel::FT edge_sensitivity, ///< - ///< larger values of edge-sensitivity give higher priority - ///< to inserting points along sharp features. - ///< The range of possible values is `[0, 1]`. - ///< See section \ref Point_set_processing_3Upsample_Parameter1 - ///< for an example. - typename Kernel::FT neighbor_radius, ///< - ///< indicates the radius of the largest hole that should be filled. - ///< The default value is set to 3 times the average spacing of the point set. - ///< If the value given by user is smaller than the average spacing, - ///< the function will use the default value instead. - const std::size_t number_of_output_points,///< number of output - ///< points to generate. - const Kernel& /*kernel*/ ///< geometric traits. -) -{ - return edge_aware_upsample_point_set - (CGAL::make_range (first, beyond), output, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - sharpness_angle (sharpness_angle). - edge_sensitivity (edge_sensitivity). - neighbor_radius (neighbor_radius). - number_of_output_points (number_of_output_points). - geom_traits (Kernel())); -} - - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::edge_aware_upsample_point_set(), please update your code") -OutputIterator -edge_aware_upsample_point_set( - ForwardIterator first, ///< forward iterator to the first input point. - ForwardIterator beyond, ///< past-the-end iterator. - OutputIterator output, ///< output iterator over points. - PointMap point_map, ///< property map: `ForwardIterator` -> Point_3. - NormalMap normal_map, ///< property map: `ForwardIterator` -> Vector_3. - double sharpness_angle, ///< control sharpness(0-90) - double edge_sensitivity, ///< edge sensitivity(0-5) - double neighbor_radius, ///< initial size of neighbors. - const std::size_t number_of_output_points///< number of iterations. - ) -{ - return edge_aware_upsample_point_set - (CGAL::make_range (first, beyond), output, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - sharpness_angle (sharpness_angle). - edge_sensitivity (edge_sensitivity). - neighbor_radius (neighbor_radius). - number_of_output_points (number_of_output_points)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::edge_aware_upsample_point_set(), please update your code") -OutputIterator -edge_aware_upsample_point_set( - ForwardIterator first, ///< iterator over the first input point - ForwardIterator beyond, ///< past-the-end iterator - OutputIterator output, ///< output iterator over points. - NormalMap normal_map, ///< property map: OutputIterator -> Vector_3. - double sharpness_angle = 30, ///< control sharpness(0-90) - double edge_sensitivity = 1, ///< edge sensitivity(0-5) - double neighbor_radius = -1, ///< initial size of neighbors. - const std::size_t number_of_output_points = 1000///< number of output points. - ) -{ - return edge_aware_upsample_point_set - (CGAL::make_range (first, beyond), output, - CGAL::parameters::normal_map (normal_map). - sharpness_angle (sharpness_angle). - edge_sensitivity (edge_sensitivity). - neighbor_radius (neighbor_radius). - number_of_output_points (number_of_output_points)); -} -#endif // CGAL_NO_DEPRECATED_CODE /// \endcond } //namespace CGAL diff --git a/Point_set_processing_3/include/CGAL/estimate_scale.h b/Point_set_processing_3/include/CGAL/estimate_scale.h index 860bf5a183e..b85806f5c83 100644 --- a/Point_set_processing_3/include/CGAL/estimate_scale.h +++ b/Point_set_processing_3/include/CGAL/estimate_scale.h @@ -744,255 +744,6 @@ estimate_global_range_scale(const PointRange& points) return estimate_global_range_scale (points, CGAL::Point_set_processing_3::parameters::all_default(points)); } - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_local_k_neighbor_scales(), please update your code") -OutputIterator -estimate_local_k_neighbor_scales( - SamplesInputIterator first, ///< iterator over the first input sample. - SamplesInputIterator beyond, ///< past-the-end iterator over the input samples. - SamplesPointMap samples_map, ///< property map: value_type of InputIterator -> Point_3 or Point_2 - QueriesInputIterator first_query, ///< iterator over the first point where scale must be estimated - QueriesInputIterator beyond_query, ///< past-the-end iterator over the points where scale must be estimated - QueriesPointMap queries_map, ///< property map: value_type of InputIterator -> Point_3 or Point_2 - OutputIterator output, ///< output iterator to store the computed scales - const Kernel& /*kernel*/) ///< geometric traits. -{ - return estimate_local_k_neighbor_scales - (CGAL::make_range (first, beyond), - CGAL::make_range (first_query, beyond_query), - output, - CGAL::parameters::point_map (samples_map). - query_point_map (queries_map). - geom_traits (Kernel())); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_local_k_neighbor_scales(), please update your code") -OutputIterator -estimate_local_k_neighbor_scales( - SamplesInputIterator first, ///< iterator over the first input sample. - SamplesInputIterator beyond, ///< past-the-end iterator over the input samples. - SamplesPointMap samples_map, ///< property map: value_type of InputIterator -> Point_3 or Point_2 - QueriesInputIterator first_query, ///< iterator over the first point where scale must be estimated - QueriesInputIterator beyond_query, ///< past-the-end iterator over the points where scale must be estimated - QueriesPointMap queries_map, ///< property map: value_type of InputIterator -> Point_3 or Point_2 - OutputIterator output) ///< output iterator to store the computed scales -{ - return estimate_local_k_neighbor_scales - (CGAL::make_range (first, beyond), - CGAL::make_range (first_query, beyond_query), - output, - CGAL::parameters::point_map (samples_map). - query_point_map (queries_map)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_local_k_neighbor_scales(), please update your code") -OutputIterator -estimate_local_k_neighbor_scales( - SamplesInputIterator first, ///< iterator over the first input sample. - SamplesInputIterator beyond, ///< past-the-end iterator over the input samples. - QueriesInputIterator first_query, ///< iterator over the first point where scale must be estimated - QueriesInputIterator beyond_query, ///< past-the-end iterator over the points where scale must be estimated - OutputIterator output) ///< output iterator to store the computed scales -{ - return estimate_local_k_neighbor_scales - (CGAL::make_range (first, beyond), - CGAL::make_range (first_query, beyond_query), - output); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_global_k_neighbor_scale(), please update your code") -std::size_t -estimate_global_k_neighbor_scale( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of InputIterator -> Point_3 or Point_2 - const Kernel& kernel) ///< geometric traits. -{ - return estimate_global_k_neighbor_scale - (CGAL::make_range (first, beyond), - CGAL::parameters::point_map (point_map). - geom_traits (kernel)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_global_k_neighbor_scale(), please update your code") -std::size_t -estimate_global_k_neighbor_scale( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map) ///< property map: value_type of InputIterator -> Point_3 or Point_2 -{ - return estimate_global_k_neighbor_scale - (CGAL::make_range (first, beyond), - CGAL::parameters::point_map (point_map)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_global_k_neighbor_scale(), please update your code") -std::size_t -estimate_global_k_neighbor_scale( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond) ///< past-the-end iterator over the input points. -{ - return estimate_global_k_neighbor_scale - (CGAL::make_range (first, beyond)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_local_range_scales(), please update your code") -OutputIterator -estimate_local_range_scales( - SamplesInputIterator first, ///< iterator over the first input sample. - SamplesInputIterator beyond, ///< past-the-end iterator over the input samples. - SamplesPointMap samples_map, ///< property map: value_type of InputIterator -> Point_3 or Point_2 - QueriesInputIterator first_query, ///< iterator over the first point where scale must be estimated - QueriesInputIterator beyond_query, ///< past-the-end iterator over the points where scale must be estimated - QueriesPointMap queries_map, ///< property map: value_type of InputIterator -> Point_3 or Point_2 - OutputIterator output, ///< output iterator to store the computed scales - const Kernel& /*kernel*/) ///< geometric traits. -{ - return estimate_local_range_scales - (CGAL::make_range (first, beyond), - CGAL::make_range (first_query, beyond_query), - output, - CGAL::parameters::point_map (samples_map). - query_point_map (queries_map). - geom_traits (Kernel())); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_local_range_scales(), please update your code") -OutputIterator -estimate_local_range_scales( - SamplesInputIterator first, ///< iterator over the first input sample. - SamplesInputIterator beyond, ///< past-the-end iterator over the input samples. - SamplesPointMap samples_map, ///< property map: value_type of InputIterator -> Point_3 or Point_2 - QueriesInputIterator first_query, ///< iterator over the first point where scale must be estimated - QueriesInputIterator beyond_query, ///< past-the-end iterator over the points where scale must be estimated - QueriesPointMap queries_map, ///< property map: value_type of InputIterator -> Point_3 or Point_2 - OutputIterator output) ///< output iterator to store the computed scales -{ - return estimate_local_range_scales - (CGAL::make_range (first, beyond), - CGAL::make_range (first_query, beyond_query), - output, - CGAL::parameters::point_map (samples_map). - query_point_map (queries_map)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_local_range_scales(), please update your code") -OutputIterator -estimate_local_range_scales( - SamplesInputIterator first, ///< iterator over the first input sample. - SamplesInputIterator beyond, ///< past-the-end iterator over the input samples. - QueriesInputIterator first_query, ///< iterator over the first point where scale must be estimated - QueriesInputIterator beyond_query, ///< past-the-end iterator over the points where scale must be estimated - OutputIterator output) ///< output iterator to store the computed scales -{ - return estimate_local_range_scales - (CGAL::make_range (first, beyond), - CGAL::make_range (first_query, beyond_query), - output); -} - - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_global_range_scale(), please update your code") -double -estimate_global_range_scale( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of InputIterator -> Point_3 or Point_3 - const Kernel& kernel) ///< geometric traits. -{ - return estimate_global_range_scale - (CGAL::make_range (first, beyond), - CGAL::parameters::point_map (point_map). - geom_traits (kernel)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_global_range_scale(), please update your code") -double -estimate_global_range_scale( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map) ///< property map: value_type of InputIterator -> Point_3 or Point_3 -{ - return estimate_global_range_scale - (CGAL::make_range (first, beyond), - CGAL::parameters::point_map (point_map)); -} - - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::estimate_global_range_scale(), please update your code") -double -estimate_global_range_scale( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond) ///< past-the-end iterator over the input points. -{ - return estimate_global_range_scale - (CGAL::make_range (first, beyond)); -} -#endif // CGAL_NO_DEPRECATED_CODE /// \endcond } //namespace CGAL diff --git a/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h b/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h index a4d59e32f92..1fbc7fa6411 100644 --- a/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/grid_simplify_point_set.h @@ -252,65 +252,6 @@ grid_simplify_point_set(PointRange& points, double epsilon) return grid_simplify_point_set (points, epsilon, CGAL::Point_set_processing_3::parameters::all_default(points)); } - - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::grid_simplify_point_set(), please update your code") -ForwardIterator grid_simplify_point_set( - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3 - double epsilon, ///< tolerance value when merging 3D points. - const Kernel& /*kernel*/) ///< geometric traits. -{ - CGAL::Iterator_range points = CGAL::make_range (first, beyond); - return grid_simplify_point_set - (points, - epsilon, - CGAL::parameters::point_map (point_map). - geom_traits (Kernel())); -} - - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::grid_simplify_point_set(), please update your code") -ForwardIterator -grid_simplify_point_set( - ForwardIterator first, ///< iterator over the first input point - ForwardIterator beyond, ///< past-the-end iterator - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3 - double epsilon) ///< tolerance value when merging 3D points -{ - CGAL::Iterator_range points = CGAL::make_range (first, beyond); - return grid_simplify_point_set - (points, - epsilon, - CGAL::parameters::point_map (point_map)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::grid_simplify_point_set(), please update your code") -ForwardIterator -grid_simplify_point_set( - ForwardIterator first, ///< iterator over the first input point - ForwardIterator beyond, ///< past-the-end iterator - double epsilon) ///< tolerance value when merging 3D points -{ - CGAL::Iterator_range points = CGAL::make_range (first, beyond); - return grid_simplify_point_set - (points, - epsilon); -} -#endif // CGAL_NO_DEPRECATED_CODE /// \endcond diff --git a/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h b/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h index b12bda49e87..a906a5bc7d0 100644 --- a/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/hierarchy_simplify_point_set.h @@ -361,86 +361,6 @@ namespace CGAL { return hierarchy_simplify_point_set (points, CGAL::Point_set_processing_3::parameters::all_default(points)); } - -#ifndef CGAL_NO_DEPRECATED_CODE - // deprecated API - template - CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::hierarchy_simplify_point_set(), please update your code") - ForwardIterator hierarchy_simplify_point_set (ForwardIterator begin, - ForwardIterator end, - PointMap point_map, - const unsigned int size, - const double var_max, - const DiagonalizeTraits&, - const Kernel&) - { - CGAL::Iterator_range points (begin, end); - return hierarchy_simplify_point_set - (points, - CGAL::parameters::point_map (point_map). - size (size). - maximum_variation (var_max). - diagonalize_traits (DiagonalizeTraits()). - geom_traits(Kernel())); - } - - // deprecated API - template - CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::hierarchy_simplify_point_set(), please update your code") - ForwardIterator hierarchy_simplify_point_set (ForwardIterator begin, - ForwardIterator end, - PointMap point_map, - const unsigned int size, - const double var_max, - const DiagonalizeTraits& diagonalize_traits) - { - CGAL::Iterator_range points (begin, end); - return hierarchy_simplify_point_set - (points, - CGAL::parameters::point_map (point_map). - size (size). - maximum_variation (var_max). - diagonalize_traits (diagonalize_traits)); - } - - // deprecated API - template - CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::hierarchy_simplify_point_set(), please update your code") - ForwardIterator hierarchy_simplify_point_set (ForwardIterator begin, - ForwardIterator end, - PointMap point_map, - const unsigned int size, - const double var_max) - { - CGAL::Iterator_range points (begin, end); - return hierarchy_simplify_point_set - (points, - CGAL::parameters::point_map (point_map). - size (size). - maximum_variation (var_max)); - } - - // deprecated API - template - CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::hierarchy_simplify_point_set(), please update your code") - ForwardIterator hierarchy_simplify_point_set (ForwardIterator begin, - ForwardIterator end, - const unsigned int size = 10, - const double var_max = 0.333) - { - CGAL::Iterator_range points (begin, end); - return hierarchy_simplify_point_set - (points, - CGAL::parameters::size (size). - maximum_variation (var_max)); - } -#endif // CGAL_NO_DEPRECATED_CODE /// \endcond } // namespace CGAL diff --git a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h index 646f2c5a8bc..bef772f6174 100644 --- a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h @@ -327,121 +327,6 @@ jet_estimate_normals( jet_estimate_normals (points, k, CGAL::Point_set_processing_3::parameters::all_default(points)); } - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::jet_estimate_normals(), please update your code") -void -jet_estimate_normals( - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - unsigned int k, ///< number of neighbors. - const Kernel& /*kernel*/, ///< geometric traits. - unsigned int degree_fitting = 2) ///< fitting degree -{ - CGAL::Iterator_range points (first, beyond); - return jet_estimate_normals - (points, - k, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - degree_fitting (degree_fitting). - geom_traits(Kernel())); -} - -#if defined(CGAL_EIGEN3_ENABLED) || defined(CGAL_LAPACK_ENABLED) -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::jet_estimate_normals(), please update your code") -void -jet_estimate_normals( - ForwardIterator first, - ForwardIterator beyond, - PointMap point_map, - NormalMap normal_map, - unsigned int k, - const Kernel& kernel, - unsigned int degree_fitting = 2) -{ - #ifdef CGAL_EIGEN3_ENABLED - typedef Eigen_svd SvdTraits; - #else - typedef Lapack_svd SvdTraits; - #endif - - CGAL::Iterator_range points (first, beyond); - return jet_estimate_normals - (points, - k, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - degree_fitting (degree_fitting). - svd_traits (SvdTraits()). - geom_traits(kernel)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::jet_estimate_normals(), please update your code") -void -jet_estimate_normals( - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - unsigned int k, ///< number of neighbors. - unsigned int degree_fitting = 2) -{ - CGAL::Iterator_range points (first, beyond); - return jet_estimate_normals - (points, - k, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - degree_fitting (degree_fitting)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::jet_estimate_normals(), please update your code") -void -jet_estimate_normals( - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - unsigned int k, ///< number of neighbors. - unsigned int degree_fitting = 2) -{ - CGAL::Iterator_range points (first, beyond); - return jet_estimate_normals - (points, - k, - CGAL::parameters::normal_map (normal_map). - degree_fitting (degree_fitting)); -} -#endif // CGAL Eigen / Lapack -#endif // CGAL_NO_DEPRECATED_CODE /// \endcond } //namespace CGAL diff --git a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h index e0557b3b412..36aaf2774ae 100644 --- a/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h +++ b/Point_set_processing_3/include/CGAL/jet_smooth_point_set.h @@ -313,117 +313,6 @@ jet_smooth_point_set( jet_smooth_point_set (points, k, CGAL::Point_set_processing_3::parameters::all_default(points)); } - - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::jet_smooth_point_set(), please update your code") -void -jet_smooth_point_set( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of InputIterator -> Point_3. - unsigned int k, ///< number of neighbors. - const Kernel& /*kernel*/, ///< geometric traits. - unsigned int degree_fitting = 2, ///< fitting degree - unsigned int degree_monge = 2) ///< Monge degree -{ - CGAL::Iterator_range points (first, beyond); - return jet_smooth_point_set - (points, - k, - CGAL::parameters::point_map (point_map). - degree_fitting (degree_fitting). - degree_monge (degree_monge). - geom_traits(Kernel())); -} - -#if defined(CGAL_EIGEN3_ENABLED) || defined(CGAL_LAPACK_ENABLED) -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::jet_smooth_point_set(), please update your code") -void -jet_smooth_point_set( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of InputIterator -> Point_3. - unsigned int k, ///< number of neighbors. - const Kernel& kernel, ///< geometric traits. - unsigned int degree_fitting = 2, ///< fitting degree - unsigned int degree_monge = 2) ///< Monge degree -{ - #ifdef CGAL_EIGEN3_ENABLED - typedef Eigen_svd SvdTraits; - #else - typedef Lapack_svd SvdTraits; - #endif - CGAL::Iterator_range points (first, beyond); - return jet_smooth_point_set - (points, - k, - CGAL::parameters::point_map (point_map). - degree_fitting (degree_fitting). - degree_monge (degree_monge). - svd_traits (SvdTraits()). - geom_traits(kernel)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::jet_smooth_point_set(), please update your code") -void -jet_smooth_point_set( - InputIterator first, ///< iterator over the first input point - InputIterator beyond, ///< past-the-end iterator - PointMap point_map, ///< property map: value_type of InputIterator -> Point_3 - unsigned int k, ///< number of neighbors. - const unsigned int degree_fitting = 2, - const unsigned int degree_monge = 2) -{ - CGAL::Iterator_range points (first, beyond); - return jet_smooth_point_set - (points, - k, - CGAL::parameters::point_map (point_map). - degree_fitting (degree_fitting). - degree_monge (degree_monge)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::jet_smooth_point_set(), please update your code") -void -jet_smooth_point_set( - InputIterator first, ///< iterator over the first input point - InputIterator beyond, ///< past-the-end iterator - unsigned int k, ///< number of neighbors. - const unsigned int degree_fitting = 2, - const unsigned int degree_monge = 2) -{ - CGAL::Iterator_range points (first, beyond); - return jet_smooth_point_set - (points, - k, - CGAL::parameters::degree_fitting (degree_fitting). - degree_monge (degree_monge)); -} -#endif // CGAL Eigen / Lapack -#endif // CGAL_NO_DEPRECATED_CODE /// \endcond diff --git a/Point_set_processing_3/include/CGAL/mst_orient_normals.h b/Point_set_processing_3/include/CGAL/mst_orient_normals.h index 8dd0bd69d92..7545ea18a23 100644 --- a/Point_set_processing_3/include/CGAL/mst_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/mst_orient_normals.h @@ -742,74 +742,6 @@ mst_orient_normals( { return mst_orient_normals (points, k, CGAL::Point_set_processing_3::parameters::all_default(points)); } - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::mst_orient_normals(), please update your code") -ForwardIterator -mst_orient_normals( - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - unsigned int k, ///< number of neighbors - const Kernel& kernel) ///< geometric traits. -{ - CGAL::Iterator_range points (first, beyond); - return mst_orient_normals - (points, - k, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - geom_traits(kernel)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::mst_orient_normals(), please update your code") -ForwardIterator -mst_orient_normals( - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - unsigned int k) ///< number of neighbors -{ - CGAL::Iterator_range points (first, beyond); - return mst_orient_normals - (points, - k, - CGAL::parameters::point_map (point_map). - normal_map (normal_map)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::mst_orient_normals(), please update your code") -ForwardIterator -mst_orient_normals( - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - unsigned int k) ///< number of neighbors -{ - CGAL::Iterator_range points (first, beyond); - return mst_orient_normals - (points, - k, - CGAL::parameters::normal_map (normal_map)); -} -#endif // CGAL_NO_DEPRECATED_CODE /// \endcond diff --git a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h index 133e793384a..0525ad959af 100644 --- a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h @@ -308,77 +308,6 @@ pca_estimate_normals( return pca_estimate_normals (points, k, CGAL::Point_set_processing_3::parameters::all_default(points)); } - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::pca_estimate_normals(), please update your code") -void -pca_estimate_normals( - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - unsigned int k, ///< number of neighbors. - const Kernel& /*kernel*/) ///< geometric traits. -{ - CGAL::Iterator_range points (first, beyond); - return pca_estimate_normals - (points, - k, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - geom_traits(Kernel())); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::pca_estimate_normals(), please update your code") -void -pca_estimate_normals( - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - unsigned int k) ///< number of neighbors. -{ - CGAL::Iterator_range points (first, beyond); - return pca_estimate_normals - (points, - k, - CGAL::parameters::point_map (point_map). - normal_map (normal_map)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::pca_estimate_normals(), please update your code") -void -pca_estimate_normals( - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - unsigned int k) ///< number of neighbors. -{ - CGAL::Iterator_range points (first, beyond); - return pca_estimate_normals - (points, - k, - CGAL::parameters::normal_map (normal_map)); -} -#endif // CGAL_NO_DEPRECATED_CODE /// \endcond diff --git a/Point_set_processing_3/include/CGAL/random_simplify_point_set.h b/Point_set_processing_3/include/CGAL/random_simplify_point_set.h index 51017d05771..63b8cc9702f 100644 --- a/Point_set_processing_3/include/CGAL/random_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/random_simplify_point_set.h @@ -76,60 +76,6 @@ random_simplify_point_set( return first_point_to_remove; } -/// \cond SKIP_IN_MANUAL -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::random_simplify_point_set(), please update your code") -ForwardIterator -random_simplify_point_set( - ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap /*point_map*/, ///< property map: value_type of ForwardIterator -> Point_3 - double removed_percentage, ///< percentage of points to remove. - const Kernel& /*kernel*/) ///< geometric traits. -{ - CGAL::Iterator_range points (first, beyond); - return random_simplify_point_set (points, removed_percentage); -} - - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::random_simplify_point_set(), please update your code") -ForwardIterator -random_simplify_point_set( - ForwardIterator first, ///< iterator over the first input point - ForwardIterator beyond, ///< past-the-end iterator - PointMap, ///< property map: value_type of ForwardIterator -> Point_3 - double removed_percentage) ///< percentage of points to remove -{ - CGAL::Iterator_range points (first, beyond); - return random_simplify_point_set (points, removed_percentage); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::random_simplify_point_set(), please update your code") -ForwardIterator -random_simplify_point_set( - ForwardIterator first, ///< iterator over the first input point - ForwardIterator beyond, ///< past-the-end iterator - double removed_percentage) ///< percentage of points to remove -{ - CGAL::Iterator_range points (first, beyond); - return random_simplify_point_set (points, removed_percentage); -} -#endif // CGAL_NO_DEPRECATED_CODE -/// \endcond - - } //namespace CGAL #include diff --git a/Point_set_processing_3/include/CGAL/remove_outliers.h b/Point_set_processing_3/include/CGAL/remove_outliers.h index d3df9cae48b..bb31f05ca3a 100644 --- a/Point_set_processing_3/include/CGAL/remove_outliers.h +++ b/Point_set_processing_3/include/CGAL/remove_outliers.h @@ -249,82 +249,6 @@ remove_outliers( { return remove_outliers (points, k, CGAL::Point_set_processing_3::parameters::all_default(points)); } - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::remove_outliers(), please update your code") -InputIterator -remove_outliers( - InputIterator first, ///< iterator over the first input point. - InputIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of InputIterator -> Point_3 - unsigned int k, ///< number of neighbors. - double threshold_percent, ///< maximum percentage of points to remove. - double threshold_distance, ///< minimum distance for a point to be - ///< considered as outlier (distance here is the square root of the average - ///< squared distance to K nearest - ///< neighbors) - const Kernel& /*kernel*/) ///< geometric traits. -{ - CGAL::Iterator_range points (first, beyond); - return remove_outliers - (points, - k, - CGAL::parameters::point_map (point_map). - threshold_percent (threshold_percent). - threshold_distance (threshold_distance). - geom_traits(Kernel())); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::remove_outliers(), please update your code") -InputIterator -remove_outliers( - InputIterator first, ///< iterator over the first input point - InputIterator beyond, ///< past-the-end iterator - PointMap point_map, ///< property map: value_type of InputIterator -> Point_3 - unsigned int k, ///< number of neighbors. - double threshold_percent, ///< percentage of points to remove - double threshold_distance = 0.0) ///< minimum average squared distance to K nearest neighbors - ///< for a point to be removed. -{ - CGAL::Iterator_range points (first, beyond); - return remove_outliers - (points, - k, - CGAL::parameters::point_map (point_map). - threshold_percent (threshold_percent). - threshold_distance (threshold_distance)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::remove_outliers(), please update your code") -InputIterator -remove_outliers( - InputIterator first, ///< iterator over the first input point - InputIterator beyond, ///< past-the-end iterator - unsigned int k, ///< number of neighbors. - double threshold_percent, ///< percentage of points to remove - double threshold_distance = 0.0) ///< minimum average squared distance to K nearest neighbors - ///< for a point to be removed. -{ - CGAL::Iterator_range points (first, beyond); - return remove_outliers - (points, - k, - CGAL::parameters::threshold_percent (threshold_percent). - threshold_distance (threshold_distance)); -} -#endif // CGAL_NO_DEPRECATED_CODE /// \endcond diff --git a/Point_set_processing_3/include/CGAL/structure_point_set.h b/Point_set_processing_3/include/CGAL/structure_point_set.h index 9f23fb9ba7c..f3c947b575b 100644 --- a/Point_set_processing_3/include/CGAL/structure_point_set.h +++ b/Point_set_processing_3/include/CGAL/structure_point_set.h @@ -202,30 +202,6 @@ public: } /// \cond SKIP_IN_MANUAL - // deprecated - template - CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::Point_set_with_structure(), please update your code") - Point_set_with_structure (const PointRange& points, - PointMap point_map, - NormalMap normal_map, - const PlaneRange& planes, - PlaneMap plane_map, - IndexMap index_map, - double epsilon, - double attraction_factor = 3.) - { - init (points, planes, epsilon, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - plane_map (plane_map). - plane_index_map (index_map). - attraction_factor (attraction_factor)); - } template -class Efficient_RANSAC; -template -class Plane_map; -template -class Point_to_shape_index_map; -} // end of namespace Shape_detection_3 - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::structure_point_set(), please update your code") -OutputIterator -structure_point_set (typename Traits::Input_range::iterator first, ///< iterator over the first input point. - typename Traits::Input_range::iterator beyond, ///< past-the-end iterator over the input points. - typename Traits::Point_map point_map, ///< property map: value_type of InputIterator -> Point_3. - typename Traits::Normal_map normal_map, ///< property map: value_type of InputIterator -> Vector_3. - OutputIterator output, ///< output iterator where output points are written - Shape_detection_3::Efficient_RANSAC& - shape_detection, ///< shape detection object - double epsilon, ///< size parameter - double attraction_factor = 3.) ///< attraction factor -{ - typename Shape_detection_3::Efficient_RANSAC::Plane_range planes = shape_detection.planes(); - return structure_point_set (CGAL::make_range(first, beyond), - planes, - output, - epsilon, // epsilon for structuring points - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - plane_map (CGAL::Shape_detection_3::Plane_map()). - plane_index_map (Shape_detection_3::Point_to_shape_index_map(CGAL::make_range(first, beyond), planes)). - attraction_factor(attraction_factor)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::structure_point_set(), please update your code") -OutputIterator -structure_point_set (typename Traits::Input_range::iterator first, ///< iterator over the first input point. - typename Traits::Input_range::iterator beyond, ///< past-the-end iterator over the input points. - OutputIterator output, ///< output iterator where output points are written - Shape_detection_3::Efficient_RANSAC& - shape_detection, ///< shape detection object - double epsilon, ///< size parameter - double attraction_factor = 3.) ///< attraction factor -{ - return structure_point_set (first, beyond, - typename Traits::Point_map(), - typename Traits::Normal_map(), - output, - shape_detection, - epsilon, - attraction_factor); -} -/// \endcond -#endif // CGAL_NO_DEPRECATED_CODE - } //namespace CGAL diff --git a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h index 96cd7f8f7c1..087f4ead7a7 100644 --- a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h @@ -308,357 +308,6 @@ compute_vcm (const PointRange& points, compute_vcm (points, ccov, offset_radius, convolution_radius, CGAL::Point_set_processing_3::parameters::all_default (points)); } - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template < class ForwardIterator, - class PointMap, - class Kernel -> -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::compute_vcm(), please update your code") -void -compute_vcm (ForwardIterator first, - ForwardIterator beyond, - PointMap point_map, - std::vector< cpp11::array > &ccov, - double offset_radius, - double convolution_radius, - const Kernel & kernel) -{ - CGAL::Iterator_range points (first, beyond); - compute_vcm (points, ccov, offset_radius, convolution_radius, - CGAL::parameters::point_map (point_map). - geom_traits (kernel)); -} -#endif // CGAL_NO_DEPRECATED_CODE -/// \endcond - -/// \cond SKIP_IN_MANUAL -template -void -vcm_estimate_normals_internal (PointRange& points, - double offset_radius, ///< offset radius. - double convolution_radius, ///< convolution radius. - const NamedParameters& np, - int nb_neighbors_convolve = -1 ///< number of neighbors used during the convolution. -) -{ - using boost::choose_param; - // basic geometric types - typedef typename Point_set_processing_3::GetPointMap::type PointMap; - typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; - typedef typename Point_set_processing_3::GetK::Kernel Kernel; - typedef typename GetDiagonalizeTraits::type DiagonalizeTraits; - - CGAL_static_assertion_msg(!(boost::is_same::NoMap>::value), - "Error: no normal map"); - - PointMap point_map = choose_param(get_param(np, internal_np::point_map), PointMap()); - NormalMap normal_map = choose_param(get_param(np, internal_np::normal_map), NormalMap()); - - typedef cpp11::array Covariance; - - // Compute the VCM and convolve it - std::vector cov; - if (nb_neighbors_convolve == -1) { - compute_vcm(points, - cov, - offset_radius, - convolution_radius, - np); - } else { - internal::vcm_offset(points.begin(), points.end(), - point_map, - cov, - offset_radius, - 20, - Kernel()); - - if (nb_neighbors_convolve > 0) - { - std::vector ccov; - ccov.reserve(cov.size()); - internal::vcm_convolve(points.begin(), points.end(), - point_map, - cov, - ccov, - (unsigned int) nb_neighbors_convolve, - Kernel()); - - cov.clear(); - std::copy(ccov.begin(), ccov.end(), std::back_inserter(cov)); - } - } - - // And finally, compute the normals - int i = 0; - for (typename PointRange::iterator it = points.begin(); it != points.end(); ++it) { - cpp11::array enormal = {{ 0,0,0 }}; - DiagonalizeTraits::extract_largest_eigenvector_of_covariance_matrix - (cov[i], enormal); - - typename Kernel::Vector_3 normal(enormal[0], - enormal[1], - enormal[2]); - put(normal_map, *it, normal); - i++; - } -} -/// @endcond - - -/** - \ingroup PkgPointSetProcessing3Algorithms - Estimates normal directions of the range of `points` - using the Voronoi Covariance Measure with a radius for the convolution. - The output normals are randomly oriented. - - See `compute_vcm()` for a detailed description of the parameters `offset_radius` and `convolution_radius` - and of the Voronoi Covariance Measure. - - \tparam PointRange is a model of `Range`. The value type of - its iterator is the key type of the named parameter `point_map`. - - \param points input point range. - \param offset_radius offset_radius. - \param convolution_radius convolution_radius. - \param np optional sequence of \ref psp_namedparameters "Named Parameters" among the ones listed below. - - \cgalNamedParamsBegin - \cgalParamBegin{point_map} a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`. - If this parameter is omitted, `CGAL::Identity_property_map` is used.\cgalParamEnd - \cgalParamBegin{normal_map} a model of `WritablePropertyMap` with value type - `geom_traits::Vector_3`.\cgalParamEnd - \cgalParamBegin{diagonalize_traits} a model of `DiagonalizeTraits`. It can be omitted: - if Eigen 3 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined then an overload - using `Eigen_diagonalize_traits` is provided. Otherwise, the internal implementation - `CGAL::Diagonalize_traits` is used.\cgalParamEnd - \cgalParamBegin{geom_traits} an instance of a geometric traits class, model of `Kernel`\cgalParamEnd - \cgalNamedParamsEnd - -*/ -template -void -vcm_estimate_normals (PointRange& points, - double offset_radius, - double convolution_radius, - const NamedParameters& np -) -{ - vcm_estimate_normals_internal(points, offset_radius, convolution_radius, np); -} - -/// \cond SKIP_IN_MANUAL -// variant with default NP -template -void -vcm_estimate_normals (PointRange& points, - double offset_radius, ///< offset radius. - double convolution_radius) ///< convolution radius. -{ - return vcm_estimate_normals - (points, offset_radius, convolution_radius, - CGAL::Point_set_processing_3::parameters::all_default(points)); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template < typename ForwardIterator, - typename PointMap, - typename NormalMap, - typename VCMTraits -> -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::vcm_estimate_normals(), please update your code") -void -vcm_estimate_normals (ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - double offset_radius, ///< offset radius. - double convolution_radius, ///< convolution radius. - VCMTraits -) -{ - CGAL::Iterator_range points (first, beyond); - vcm_estimate_normals - (points, - offset_radius, convolution_radius, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - diagonalize_traits (VCMTraits())); -} -#endif // CGAL_NO_DEPRECATED_CODE -/// \endcond - - -/** - \ingroup PkgPointSetProcessing3Algorithms - Estimates normal directions of the range of `points` - using the Voronoi Covariance Measure with a number of neighbors for the convolution. - The output normals are randomly oriented. - - See `compute_vcm()` for a detailed description of the parameter `offset_radius` - and of the Voronoi Covariance Measure. - - \tparam PointRange is a model of `Range`. The value type of - its iterator is the key type of the named parameter `point_map`. - - \param points input point range. - \param offset_radius offset_radius. - \param k number of neighbor points used for convolution. - \param np optional sequence of \ref psp_namedparameters "Named Parameters" among the ones listed below. - - \cgalNamedParamsBegin - \cgalParamBegin{point_map} a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`. - If this parameter is omitted, `CGAL::Identity_property_map` is used.\cgalParamEnd - \cgalParamBegin{normal_map} a model of `WritablePropertyMap` with value type - `geom_traits::Vector_3`.\cgalParamEnd - \cgalParamBegin{diagonalize_traits} a model of `DiagonalizeTraits`. It can be omitted: - if Eigen 3 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined then an overload - using `Eigen_diagonalize_traits` is provided. Otherwise, the internal implementation - `CGAL::Diagonalize_traits` is used.\cgalParamEnd - \cgalParamBegin{geom_traits} an instance of a geometric traits class, model of `Kernel`\cgalParamEnd - \cgalNamedParamsEnd -*/ -template < typename PointRange, - typename NamedParameters -> -void -vcm_estimate_normals (PointRange& points, - double offset_radius, - unsigned int k, - const NamedParameters& np -) -{ - vcm_estimate_normals_internal(points, offset_radius, 0, np, k); -} - -/// \cond SKIP_IN_MANUAL -// variant with default NP -template -void -vcm_estimate_normals (PointRange& points, - double offset_radius, ///< offset radius. - unsigned int k) -{ - return vcm_estimate_normals - (points, offset_radius, k, - CGAL::Point_set_processing_3::parameters::all_default(points)); -} - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template < typename ForwardIterator, - typename PointMap, - typename NormalMap, - typename VCMTraits -> -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::vcm_estimate_normals(), please update your code") -void -vcm_estimate_normals (ForwardIterator first, ///< iterator over the first input point. - ForwardIterator beyond, ///< past-the-end iterator over the input points. - PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3. - NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3. - double offset_radius, ///< offset radius. - unsigned int k, ///< number of neighbor points used for the convolution. - VCMTraits -) -{ - CGAL::Iterator_range points (first, beyond); - vcm_estimate_normals - (points, - offset_radius, k, - CGAL::parameters::point_map (point_map). - normal_map (normal_map). - diagonalize_traits (VCMTraits())); -} - -// deprecated API -template < typename ForwardIterator, - typename PointMap, - typename NormalMap -> -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::vcm_estimate_normals(), please update your code") -void -vcm_estimate_normals (ForwardIterator first, - ForwardIterator beyond, - PointMap point_map, - NormalMap normal_map, - double offset_radius, - double convolution_radius) -{ - CGAL::Iterator_range points (first, beyond); - vcm_estimate_normals - (points, - offset_radius, convolution_radius, - CGAL::parameters::point_map (point_map). - normal_map (normal_map)); -} - -// deprecated API -template < typename ForwardIterator, - typename PointMap, - typename NormalMap -> -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::vcm_estimate_normals(), please update your code") -void -vcm_estimate_normals (ForwardIterator first, - ForwardIterator beyond, - PointMap point_map, - NormalMap normal_map, - double offset_radius, - unsigned int nb_neighbors_convolve) -{ - CGAL::Iterator_range points (first, beyond); - vcm_estimate_normals - (points, - offset_radius, nb_neighbors_convolve, - CGAL::parameters::point_map (point_map). - normal_map (normal_map)); -} - - -// deprecated API -template < typename ForwardIterator, - typename NormalMap -> -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::vcm_estimate_normals(), please update your code") -void -vcm_estimate_normals (ForwardIterator first, - ForwardIterator beyond, - NormalMap normal_map, - double offset_radius, - double convolution_radius) { - CGAL::Iterator_range points (first, beyond); - vcm_estimate_normals - (points, - offset_radius, convolution_radius, - CGAL::parameters::normal_map (normal_map)); -} - -// deprecated API -template < typename ForwardIterator, - typename NormalMap -> -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::vcm_estimate_normals(), please update your code") -void -vcm_estimate_normals (ForwardIterator first, - ForwardIterator beyond, - NormalMap normal_map, - double offset_radius, - unsigned int nb_neighbors_convolve) { - CGAL::Iterator_range points (first, beyond); - vcm_estimate_normals - (points, - offset_radius, nb_neighbors_convolve, - CGAL::parameters::normal_map (normal_map)); -} -#endif // CGAL_NO_DEPRECATED_CODE /// \endcond } // namespace CGAL diff --git a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h index f01e5f0778e..8db4cea66ab 100644 --- a/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h +++ b/Point_set_processing_3/include/CGAL/wlop_simplify_and_regularize_point_set.h @@ -688,107 +688,7 @@ wlop_simplify_and_regularize_point_set( return wlop_simplify_and_regularize_point_set (points, output, CGAL::Point_set_processing_3::parameters::all_default(points)); } - -#ifndef CGAL_NO_DEPRECATED_CODE -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::wlop_simplify_and_regularize_point_set(), please update your code") -OutputIterator -wlop_simplify_and_regularize_point_set( - RandomAccessIterator first, ///< random-access iterator to the first input point. - RandomAccessIterator beyond, ///< past-the-end iterator. - OutputIterator output, ///< output iterator where output points are put. - PointMap point_map, ///< point property map. - double select_percentage, ///< percentage of points to retain. - ///< The default value is set to 5 (\%). - double radius, ///< spherical neighborhood radius. - ///< This is a key parameter that needs to be finely tuned. - ///< The result will be irregular if too small, but a larger - ///< value will impact the runtime. - ///< In practice, choosing a radius such that the neighborhood of each sample point - ///< includes at least two rings of neighboring sample points - ///< gives satisfactory result. - ///< The default value is set to 8 times the average spacing of the point set. - unsigned int iter_number, ///< number of iterations to solve the optimsation problem. The default value is 35. - ///< More iterations give a more regular result but increase the runtime. - bool require_uniform_sampling,///< an optional preprocessing, which will give better result - ///< if the distribution of the input points is highly non-uniform. - ///< The default value is `false`. - const Kernel& ///< geometric traits. -) -{ - CGAL::Iterator_range points (first, beyond); - return wlop_simplify_and_regularize_point_set - (points, output, - CGAL::parameters::point_map (point_map). - select_percentage (select_percentage). - neighbor_radius (radius). - number_of_iterations(iter_number). - require_uniform_sampling (require_uniform_sampling). - geom_traits (Kernel())); -} - - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::wlop_simplify_and_regularize_point_set(), please update your code") -OutputIterator -wlop_simplify_and_regularize_point_set( - RandomAccessIterator first, ///< iterator over the first input point - RandomAccessIterator beyond, ///< past-the-end iterator - OutputIterator output, ///< add back-inserter - PointMap point_map, ///< property map RandomAccessIterator -> Point_3 - const double select_percentage, ///< percentage of points to retain - double neighbor_radius, ///< size of neighbors. - const unsigned int max_iter_number, ///< number of iterations. - const bool require_uniform_sampling ///< if needed to compute density - /// to generate more rugularized result. -) -{ - CGAL::Iterator_range points (first, beyond); - return wlop_simplify_and_regularize_point_set - (points, output, - CGAL::parameters::point_map (point_map). - select_percentage (select_percentage). - neighbor_radius (neighbor_radius). - number_of_iterations(max_iter_number). - require_uniform_sampling (require_uniform_sampling)); -} - -// deprecated API -template -CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::wlop_simplify_and_regularize_point_set(), please update your code") -OutputIterator -wlop_simplify_and_regularize_point_set( - RandomAccessIterator first, ///< iterator to the first input point. - RandomAccessIterator beyond, ///< past-the-end iterator. - OutputIterator output, ///< add back-inserter. - const double select_percentage = 5, ///< percentage of points to retain - double neighbor_radius = -1, ///< size of neighbors. - const unsigned int max_iter_number = 35, ///< number of iterations. - const bool require_uniform_sampling = false ///< if needed to compute density - ///to generate a more uniform result. -) -{ - CGAL::Iterator_range points (first, beyond); - return wlop_simplify_and_regularize_point_set - (points, output, - CGAL::parameters::select_percentage (select_percentage). - neighbor_radius (neighbor_radius). - number_of_iterations(max_iter_number). - require_uniform_sampling (require_uniform_sampling)); -} -#endif // CGAL_NO_DEPRECATED_CODE -/// @endcond +/// \endcond } //namespace CGAL diff --git a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt index fd52ff350d0..4d0dbbb49c2 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt @@ -38,16 +38,6 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "edge_aware_upsample_test.cpp" ) create_single_source_cgal_program( "structuring_test.cpp" ) - # Deprecated tests - create_single_source_cgal_program( "deprecated_read_test.cpp" ) - create_single_source_cgal_program( "deprecated_read_test_with_different_pmaps.cpp" ) - create_single_source_cgal_program( "deprecated_analysis_test.cpp" ) - create_single_source_cgal_program( "deprecated_remove_outliers_test.cpp" ) - create_single_source_cgal_program( "deprecated_wlop_simplify_and_regularize_test.cpp" ) - create_single_source_cgal_program( "deprecated_bilateral_smoothing_test.cpp" ) - create_single_source_cgal_program( "deprecated_edge_aware_upsample_test.cpp" ) - create_single_source_cgal_program( "deprecated_structuring_test.cpp" ) - # Use Eigen or BLAS and LAPACK (optional) find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (NOT EIGEN3_FOUND) @@ -68,15 +58,6 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "vcm_plane_test.cpp" ) create_single_source_cgal_program( "vcm_all_test.cpp" ) create_single_source_cgal_program( "jet_pointer_as_property_map.cpp" ) - - # Deprecated tests - create_single_source_cgal_program( "deprecated_normal_estimation_test.cpp" ) - create_single_source_cgal_program( "deprecated_hierarchy_simplification_test.cpp" ) - create_single_source_cgal_program( "deprecated_smoothing_test.cpp" ) - create_single_source_cgal_program( "deprecated_vcm_plane_test.cpp" ) - create_single_source_cgal_program( "deprecated_vcm_all_test.cpp" ) - create_single_source_cgal_program( "deprecated_jet_pointer_as_property_map.cpp" ) - else(EIGEN3_FOUND OR LAPACK_FOUND) message(STATUS "NOTICE: This program requires either Eigen 3.1 (or greater) or LAPACK, and will not be compiled.") diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_analysis_test.cmd b/Point_set_processing_3/test/Point_set_processing_3/deprecated_analysis_test.cmd deleted file mode 100644 index 19722151afc..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_analysis_test.cmd +++ /dev/null @@ -1 +0,0 @@ -data/*.xyz diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_analysis_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_analysis_test.cpp deleted file mode 100644 index 8ca967a03c3..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_analysis_test.cpp +++ /dev/null @@ -1,139 +0,0 @@ -#include - -// analysis_test.cpp - -//---------------------------------------------------------- -// Test the analysis methods: -// For each input point set, compute the average spacing. -// Input format is .xyz. -// No output. -//---------------------------------------------------------- -// analysis_test points1.xyz points2.xyz... - -// CGAL -#include -#include -#include - -// This package -#include -#include - -#include -#include -#include - -// ---------------------------------------------------------------------------- -// Types -// ---------------------------------------------------------------------------- - -// kernel -typedef CGAL::Simple_cartesian Kernel; - -// Simple geometric types -typedef Kernel::FT FT; -typedef Kernel::Point_3 Point; - -// Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - - -// ---------------------------------------------------------------------------- -// Tests -// ---------------------------------------------------------------------------- - -// Computes average spacing. -void test_average_spacing(std::deque& points, // input point set - unsigned int nb_neighbors) // number of neighbors -{ - std::cerr << "Computes average spacing to k nearest neighbors (k="<< nb_neighbors << ")... "; - CGAL::Timer task_timer; task_timer.start(); - - FT average_spacing = CGAL::compute_average_spacing(points.begin(), points.end(), nb_neighbors); - std::cout << average_spacing << std::endl; - - std::size_t memory = CGAL::Memory_sizer().virtual_size(); - std::cerr << "ok: " << task_timer.time() << " seconds, " - << (memory>>20) << " Mb allocated" - << std::endl; -} - - -// ---------------------------------------------------------------------------- -// main() -// ---------------------------------------------------------------------------- - -int main(int argc, char * argv[]) -{ - std::cerr << "Analysis test" << std::endl; - - //*************************************** - // decode parameters - //*************************************** - - // usage - if(argc < 2) - { - std::cerr << "For each input point set, compute the average spacing.\n"; - std::cerr << "\n"; - std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz..." << std::endl; - std::cerr << "Input file format is .xyz.\n"; - std::cerr << "No output" << std::endl; - return EXIT_FAILURE; - } - - // Average Spacing options - const unsigned int nb_neighbors = 6; // K-nearest neighbors = 1 ring (average spacing) - - // Accumulated errors - int accumulated_fatal_err = EXIT_SUCCESS; - - // Process each input file - for(int i=1; i points; - std::cerr << "Open " << input_filename << " for reading..." << std::endl; - - // If XYZ file format: - std::ifstream stream(input_filename.c_str()); - if(stream && - CGAL::read_xyz_points(stream, std::back_inserter(points))) - { - std::cerr << "ok (" << points.size() << " points)" << std::endl; - } - else - { - std::cerr << "Error: cannot read file " << input_filename << std::endl; - accumulated_fatal_err = EXIT_FAILURE; - continue; - } - - //*************************************** - // Test - //*************************************** - - test_average_spacing(points, nb_neighbors); - - } // for each input file - - std::cerr << std::endl; - - // Returns accumulated fatal error - std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; - return accumulated_fatal_err; -} - diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_bilateral_smoothing_test.cmd b/Point_set_processing_3/test/Point_set_processing_3/deprecated_bilateral_smoothing_test.cmd deleted file mode 100644 index 39d9a38f5d5..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_bilateral_smoothing_test.cmd +++ /dev/null @@ -1 +0,0 @@ -data/fin90_with_PCA_normals.xyz diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_bilateral_smoothing_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_bilateral_smoothing_test.cpp deleted file mode 100644 index 02b08a7ce30..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_bilateral_smoothing_test.cpp +++ /dev/null @@ -1,157 +0,0 @@ -#include - -// bilateral_smoothing_test.cpp - -//---------------------------------------------------------- -// Test the smoothing methods: -// For each input point set, smooth it. -// Input format is .xyz. -// No output. -//---------------------------------------------------------- -// bilateral_smoothing_test points1.xyz points2.xyz... - -// CGAL -#include -#include -#include - -// This package -#include -#include - -#include -#include -#include - - -// ---------------------------------------------------------------------------- -// Types -// ---------------------------------------------------------------------------- - -// kernel -typedef CGAL::Simple_cartesian Kernel; - -// Simple geometric types -typedef Kernel::FT FT; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; - -// Point with normal vector stored in a std::pair. -typedef std::pair PointVectorPair; - -// ---------------------------------------------------------------------------- -// Tests -// ---------------------------------------------------------------------------- - -template -void test_bilateral_smoothing(std::deque& points,// input point set - unsigned int nb_neighbors, // number of neighbors - double sharpness_sigma) -{ - CGAL::Real_timer task_timer; task_timer.start(); - - for (int i = 0; i < 3; i++) - { - CGAL::bilateral_smooth_point_set ( - points.begin(), - points.end(), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map(), - nb_neighbors, - sharpness_sigma); - } - - std::size_t memory = CGAL::Memory_sizer().virtual_size(); - std::cerr << "ok: " << task_timer.time() << " seconds, " - << (memory>>20) << " Mb allocated" - << std::endl; -} - - -// ---------------------------------------------------------------------------- -// main() -// ---------------------------------------------------------------------------- - -int main(int argc, char * argv[]) -{ - std::cerr << "Bilateral smoothing test" << std::endl; - - //*************************************** - // decode parameters - //*************************************** - - // usage - if(argc < 2) - { - std::cerr << "For each input point set, smooth it.\n"; - std::cerr << "\n"; - std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz..." << std::endl; - std::cerr << "Input file format is .xyz.\n"; - std::cerr << "No output" << std::endl; - return EXIT_FAILURE; - } - - // Smoothing options - const unsigned int nb_neighbors = 50; // K-nearest neighbors - const double sharpness_sigma = 25; // control sharpness - - // Accumulated errors - int accumulated_fatal_err = EXIT_SUCCESS; - - // Process each input file - for(int i=1; i points; - std::cerr << "Opening " << input_filename << " for reading..." << std::endl; - - // If XYZ file format: - std::ifstream stream(input_filename.c_str()); - if(stream && - CGAL::read_xyz_points_and_normals(stream, - std::back_inserter(points), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map())) - { - std::cerr << "ok (" << points.size() << " points)" << std::endl; - } - else - { - std::cerr << "Error: cannot read file " << input_filename << std::endl; - accumulated_fatal_err = EXIT_FAILURE; - continue; - } - - //*************************************** - // Test - //*************************************** - -#ifdef CGAL_LINKED_WITH_TBB - std::deque points2(points); -#endif // CGAL_LINKED_WITH_TBB - - test_bilateral_smoothing( - points, nb_neighbors, sharpness_sigma); - -#ifdef CGAL_LINKED_WITH_TBB - test_bilateral_smoothing( - points2, nb_neighbors, sharpness_sigma); -#endif // CGAL_LINKED_WITH_TBB - - } // for each input file - - std::cerr << std::endl; - // Returns accumulated fatal error - std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; - return accumulated_fatal_err; -} - diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_edge_aware_upsample_test.cmd b/Point_set_processing_3/test/Point_set_processing_3/deprecated_edge_aware_upsample_test.cmd deleted file mode 100644 index ac214ba0b5e..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_edge_aware_upsample_test.cmd +++ /dev/null @@ -1 +0,0 @@ -data/before_upsample.xyz diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_edge_aware_upsample_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_edge_aware_upsample_test.cpp deleted file mode 100644 index e72f8e663be..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_edge_aware_upsample_test.cpp +++ /dev/null @@ -1,168 +0,0 @@ -#include - -// edge_aware_upsample_test.cpp - -//---------------------------------------------------------- -// Test the edge aware up-sample test method: -// Input format is .xyz. -// No output. -//---------------------------------------------------------- -// edge_aware_upsample_test points1.xyz points2.xyz... - -// CGAL -#include -#include -#include - -// This package -#include -#include - -#include -#include - - -// ---------------------------------------------------------------------------- -// Types -// ---------------------------------------------------------------------------- - -// kernel -typedef CGAL::Simple_cartesian Kernel; - -// Simple geometric types -typedef Kernel::FT FT; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; - -// Point with normal vector stored in a std::pair. -typedef std::pair PointVectorPair; - -// Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - - -// ---------------------------------------------------------------------------- -// Tests -// ---------------------------------------------------------------------------- - -void test_edge_aware_upsample(std::vector& points, // input point set - double sharpness_sigma, //control sharpness - double edge_sensitivity,// more points will up-sample on edge - double neighbor_radius, // initial neighbors size. - unsigned int times_of_output_points) - -{ - CGAL::Real_timer task_timer; task_timer.start(); - std::cerr << "Running edge aware up-sample, (sharpness_sigma: " - << sharpness_sigma << "%, number_of_output_points=" - << points.size() * times_of_output_points << ")...\n"; - - //Run algorithm - CGAL::edge_aware_upsample_point_set( - points.begin(), - points.end(), - std::back_inserter(points), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map(), - sharpness_sigma, - edge_sensitivity, - neighbor_radius, - points.size() * times_of_output_points); - - - std::size_t memory = CGAL::Memory_sizer().virtual_size(); - std::cerr << "ok: " << task_timer.time() << " seconds, " - << (memory>>20) << " Mb allocated" - << std::endl; -} - - -// ---------------------------------------------------------------------------- -// main() -// ---------------------------------------------------------------------------- - -int main(int argc, char * argv[]) -{ - std::cerr << "Edge aware up-sample" << std::endl; - - //*************************************** - // decode parameters - //*************************************** - - // usage - if(argc < 2) - { - std::cerr << "Upsample each input point set.\n"; - std::cerr << "\n"; - std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz..." << std::endl; - std::cerr << "Input file format is .xyz.\n"; - std::cerr << "No output" << std::endl; - return EXIT_FAILURE; - } - - //Algorithm parameters - const double sharpness_sigma = 25; //control sharpness of the result. - const double edge_sensitivity = 0; // more points will up-sample on edge. - const double neighbor_radius = 0.2; // initial neighbors size. - const unsigned int times_of_output_points = 4; - - // Accumulated errors - int accumulated_fatal_err = EXIT_SUCCESS; - - // Process each input file - for(int i=1; i points; - std::cerr << "Opening " << input_filename << " for reading..." << std::endl; - - // If XYZ file format: - std::ifstream stream(input_filename.c_str()); - if(stream && - CGAL::read_xyz_points_and_normals - (stream, - std::back_inserter(points), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map())) - { - std::cerr << "ok (" << points.size() << " points)" << std::endl; - } - else - { - std::cerr << "Error: cannot read file " << input_filename << std::endl; - accumulated_fatal_err = EXIT_FAILURE; - continue; - } - - //*************************************** - // Test - //*************************************** - - test_edge_aware_upsample(points, - sharpness_sigma, - edge_sensitivity, - neighbor_radius, - times_of_output_points); - - } // for each input file - - std::cerr << std::endl; - - // Returns accumulated fatal error - std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; - return accumulated_fatal_err; -} - diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_hierarchy_simplification_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_hierarchy_simplification_test.cpp deleted file mode 100644 index 009f01082f6..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_hierarchy_simplification_test.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include - -#include - -#include -#include - -#include - -// types -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef Kernel::Point_3 Point; -typedef Kernel::FT FT; - -void test (std::vector& input, - std::ptrdiff_t result0 = 1, int result1 = 1, int result2 = 1, int result3 = 1, int result4 = 1) -{ - std::vector::iterator it = - CGAL::hierarchy_simplify_point_set (input.begin (), input.end (), 1); - if (result0 > 0 && std::distance (input.begin (), it) != result0) - exit (EXIT_FAILURE); - - it = CGAL::hierarchy_simplify_point_set (input.begin (), input.end ()); - if (result1 > 0 && std::distance (input.begin (), it) != result1) - exit (EXIT_FAILURE); - - it = CGAL::hierarchy_simplify_point_set (input.begin (), input.end (), 100); - if (result2 > 0 && std::distance (input.begin (), it) != result2) - exit (EXIT_FAILURE); - - - it = CGAL::hierarchy_simplify_point_set (input.begin (), input.end (), 1000, 0.1); - if (result3 > 0 && std::distance (input.begin (), it) != result3) - exit (EXIT_FAILURE); - - - it = CGAL::hierarchy_simplify_point_set (input.begin (), input.end (), - CGAL::Identity_property_map(), - (std::numeric_limits::max)(), - 0.0001); - if (result4 > 0 && std::distance (input.begin (), it) != result4) - exit (EXIT_FAILURE); - - input.clear (); -} - - -int main(void) -{ - - std::vector input; - - // Test 1 point - input.push_back (Point (0., 0., 0.)); - test (input); - - // Test twice the same point - input.push_back (Point (0., 0., 0.)); - input.push_back (Point (0., 0., 0.)); - test (input); - - // Test 2 points - input.push_back (Point (0., 0., 0.)); - input.push_back (Point (1., 0., 0.)); - test (input, 2); - - // Test line - for (std::size_t i = 0; i < 1000; ++ i) - input.push_back (Point (0., 0., (double)i)); - test (input, input.size (), 128, 16, 1, 1); - - // Test plane - for (std::size_t i = 0; i < 128; ++ i) - for (std::size_t j = 0; j < 128; ++ j) - input.push_back (Point (0., (double)j, (double)i)); - test (input, input.size (), 2048, 256, 32, 1); - - // Test random - for (std::size_t i = 0; i < 10000; ++ i) - input.push_back (Point (rand() / (FT)RAND_MAX, - rand() / (FT)RAND_MAX, - rand() / (FT)RAND_MAX)); - test (input, input.size (), -1, -1, -1, -1); - - return EXIT_SUCCESS; -} - diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_jet_pointer_as_property_map.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_jet_pointer_as_property_map.cpp deleted file mode 100644 index 3e97a2c0c12..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_jet_pointer_as_property_map.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include - -#include - -#include - -#include - -#include - - -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; - -// Simple geometric types -typedef Kernel::FT FT; -typedef Kernel::Point_3 Point_3; -typedef Kernel::Vector_3 Vector_3; - - - - -int main() -{ - std::vector points; - std::vector indices(100); - - for(int i=0; i < 100; i++){ - indices[i] = i; - } - std::vector normals(100); - - - for(int i=0; i <10; i++){ - for(int j=0; j <10; j++){ - points.push_back(Point_3(i,j,0)); - } - } - - - CGAL::jet_estimate_normals(indices.begin(), indices.end(), - CGAL::make_property_map(points), - CGAL::make_property_map(normals), - 12); - - - return 0; -} - diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_normal_estimation_test.cmd b/Point_set_processing_3/test/Point_set_processing_3/deprecated_normal_estimation_test.cmd deleted file mode 100644 index c6919d97e3e..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_normal_estimation_test.cmd +++ /dev/null @@ -1 +0,0 @@ -data/sphere926.pwn data/sphere_1k.xyz diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_normal_estimation_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_normal_estimation_test.cpp deleted file mode 100644 index 1ac14a5392f..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_normal_estimation_test.cpp +++ /dev/null @@ -1,407 +0,0 @@ -#include - -// normal_estimation_test.cpp - -//---------------------------------------------------------- -// Test the normal estimation methods: -// For each input point set, compute and orient its normals. -// If an input mesh has normals, print the normal deviation. -// Input file formats are .off, .xyz and .pwn. -// No output. -//---------------------------------------------------------- -// normal_estimation_test points1.xyz points2.xyz... - -// With iterator debugging this testsuite takes to long and the process gets killed -//#define _HAS_ITERATOR_DEBUGGING 0 - -// CGAL -#include -#include -#include - -// This package -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - - -// ---------------------------------------------------------------------------- -// Types -// ---------------------------------------------------------------------------- - -// kernel -typedef CGAL::Simple_cartesian Kernel; - -// Simple geometric types -typedef Kernel::FT FT; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; -typedef CGAL::Point_with_normal_3 Point_with_normal; // position + normal vector -typedef std::vector PointList; - -// Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - - -// ---------------------------------------------------------------------------- -// Tests -// ---------------------------------------------------------------------------- - -// Check the accuracy of normals direction estimation. -// If original normals are available, compare with them and count normals with large deviation. -// @return true on success. -bool verify_normal_direction(const PointList& points, // input points + computed normals - const std::vector& original_normals) // may be empty -{ - bool success = true; - - bool points_have_original_normals = ! original_normals.empty(); - if (points_have_original_normals) - { - assert(points.size() == original_normals.size()); - - std::cerr << "Compare with original normals:" << std::endl; - - double min_normal_deviation = DBL_MAX; // deviation / original normal - double max_normal_deviation = DBL_MIN; - double avg_normal_deviation = 0; - int invalid_normals = 0; // #normals with large deviation - PointList::const_iterator p; - std::vector::const_iterator n; - for (p = points.begin(), n = original_normals.begin(); p != points.end(); p++, n++) - { - // Computes normal deviation. - Vector v1 = *n; // original normal - double norm1 = std::sqrt( v1*v1 ); - assert(norm1 != 0.0); - Vector v2 = p->normal(); // computed normal - double norm2 = std::sqrt( v2*v2 ); - assert(norm2 != 0.0); - double cos_normal_deviation = (v1*v2)/(norm1*norm2); - if (cos_normal_deviation < 0) - { - cos_normal_deviation = -cos_normal_deviation; - } - double normal_deviation = std::acos(cos_normal_deviation); - - // statistics about normals deviation - min_normal_deviation = (std::min)(min_normal_deviation, normal_deviation); - max_normal_deviation = (std::max)(max_normal_deviation, normal_deviation); - avg_normal_deviation += normal_deviation; - - // count normal if large deviation - bool valid = (normal_deviation <= CGAL_PI/3.); // valid if deviation <= 60 degrees - if ( ! valid ) - { - invalid_normals++; - } - } - avg_normal_deviation /= double(points.size()); - - std::cerr << " Min normal deviation=" << min_normal_deviation*180.0/CGAL_PI << " degrees\n"; - std::cerr << " Max normal deviation=" << max_normal_deviation*180.0/CGAL_PI << " degrees\n"; - std::cerr << " Avg normal deviation=" << avg_normal_deviation*180.0/CGAL_PI << " degrees\n"; - if (invalid_normals > 0) - { - std::cerr << " Error: " << invalid_normals << " normals have a deviation > 60 degrees\n"; - success = false; - } - } - - return success; -} - -// Computes normals direction by Principal Component Analysis -// @return true on success. -bool run_pca_estimate_normals(PointList& points, // input points + output normals - unsigned int nb_neighbors_pca_normals, // number of neighbors - const std::vector& original_normals) // may be empty -{ - CGAL::Timer task_timer; task_timer.start(); - std::cerr << "Estimates Normals Direction by PCA (k=" - << nb_neighbors_pca_normals << ")...\n"; - - CGAL::pca_estimate_normals(points.begin(), points.end(), - CGAL::make_normal_of_point_with_normal_map(PointList::value_type()), - nb_neighbors_pca_normals); - - std::size_t memory = CGAL::Memory_sizer().virtual_size(); - std::cerr << "done: " << task_timer.time() << " seconds, " - << (memory>>20) << " Mb allocated" - << std::endl; - - // Check the accuracy of normals direction estimation. - // If original normals are available, compare with them. - return verify_normal_direction(points, original_normals); -} - -// Computes normals direction by Jet Fitting -// @return true on success. -bool run_jet_estimate_normals(PointList& points, // input points + output normals - unsigned int nb_neighbors_jet_fitting_normals, // number of neighbors - const std::vector& original_normals) // may be empty -{ - CGAL::Timer task_timer; task_timer.start(); - std::cerr << "Estimates Normals Direction by Jet Fitting (k=" - << nb_neighbors_jet_fitting_normals << ")...\n"; - - CGAL::jet_estimate_normals(points.begin(), points.end(), - CGAL::make_normal_of_point_with_normal_map(PointList::value_type()), - nb_neighbors_jet_fitting_normals); - - std::size_t memory = CGAL::Memory_sizer().virtual_size(); - std::cerr << "done: " << task_timer.time() << " seconds, " - << (memory>>20) << " Mb allocated" - << std::endl; - - // Check the accuracy of normals direction estimation. - // If original normals are available, compare with them. - return verify_normal_direction(points, original_normals); -} - -// Check the accuracy of normal orientation. -// Count non-oriented normals. -// If original normals are available, compare with them and count flipped normals. -bool verify_normal_orientation(const PointList& points, // input points + computed normals - PointList::const_iterator unoriented_points_begin, // first pt w/ unoriented normal - const std::vector& original_normals) // may be empty -{ - bool success = true; - - // Count non-oriented normals - int unoriented_normals = 0; - for (PointList::const_iterator p = unoriented_points_begin ; p != points.end(); p++) - { - unoriented_normals++; - } - if (unoriented_normals > 0) - { - std::cerr << "Error: " << unoriented_normals << " normals are unoriented\n"; - success = false; - } - - // Compare oriented normals with original ones and count flipped normals - bool points_have_original_normals = ! original_normals.empty(); - if (points_have_original_normals) - { - assert(points.size() == original_normals.size()); - - std::cerr << "Compare with original normals:" << std::endl; - - int flipped_normals = 0; // #normals with wrong orientation - PointList::const_iterator p; - std::vector::const_iterator n; - for (p = points.begin(), n = original_normals.begin(); p != unoriented_points_begin; p++, n++) - { - Vector v1 = *n; // original normal - double norm1 = std::sqrt( v1*v1 ); - assert(norm1 != 0.0); - Vector v2 = p->normal(); // computed normal - double norm2 = std::sqrt( v2*v2 ); - assert(norm2 != 0.0); - double cos_normal_deviation = (v1*v2)/(norm1*norm2); - if (cos_normal_deviation < 0) // if flipped - { - flipped_normals++; - } - } - - if (flipped_normals == 0) - std::cerr << " ok\n"; - else - std::cerr << " Error: " << flipped_normals << " normal(s) are flipped\n"; - } - - return success; -} - -// Hoppe92 normal orientation using a Minimum Spanning Tree. -// @return true on success. -bool run_mst_orient_normals(PointList& points, // input points + input/output normals - unsigned int nb_neighbors_mst, // number of neighbors - const std::vector& original_normals) // may be empty -{ -#if (BOOST_VERSION / 100) == 1054 - std::cerr << - "In run_mst_orient_normals():\n" - "NOTICE: This function is incompatible with Boost 1.54, " - "and will not be tested. See the following bug:\n" - " https://svn.boost.org/trac/boost/ticket/9012\n"; - return true; -#endif // Boost version is 1.54 - - std::cerr << "Orients Normals with a Minimum Spanning Tree (k="<< nb_neighbors_mst << ")...\n"; - CGAL::Timer task_timer; task_timer.start(); - - PointList::iterator unoriented_points_begin = - CGAL::mst_orient_normals(points.begin(), points.end(), - CGAL::make_normal_of_point_with_normal_map(PointList::value_type()), - nb_neighbors_mst); - - std::size_t memory = CGAL::Memory_sizer().virtual_size(); - std::cerr << "done: " << task_timer.time() << " seconds, " - << (memory>>20) << " Mb allocated" - << std::endl; - - // Note: we do *not* delete points with unoriented normals in this test. - // Instead, we check the accuracy of normal orientation and, - // if original normals are available, compare with them. - return verify_normal_orientation(points, unoriented_points_begin, original_normals); -} - - -// ---------------------------------------------------------------------------- -// main() -// ---------------------------------------------------------------------------- - -int main(int argc, char * argv[]) -{ - std::cerr << "Normal estimation test" << std::endl; - - //*************************************** - // decode parameters - //*************************************** - - // usage - if(argc < 2) - { - std::cerr << "For each input point set, compute and orient its normals.\n"; - std::cerr << "If an input mesh has normals, print the normals deviation.\n"; - std::cerr << "\n"; - std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz..." << std::endl; - std::cerr << "Input file formats are .off, .xyz and .pwn.\n"; - std::cerr << "No output" << std::endl; - return EXIT_FAILURE; - } - - // Normals Computing options - unsigned int nb_neighbors_pca_normals = 18; // K-nearest neighbors = 3 rings (estimate normals by PCA) - unsigned int nb_neighbors_jet_fitting_normals = 18; // K-nearest neighbors (estimate normals by Jet Fitting) - unsigned int nb_neighbors_mst = 18; // K-nearest neighbors (orient normals by MST) - - // Accumulated errors - int accumulated_fatal_err = EXIT_SUCCESS; - - // Process each input file - for(int i=1; i original_normals; - bool points_have_original_normals = (points.begin()->normal() != CGAL::NULL_VECTOR); - if ( points_have_original_normals ) - { - for (PointList::iterator p = points.begin() ; p != points.end(); p++) - original_normals.push_back(p->normal()); - } - - //*************************************** - // Computes normals (PCA + MST) - //*************************************** - - // Estimates normals direction. - success = run_pca_estimate_normals(points, nb_neighbors_pca_normals, original_normals); - if ( ! success ) - accumulated_fatal_err = EXIT_FAILURE; // set error and continue - - // Orients normals. - success = run_mst_orient_normals(points, nb_neighbors_mst, original_normals); - if ( ! success ) - accumulated_fatal_err = EXIT_FAILURE; // set error and continue - - //*************************************** - // Computes normals (jet fitting + MST) - //*************************************** - - // Estimates normals direction - success = run_jet_estimate_normals(points, nb_neighbors_jet_fitting_normals, original_normals); - if ( ! success ) - accumulated_fatal_err = EXIT_FAILURE; // set error and continue - - // Orients normals - success = run_mst_orient_normals(points, nb_neighbors_mst, original_normals); - if ( ! success ) - accumulated_fatal_err = EXIT_FAILURE; // set error and continue - - } // for each input file - - std::cerr << std::endl; - - // Returns accumulated fatal error - std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; - return accumulated_fatal_err; -} diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_read_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_read_test.cpp deleted file mode 100644 index 1f1b1ae4da0..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_read_test.cpp +++ /dev/null @@ -1,121 +0,0 @@ -#include - -#include -#include -#include -#include - -#include -#ifdef CGAL_CXX11 -#include -#endif - -#include -#include -#include -#include - -typedef CGAL::Simple_cartesian Kernel; -typedef Kernel::Point_3 Point_3; -typedef Kernel::Vector_3 Vector_3; -typedef std::pair PointVectorPair; - -bool read(std::string s) -{ - std::ifstream fs(s.c_str()); - std::vector pv_pairs; - return CGAL::read_xyz_points_and_normals(fs, - back_inserter(pv_pairs), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map()); -} - - - -bool read(std::string s, - std::vector& pv_pairs) -{ - std::ifstream fs(s.c_str()); - - return CGAL::read_xyz_points_and_normals(fs, - back_inserter(pv_pairs), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map()); -} - -bool read_off(std::string s, - std::vector& pv_pairs) -{ - std::ifstream fs(s.c_str()); - - return CGAL::read_off_points_and_normals(fs, - back_inserter(pv_pairs), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map()); -} - -#ifdef CGAL_CXX11 -bool read_ply (std::string s, - std::vector& pv_pairs) -{ - std::ifstream fs(s.c_str()); - - return CGAL::read_ply_points_and_normals (fs, - back_inserter(pv_pairs), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map()); -} -#endif - -int main() -{ - std::cerr << "### There should be three errors following this line...\n"; - assert(! read("data/read_test/bug_1.xyz")); - assert(! read("data/read_test/bug_2.xyz")); - assert(! read("data/read_test/bug_3.xyz")); - std::cerr << "### ... Done. Now, there should not be any error.\n"; - - assert(read("data/read_test/ok_1.xyz")); - assert(read("data/read_test/ok_2.xyz")); - assert(read("data/read_test/ok_3.xyz")); - - std::vector pv_pairs; - - read("data/read_test/ok_2.xyz", pv_pairs); - assert(pv_pairs.size() == 4); - assert(pv_pairs[0] == std::make_pair(Point_3(2,3,4), Vector_3(4,4,2))); - assert(pv_pairs[1] == std::make_pair(Point_3(3,4,6), Vector_3(0,0,0))); - assert(pv_pairs[2] == std::make_pair(Point_3(3,6,7), Vector_3(3,5,6))); - assert(pv_pairs[3] == std::make_pair(Point_3(1,3,4), Vector_3(4,6,8))); - - pv_pairs.clear(); - - assert(read_off("data/read_test/ok_1.off", pv_pairs)); - assert(pv_pairs.size() == 4); - assert(pv_pairs[0] == std::make_pair(Point_3(3,2,0), Vector_3(1,2,3))); - assert(pv_pairs[1] == std::make_pair(Point_3(1,2,3), Vector_3(0,0,0))); - assert(pv_pairs[2] == std::make_pair(Point_3(4,5,6), Vector_3(0,0,0))); - assert(pv_pairs[3] == std::make_pair(Point_3(7,8,9), Vector_3(0,0,0))); - -#ifdef CGAL_CXX11 - pv_pairs.clear (); - assert(read_ply("data/read_test/simple.ply", pv_pairs)); - assert(pv_pairs[0] == std::make_pair(Point_3(1,1,1), Vector_3(2,2,2))); - assert(pv_pairs[1] == std::make_pair(Point_3(3,3,3), Vector_3(4,4,4))); - assert(pv_pairs[2] == std::make_pair(Point_3(5,5,5), Vector_3(6,6,6))); - - pv_pairs.clear (); - assert(read_ply("data/read_test/simple_ascii.ply", pv_pairs)); - assert(pv_pairs[0] == std::make_pair(Point_3(1,1,1), Vector_3(2,2,2))); - assert(pv_pairs[1] == std::make_pair(Point_3(3,3,3), Vector_3(4,4,4))); - assert(pv_pairs[2] == std::make_pair(Point_3(5,5,5), Vector_3(6,6,6))); - - pv_pairs.clear (); - assert(read_ply("data/read_test/simple_with_flag.ply", pv_pairs)); - assert(pv_pairs[0] == std::make_pair(Point_3(1,1,1), Vector_3(2,2,2))); - assert(pv_pairs[1] == std::make_pair(Point_3(3,3,3), Vector_3(4,4,4))); - assert(pv_pairs[2] == std::make_pair(Point_3(5,5,5), Vector_3(6,6,6))); -#endif - - return 0; -} diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_read_test_with_different_pmaps.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_read_test_with_different_pmaps.cpp deleted file mode 100644 index f15357b13da..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_read_test_with_different_pmaps.cpp +++ /dev/null @@ -1,340 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - - -typedef CGAL::Simple_cartesian Kernel; -typedef Kernel::Point_3 Point_3; -typedef Kernel::Vector_3 Vector_3; -typedef std::pair PointVectorPair; - -// this is going to be custom OutputIterator value_type -struct dummy_counter { - static std::size_t counter; - - dummy_counter() { ++counter; } - operator std::size_t() { return counter-1; } -}; -std::size_t dummy_counter::counter = 0; - -bool check_points_and_vectors( - const boost::vector_property_map& points, - const boost::vector_property_map& normals, - const std::vector& pv_pairs, - const std::vector& indices) -{ - if(pv_pairs.size() != indices.size()) { - std::cerr << "Error: inconsistency between point / normal size." << std::endl; - return false; - } - - for(std::size_t i = 0; i < pv_pairs.size(); ++i ) { - if(pv_pairs[i].first != points[i]) { - std::cerr << "Error: points are not equal." << std::endl; - return false; - } - if(pv_pairs[i].second != normals[i]) { - std::cerr << "Error: normals are not equal." << std::endl; - return false; - } - } - return true; -} - -bool check_points( - const boost::vector_property_map& points_1, - const std::vector& points_2, - const std::vector& indices) -{ - if(points_2.size() != indices.size()) { - std::cerr << "Error: inconsistency between point / normal size." << std::endl; - return false; - } - - for(std::size_t i = 0; i < points_2.size(); ++i ) { - if(points_2[i] != points_1[i]) { - std::cerr << "Error: points are not equal." << std::endl; - return false; - } - } - return true; -} - -bool test_no_deduction_points_and_normals_xyz(const char* file_name) -{ - boost::vector_property_map points; - boost::vector_property_map normals; - std::vector indices; - - std::vector pv_pairs; - - // read with custom output iterator type - dummy_counter::counter = 0; - std::ifstream input(file_name); - CGAL::read_xyz_points_and_normals( - input, back_inserter(indices), points, normals, Kernel()); - - // read with ordinary pmaps - input.clear(); - input.close(); - input.open(file_name); - CGAL::read_xyz_points_and_normals( - input, back_inserter(pv_pairs), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map(), - Kernel()); - - return check_points_and_vectors(points, normals, pv_pairs, indices); -} - -bool test_no_deduction_points_and_normals_off(const char* file_name) -{ - boost::vector_property_map points; - boost::vector_property_map normals; - std::vector indices; - - std::vector pv_pairs; - - // read with custom output iterator type - dummy_counter::counter = 0; - std::ifstream input(file_name); - CGAL::read_off_points_and_normals( - input, back_inserter(indices), points, normals, Kernel()); - - // read with ordinary pmaps - input.clear(); - input.close(); - input.open(file_name); - CGAL::read_off_points_and_normals( - input, back_inserter(pv_pairs), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map(), - Kernel()); - - return check_points_and_vectors(points, normals, pv_pairs, indices); -} - -bool test_no_deduction_points_xyz(const char* file_name) -{ - boost::vector_property_map points_1; \ - std::vector indices; - - std::vector points_2; - - // read with custom output iterator type - dummy_counter::counter = 0; - std::ifstream input(file_name); - CGAL::read_xyz_points( - input, back_inserter(indices), points_1, Kernel()); - - // read with ordinary pmaps - input.clear(); - input.close(); - input.open(file_name); - CGAL::read_xyz_points( - input, back_inserter(points_2), - CGAL::Identity_property_map(), - Kernel()); - - return check_points(points_1, points_2, indices); -} - -bool test_no_deduction_points_off(const char* file_name) -{ - boost::vector_property_map points_1; - std::vector indices; - - std::vector points_2; - - // read with custom output iterator type - dummy_counter::counter = 0; - std::ifstream input(file_name); - CGAL::read_off_points( - input, back_inserter(indices), points_1, Kernel()); - - // read with ordinary pmaps - input.clear(); - input.close(); - input.open(file_name); - CGAL::read_off_points( - input, back_inserter(points_2), - CGAL::Identity_property_map(), - Kernel()); - - return check_points(points_1, points_2, indices); -} - -void compile_test() { - std::deque points; - std::deque normals; - std::deque pv_pairs; - std::ifstream input; - - input.open("data/read_test/simple.xyz"); - CGAL::read_xyz_points( - input, - std::front_inserter(points)); - input.clear(); - input.close(); - - input.open("data/read_test/simple.xyz"); - CGAL::read_xyz_points( - input, - std::front_inserter(points), - CGAL::Identity_property_map()); - input.clear(); - input.close(); - - input.open("data/read_test/simple.xyz"); - CGAL::read_xyz_points( - input, - std::front_inserter(points), - CGAL::Identity_property_map(), - Kernel()); - input.clear(); - input.close(); - - // this will span all OutputIteratorValueType versions - input.open("data/read_test/simple.xyz"); - CGAL::read_xyz_points( - input, - std::front_inserter(points)); - input.clear(); - input.close(); - //----------------------------------------------------------------------- - input.open("data/read_test/simple.off"); - CGAL::read_off_points( - input, - std::front_inserter(points)); - input.clear(); - input.close(); - - input.open("data/read_test/simple.off"); - CGAL::read_off_points( - input, - std::front_inserter(points), - CGAL::Identity_property_map()); - input.clear(); - input.close(); - - input.open("data/read_test/simple.off"); - CGAL::read_off_points( - input, - std::front_inserter(points), - CGAL::Identity_property_map(), - Kernel()); - input.clear(); - input.close(); - - // this will span all OutputIteratorValueType versions - input.open("data/read_test/simple.off"); - CGAL::read_off_points( - input, - std::front_inserter(points)); - input.clear(); - input.close(); - //----------------------------------------------------------------------- - input.open("data/read_test/simple.xyz"); - CGAL::read_xyz_points_and_normals( - input, - std::front_inserter(points), - boost::dummy_property_map()); - input.clear(); - input.close(); - - input.open("data/read_test/simple.xyz"); - CGAL::read_xyz_points_and_normals( - input, - std::front_inserter(pv_pairs), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map()); - input.clear(); - input.close(); - - input.open("data/read_test/simple.xyz"); - CGAL::read_xyz_points_and_normals( - input, - std::front_inserter(pv_pairs), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map(), - Kernel()); - input.clear(); - input.close(); - - input.open("data/read_test/simple.xyz"); - CGAL::read_xyz_points_and_normals( - input, - std::front_inserter(points), - boost::dummy_property_map()); - input.clear(); - input.close(); - //----------------------------------------------------------------------- - input.open("data/read_test/simple.off"); - CGAL::read_off_points_and_normals( - input, - std::front_inserter(points), - boost::dummy_property_map()); - input.clear(); - input.close(); - - input.open("data/read_test/simple.off"); - CGAL::read_off_points_and_normals( - input, - std::front_inserter(pv_pairs), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map()); - input.clear(); - input.close(); - - input.open("data/read_test/simple.off"); - CGAL::read_off_points_and_normals( - input, - std::front_inserter(pv_pairs), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map(), - Kernel()); - input.clear(); - input.close(); - - input.open("data/read_test/simple.off"); - CGAL::read_off_points_and_normals( - input, - std::front_inserter(points), - boost::dummy_property_map()); - input.clear(); - input.close(); -} - -int main() { - if(!test_no_deduction_points_and_normals_xyz("data/read_test/simple.xyz")) { - return EXIT_FAILURE; - } - std::cerr << "test_no_deduction_points_and_normals_xyz OK." << std::endl; - - if(!test_no_deduction_points_and_normals_off("data/read_test/simple.off")) { - return EXIT_FAILURE; - } - std::cerr << "test_no_deduction_points_and_normals_off OK." << std::endl; - - if(!test_no_deduction_points_xyz("data/read_test/simple.xyz")) { - return EXIT_FAILURE; - } - std::cerr << "test_no_deduction_points_xyz OK." << std::endl; - - if(!test_no_deduction_points_off("data/read_test/simple.off")) { - return EXIT_FAILURE; - } - std::cerr << "test_no_deduction_points_off OK." << std::endl; - - compile_test(); - return EXIT_SUCCESS; -} diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_remove_outliers_test.cmd b/Point_set_processing_3/test/Point_set_processing_3/deprecated_remove_outliers_test.cmd deleted file mode 100644 index 19722151afc..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_remove_outliers_test.cmd +++ /dev/null @@ -1 +0,0 @@ -data/*.xyz diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_remove_outliers_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_remove_outliers_test.cpp deleted file mode 100644 index 0a473a22a57..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_remove_outliers_test.cpp +++ /dev/null @@ -1,144 +0,0 @@ -#include - -// remove_outliers_test.cpp - -//---------------------------------------------------------- -// Test the outlier removal methods: -// For each input point set, remove outliers. -// Input format is .xyz. -// No output. -//---------------------------------------------------------- -// remove_outliers_test points1.xyz points2.xyz... - -// CGAL -#include -#include -#include - -// This package -#include -#include - -#include -#include -#include -#include - - -// ---------------------------------------------------------------------------- -// Types -// ---------------------------------------------------------------------------- - -// kernel -typedef CGAL::Simple_cartesian Kernel; - -// Simple geometric types -typedef Kernel::FT FT; -typedef Kernel::Point_3 Point; - - -// ---------------------------------------------------------------------------- -// Tests -// ---------------------------------------------------------------------------- - -// Removes outliers -void test_avg_knn_sq_distance(std::deque& points, // input point set - unsigned int nb_neighbors_remove_outliers, // K-nearest neighbors - double removed_percentage) // percentage of points to remove -{ - CGAL::Timer task_timer; task_timer.start(); - std::cerr << "Removes outliers wrt average squared distance to k nearest neighbors (remove " - << removed_percentage << "%, k=" - << nb_neighbors_remove_outliers << ")...\n"; - - // Removes outliers using erase-remove idiom - points.erase(CGAL::remove_outliers(points.begin(), points.end(), - nb_neighbors_remove_outliers, removed_percentage), - points.end()); - - // Optional: after erase(), use Scott Meyer's "swap trick" to trim excess capacity - std::deque(points).swap(points); - - - std::size_t memory = CGAL::Memory_sizer().virtual_size(); - std::cerr << "ok: " << task_timer.time() << " seconds, " - << (memory>>20) << " Mb allocated" - << std::endl; -} - - -// ---------------------------------------------------------------------------- -// main() -// ---------------------------------------------------------------------------- - -int main(int argc, char * argv[]) -{ - std::cerr << "Outlier removal test" << std::endl; - - //*************************************** - // decode parameters - //*************************************** - - // usage - if(argc < 2) - { - std::cerr << "For each input point set, remove outliers.\n"; - std::cerr << "\n"; - std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz..." << std::endl; - std::cerr << "Input file format is .xyz.\n"; - std::cerr << "No output" << std::endl; - return EXIT_FAILURE; - } - - // Outlier Removal options - const double removed_percentage = 5.0 /* % */; // percentage of outliers to remove - const unsigned int nb_neighbors_remove_outliers = 24; // K-nearest neighbors - - // Accumulated errors - int accumulated_fatal_err = EXIT_SUCCESS; - - // Process each input file - for(int i=1; i points; - std::cerr << "Open " << input_filename << " for reading..." << std::endl; - - // If XYZ file format: - std::ifstream stream(input_filename.c_str()); - if(stream && - CGAL::read_xyz_points(stream, std::back_inserter(points))) - { - std::cerr << "ok (" << points.size() << " points)" << std::endl; - } - else - { - std::cerr << "Error: cannot read file " << input_filename << std::endl; - accumulated_fatal_err = EXIT_FAILURE; - continue; - } - - //*************************************** - // Test - //*************************************** - - test_avg_knn_sq_distance(points, nb_neighbors_remove_outliers, removed_percentage); - - } // for each input file - - std::cerr << std::endl; - - // Returns accumulated fatal error - std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; - return accumulated_fatal_err; -} - diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_smoothing_test.cmd b/Point_set_processing_3/test/Point_set_processing_3/deprecated_smoothing_test.cmd deleted file mode 100644 index 19722151afc..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_smoothing_test.cmd +++ /dev/null @@ -1 +0,0 @@ -data/*.xyz diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_smoothing_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_smoothing_test.cpp deleted file mode 100644 index 99e1356f9ca..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_smoothing_test.cpp +++ /dev/null @@ -1,140 +0,0 @@ -#include - -// smoothing_test.cpp - -//---------------------------------------------------------- -// Test the smoothing methods: -// For each input point set, smooth it. -// Input format is .xyz. -// No output. -//---------------------------------------------------------- -// smoothing_test points1.xyz points2.xyz... - -// CGAL -#include -#include -#include - -// This package -#include -#include - -#include -#include -#include -#include - - -// ---------------------------------------------------------------------------- -// Types -// ---------------------------------------------------------------------------- - -// kernel -typedef CGAL::Simple_cartesian Kernel; - -// Simple geometric types -typedef Kernel::FT FT; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; - -// Concurrency -#ifdef CGAL_LINKED_WITH_TBB -typedef CGAL::Parallel_tag Concurrency_tag; -#else -typedef CGAL::Sequential_tag Concurrency_tag; -#endif - -// ---------------------------------------------------------------------------- -// Tests -// ---------------------------------------------------------------------------- - -void test_smooth_jet_fitting(std::deque& points,// input point set - unsigned int nb_neighbors_smooth_jet_fitting) // number of neighbors -{ - CGAL::Timer task_timer; task_timer.start(); - std::cerr << "Smoothes Point Set (k=" << nb_neighbors_smooth_jet_fitting << ")...\n"; - - CGAL::jet_smooth_point_set(points.begin(), points.end(), - nb_neighbors_smooth_jet_fitting); - - std::size_t memory = CGAL::Memory_sizer().virtual_size(); - std::cerr << "ok: " << task_timer.time() << " seconds, " - << (memory>>20) << " Mb allocated" - << std::endl; -} - - -// ---------------------------------------------------------------------------- -// main() -// ---------------------------------------------------------------------------- - -int main(int argc, char * argv[]) -{ - std::cerr << "Smoothing test" << std::endl; - - //*************************************** - // decode parameters - //*************************************** - - // usage - if(argc < 2) - { - std::cerr << "For each input point set, smooth it.\n"; - std::cerr << "\n"; - std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz..." << std::endl; - std::cerr << "Input file format is .xyz.\n"; - std::cerr << "No output" << std::endl; - return EXIT_FAILURE; - } - - // Smoothing options - const unsigned int nb_neighbors_smooth_jet_fitting = 24; // K-nearest neighbors (smooth points by Jet Fitting) - - // Accumulated errors - int accumulated_fatal_err = EXIT_SUCCESS; - - // Process each input file - for(int i=1; i points; - std::cerr << "Open " << input_filename << " for reading..." << std::endl; - - // If XYZ file format: - std::ifstream stream(input_filename.c_str()); - if(stream && - CGAL::read_xyz_points(stream, std::back_inserter(points))) - { - std::cerr << "ok (" << points.size() << " points)" << std::endl; - } - else - { - std::cerr << "Error: cannot read file " << input_filename << std::endl; - accumulated_fatal_err = EXIT_FAILURE; - continue; - } - - //*************************************** - // Test - //*************************************** - - test_smooth_jet_fitting(points, nb_neighbors_smooth_jet_fitting); - - } // for each input file - - std::cerr << std::endl; - - // Returns accumulated fatal error - std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; - return accumulated_fatal_err; -} - diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_structuring_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_structuring_test.cpp deleted file mode 100644 index ccbbebcbdb7..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_structuring_test.cpp +++ /dev/null @@ -1,146 +0,0 @@ -#include - -#include -#include -#include - -#include -#include - -#include - -#include -#include - -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; -typedef Kernel::Plane_3 Plane; -typedef std::pair Point_with_normal; -typedef std::vector Pwn_vector; -typedef CGAL::First_of_pair_property_map Point_map; -typedef CGAL::Second_of_pair_property_map Normal_map; - -typedef CGAL::Shape_detection_3::Shape_detection_traits - Traits; -typedef CGAL::Shape_detection_3::Efficient_RANSAC Efficient_ransac; - -typedef CGAL::Point_set_with_structure Points_with_structure; - -template -void generate_random_points (const Point& origin, const Vector& base1, const Vector& base2, - std::size_t nb_pts, OutputIterator output) -{ - Vector normal = CGAL::cross_product (base1, base2); - normal = normal / std::sqrt (normal * normal); - - for (std::size_t i = 0; i < nb_pts; ++ i) - { - Point point = origin - + CGAL::get_default_random().get_double() * base1 - + CGAL::get_default_random().get_double() * base2; - - *(output ++) = std::make_pair (point, normal); - } -} - - -int main() -{ - Vector vx (1., 0., 0.), - vy (0., 1., 0.), - vz (0., 0., 1.); - - Efficient_ransac ransac; - ransac.add_shape_factory >(); - - const std::size_t nb_pts = 1000; - - Efficient_ransac::Parameters op; - op.probability = 0.05; - op.min_points = nb_pts / 2; - op.epsilon = 0.02; - op.cluster_epsilon = 0.05; - op.normal_threshold = 0.8; - - Pwn_vector points; - - generate_random_points (Point (0., 0., 0.), vx, vy, - 5000, std::back_inserter (points)); - generate_random_points (Point (0., 0., 0.), vx, vz, - 5000, std::back_inserter (points)); - generate_random_points (Point (0., 0., 0.), vy, vz, - 5000, std::back_inserter (points)); - generate_random_points (Point (0., 0., 1.), vx, vy, - 5000, std::back_inserter (points)); - generate_random_points (Point (0., 1., 0.), vx, vz, - 5000, std::back_inserter (points)); - generate_random_points (Point (1., 0., 0.), vy, vz, - 5000, std::back_inserter (points)); - - - ransac.set_input(points); - ransac.detect(op); - Efficient_ransac::Plane_range planes = ransac.planes(); - - Points_with_structure pss (points, Point_map(), Normal_map(), - planes, - CGAL::Shape_detection_3::Plane_map(), - CGAL::Shape_detection_3::Point_to_shape_index_map(points, planes), - op.cluster_epsilon); - - - std::vector vertices; - - for (std::size_t i = 0; i < pss.size(); ++ i) - { - std::vector planes; - pss.adjacency (i, std::back_inserter (planes)); - if (planes.size () == 3) - vertices.push_back (pss.point (i)); - } - - if (vertices.size () != 8) - { - std::cerr << "Error: 8 point should have been structural vertices." << std::endl; - return EXIT_FAILURE; - } - - std::vector ground_truth; - ground_truth.push_back (Point (0., 0., 0.)); - ground_truth.push_back (Point (0., 0., 1.)); - ground_truth.push_back (Point (0., 1., 0.)); - ground_truth.push_back (Point (0., 1., 1.)); - ground_truth.push_back (Point (1., 0., 0.)); - ground_truth.push_back (Point (1., 0., 1.)); - ground_truth.push_back (Point (1., 1., 0.)); - ground_truth.push_back (Point (1., 1., 1.)); - std::vector found (ground_truth.size(), false); - std::size_t nb_found = 0; - - for (std::size_t i = 0; i < vertices.size(); ++ i) - for (std::size_t j = 0; j < ground_truth.size(); ++ j) - { - if (found[j]) - continue; - - if (CGAL::squared_distance (ground_truth[j], vertices[i]) < 1e-6) - { - found[j] = true; - ++ nb_found; - break; - } - } - - if (nb_found != ground_truth.size()) - { - std::cerr << "Error: the following vert(ex/ices) was/were not found:" << std::endl; - for (std::size_t i = 0; i < ground_truth.size(); ++ i) - if (!(found[i])) - std::cerr << " * " << ground_truth[i] << std::endl; - return EXIT_FAILURE; - } - - - return EXIT_SUCCESS; -} diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_vcm_all_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_vcm_all_test.cpp deleted file mode 100644 index 55f707e0c98..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_vcm_all_test.cpp +++ /dev/null @@ -1,104 +0,0 @@ -#include - -#include -#include -#include -#include - -#include - -#include -#include - - -// Types -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef Kernel::Point_3 Point; -typedef Kernel::Vector_3 Vector; - -typedef CGAL::cpp11::array Covariance; - - -bool test_fandisk() -{ -std::cout << "=== test_fandisk ===\n"; - std::size_t nb_points = 15843; - CGAL::Identity_property_map pmap; - Covariance expected; - int index; - - // Reads a .xyz point set file in points[]. - std::vector points; - std::vector cov; - boost::dynamic_bitset on_feature_edge(nb_points); - points.reserve(nb_points); - cov.reserve(nb_points); - std::ifstream stream("data/fandisk.off"); - if (!stream || - !CGAL::read_off_points(stream, - std::back_inserter(points), - pmap)) - { - std::cerr << "Error: cannot read file data/fandisk.off" << std::endl; - return false; - } - -// test vcm without convolution - std::cout << " Test compute vcm without convolution\n"; - cov.clear(); - CGAL::compute_vcm(points.begin(), points.end(), pmap, cov, 0.2, 0, Kernel()); - -// check the cov matrices - std::ifstream cov_stream("vcm_all_test-covmat_no_cov.txt"); - while( cov_stream >> index >> expected[0] >> expected[1] >> expected[2] >> expected[3] >> expected[4] >> expected[5] ) - for(int i=0;i<6;++i) - assert( CGAL::abs(cov[index][i]-expected[i]) <= CGAL::abs(expected[i])*5/100 ); - cov_stream.close(); - -// check points detected as feature point - int indices_no_cov[243]={81,616,694,726,740,812,814,823,834,835,874,1153,1170,1188,1273,1382,1415,1563,1720,1745,1752,1763,1825,2013,2041,2042,2065,2181,2463,2508,2573,2616,2630,2632,2654,2715,2842,2864,2867,2893,3006,3014,3018,3121,3122,3144,3382,3654,3740,3914,4392,4454,4549,4765,4774,4804,4843,4862,4918,4949,4980,5054,5150,5178,5179,5181,5183,5373,5374,5557,5583,5584,5655,5657,5767,5827,6380,6565,6619,6645,6784,6786,6839,6895,6896,6929,7064,7071,7074,7098,7239,7350,7545,7659,7661,7681,7709,7843,7859,7895,7973,7983,8003,8064,8115,8125,8143,8255,8334,8428,8429,8464,8554,8689,8768,8769,8881,8883,8924,8962,8963,9121,9168,9213,9267,9380,9495,9503,9536,9577,9648,9661,9665,9668,9695,9696,9740,9753,9798,9805,9821,9972,9977,10095,10096,10254,10266,10267,10269,10297,10305,10671,10725,10727,10824,10915,10948,11015,11026,11201,11234,11455,11466,11553,11611,11667,11713,11724,11745,11849,11903,11952,11992,12008,12287,12297,12321,12342,12467,12468,12511,12530,12715,12758,12987,13012,13045,13188,13210,13380,13442,13443,13475,13503,13549,13564,13572,13591,13630,13672,13694,13740,13742,13791,13856,13896,13905,13942,13945,14008,14055,14077,14140,14166,14397,14460,14482,14485,14546,14566,14614,14667,14721,14793,14816,14864,14928,15029,15037,15090,15132,15148,15168,15360,15363,15384,15394,15478,15501,15522,15810,15811,15827}; - on_feature_edge.reset(); - for(int i=0;i<243;++i) - on_feature_edge.set(indices_no_cov[i]); - std::size_t nb_wrong=0; - for (std::size_t i=0; i> index >> expected[0] >> expected[1] >> expected[2] >> expected[3] >> expected[4] >> expected[5] ) - for(int i=0;i<6;++i) - assert( CGAL::abs(cov[index][i]-expected[i]) <= CGAL::abs(expected[i])*5/100 ); - cov_stream.close(); -// check points detected as feature point - int indices_with_cov[2746]={21,22,23,24,25,36,37,38,42,43,44,45,77,78,79,80,81,82,83,89,120,121,129,130,173,174,181,182,184,185,186,215,216,221,222,228,232,233,234,236,255,256,269,270,271,275,288,289,290,291,292,293,294,315,317,329,354,355,356,378,379,380,381,382,383,402,403,404,405,419,420,467,469,477,478,479,480,482,483,497,498,499,521,527,528,536,557,581,582,586,587,593,594,613,614,616,617,618,619,624,625,627,629,644,678,693,694,695,696,700,725,726,727,734,735,736,740,741,742,755,791,794,798,811,812,813,814,823,824,825,826,829,830,831,835,844,850,851,858,859,860,861,874,875,876,927,928,936,945,946,962,970,972,985,987,998,1003,1005,1014,1015,1016,1059,1060,1086,1102,1103,1104,1111,1112,1113,1121,1122,1129,1131,1133,1134,1135,1153,1154,1164,1167,1168,1169,1170,1171,1172,1173,1180,1186,1187,1188,1192,1193,1194,1195,1196,1197,1198,1214,1216,1236,1237,1238,1257,1258,1266,1270,1271,1272,1273,1298,1299,1305,1309,1310,1311,1312,1317,1318,1326,1330,1339,1342,1343,1347,1348,1349,1368,1370,1372,1373,1374,1375,1381,1382,1383,1387,1389,1393,1395,1399,1401,1412,1415,1416,1417,1482,1490,1492,1493,1503,1504,1505,1506,1507,1521,1522,1543,1544,1549,1550,1552,1553,1563,1564,1566,1567,1568,1569,1570,1595,1597,1598,1599,1650,1651,1652,1657,1659,1660,1661,1662,1704,1710,1711,1719,1720,1721,1740,1745,1746,1747,1749,1750,1751,1752,1754,1762,1763,1764,1765,1770,1771,1816,1817,1818,1823,1824,1825,1828,1829,1830,1853,1854,1855,1856,1857,1859,1867,1868,1872,1931,1933,1935,1936,1958,1959,1971,1972,1988,1998,1999,2000,2001,2005,2006,2007,2011,2012,2013,2028,2030,2032,2041,2042,2043,2044,2051,2052,2053,2063,2064,2065,2072,2106,2108,2109,2123,2129,2130,2132,2133,2134,2135,2160,2170,2178,2179,2180,2181,2206,2238,2247,2269,2296,2309,2310,2311,2330,2331,2332,2334,2343,2345,2346,2358,2361,2362,2363,2368,2370,2398,2399,2400,2440,2441,2446,2447,2448,2452,2463,2464,2475,2502,2503,2508,2509,2510,2511,2512,2520,2530,2567,2572,2573,2576,2584,2585,2612,2614,2615,2616,2621,2625,2626,2627,2628,2630,2631,2632,2635,2648,2650,2651,2652,2653,2654,2660,2661,2662,2664,2665,2666,2667,2669,2671,2680,2692,2699,2700,2701,2703,2713,2714,2715,2719,2720,2721,2726,2727,2733,2745,2746,2759,2778,2786,2796,2797,2798,2803,2804,2842,2843,2844,2845,2849,2851,2863,2864,2865,2866,2867,2868,2869,2870,2871,2872,2891,2892,2893,2919,2921,2941,2942,2964,2967,2968,2969,2970,2982,3004,3005,3006,3008,3009,3010,3012,3013,3014,3015,3016,3017,3018,3019,3037,3038,3039,3079,3080,3081,3094,3118,3120,3121,3122,3123,3130,3131,3134,3144,3145,3146,3176,3177,3178,3179,3195,3196,3197,3198,3200,3209,3211,3236,3238,3244,3245,3254,3255,3259,3260,3261,3262,3276,3277,3296,3297,3309,3322,3323,3328,3329,3337,3340,3368,3380,3381,3382,3386,3387,3401,3409,3410,3411,3412,3450,3452,3507,3508,3523,3524,3525,3532,3533,3542,3558,3559,3568,3569,3575,3605,3606,3607,3610,3611,3624,3629,3639,3645,3646,3654,3655,3688,3694,3695,3738,3739,3740,3741,3745,3746,3747,3751,3760,3761,3762,3763,3773,3802,3817,3818,3819,3820,3840,3844,3880,3881,3907,3908,3909,3913,3914,3923,3931,3932,3933,3942,3963,3964,3965,3983,3989,3990,3991,3992,4013,4014,4019,4020,4022,4023,4024,4026,4028,4029,4065,4076,4077,4078,4135,4136,4137,4138,4143,4150,4170,4171,4180,4189,4197,4198,4200,4201,4206,4208,4209,4211,4212,4213,4224,4237,4286,4287,4288,4296,4346,4348,4355,4391,4392,4411,4412,4413,4414,4429,4433,4434,4451,4453,4454,4455,4472,4505,4508,4513,4514,4519,4535,4537,4549,4550,4551,4555,4556,4557,4558,4562,4568,4576,4584,4586,4587,4617,4619,4629,4631,4632,4653,4657,4696,4698,4700,4701,4715,4718,4727,4728,4729,4732,4733,4734,4740,4757,4758,4765,4767,4772,4773,4774,4775,4786,4787,4800,4801,4802,4803,4804,4805,4806,4815,4817,4843,4844,4845,4846,4848,4854,4862,4863,4864,4870,4871,4900,4901,4902,4903,4906,4918,4919,4922,4928,4929,4935,4943,4947,4948,4949,4967,4972,4973,4976,4979,4980,4981,4986,4987,4988,4991,5002,5003,5004,5006,5007,5010,5012,5013,5014,5015,5016,5040,5053,5054,5055,5091,5092,5102,5103,5111,5115,5118,5119,5123,5134,5149,5150,5151,5173,5175,5176,5177,5178,5179,5180,5181,5182,5183,5190,5191,5244,5245,5255,5258,5259,5263,5265,5297,5298,5326,5327,5330,5331,5336,5338,5364,5366,5370,5371,5372,5373,5374,5375,5379,5391,5393,5396,5397,5399,5400,5401,5411,5412,5413,5459,5463,5464,5489,5518,5519,5520,5522,5524,5531,5532,5539,5550,5551,5555,5556,5557,5583,5584,5585,5594,5595,5614,5619,5620,5621,5639,5651,5653,5655,5656,5657,5661,5662,5668,5681,5682,5683,5684,5687,5688,5689,5697,5700,5701,5702,5703,5707,5708,5713,5724,5725,5737,5738,5750,5766,5767,5782,5783,5784,5785,5790,5805,5806,5810,5826,5836,5857,5858,5860,5882,5883,5903,5904,5905,5907,5908,5909,5910,5918,5919,5921,5922,5928,5930,5931,5932,5936,5937,5953,5958,5960,5961,5982,5988,5989,6016,6025,6026,6061,6062,6086,6087,6095,6096,6097,6103,6104,6108,6109,6114,6116,6119,6121,6129,6156,6157,6158,6171,6172,6173,6179,6180,6201,6225,6227,6228,6229,6232,6233,6234,6246,6247,6248,6268,6269,6270,6271,6282,6283,6285,6289,6290,6309,6310,6341,6359,6362,6367,6369,6370,6371,6372,6380,6381,6400,6401,6402,6422,6431,6445,6446,6483,6487,6488,6492,6498,6500,6506,6507,6510,6511,6519,6520,6521,6522,6523,6524,6525,6543,6552,6553,6559,6560,6561,6564,6565,6567,6579,6585,6586,6587,6595,6596,6599,6614,6615,6616,6619,6627,6631,6632,6633,6634,6635,6637,6638,6645,6651,6652,6653,6661,6662,6669,6670,6694,6705,6707,6708,6709,6714,6718,6722,6723,6742,6743,6744,6746,6747,6763,6764,6765,6766,6767,6783,6784,6785,6786,6801,6809,6810,6816,6817,6846,6858,6873,6874,6875,6876,6880,6881,6885,6895,6896,6897,6908,6917,6919,6927,6929,6930,6931,6932,6942,6944,6945,6954,6955,6956,6962,6966,6995,7033,7034,7037,7043,7044,7045,7049,7063,7064,7065,7071,7072,7073,7074,7084,7090,7092,7093,7096,7097,7098,7099,7104,7118,7127,7128,7133,7174,7194,7195,7197,7198,7199,7208,7209,7213,7237,7238,7239,7240,7253,7254,7255,7259,7279,7342,7347,7348,7349,7350,7352,7354,7355,7357,7358,7368,7385,7395,7429,7430,7431,7432,7490,7498,7529,7534,7537,7543,7544,7545,7546,7560,7562,7563,7564,7568,7569,7572,7584,7590,7602,7627,7628,7634,7636,7641,7642,7643,7644,7645,7657,7658,7659,7660,7661,7666,7668,7671,7676,7680,7681,7682,7699,7703,7706,7709,7710,7714,7715,7718,7719,7721,7722,7724,7727,7730,7732,7754,7769,7771,7775,7785,7786,7810,7811,7812,7842,7843,7844,7850,7858,7859,7869,7873,7877,7890,7891,7892,7893,7894,7895,7896,7900,7913,7930,7931,7932,7933,7934,7938,7939,7940,7941,7945,7951,7960,7961,7966,7970,7971,7972,7973,7974,7975,7977,7980,7981,7982,7983,7985,7999,8003,8004,8005,8012,8013,8015,8017,8047,8053,8064,8065,8083,8084,8087,8093,8094,8095,8097,8115,8116,8117,8120,8123,8124,8125,8126,8129,8131,8132,8135,8136,8143,8144,8146,8147,8148,8185,8188,8205,8206,8211,8212,8213,8214,8215,8225,8229,8230,8252,8255,8256,8257,8258,8260,8293,8294,8295,8305,8306,8307,8332,8333,8334,8335,8338,8342,8343,8344,8345,8365,8366,8367,8368,8373,8374,8379,8380,8384,8410,8426,8427,8428,8429,8442,8443,8444,8445,8462,8463,8464,8465,8467,8477,8482,8483,8484,8485,8499,8500,8501,8502,8503,8552,8553,8554,8565,8604,8605,8612,8626,8637,8638,8639,8644,8647,8648,8649,8659,8665,8676,8677,8680,8681,8683,8687,8688,8689,8696,8697,8725,8726,8727,8740,8742,8743,8750,8752,8753,8758,8768,8784,8785,8786,8787,8788,8796,8803,8821,8830,8831,8842,8849,8859,8860,8881,8883,8892,8893,8900,8901,8902,8912,8923,8924,8925,8941,8942,8943,8945,8946,8947,8948,8949,8962,8963,8989,8994,9006,9007,9010,9011,9015,9017,9030,9057,9058,9060,9061,9065,9067,9096,9099,9103,9118,9119,9120,9121,9122,9130,9134,9141,9154,9155,9164,9168,9169,9170,9179,9181,9194,9208,9210,9211,9212,9213,9220,9223,9226,9235,9263,9264,9266,9267,9268,9269,9286,9310,9311,9312,9325,9332,9350,9352,9355,9356,9358,9361,9374,9376,9377,9380,9381,9385,9389,9400,9408,9409,9420,9424,9430,9438,9445,9446,9460,9461,9470,9473,9483,9495,9496,9500,9501,9503,9512,9516,9529,9530,9536,9542,9555,9560,9561,9565,9566,9567,9577,9582,9583,9587,9589,9591,9592,9626,9628,9629,9634,9635,9640,9641,9642,9646,9647,9648,9649,9650,9652,9658,9661,9662,9664,9665,9668,9669,9676,9678,9679,9680,9682,9687,9688,9689,9695,9696,9703,9730,9740,9741,9742,9743,9748,9749,9751,9752,9753,9763,9779,9780,9798,9805,9806,9814,9821,9822,9823,9824,9831,9837,9838,9848,9854,9858,9859,9860,9862,9872,9874,9899,9900,9905,9906,9925,9926,9928,9932,9938,9945,9950,9953,9961,9965,9966,9967,9972,9976,9977,9988,10015,10016,10035,10038,10039,10042,10043,10044,10045,10054,10055,10057,10058,10060,10063,10065,10073,10074,10080,10095,10096,10097,10099,10103,10104,10113,10121,10122,10124,10125,10132,10143,10148,10168,10172,10173,10177,10181,10182,10187,10204,10205,10216,10220,10230,10236,10254,10255,10266,10267,10269,10270,10297,10298,10304,10305,10306,10311,10312,10313,10317,10327,10328,10331,10342,10343,10373,10378,10394,10395,10396,10403,10408,10409,10430,10432,10434,10435,10470,10471,10479,10504,10517,10542,10543,10544,10556,10557,10559,10560,10565,10567,10568,10569,10571,10572,10584,10589,10605,10607,10613,10615,10626,10627,10633,10638,10642,10643,10644,10649,10655,10656,10657,10664,10665,10670,10671,10677,10687,10688,10690,10699,10700,10701,10723,10724,10725,10727,10730,10734,10738,10739,10757,10758,10759,10761,10762,10771,10774,10775,10776,10777,10780,10783,10784,10787,10788,10807,10808,10815,10823,10824,10834,10855,10867,10874,10879,10889,10911,10912,10913,10914,10915,10916,10918,10919,10924,10925,10928,10932,10933,10937,10942,10946,10948,10949,10953,10954,10964,10977,10978,11002,11006,11007,11008,11015,11021,11022,11026,11027,11032,11060,11067,11068,11069,11075,11080,11082,11083,11084,11090,11105,11107,11110,11111,11112,11115,11116,11120,11130,11145,11146,11155,11165,11183,11192,11193,11197,11201,11202,11209,11210,11211,11217,11219,11222,11231,11232,11234,11249,11251,11252,11269,11292,11294,11298,11327,11330,11331,11338,11344,11345,11346,11347,11349,11350,11364,11365,11366,11367,11386,11387,11389,11390,11404,11410,11412,11415,11416,11417,11430,11436,11437,11455,11456,11457,11465,11466,11467,11476,11480,11483,11492,11503,11506,11519,11520,11521,11524,11527,11528,11532,11533,11534,11535,11543,11545,11553,11554,11560,11579,11583,11603,11604,11606,11611,11630,11641,11651,11656,11667,11668,11683,11685,11686,11687,11695,11704,11709,11710,11711,11713,11721,11723,11724,11725,11726,11727,11743,11745,11747,11748,11756,11769,11787,11792,11803,11804,11836,11841,11842,11848,11849,11860,11861,11903,11911,11914,11915,11917,11918,11925,11929,11938,11939,11951,11952,11953,11955,11956,11969,11970,11979,11985,11986,11991,11992,11994,12007,12008,12009,12010,12026,12048,12059,12060,12069,12070,12071,12079,12098,12099,12109,12126,12127,12132,12143,12146,12148,12149,12155,12171,12173,12174,12175,12187,12191,12197,12212,12213,12214,12219,12227,12233,12252,12267,12278,12285,12286,12287,12291,12294,12295,12296,12297,12299,12306,12317,12321,12322,12324,12330,12331,12333,12341,12342,12343,12344,12357,12364,12369,12374,12383,12384,12390,12397,12398,12399,12400,12402,12411,12412,12433,12449,12467,12468,12469,12495,12505,12511,12513,12515,12516,12517,12530,12531,12539,12540,12541,12549,12550,12553,12560,12566,12567,12582,12586,12598,12601,12602,12603,12606,12612,12613,12614,12615,12619,12628,12636,12639,12645,12650,12651,12659,12701,12715,12716,12717,12732,12738,12740,12757,12758,12761,12778,12779,12780,12781,12800,12802,12810,12811,12812,12816,12827,12832,12833,12841,12842,12843,12882,12883,12884,12885,12887,12888,12895,12905,12917,12926,12927,12928,12929,12935,12940,12945,12952,12960,12981,12984,12987,12991,12994,13012,13014,13021,13022,13043,13044,13045,13051,13054,13055,13056,13057,13059,13064,13067,13068,13069,13070,13081,13083,13088,13090,13092,13095,13102,13105,13106,13112,13113,13120,13127,13132,13137,13138,13139,13140,13144,13145,13146,13147,13157,13163,13188,13192,13196,13199,13200,13210,13234,13239,13247,13248,13252,13261,13263,13264,13269,13272,13273,13276,13282,13284,13288,13307,13323,13325,13326,13331,13332,13333,13339,13341,13342,13343,13344,13346,13347,13348,13349,13350,13358,13361,13364,13366,13367,13369,13370,13371,13374,13379,13380,13396,13397,13406,13415,13420,13421,13422,13424,13426,13428,13429,13440,13442,13443,13453,13458,13462,13467,13468,13474,13475,13487,13488,13499,13503,13510,13520,13528,13530,13537,13548,13549,13550,13563,13564,13571,13572,13574,13576,13579,13591,13595,13597,13622,13626,13629,13630,13631,13649,13657,13666,13667,13672,13673,13679,13682,13683,13694,13696,13706,13707,13721,13725,13731,13732,13738,13739,13740,13742,13743,13748,13753,13763,13767,13771,13783,13789,13790,13791,13796,13799,13803,13804,13805,13806,13810,13815,13817,13818,13821,13822,13833,13837,13842,13843,13855,13856,13857,13863,13867,13872,13873,13874,13875,13876,13877,13878,13887,13888,13889,13896,13905,13906,13916,13918,13929,13933,13939,13942,13944,13945,13946,13947,13948,13955,13958,13959,13973,13984,13985,13986,13997,14001,14002,14005,14007,14008,14009,14020,14036,14051,14055,14056,14057,14064,14065,14070,14077,14093,14097,14099,14113,14114,14116,14117,14126,14129,14130,14133,14139,14140,14141,14142,14146,14154,14164,14165,14166,14169,14178,14181,14189,14197,14198,14213,14222,14226,14233,14238,14239,14245,14246,14251,14252,14262,14263,14267,14270,14273,14294,14299,14304,14319,14325,14337,14338,14343,14345,14347,14353,14360,14361,14362,14368,14369,14382,14387,14388,14396,14397,14409,14411,14415,14424,14425,14445,14449,14460,14462,14464,14466,14468,14475,14482,14483,14485,14495,14496,14503,14504,14515,14525,14526,14538,14545,14546,14547,14548,14549,14560,14561,14562,14563,14566,14571,14577,14596,14597,14598,14614,14628,14640,14644,14648,14652,14654,14658,14660,14662,14667,14668,14669,14670,14685,14694,14700,14701,14702,14707,14716,14721,14722,14726,14740,14741,14742,14744,14755,14758,14780,14781,14787,14793,14794,14796,14797,14801,14815,14816,14824,14830,14846,14848,14864,14865,14879,14881,14883,14884,14903,14905,14926,14928,14932,14933,14934,14935,14936,14961,14965,14967,14973,14975,14983,14990,14999,15000,15004,15005,15006,15007,15022,15023,15029,15036,15037,15038,15045,15047,15054,15061,15072,15089,15090,15101,15114,15118,15128,15129,15132,15141,15148,15149,15150,15158,15160,15161,15164,15165,15168,15172,15173,15174,15183,15191,15194,15196,15200,15209,15210,15213,15216,15217,15221,15228,15229,15243,15247,15286,15287,15291,15321,15322,15331,15352,15353,15354,15360,15362,15363,15377,15379,15384,15393,15394,15395,15397,15403,15406,15412,15422,15451,15455,15470,15473,15476,15478,15482,15487,15492,15498,15501,15504,15522,15552,15556,15574,15576,15581,15585,15586,15587,15602,15603,15604,15605,15615,15616,15617,15624,15625,15637,15644,15646,15662,15663,15664,15682,15688,15689,15692,15726,15735,15740,15743,15756,15758,15763,15796,15802,15803,15805,15809,15810,15811,15818,15823,15827,15836,15839,15841}; - on_feature_edge.reset(); - for(int i=0;i<2746;++i) - on_feature_edge.set(indices_with_cov[i]); - nb_wrong=0; - for (std::size_t i=0; i - -#include -#include -#include -#include - -typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; -typedef CGAL::Point_3 Point_3; -typedef CGAL::Vector_3 Vector_3; -typedef std::pair PointWithNormal; - -int main (void) { - // Generate points on a plane - int k = 100; - double r = 10; - - std::vector points; - points.push_back(std::make_pair(Point_3(0, 0, 0), Vector_3(0, 0, 0))); - for (int i = 0; i < k; ++i) { - double theta = 2 * i * CGAL_PI / k; - points.push_back(std::make_pair(Point_3(r * cos(theta), r * sin(theta), 0), - Vector_3(0, 0, 0))); - } - - // Estimate the normals using VCM - double R = 20; - vcm_estimate_normals(points.begin(), points.end(), - CGAL::First_of_pair_property_map(), - CGAL::Second_of_pair_property_map(), - R, 0.0); - - std::cout << "Normal is " << points[0].second << std::endl; - - // The normal at the origin should be (0, 0, 1) - double epsilon=2e-5; - assert(points[0].second.x() < epsilon && points[0].second.x() > -epsilon); - assert(points[0].second.y() < epsilon && points[0].second.y() > -epsilon); - assert(points[0].second.z() < 0 || (points[0].second.z() < 1+epsilon && points[0].second.z() > 1-epsilon)); - assert(points[0].second.z() > 0 || (points[0].second.z() < -1+epsilon && points[0].second.z() > -1-epsilon)); - - return 0; -} - diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_wlop_simplify_and_regularize_test.cmd b/Point_set_processing_3/test/Point_set_processing_3/deprecated_wlop_simplify_and_regularize_test.cmd deleted file mode 100644 index ee93d623f58..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_wlop_simplify_and_regularize_test.cmd +++ /dev/null @@ -1 +0,0 @@ -data/sphere_20k.xyz diff --git a/Point_set_processing_3/test/Point_set_processing_3/deprecated_wlop_simplify_and_regularize_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/deprecated_wlop_simplify_and_regularize_test.cpp deleted file mode 100644 index eb7467d422d..00000000000 --- a/Point_set_processing_3/test/Point_set_processing_3/deprecated_wlop_simplify_and_regularize_test.cpp +++ /dev/null @@ -1,170 +0,0 @@ -#include - -// wlop_simplify_and_regularize_test.cpp - -//---------------------------------------------------------- -// Test the wlop simplify and regularize method: -// Input format is .xyz. -// No output. -//---------------------------------------------------------- -// wlop_simplify_and_regularize_test points1.xyz points2.xyz... - -// CGAL -#include -#include -#include -#include - -// This package -#include -#include - -#include -#include -#include -#include - - -// ---------------------------------------------------------------------------- -// Types -// ---------------------------------------------------------------------------- - -// kernel -typedef CGAL::Simple_cartesian Kernel; - -// Simple geometric types -typedef Kernel::FT FT; -typedef Kernel::Point_3 Point; - -// ---------------------------------------------------------------------------- -// Tests -// ---------------------------------------------------------------------------- - -// Removes outliers -template -void test_wlop_simplify_and_regularize( - std::vector& points, // input point set - std::vector& output, - double retain_percentage, // percentage of points to remove - double neighbor_radius, // neighborhood size - unsigned int iter_number, // iteration number - bool need_compute_density) - -{ - CGAL::Real_timer task_timer; task_timer.start(); - std::cerr << "Running WLOP simplify and regularize, (retain_percentage: " - << retain_percentage << "%, neighbor_radius=" - << neighbor_radius << ")...\n"; - - // Make room for sample points - std::vector points_sampled; - points_sampled.resize(static_cast(points.size() * (retain_percentage / 100.))); - - output.clear(); - // Run algorithm - CGAL::wlop_simplify_and_regularize_point_set( - points.begin(), - points.end(), - std::back_inserter(output), - retain_percentage, - neighbor_radius, - iter_number, - need_compute_density); - - output.clear(); - - std::size_t memory = CGAL::Memory_sizer().virtual_size(); - std::cerr << "ok: " << task_timer.time() << " seconds, " - << (memory>>20) << " Mb allocated" - << std::endl; -} - - -// ---------------------------------------------------------------------------- -// main() -// ---------------------------------------------------------------------------- - -int main(int argc, char * argv[]) -{ - std::cerr << "WLOP simplify and regularize" << std::endl; - - //*************************************** - // decode parameters - //*************************************** - - // usage - if(argc < 2) - { - std::cerr << "For each input point set, apply WLOP algorithm.\n"; - std::cerr << "\n"; - std::cerr << "Usage: " << argv[0] << " file1.xyz file2.xyz..." << std::endl; - std::cerr << "Input file format is .xyz.\n"; - std::cerr << "No output" << std::endl; - return EXIT_FAILURE; - } - - //Algorithm parameters - const double retain_percentage = 2; // percentage of points to retain. - const double neighbor_radius = 0.5; // neighbors size. - const unsigned int iter_number = 25; // number of iterations. - const bool need_compute_density = false; // if needed to compute density. - - // Accumulated errors - int accumulated_fatal_err = EXIT_SUCCESS; - - // Process each input file - for(int i=1; i points; - std::cerr << "Opening " << input_filename << " for reading..." << std::endl; - - // If XYZ file format: - std::ifstream stream(input_filename.c_str()); - if(stream && - CGAL::read_xyz_points(stream, std::back_inserter(points))) - { - std::cerr << "ok (" << points.size() << " points)" << std::endl; - } - else - { - std::cerr << "Error: cannot read file " << input_filename << std::endl; - accumulated_fatal_err = EXIT_FAILURE; - continue; - } - - //*************************************** - // Test - //*************************************** -#ifdef CGAL_LINKED_WITH_TBB - std::vector points2(points); -#endif - std::vector output; - test_wlop_simplify_and_regularize( - points, output, retain_percentage, neighbor_radius, - iter_number, need_compute_density); - -#ifdef CGAL_LINKED_WITH_TBB - output.clear(); - test_wlop_simplify_and_regularize( - points2, output, retain_percentage, neighbor_radius, - iter_number, need_compute_density); -#endif // CGAL_LINKED_WITH_TBB - - - } // for each input file - - std::cerr << std::endl; - // Returns accumulated fatal error - std::cerr << "Tool returned " << accumulated_fatal_err << std::endl; - return accumulated_fatal_err; -} From 911bea402156ce54f13a981c28e963ddb5730a1a Mon Sep 17 00:00:00 2001 From: Simon Giraudot Date: Fri, 8 Mar 2019 09:53:21 +0100 Subject: [PATCH 3/5] Remove Lapack support from Jet_fitting, PSP, Ridges and Solver_interface --- .../examples/Jet_fitting_3/CMakeLists.txt | 28 +-- Jet_fitting_3/examples/Jet_fitting_3/README | 2 +- .../include/CGAL/Monge_via_jet_fitting.h | 8 - .../test/Jet_fitting_3/CMakeLists.txt | 23 +- .../Point_set_processing_3/CMakeLists.txt | 23 +- .../Point_set_processing_3/CMakeLists.txt | 25 +-- Ridges_3/examples/Ridges_3/CMakeLists.txt | 20 +- Ridges_3/test/Ridges_3/CMakeLists.txt | 20 +- .../doc/Solver_interface/Concepts/SvdTraits.h | 1 - .../Solver_interface/PackageDescription.txt | 3 - Solver_interface/include/CGAL/Lapack_svd.h | 206 ------------------ 11 files changed, 40 insertions(+), 319 deletions(-) delete mode 100644 Solver_interface/include/CGAL/Lapack_svd.h diff --git a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt index 99d25985c62..28f6320cf68 100644 --- a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt @@ -11,18 +11,10 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - # use either Eigen or BLAS/LAPACK + # use Eigen find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - if (NOT EIGEN3_FOUND) - find_package(LAPACK) - if(LAPACK_FOUND) - include( ${LAPACK_USE_FILE} ) - endif(LAPACK_FOUND) - else() - include( ${EIGEN3_USE_FILE} ) - endif() + if (EIGEN3_FOUND) - if(EIGEN3_FOUND OR LAPACK_FOUND) # Link with Boost.ProgramOptions (optional) find_package(Boost QUIET COMPONENTS program_options) if(Boost_PROGRAM_OPTIONS_FOUND) @@ -33,20 +25,18 @@ if ( CGAL_FOUND ) endif() add_definitions( "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" ) list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_LIBRARIES}) - endif() - + endif() + create_single_source_cgal_program( "Mesh_estimation.cpp" ) create_single_source_cgal_program( "Single_estimation.cpp" ) - - else(EIGEN3_FOUND OR LAPACK_FOUND) - - message(STATUS "NOTICE: This program requires either Eigen 3.1 (or greater) or LAPACK, and will not be compiled.") - - endif(EIGEN3_FOUND OR LAPACK_FOUND) + + else() + message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.") + endif() else() - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") + message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") endif() diff --git a/Jet_fitting_3/examples/Jet_fitting_3/README b/Jet_fitting_3/examples/Jet_fitting_3/README index 3ef5043842a..fc4df02d7b6 100644 --- a/Jet_fitting_3/examples/Jet_fitting_3/README +++ b/Jet_fitting_3/examples/Jet_fitting_3/README @@ -1,4 +1,4 @@ -To compile, you need support for lapack +To compile, you need support for Eigen Program Single_estimation --------------------- diff --git a/Jet_fitting_3/include/CGAL/Monge_via_jet_fitting.h b/Jet_fitting_3/include/CGAL/Monge_via_jet_fitting.h index 66f5dc159db..31a5a3ee4f0 100644 --- a/Jet_fitting_3/include/CGAL/Monge_via_jet_fitting.h +++ b/Jet_fitting_3/include/CGAL/Monge_via_jet_fitting.h @@ -32,10 +32,6 @@ #include #ifdef CGAL_EIGEN3_ENABLED #include -#else -#ifdef CGAL_LAPACK_ENABLED -#include -#endif #endif namespace CGAL { @@ -51,11 +47,7 @@ unsigned int fact(unsigned int n){ #ifdef CGAL_EIGEN3_ENABLED template < class DataKernel, class LocalKernel = Simple_cartesian, class SvdTraits = Eigen_svd > #else -#ifdef CGAL_LAPACK_ENABLED -template < class DataKernel, class LocalKernel = Simple_cartesian, class SvdTraits = Lapack_svd> -#else template < class DataKernel, class LocalKernel, class SvdTraits > -#endif #endif class Monge_via_jet_fitting { public: diff --git a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt index e1f65cb1884..14e3e10e01b 100644 --- a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt @@ -11,27 +11,14 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - # use either Eigen or BLAS/LAPACK + # use Eigen find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - if (NOT EIGEN3_FOUND) - find_package(LAPACK) - if(LAPACK_FOUND) - include( ${LAPACK_USE_FILE} ) - endif(LAPACK_FOUND) - else() + if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - endif() - - - if(EIGEN3_FOUND OR LAPACK_FOUND) - create_single_source_cgal_program( "blind_1pt.cpp" ) - - else(EIGEN3_FOUND OR LAPACK_FOUND) - - message(STATUS "NOTICE: This program requires either Eigen 3.1 (or greater) or LAPACK, and will not be compiled.") - - endif(EIGEN3_FOUND OR LAPACK_FOUND) + else() + message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.") + endif() else() diff --git a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt index 5f0d4ac489b..cf741624daa 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt @@ -37,7 +37,7 @@ if ( CGAL_FOUND ) find_package( TBB REQUIRED ) endif() - # Executables that do *not* require EIGEN or LAPACK + # Executables that do *not* require EIGEN create_single_source_cgal_program( "average_spacing_example.cpp" ) create_single_source_cgal_program( "bilateral_smooth_point_set_example.cpp" ) create_single_source_cgal_program( "grid_simplification_example.cpp" ) @@ -70,27 +70,18 @@ if ( CGAL_FOUND ) message(STATUS "NOTICE : the LAS reader test requires LASlib and will not be compiled.") endif() - # Use Eigen or BLAS and LAPACK (optional) + # Use Eigen find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - if (NOT EIGEN3_FOUND) - find_package(LAPACK) - if(LAPACK_FOUND) - include( ${LAPACK_USE_FILE} ) - endif(LAPACK_FOUND) - else() + if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - endif() - - if(EIGEN3_FOUND OR LAPACK_FOUND) - # Executables that require Eigen or BLAS and LAPACK + # Executables that require Eigen create_single_source_cgal_program( "jet_smoothing_example.cpp" ) create_single_source_cgal_program( "normal_estimation.cpp" ) create_single_source_cgal_program( "edges_example.cpp" ) - else(EIGEN3_FOUND OR LAPACK_FOUND) + else() - message(STATUS "NOTICE: Some of the executables in this directory need either Eigen 3.1 (or greater) or LAPACK, and will not be compiled.") - - endif(EIGEN3_FOUND OR LAPACK_FOUND) + message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.") + endif() foreach(target scale_estimation_example diff --git a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt index 4d0dbbb49c2..e168fc5f532 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt @@ -28,7 +28,7 @@ if ( CGAL_FOUND ) find_package( TBB QUIET ) - # Executables that do *not* require LAPACK + # Executables that do *not* require Eigen create_single_source_cgal_program( "read_test.cpp" ) create_single_source_cgal_program( "read_test_with_different_pmaps.cpp" ) create_single_source_cgal_program( "analysis_test.cpp" ) @@ -38,31 +38,20 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "edge_aware_upsample_test.cpp" ) create_single_source_cgal_program( "structuring_test.cpp" ) - # Use Eigen or BLAS and LAPACK (optional) + # Use Eigen find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - if (NOT EIGEN3_FOUND) - find_package(LAPACK) - if(LAPACK_FOUND) - include( ${LAPACK_USE_FILE} ) - endif(LAPACK_FOUND) - else() + if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - endif() - - - if(EIGEN3_FOUND OR LAPACK_FOUND) - # Executables that require Eigen or BLAS and LAPACK + # Executables that require Eigen create_single_source_cgal_program( "normal_estimation_test.cpp" ) create_single_source_cgal_program( "hierarchy_simplification_test.cpp" ) create_single_source_cgal_program( "smoothing_test.cpp" ) create_single_source_cgal_program( "vcm_plane_test.cpp" ) create_single_source_cgal_program( "vcm_all_test.cpp" ) create_single_source_cgal_program( "jet_pointer_as_property_map.cpp" ) - else(EIGEN3_FOUND OR LAPACK_FOUND) - - message(STATUS "NOTICE: This program requires either Eigen 3.1 (or greater) or LAPACK, and will not be compiled.") - - endif(EIGEN3_FOUND OR LAPACK_FOUND) + else() + message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.") + endif() foreach(target analysis_test diff --git a/Ridges_3/examples/Ridges_3/CMakeLists.txt b/Ridges_3/examples/Ridges_3/CMakeLists.txt index 5f34b46eb30..eee57a9d220 100644 --- a/Ridges_3/examples/Ridges_3/CMakeLists.txt +++ b/Ridges_3/examples/Ridges_3/CMakeLists.txt @@ -8,19 +8,11 @@ find_package(CGAL QUIET ) if ( CGAL_FOUND ) - # use either Eigen or BLAS/LAPACK + # use either Eigen find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - if (NOT EIGEN3_FOUND) - find_package(LAPACK) - if(LAPACK_FOUND) - include( ${LAPACK_USE_FILE} ) - endif(LAPACK_FOUND) - else() + if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - endif() - - - if(EIGEN3_FOUND OR LAPACK_FOUND) + # Link with Boost.ProgramOptions (optional) find_package(Boost QUIET COMPONENTS program_options) if(Boost_PROGRAM_OPTIONS_FOUND) @@ -37,11 +29,11 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( Ridges_Umbilics_SM.cpp) create_single_source_cgal_program( Ridges_Umbilics_LCC.cpp) - else(EIGEN3_FOUND OR LAPACK_FOUND) + else() - message(STATUS "NOTICE: This program requires either Eigen 3.1 (or greater) or LAPACK, and will not be compiled.") + message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.") - endif(EIGEN3_FOUND OR LAPACK_FOUND) + endif() else() diff --git a/Ridges_3/test/Ridges_3/CMakeLists.txt b/Ridges_3/test/Ridges_3/CMakeLists.txt index 6603c76db97..99a76fe4426 100644 --- a/Ridges_3/test/Ridges_3/CMakeLists.txt +++ b/Ridges_3/test/Ridges_3/CMakeLists.txt @@ -11,27 +11,17 @@ find_package(CGAL QUIET) if ( CGAL_FOUND ) - # use either Eigen or BLAS/LAPACK + # use either Eigen find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - if (NOT EIGEN3_FOUND) - find_package(LAPACK) - if(LAPACK_FOUND) - include( ${LAPACK_USE_FILE} ) - endif(LAPACK_FOUND) - else() + if (EIGEN3_FOUND) include( ${EIGEN3_USE_FILE} ) - endif() - - - if(EIGEN3_FOUND OR LAPACK_FOUND) - create_single_source_cgal_program( "ridge_test.cpp" ) - else(EIGEN3_FOUND OR LAPACK_FOUND) + else() - message(STATUS "NOTICE: This program requires either Eigen 3.1 (or greater) or LAPACK, and will not be compiled.") + message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.") - endif(EIGEN3_FOUND OR LAPACK_FOUND) + endif() else() diff --git a/Solver_interface/doc/Solver_interface/Concepts/SvdTraits.h b/Solver_interface/doc/Solver_interface/Concepts/SvdTraits.h index ba6236639eb..d6f9b934330 100644 --- a/Solver_interface/doc/Solver_interface/Concepts/SvdTraits.h +++ b/Solver_interface/doc/Solver_interface/Concepts/SvdTraits.h @@ -6,7 +6,6 @@ to solve in the least square sense a linear system with a singular value decomposition \cgalHasModel `CGAL::Eigen_svd` - \cgalHasModel `CGAL::Lapack_svd` */ class SvdTraits { diff --git a/Solver_interface/doc/Solver_interface/PackageDescription.txt b/Solver_interface/doc/Solver_interface/PackageDescription.txt index a084ce0dca6..c8b3c05c79b 100644 --- a/Solver_interface/doc/Solver_interface/PackageDescription.txt +++ b/Solver_interface/doc/Solver_interface/PackageDescription.txt @@ -39,7 +39,4 @@ - `CGAL::Eigen_sparse_matrix` - `CGAL::Eigen_sparse_symmetric_matrix` - `CGAL::Eigen_svd` -- `CGAL::Lapack_vector` -- `CGAL::Lapack_matrix` -- `CGAL::Lapack_svd` */ diff --git a/Solver_interface/include/CGAL/Lapack_svd.h b/Solver_interface/include/CGAL/Lapack_svd.h deleted file mode 100644 index cb6cc749e0e..00000000000 --- a/Solver_interface/include/CGAL/Lapack_svd.h +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) 2007 INRIA Sophia-Antipolis (France), INRIA Lorraine LORIA. -// All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// SPDX-License-Identifier: LGPL-3.0+ -// -// Author(s) : Marc Pouget and Frédéric Cazals - -#ifndef CGAL_LAPACK_H -#define CGAL_LAPACK_H - -#include -#include -#include - -extern "C" -{ -// taken from acml.h -void dgelss(int m, int n, int nrhs, - double *a, int lda, double *b, int ldb, double *sing, - double rcond, int *irank, int *info); - -void dgelss_(int *m, int *n, int *nrhs, - double *a, int *lda, double *b, int *ldb, double * - s, double *rcond, int *rank, double *work, int *lwork, - int *info); -} - -namespace CGAL { -namespace LAPACK { - -inline -void dgelss(int *m, int *n, int *nrhs, - double *a, int *lda, double *b, int *ldb, double *s, - double *rcond, int *rank, double *work, int *lwork, int *info) -{ -#ifdef CGAL_USE_F2C - ::dgelss_(m, n, nrhs, a, lda, b, ldb, s, rcond, rank, work, lwork, info); -#else - ::dgelss(*m, *n, *nrhs, a, *lda, b, *ldb, s, *rcond, rank, info); -#endif -} - -} // namespace LAPACK -} // namespace CGAL - -namespace CGAL { - -/// \ingroup PkgSolverInterfaceRef -/// -/// A matrix class to be used in the class `Lapack_svd`. -/// -/// \cgalModels `SvdTraits::Matrix` -class Lapack_vector -{ - typedef double FT; - -protected: - FT* m_vector; - size_t nb_elts; - -public: - /// Initializes all the elements of the vector to zero. - Lapack_vector(size_t n) - { - m_vector = (FT*) std::calloc(n, sizeof(FT)); - nb_elts = n; - } - - ~Lapack_vector() { free(m_vector); } - - /// Return the size of the vector. - size_t size() { return nb_elts; } - - /// Return the vector as an array. - const FT* vector() const { return m_vector;} - - /// Return the vector as an array. - FT* vector() { return m_vector; } - - /// Return the `i`th entry, `i` from `0` to `size()-1`. - FT operator()(size_t i) {return m_vector[i];} - - /// Set the `i`'th entry to `value`. - void set(size_t i, const FT value) { m_vector[i] = value; } - -private: - /// Copy constructor and operator =() are not implemented. - Lapack_vector(const Lapack_vector& toCopy); - Lapack_vector& operator =(const Lapack_vector& toCopy); -}; - -/// \ingroup PkgSolverInterfaceRef -/// -/// In CLAPACK, matrices are one-dimensional arrays and elements are -/// column-major ordered. This class is a wrapper defining set and get -/// in the usual way with line and column indices. -/// -/// \cgalModels `SvdTraits::Matrix` -class Lapack_matrix -{ - typedef double FT; - -protected: - FT* m_matrix; - size_t nb_rows; - size_t nb_columns; - -public: - /// Initializes all the elements of the matrix to zero. - Lapack_matrix(size_t n1, size_t n2) - { - m_matrix = (FT*) std::calloc (n1*n2, sizeof(FT)); - nb_rows = n1; - nb_columns = n2; - } - - ~Lapack_matrix() { free(m_matrix); } - - /// Return the number of rows of the matrix. - size_t number_of_rows() { return nb_rows; } - /// Return the number of columns of the matrix. - size_t number_of_columns() { return nb_columns; } - - /// Return the matrix as an array. - const FT* matrix() const { return m_matrix; } - /// Return the matrix as an array. - FT* matrix() { return m_matrix; } - - /// Return the entry at row `i` and column `j`, `i` from `0` to `number_of_rows - 1`, - /// `j` from `0` to `number_of_columns - 1`. - FT operator()(size_t i, size_t j) { return m_matrix[j*nb_rows+i]; } - - /// Set the entry at row `i` and column `j` to `value`. - void set(size_t i, size_t j, const FT value) { m_matrix[j*nb_rows+i] = value; } - -private: - /// Copy constructor and operator =() are not implemented. - Lapack_matrix(const Lapack_matrix& toCopy); - Lapack_matrix& operator =(const Lapack_matrix& toCopy); -}; - -/// \ingroup PkgSolverInterfaceRef -/// -/// This class is a wrapper to the singular value decomposition algorithm of LAPACK. -/// -/// \cgalModels `SvdTraits` -class Lapack_svd -{ -public: - typedef double FT; - typedef Lapack_vector Vector; - typedef Lapack_matrix Matrix; - - /// Solves the system \f$ MX=B\f$ (in the least square sense if \f$ M\f$ is not - /// square) using a singular value decomposition. The solution is stored in \f$ B\f$. - /// \return the condition number of \f$ M\f$ - static FT solve(Matrix& M, Vector& B); -}; - -inline -Lapack_svd::FT Lapack_svd::solve(Matrix& M, Vector& B) -{ - int m = static_cast(M.number_of_rows()), - n = static_cast(M.number_of_columns()), - nrhs = 1, - lda = m, - ldb = m, - rank, - lwork = 5*m, - info; - - // c style - FT* sing_values = (FT*) std::malloc(n*sizeof(FT)); - FT* work = (FT*) std::malloc(lwork*sizeof(FT)); - - FT rcond = -1; - - LAPACK::dgelss(&m, &n, &nrhs, M.matrix(), &lda, B.vector(), &ldb, sing_values, - &rcond, &rank, work, &lwork, &info); - CGAL_assertion(info==0); - - FT cond_nb = sing_values[0]/sing_values[n-1]; - - // clean up - free(sing_values); - free(work); - - return cond_nb; -} - -} // namespace CGAL - -#endif // CGAL_LAPACK_H From 7231fc77e9a906aaa46a1165ca4d845a70640952 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 3 Apr 2019 11:08:34 +0200 Subject: [PATCH 4/5] include EIGEN_USE_FILE, otherwise CGAL_EIGEN3_ENABLED is not defined --- Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt index 28f6320cf68..dde371d56d4 100644 --- a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt @@ -14,7 +14,7 @@ if ( CGAL_FOUND ) # use Eigen find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) if (EIGEN3_FOUND) - + include( ${EIGEN3_USE_FILE} ) # Link with Boost.ProgramOptions (optional) find_package(Boost QUIET COMPONENTS program_options) if(Boost_PROGRAM_OPTIONS_FOUND) From e5e174941a7ec5ed7a6cc21594d606436d22787e Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 3 Apr 2019 11:13:28 +0200 Subject: [PATCH 5/5] Restore non-deprecated code --- .../include/CGAL/vcm_estimate_normals.h | 196 ++++++++++++++++++ 1 file changed, 196 insertions(+) diff --git a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h index 087f4ead7a7..4341f21147b 100644 --- a/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/vcm_estimate_normals.h @@ -308,6 +308,202 @@ compute_vcm (const PointRange& points, compute_vcm (points, ccov, offset_radius, convolution_radius, CGAL::Point_set_processing_3::parameters::all_default (points)); } + + +/// \endcond + +/// \cond SKIP_IN_MANUAL +template +void +vcm_estimate_normals_internal (PointRange& points, + double offset_radius, ///< offset radius. + double convolution_radius, ///< convolution radius. + const NamedParameters& np, + int nb_neighbors_convolve = -1 ///< number of neighbors used during the convolution. +) +{ + using boost::choose_param; + // basic geometric types + typedef typename Point_set_processing_3::GetPointMap::type PointMap; + typedef typename Point_set_processing_3::GetNormalMap::type NormalMap; + typedef typename Point_set_processing_3::GetK::Kernel Kernel; + typedef typename GetDiagonalizeTraits::type DiagonalizeTraits; + + CGAL_static_assertion_msg(!(boost::is_same::NoMap>::value), + "Error: no normal map"); + + PointMap point_map = choose_param(get_param(np, internal_np::point_map), PointMap()); + NormalMap normal_map = choose_param(get_param(np, internal_np::normal_map), NormalMap()); + + typedef cpp11::array Covariance; + + // Compute the VCM and convolve it + std::vector cov; + if (nb_neighbors_convolve == -1) { + compute_vcm(points, + cov, + offset_radius, + convolution_radius, + np); + } else { + internal::vcm_offset(points.begin(), points.end(), + point_map, + cov, + offset_radius, + 20, + Kernel()); + + if (nb_neighbors_convolve > 0) + { + std::vector ccov; + ccov.reserve(cov.size()); + internal::vcm_convolve(points.begin(), points.end(), + point_map, + cov, + ccov, + (unsigned int) nb_neighbors_convolve, + Kernel()); + + cov.clear(); + std::copy(ccov.begin(), ccov.end(), std::back_inserter(cov)); + } + } + + // And finally, compute the normals + int i = 0; + for (typename PointRange::iterator it = points.begin(); it != points.end(); ++it) { + cpp11::array enormal = {{ 0,0,0 }}; + DiagonalizeTraits::extract_largest_eigenvector_of_covariance_matrix + (cov[i], enormal); + + typename Kernel::Vector_3 normal(enormal[0], + enormal[1], + enormal[2]); + put(normal_map, *it, normal); + i++; + } +} +/// @endcond + + +/** + \ingroup PkgPointSetProcessing3Algorithms + Estimates normal directions of the range of `points` + using the Voronoi Covariance Measure with a radius for the convolution. + The output normals are randomly oriented. + + See `compute_vcm()` for a detailed description of the parameters `offset_radius` and `convolution_radius` + and of the Voronoi Covariance Measure. + + \tparam PointRange is a model of `Range`. The value type of + its iterator is the key type of the named parameter `point_map`. + + \param points input point range. + \param offset_radius offset_radius. + \param convolution_radius convolution_radius. + \param np optional sequence of \ref psp_namedparameters "Named Parameters" among the ones listed below. + + \cgalNamedParamsBegin + \cgalParamBegin{point_map} a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`. + If this parameter is omitted, `CGAL::Identity_property_map` is used.\cgalParamEnd + \cgalParamBegin{normal_map} a model of `WritablePropertyMap` with value type + `geom_traits::Vector_3`.\cgalParamEnd + \cgalParamBegin{diagonalize_traits} a model of `DiagonalizeTraits`. It can be omitted: + if Eigen 3 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined then an overload + using `Eigen_diagonalize_traits` is provided. Otherwise, the internal implementation + `CGAL::Diagonalize_traits` is used.\cgalParamEnd + \cgalParamBegin{geom_traits} an instance of a geometric traits class, model of `Kernel`\cgalParamEnd + \cgalNamedParamsEnd + +*/ +template +void +vcm_estimate_normals (PointRange& points, + double offset_radius, + double convolution_radius, + const NamedParameters& np +) +{ + vcm_estimate_normals_internal(points, offset_radius, convolution_radius, np); +} + +/// \cond SKIP_IN_MANUAL +// variant with default NP +template +void +vcm_estimate_normals (PointRange& points, + double offset_radius, ///< offset radius. + double convolution_radius) ///< convolution radius. +{ + return vcm_estimate_normals + (points, offset_radius, convolution_radius, + CGAL::Point_set_processing_3::parameters::all_default(points)); +} + +/// \endcond + + +/** + \ingroup PkgPointSetProcessing3Algorithms + Estimates normal directions of the range of `points` + using the Voronoi Covariance Measure with a number of neighbors for the convolution. + The output normals are randomly oriented. + + See `compute_vcm()` for a detailed description of the parameter `offset_radius` + and of the Voronoi Covariance Measure. + + \tparam PointRange is a model of `Range`. The value type of + its iterator is the key type of the named parameter `point_map`. + + \param points input point range. + \param offset_radius offset_radius. + \param k number of neighbor points used for convolution. + \param np optional sequence of \ref psp_namedparameters "Named Parameters" among the ones listed below. + + \cgalNamedParamsBegin + \cgalParamBegin{point_map} a model of `ReadablePropertyMap` with value type `geom_traits::Point_3`. + If this parameter is omitted, `CGAL::Identity_property_map` is used.\cgalParamEnd + \cgalParamBegin{normal_map} a model of `WritablePropertyMap` with value type + `geom_traits::Vector_3`.\cgalParamEnd + \cgalParamBegin{diagonalize_traits} a model of `DiagonalizeTraits`. It can be omitted: + if Eigen 3 (or greater) is available and `CGAL_EIGEN3_ENABLED` is defined then an overload + using `Eigen_diagonalize_traits` is provided. Otherwise, the internal implementation + `CGAL::Diagonalize_traits` is used.\cgalParamEnd + \cgalParamBegin{geom_traits} an instance of a geometric traits class, model of `Kernel`\cgalParamEnd + \cgalNamedParamsEnd +*/ +template < typename PointRange, + typename NamedParameters +> +void +vcm_estimate_normals (PointRange& points, + double offset_radius, + unsigned int k, + const NamedParameters& np +) +{ + vcm_estimate_normals_internal(points, offset_radius, 0, np, k); +} + +/// \cond SKIP_IN_MANUAL +// variant with default NP +template +void +vcm_estimate_normals (PointRange& points, + double offset_radius, ///< offset radius. + unsigned int k) +{ + return vcm_estimate_normals + (points, offset_radius, k, + CGAL::Point_set_processing_3::parameters::all_default(points)); +} + + /// \endcond } // namespace CGAL