diff --git a/.github/workflows/build-PR2.0.yml b/.github/workflows/build-PR2.0.yml new file mode 100644 index 0000000000..065524efda --- /dev/null +++ b/.github/workflows/build-PR2.0.yml @@ -0,0 +1,149 @@ +name: CI (linux/macOS/windows), PR (2.0) + +on: + push: + branches: [ main2.0 ] + pull_request: + branches: [ main2.0 ] + +env: + TESTBLACKLIST: "(testLinearStructure|testIntegerConverter|testArithmeticalDSSComputerOnSurfels)" + CONFIG_GLOBAL: -DDGTAL_BUILD_EXAMPLES=true -DDGTAL_BUILD_TESTS=true -DDGTAL_RANDOMIZED_TESTING_THRESHOLD=10 + CONFIG_LINUX: -DUSE_CCACHE=NO -DDGTAL_WITH_OPENMP=true -DDGTAL_WITH_GMP=true -DDGTAL_WITH_FFTW3=true -DDGTAL_WITH_CGAL=true -DDGTAL_WITH_LIBIGL=true -DWARNING_AS_ERROR=ON -DDGTAL_WITH_HDF5=true -DWITH_QGLVIEWER=true -DDGTAL_WITH_CAIRO=true -DDGTAL_WITH_ITK=true -DDGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS=true -DDGTAL_BUILD_POLYSCOPE_EXAMPLES=true + CONFIG_MAC: -DUSE_CCACHE=NO -DDGTAL_WITH_GMP=true -DDGTAL_BUILD_POLYSCOPE_EXAMPLES=true -DDGTAL_WITH_CGAL=true -DDGTAL_WITH_LIBIGL=true + CONFIG_WINDOWS: -DDGTAL_WITH_OPENMP=true #-DDGTAL_WITH_GMP=true -DDGTAL_WITH_FFTW3=true -DDGTAL_WITH_CAIRO=true -DDGTAL_WITH_ITK=true + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest, windows-latest] + BUILD_TYPE: [Release] + python-version: ["3.9"] + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 5 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install linux deps + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install ccache zsh libqglviewer-dev-qt5 libcgal-dev libboost-dev ninja-build libhdf5-serial-dev libboost-dev libcairo2-dev libgmp-dev libfftw3-dev libinsighttoolkit5-dev xorg-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev + + - name: Install macOS deps + if: matrix.os == 'macOS-latest' + run: brew install boost ninja gmp libomp ccache cgal + + - name: Install conan + if: matrix.os == 'windows-latest' + id: conan + uses: turtlebrowser/get-conan@main + with: + version: 2.4.0 + + - name: Create conan default profile + if: matrix.os == 'windows-latest' + run: | + conan profile detect --force + + + - uses: actions/cache@v4 + if: matrix.os == 'windows-latest' + with: + path: ~/.conan2 + key: ${{ runner.os }}-conan2-${{ matrix.BUILD_TYPE }} + + - name: Get white list of tests + run: | + echo "::set-output name=WHITELIST::$(${{runner.workspace}}/DGtal/.github/workflows/create_whitelist.sh)" + id: whitelist + + - name: Create Build Environment + run: cmake -E make_directory ${{runner.workspace}}/build + + - name: Configure CMake (linux) + if: matrix.os == 'ubuntu-latest' + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_GLOBAL $CONFIG_LINUX -DDGTAL_RANDOMIZED_TESTING_WHITELIST="${{ steps.whitelist.outputs.WHITELIST }}" -G Ninja + + - name: Configure CMake (macOS) + if: matrix.os == 'macOS-latest' + shell: bash + working-directory: ${{runner.workspace}}/build + run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_GLOBAL $CONFIG_MAC -DDGTAL_RANDOMIZED_TESTING_WHITELIST="${{ steps.whitelist.outputs.WHITELIST }}" + + + - name: Configure CMake (windows) + if: matrix.os == 'windows-latest' + shell: bash + working-directory: ${{runner.workspace}}/build + run: | + conan install $GITHUB_WORKSPACE --build=missing -s:a compiler.cppstd=20 + cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_GLOBAL $CONFIG_WINDOWS -DDGTAL_RANDOMIZED_TESTING_WHITELIST="${{ steps.whitelist.outputs.WHITELIST }}" + + - name: Build + working-directory: ${{runner.workspace}}/build + shell: bash + # Execute the build. You can specify a specific target with "--target " + run: cmake --build . --config ${{ matrix.BUILD_TYPE }} --parallel 3 + + - name: Test + working-directory: ${{runner.workspace}}/build + if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' + shell: bash + run: | + echo ctest -C ${{ matrix.BUILD_TYPE }} --output-on-failure -E $TESTBLACKLIST + ctest -C $${{ matrix.BUILD_TYPE }} --output-on-failure -E $TESTBLACKLIST + + - name: DGtalTools (linux only, we check this PR against DGtalTools PR main2.0) + if: matrix.os == 'ubuntu-latest' + shell: bash + working-directory: ${{runner.workspace}}/build + run: | + git clone --depth 1 https://github.com/DGtal-team/DGtalTools.git + cd DGtalTools + git fetch origin pull/467/head:main2.0 + git checkout main2.0 + mkdir buildDGtalTools + cd buildDGtalTools + cmake .. -DCMAKE_MODULE_PATH=${{runner.workspace}}/DGtal/cmake/deps -DDGtal_DIR=${{runner.workspace}}/build -DDGTALTOOLS_RANDOMIZED_BUILD_THRESHOLD=25 -G Ninja + ninja + + + # Documentatin (build, check and deploy) + Documentation: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set up + run: | + sudo apt-get update + sudo apt-get install libboost-dev graphviz texlive doxygen + + - name: Building pages + run: | + mkdir build + cd build + cmake .. + wget --no-check-certificate -O "${{runner.workspace}}/DGtal/build/DGtalTools-tagfile" http://dgtal.org/doc/tags/DGtalTools-tagfile; + make doc > buildDoc.log + + - name: Checking doc + run: | + pwd + export BUILD_DIR=${{runner.workspace}}/DGtal/build + export SRC_DIR=${{runner.workspace}}/DGtal/ + .github/workflows/checkDoxygenDocumentation.sh + #&& .github/workflows/check_src_file_tag.sh diff --git a/.github/workflows/build-master.yml b/.github/workflows/build-master.yml index 73f586fce9..78e8106093 100644 --- a/.github/workflows/build-master.yml +++ b/.github/workflows/build-master.yml @@ -2,7 +2,7 @@ name: CI (linux/macOS/windows), master on: push: - branches: [ master, main2.0 ] + branches: [ master ] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) @@ -82,7 +82,7 @@ jobs: shell: bash working-directory: ${{runner.workspace}}/build run: | - conan install $GITHUB_WORKSPACE --build=missing + conan install $GITHUB_WORKSPACE --build=missing -s:a compiler.cppstd=20 cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_GLOBAL $CONFIG_WINDOWS -DDGTAL_RANDOMIZED_TESTING_WHITELIST="${{ steps.whitelist.outputs.WHITELIST }}" - name: Build diff --git a/.github/workflows/buildAndDocumentation-PR.yml b/.github/workflows/buildAndDocumentation-PR.yml index 70f71fd8b9..e6f2fa5236 100644 --- a/.github/workflows/buildAndDocumentation-PR.yml +++ b/.github/workflows/buildAndDocumentation-PR.yml @@ -2,12 +2,12 @@ name: CI (linux/macOS/windows), PR on: pull_request: - branches: [ master, main2.0 ] + branches: [ master ] env: # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) TESTBLACKLIST: "(testLinearStructure|testIntegerConverter|testArithmeticalDSSComputerOnSurfels)" - CONFIG_GLOBAL: -DDGTAL_BUILD_EXAMPLES=true -DDGTAL_BUILD_TESTS=true -DDGTAL_RANDOMIZED_TESTING_THRESHOLD=10 + CONFIG_GLOBAL: -DDGTAL_BUILD_EXAMPLES=true -DDGTAL_BUILD_TESTS=true -DDGTAL_RANDOMIZED_TESTING_THRESHOLD=10 CONFIG_LINUX: -DUSE_CCACHE=NO -DDGTAL_WITH_OPENMP=true -DDGTAL_WITH_GMP=true -DDGTAL_WITH_CGAL=true -DDGTAL_WITH_LIBIGL=true -DDGTAL_WITH_FFTW3=true -DWARNING_AS_ERROR=ON -DDGTAL_WITH_HDF5=true -DWITH_QGLVIEWER=true -DDGTAL_WITH_CAIRO=true -DDGTAL_WITH_ITK=true -DDGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS=true -DDGTAL_BUILD_POLYSCOPE_EXAMPLES=true CONFIG_MAC: -DUSE_CCACHE=NO -DDGTAL_WITH_GMP=true -DDGTAL_BUILD_POLYSCOPE_EXAMPLES=true -DDGTAL_WITH_CGAL=true -DDGTAL_WITH_LIBIGL=true CONFIG_WINDOWS: -DDGTAL_WITH_OPENMP=true #-DDGTAL_WITH_GMP=true -DDGTAL_WITH_FFTW3=true -DDGTAL_WITH_CAIRO=true -DDGTAL_WITH_ITK=true @@ -83,7 +83,7 @@ jobs: shell: bash working-directory: ${{runner.workspace}}/build run: | - conan install $GITHUB_WORKSPACE --build=missing + conan install $GITHUB_WORKSPACE --build=missing -s:a compiler.cppstd=20 cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_GLOBAL $CONFIG_WINDOWS -DDGTAL_RANDOMIZED_TESTING_WHITELIST="${{ steps.whitelist.outputs.WHITELIST }}" - name: Build @@ -118,8 +118,9 @@ jobs: cd DGtalTools mkdir buildDGtalTools cd buildDGtalTools - echo cmake .. -DDGTAL_DIR=${{runner.workspace}}/build -DDGTALTOOLS_RANDOMIZED_BUILD_THRESHOLD=25 -G Ninja - cmake .. -DDGtal_DIR=${{runner.workspace}}/build -DDGTALTOOLS_RANDOMIZED_BUILD_THRESHOLD=25 -G Ninja + ls + echo cmake .. -DCMAKE_PREFIX_PATH=${{runner.workspace}}/DGtal/cmake/deps -DDGTAL_DIR=${{runner.workspace}}/build -DDGTALTOOLS_RANDOMIZED_BUILD_THRESHOLD=25 -G Ninja + cmake .. -DCMAKE_PREFIX_PATH=${{runner.workspace}}/DGtal/cmake/deps -DDGtal_DIR=${{runner.workspace}}/build -DDGTALTOOLS_RANDOMIZED_BUILD_THRESHOLD=25 -G Ninja ninja # Documentatin (build, check and deploy) diff --git a/.github/workflows/pythonBindings-PR.yml b/.github/workflows/pythonBindings-PR.yml index 99dc491d38..6c108dac17 100644 --- a/.github/workflows/pythonBindings-PR.yml +++ b/.github/workflows/pythonBindings-PR.yml @@ -37,7 +37,7 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | sudo apt-get update - sudo apt-get install zsh libqglviewer-dev-qt5 libboost-dev libcgal-dev ninja-build libhdf5-serial-dev libboost-dev libcairo2-dev libgmp-dev libfftw3-dev libinsighttoolkit5-dev xorg-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev + sudo apt-get install zsh libqglviewer-dev-qt5 libboost-dev libcgal-dev ninja-build libhdf5-serial-dev libboost-dev libcairo2-dev libgmp-dev libfftw3-dev libinsighttoolkit5-dev xorg-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev - name: Installing dependencies (macOS) if: matrix.os == 'macOS-latest' @@ -82,7 +82,7 @@ jobs: shell: bash working-directory: ${{runner.workspace}}/build run: | - conan install $GITHUB_WORKSPACE --build=missing + conan install $GITHUB_WORKSPACE --build=missing -s:a compiler.cppstd=20 cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_PYTHON $CONFIG_GLOBAL $CONFIG_WINDOWS diff --git a/.github/workflows/pythonBindings-Pypi.yml b/.github/workflows/pythonBindings-Pypi.yml index d567c335cf..5e09b58af0 100644 --- a/.github/workflows/pythonBindings-Pypi.yml +++ b/.github/workflows/pythonBindings-Pypi.yml @@ -96,7 +96,7 @@ jobs: shell: bash working-directory: ${{runner.workspace}}/build run: | - conan install $GITHUB_WORKSPACE --build=missing + conan install $GITHUB_WORKSPACE --build=missing -s:a compiler.cppstd=20 cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} $CONFIG_PYTHON $CONFIG_GLOBAL $CONFIG_WINDOWS - name: Setting build informations (Windows) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a1734b6ba..878bab981d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,8 @@ # ----------------------------------------------------------------------------- # Project definition # ----------------------------------------------------------------------------- -cmake_minimum_required (VERSION 3.11) -cmake_policy(SET CMP0057 NEW) # the new interpretation of IN_LIST is by default not set (at least until 3.21.1). -project (DGtal) +cmake_minimum_required (VERSION 3.20) +project (DGtal VERSION 2.0.0) # ----------------------------------------------------------------------------- # By default, do not warn when built on machines using only VS Express: @@ -12,27 +11,30 @@ if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) endif() -# ----------------------------------------------------------------------------- -# Define variables and cmake parameters, and display some information -# ----------------------------------------------------------------------------- list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}) list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR}) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/deps) +# @TODO : See if those variable are still usefull, +# Note that they are set in source code ! +set(DGtal_VERSION_MAJOR ${CMAKE_PROJECT_VERSION_MAJOR}) +set(DGtal_VERSION_MINOR ${CMAKE_PROJECT_VERSION_MINOR}) +set(DGtal_VERSION_PATCH ${CMAKE_PROJECT_VERSION_PATCH}) +set(DGTAL_VERSION ${CMAKE_PROJECT_VERSION}) +set(PROJECT_VERSION ${CMAKE_PROJECT_VERSION}) +set(VERSION ${CMAKE_PROJECT_VERSION}) - -set(DGtal_VERSION_MAJOR 2) -set(DGtal_VERSION_MINOR 0) -set(DGtal_VERSION_PATCH beta) -set(DGTAL_VERSION "${DGtal_VERSION_MAJOR}.${DGtal_VERSION_MINOR}.${DGtal_VERSION_PATCH}") -set(PROJECT_VERSION "${DGtal_VERSION_MAJOR}.${DGtal_VERSION_MINOR}.${DGtal_VERSION_PATCH}") -set(VERSION ${DGtal_VERSION_MAJOR}.${DGtal_VERSION_MINOR}.${DGtal_VERSION_PATCH}) # ----------------------------------------------------------------------------- # Common build options/settings # ----------------------------------------------------------------------------- include(Common) +#------------------------------------------------------------------------------ +# Add DGtal library +#------------------------------------------------------------------------------ +add_subdirectory(src) + # ----------------------------------------------------------------------------- # Development and debug options # ----------------------------------------------------------------------------- @@ -45,58 +47,12 @@ message(STATUS "Downloading external projects") include(FetchExternalDeps) message(STATUS "Done.") -#------------------------------------------------------------------------------ -# Add DGtal library -#------------------------------------------------------------------------------ -# Include CPP files to add to the library target -# -# each subdir can contain a ModuleSRC.txt file -# with a set command on the variable ${DGTAL_SRC} -# -include(src/DGtal/base/ModuleSRC.cmake) -include(src/DGtal/io/ModuleSRC.cmake) -include(src/DGtal/helpers/ModuleSRC.cmake) -## Board dependency -include(src/Board/ModuleSRC.cmake) -## Boost Add-ons -include(src/BoostAddons/ModuleSRC.cmake) - -list(TRANSFORM DGTAL_SRC PREPEND "src/") -list(TRANSFORM BOARD_SRC PREPEND "src/") -list(TRANSFORM DGTALIO_SRC PREPEND "src/") - -# DGtal Target. Library is added on the top directory to use target_link_libraries for CMake < 3.13 -add_library (DGtal ${DGTAL_SRC} ${DGTALIO_SRC} ${BOARD_SRC} ) -target_include_directories(DGtal PUBLIC - $ - $ - # INSTALL_INTERFACE must not contain absolute paths - $ - ) - # ----------------------------------------------------------------------------- # Check mandatory and optional dependencies # ----------------------------------------------------------------------------- include(CheckDGtalDependencies) include(CheckDGtalOptionalDependencies) -# ----------------------------------------------------------------------------- -# Install -# ----------------------------------------------------------------------------- -install(TARGETS DGtal - # IMPORTANT: Add the DGtal library to the "export-set" - EXPORT DGtalLibraryDepends - RUNTIME DESTINATION "${INSTALL_BIN_DIR}" COMPONENT bin - LIBRARY DESTINATION "${INSTALL_LIB_DIR}" COMPONENT shlib - ARCHIVE DESTINATION "${INSTALL_LIB_DIR}" - #PUBLIC_HEADER DESTINATION "${INSTALL_INCLUDE_DIR}/DGtal" - COMPONENT dev) - -# ----------------------------------------------------------------------------- -# Common build options/settings -# ----------------------------------------------------------------------------- -include(OSDependentSettings) - # ----------------------------------------------------------------------------- # Randomized build 1/2. # ----------------------------------------------------------------------------- @@ -138,11 +94,6 @@ include(GeneratorSpecific) # ----------------------------------------------------------------------------- include(OSDependentSettings) -# ----------------------------------------------------------------------------- -# Install settings -# ----------------------------------------------------------------------------- -include(Install) - #------------------------------------------------------------------------------ # Python wrappings #------------------------------------------------------------------------------ @@ -152,3 +103,8 @@ include(PythonWrappings) # Unzip and install topology Look up Tables. # ----------------------------------------------------------------------------- include(NeighborhoodTablesConfig) + +# ----------------------------------------------------------------------------- +# Unzip and install topology Look up Tables. +# ----------------------------------------------------------------------------- +include(Install) diff --git a/ChangeLog.md b/ChangeLog.md index ccca3ddda1..f4990787ce 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,16 @@ # DGtal 2.0 +- *General* + - Upgrade of ITK to version 5 and above (Bastien Doignies, [#1757](https://github.com/DGtal-team/DGtal/pull/1757)) + - C++20 support and new minimal standard (Bastien Doignies, [#1757](https://github.com/DGtal-team/DGtal/pull/1757)) + - Library is now (almost) header only (Bastien Doignies, [#1757](https://github.com/DGtal-team/DGtal/pull/1757)) + - Fix compilation warnings (Bastien Doignies, [#1757](https://github.com/DGtal-team/DGtal/pull/1757)) + +- *CMake* + - Updated to version 3.20 minimum (contemporary version of C++20's new minimal standard) (Bastien Doignies, [#1757](https://github.com/DGtal-team/DGtal/pull/1757)) + - Updated export and install commands to more modern cmake (Bastien Doignies, [#1757](https://github.com/DGtal-team/DGtal/pull/1757)) + - Dependancies of DGTal are now build as separate targets (Bastien Doignies, [#1757](https://github.com/DGtal-team/DGtal/pull/1757)) + - *Build* - Prefixing main cmake variables with `DGTAL_` (David Coeurjolly, [#1753](https://github.com/DGtal-team/DGtal/pull/1753)) - Add a cmake option to use the ITK EIGEN configuration to solve the issue [#347](https://github.com/DGtal-team/DGtalTools/issues/437) of DGTalTools. (Bertrand Kerautret, [#1759](https://github.com/DGtal-team/DGtal/pull/1759) diff --git a/Dockerfile b/Dockerfile index 3aeadb8fd2..b1ff246664 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,7 +40,7 @@ RUN apt -y install doxygen RUN apt -y install libcgal-dev -#RUN apt-get -y install libinsighttoolkit4-dev +#RUN apt-get -y install libinsighttoolkit5-dev #RUN apt -y install libqglviewer-dev-qt5 diff --git a/cmake/CheckDGtalDependencies.cmake b/cmake/CheckDGtalDependencies.cmake index 5965c798d9..8cf58a791e 100644 --- a/cmake/CheckDGtalDependencies.cmake +++ b/cmake/CheckDGtalDependencies.cmake @@ -14,15 +14,21 @@ set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) set(Boost_FOUND FALSE) find_package(Boost 1.50.0 REQUIRED) -target_compile_definitions(DGtal PUBLIC ${BOOST_DEFINITIONS} -DBOOST_ALL_NO_LIB) +target_compile_definitions(DGtal PUBLIC ${BOOST_DEFINITIONS} -DBOOST_ALL_NO_LIB -DBOOST_ALLOW_DEPRECATED_HEADERS) # SYSTEM to avoid warnings from boost. target_include_directories(DGtal SYSTEM PUBLIC ${Boost_INCLUDE_DIRS} ) + +target_compile_definitions(DGTAL_BoostAddons PUBLIC ${BOOST_DEFINITIONS} -DBOOST_ALL_NO_LIB) +target_include_directories(DGTAL_BoostAddons SYSTEM PUBLIC ${Boost_INCLUDE_DIRS} ) + # ----------------------------------------------------------------------------- # Looking for zlib # ----------------------------------------------------------------------------- find_package(ZLIB REQUIRED) target_link_libraries(DGtal PUBLIC ZLIB::ZLIB) +target_link_libraries(DGTAL_BoostAddons PUBLIC ZLIB::ZLIB) + set(DGtalLibDependencies ${DGtalLibDependencies} ${ZLIB_LIBRARIES}) # ----------------------------------------------------------------------------- @@ -37,3 +43,4 @@ endif() # Eigen (already fetched) # ----------------------------------------------------------------------------- set(DGtalLibDependencies ${DGtalLibDependencies} Eigen3::Eigen) +target_compile_definitions(DGtal PUBLIC "-DDGTAL_WITH_EIGEN=true") \ No newline at end of file diff --git a/cmake/CheckDGtalOptionalDependencies.cmake b/cmake/CheckDGtalOptionalDependencies.cmake index baf6d6eb00..a72e8cafc9 100644 --- a/cmake/CheckDGtalOptionalDependencies.cmake +++ b/cmake/CheckDGtalOptionalDependencies.cmake @@ -2,6 +2,7 @@ # Check Optional Dependencies # ----------------------------------------------------------------------------- + # ----------------------------------------------------------------------------- # Global options # ----------------------------------------------------------------------------- @@ -164,7 +165,24 @@ if (DGTAL_WITH_ITK) target_link_libraries(DGtal PUBLIC ${ITK_LIBRARIES}) set(DGtalLibDependencies ${DGtalLibDependencies} ${ITK_LIBRARIES}) target_compile_definitions(DGtal PUBLIC -DDGTAL_WITH_ITK) - target_include_directories(DGtal PUBLIC ${ITK_INCLUDE_DIRS}) + + # ------------------------------------------------------------------------- + # ITK 5.0 adds "/usr/lib/x86_64-linux-gnu/include" to include path which + # does not exists on "new" (for example in Docker containers) systems. + # When linking with DGTal, a cmake Error is raised + # "Imported target "DGtal::DGtal" includes non-existent path" + # + # In case the name is not the same accross unix distributions and windows + # we filter out all directories that do not exist on the system + # -------------------------------------------------------------------------- + set(FILTERED_ITK_INCLUDE_DIRS "") + foreach (includedir ${ITK_INCLUDE_DIRS}) + if(EXISTS ${includedir}) + list(APPEND FILTERED_ITK_INCLUDE_DIRS ${includedir}) + endif() + endforeach() + + target_include_directories(DGtal PUBLIC ${FILTERED_ITK_INCLUDE_DIRS}) # ------------------------------------------------------------------------- # This test is for instance used for ITK v3.x. ITK forces a limited @@ -196,7 +214,14 @@ if(DGTAL_WITH_CAIRO) target_include_directories(DGtal PUBLIC ${CAIRO_INCLUDE_DIRS} ${cairo_INCLUDE_DIRS}) target_link_libraries(DGtal PUBLIC ${CAIRO_LIBRARIES} ${cairo_LIBRARIES}) set(DGtalLibDependencies ${DGtalLibDependencies} ${CAIRO_LIBRARIES} ${cairo_LIBRARIES}) + + target_compile_definitions(DGTAL_LibBoard PUBLIC -DDGTAL_WITH_CAIRO) + target_include_directories(DGTAL_LibBoard PUBLIC ${CAIRO_INCLUDE_DIRS} ${cairo_INCLUDE_DIRS}) + target_link_libraries(DGTAL_LibBoard PUBLIC ${CAIRO_LIBRARIES} ${cairo_LIBRARIES}) + message(STATUS "cairo found") + + set(CAIRO_FOUND_DGTAL 1) else() message(FATAL_ERROR "cairo not found. Check the cmake variables associated to this package or disable it." ) diff --git a/cmake/Common.cmake b/cmake/Common.cmake index 3dd6b54eb2..731a730af4 100644 --- a/cmake/Common.cmake +++ b/cmake/Common.cmake @@ -28,9 +28,9 @@ endforeach() # ----------------------------------------------------------------------------- -# CPP17 +# CPP20 # ----------------------------------------------------------------------------- -set(DGTAL_CMAKE_CXX_STANDARD_MIN_REQUIRED 17) +set(DGTAL_CMAKE_CXX_STANDARD_MIN_REQUIRED 20) if(NOT CMAKE_CXX_STANDARD) set(CMAKE_CXX_STANDARD ${DGTAL_CMAKE_CXX_STANDARD_MIN_REQUIRED}) else() @@ -44,6 +44,8 @@ if(NOT CMAKE_CXX_STANDARD_REQUIRED) set(CMAKE_CXX_STANDARD_REQUIRED ON) endif() +message(STATUS "C++ standard set to ${CMAKE_CXX_STANDARD}") + # ----------------------------------------------------------------------------- # Visual Studio : to distinguish between debug and release lib and /bigobj flag # ----------------------------------------------------------------------------- diff --git a/cmake/DGtalConfig.cmake.in b/cmake/DGtalConfig.cmake.in index 1fec6ed2f9..7a13bee345 100644 --- a/cmake/DGtalConfig.cmake.in +++ b/cmake/DGtalConfig.cmake.in @@ -5,16 +5,10 @@ # DGTAL_LIBRARIES - libraries to link against # DGTAL_VERSION - version of the DGtal library @PACKAGE_INIT@ - -set(DGTAL_VERSION "@DGTAL_VERSION@") - include(CMakeFindDependencyMacro) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}) -get_filename_component(DGTAL_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${DGTAL_CMAKE_DIR}/Modules") - -include(CPM) - +set(DGTAL_VERSION "@DGTAL_VERSION@") #### Required dependencies #### find_dependency(Boost REQUIRED @@ -24,7 +18,7 @@ find_dependency(ZLIB REQUIRED @ZLIB_HINTS@ ) -set(WITH_EIGEN 1) +set(DGTAL_WITH_EIGEN 1) include(eigen) set(DGtalLibDependencies ${DGtalLibDependencies} Eigen3::Eigen) @@ -34,6 +28,8 @@ if (@LIBIGL_FOUND_DGTAL@) set(DGtalLibDependencies ${DGtalLibDependencies} igl::core) endif() +#### Optionnal dependencies #### + if(@GMP_FOUND_DGTAL@) #if GMP_FOUND_DGTAL find_package(GMP REQUIRED @GMP_HINTS@ @@ -99,10 +95,7 @@ if(@FFTW3_FOUND_DGTAL@) #if FFTW3_FOUND_DGTAL set(DGTAL_WITH_FFTW3 1) endif() -if(NOT TARGET DGtal) - # Our imported targets, including dependencies - include ("${DGTAL_CMAKE_DIR}/DGtalLibraryDepends.cmake") -endif() +include("${CMAKE_CURRENT_LIST_DIR}/DGtalTargets.cmake") -set(DGTAL_LIBRARIES DGtal ${DGtalLibDependencies}) -get_target_property(DGTAL_INCLUDE_DIRS DGtal INTERFACE_INCLUDE_DIRECTORIES) +set(DGTAL_LIBRARIES DGtal::DGtal DGtal::DGTAL_LibBoard DGtal::DGTAL_BoostAddons DGtal::DGtal_STB ${DGtalLibDependencies}) +get_target_property(DGTAL_INCLUDE_DIRS DGtal::DGtal INTERFACE_INCLUDE_DIRECTORIES) \ No newline at end of file diff --git a/cmake/DGtalConfigGenerator.cmake b/cmake/DGtalConfigGenerator.cmake deleted file mode 100644 index 55fe3d0817..0000000000 --- a/cmake/DGtalConfigGenerator.cmake +++ /dev/null @@ -1,69 +0,0 @@ -MESSAGE(STATUS "Generating DGtalConfig files") - -set(dgtal_export_file "${PROJECT_BINARY_DIR}/DGtalLibraryDepends.cmake") -export(TARGETS DGtal FILE ${dgtal_export_file}) - -# Export the package for use from the build-tree -# (this registers the build-tree with a global CMake-registry) -# export(PACKAGE DGtal) -# Not working on cmake 2.6, I remove this option but keep the codeline (DC) - - -# Provide HINTS to find_dependency in DGtalConfig.cmake if DGTAL_CONFIG_HINTS -# is ON. Disable it when deploying. -set(_dependencies_list - Boost ZLIB - GMP ITK Cairo HDF5 QGLVIEWER Qt5 OpenMP Eigen3::Eigen CGAL FFTW3 OpenMP::OpenMPCXX - ) -foreach(dep ${_dependencies_list}) - if(DGTAL_CONFIG_HINTS) - if("${${dep}_DIR}" STREQUAL "" OR - "${${dep}_DIR}" STREQUAL "${dep}_DIR-NOTFOUND") - set(${dep}_HINTS "# NO_HINTS (no ${dep}_DIR or ${dep}_DIR-NOTFOUND)") - else() - set(${dep}_HINTS "HINTS \"${${dep}_DIR}\"") - endif() - else() - set(${dep}_HINTS "# NO_HINTS (disabled with DGTAL_CONFIG_HINTS=OFF)") - endif() -endforeach() -# Create a DGtalConfig.cmake file for the use from the build tree -configure_file(${PROJECT_SOURCE_DIR}/cmake/DGtalConfig.cmake.in - "${PROJECT_BINARY_DIR}/DGtalConfig.cmake" @ONLY) -configure_file(${PROJECT_SOURCE_DIR}/cmake/DGtalConfigVersion.cmake.in - "${PROJECT_BINARY_DIR}/DGtalConfigVersion.cmake" @ONLY) - -# Install the export set for use with the install-tree -set(DGTAL_CMAKE_DIR_INSTALL "${INSTALL_DATA_DIR}") -install(EXPORT DGtalLibraryDepends - DESTINATION ${DGTAL_CMAKE_DIR_INSTALL} - COMPONENT dev) - -# Create a DGtalConfig.cmake file for the use from the install tree -# and install it -configure_file(${PROJECT_SOURCE_DIR}/cmake/DGtalConfig.cmake.in - "${PROJECT_BINARY_DIR}/InstallFiles/DGtalConfig.cmake" @ONLY) - -configure_file(${PROJECT_SOURCE_DIR}/cmake/DGtalConfigVersion.cmake.in - "${PROJECT_BINARY_DIR}/InstallFiles/DGtalConfigVersion.cmake" @ONLY) - -install(FILES - "${PROJECT_BINARY_DIR}/InstallFiles/DGtalConfig.cmake" - "${PROJECT_BINARY_DIR}/InstallFiles/DGtalConfigVersion.cmake" - DESTINATION "${DGTAL_CMAKE_DIR_INSTALL}" COMPONENT dev) - -# Distribute FindFoo.cmake files to the build and install tree -set(_find_cmake_files - "${PROJECT_SOURCE_DIR}/cmake/FindCairo.cmake" - "${PROJECT_SOURCE_DIR}/cmake/FindFFTW3.cmake" - "${PROJECT_SOURCE_DIR}/cmake/FindQGLVIEWER.cmake" - "${PROJECT_SOURCE_DIR}/cmake/FindGMP.cmake" - "${PROJECT_SOURCE_DIR}/cmake/deps/eigen.cmake" - "${PROJECT_SOURCE_DIR}/cmake/deps/libigl.cmake" - "${PROJECT_SOURCE_DIR}/cmake/deps/openmp.cmake" - "${PROJECT_SOURCE_DIR}/cmake/CPM.cmake" - ) -file(COPY ${_find_cmake_files} - DESTINATION "${PROJECT_BINARY_DIR}/Modules") -install(FILES ${_find_cmake_files} - DESTINATION "${DGTAL_CMAKE_DIR_INSTALL}/Modules" COMPONENT dev) diff --git a/cmake/DGtalConfigVersion.cmake.in b/cmake/DGtalConfigVersion.cmake.in deleted file mode 100644 index 1423934583..0000000000 --- a/cmake/DGtalConfigVersion.cmake.in +++ /dev/null @@ -1,11 +0,0 @@ -set(PACKAGE_VERSION "@DGTAL_VERSION@") - -# Check whether the requested PACKAGE_FIND_VERSION is compatible -if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") - set(PACKAGE_VERSION_COMPATIBLE FALSE) -else() - set(PACKAGE_VERSION_COMPATIBLE TRUE) - if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") - set(PACKAGE_VERSION_EXACT TRUE) - endif() -endif() diff --git a/cmake/DevelopmentOptions.cmake b/cmake/DevelopmentOptions.cmake index 5df633c6e9..b8729496f5 100644 --- a/cmake/DevelopmentOptions.cmake +++ b/cmake/DevelopmentOptions.cmake @@ -46,6 +46,6 @@ CPMAddPackage( # ----------------------------------------------------------------------------- option(WARNING_AS_ERROR "Transform compiler warnings as errors (in Debug build type)." OFF) if (WARNING_AS_ERROR) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Werror") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-dangling-reference -Wno-sign-compare -Werror -Wno-unknown-pragmas -Wshadow -Wunused-variable -Wunused-parameter -Wunused-function -Wno-deprecated-copy -Werror=type-limits -Wno-nonnull -Wno-unused-function -Wunused -Wno-long-long -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings") message(STATUS "Warnings as Errors ENABLED.") endif() diff --git a/cmake/Install.cmake b/cmake/Install.cmake index e30aded20b..b3e51c53d8 100644 --- a/cmake/Install.cmake +++ b/cmake/Install.cmake @@ -1,15 +1,106 @@ #------------------------------------------------------------------------------ # DGtal Configuration file for the install target #------------------------------------------------------------------------------ +include(CMakePackageConfigHelpers) +set(DGTAL_INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/DGtal") -#--- Headers installation -install(DIRECTORY "${PROJECT_SOURCE_DIR}/src/" - DESTINATION "${INSTALL_INCLUDE_DIR}/" - FILES_MATCHING PATTERN "*.*h") +install(TARGETS + DGtal + # Dependancies also built by the project + DGtal_STB DGTAL_LibBoard DGTAL_BoostAddons + EXPORT DGtalTargets + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) -#-- specific install for Config.h.in -install(DIRECTORY "${PROJECT_BINARY_DIR}/src/DGtal/" - DESTINATION "${INSTALL_INCLUDE_DIR}/DGtal/" - FILES_MATCHING PATTERN "*.*h") +# Export file locally also, so the DGtalConfig.cmake +# in the build/ directory can work +export(TARGETS + DGtal + # Dependancies also built by the project + DGtal_STB DGTAL_LibBoard DGTAL_BoostAddons + NAMESPACE DGtal:: + FILE DGtalTargets.cmake +) -INCLUDE(DGtalConfigGenerator) +# Install headers +# Note : this also copies a few .cpp and CMakeLists but simplifies the code here +install(DIRECTORY + "${PROJECT_SOURCE_DIR}/src/Board" + "${PROJECT_SOURCE_DIR}/src/DGtal" + "${PROJECT_SOURCE_DIR}/src/BoostAddons" + "${PROJECT_SOURCE_DIR}/src/stb" + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} +) +# COPY Generated files +install(FILES + ${PROJECT_BINARY_DIR}/src/DGtal/base/Config.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/DGtal/base +) + +install(FILES + ${PROJECT_BINARY_DIR}/src/DGtal/topology/tables/NeighborhoodTables.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/DGtal/topology/tables/ +) + + +install(EXPORT DGtalTargets + FILE DGtalTargets.cmake + NAMESPACE DGtal:: + DESTINATION ${DGTAL_INSTALL_DESTINATION} +) + + +#------------------------------------------------------------------------------ +# DGtalConfig.cmake variables +#------------------------------------------------------------------------------ +set(_dependencies_list + Boost ZLIB + LibBoard + GMP ITK Cairo HDF5 QGLVIEWER Qt5 OpenMP Eigen3::Eigen CGAL FFTW3 OpenMP::OpenMPCXX + ) +set(_find_cmake_files + "${PROJECT_SOURCE_DIR}/cmake/deps/eigen.cmake" + "${PROJECT_SOURCE_DIR}/cmake/deps/FindCairo.cmake" + "${PROJECT_SOURCE_DIR}/cmake/deps/FindFFTW3.cmake" + "${PROJECT_SOURCE_DIR}/cmake/deps/FindQGLVIEWER.cmake" + "${PROJECT_SOURCE_DIR}/cmake/deps/FindGMP.cmake" + "${PROJECT_SOURCE_DIR}/cmake/deps/eigen.cmake" + "${PROJECT_SOURCE_DIR}/cmake/deps/libigl.cmake" + "${PROJECT_SOURCE_DIR}/cmake/deps/openmp.cmake" + "${PROJECT_SOURCE_DIR}/cmake/CPM.cmake" +) +foreach(dep ${_dependencies_list}) + if(DGTAL_CONFIG_HINTS) + if("${${dep}_DIR}" STREQUAL "" OR + "${${dep}_DIR}" STREQUAL "${dep}_DIR-NOTFOUND") + set(${dep}_HINTS "# NO_HINTS (no ${dep}_DIR or ${dep}_DIR-NOTFOUND)") + else() + set(${dep}_HINTS "HINTS \"${${dep}_DIR}\"") + endif() + else() + set(${dep}_HINTS "# NO_HINTS (disabled with DGTAL_CONFIG_HINTS=OFF)") + endif() +endforeach() + +write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/DGtalConfigVersion.cmake" + VERSION "${version}" + COMPATIBILITY AnyNewerVersion +) + +configure_package_config_file( + ${PROJECT_SOURCE_DIR}/cmake/DGtalConfig.cmake.in + "${CMAKE_CURRENT_BINARY_DIR}/DGtalConfig.cmake" + INSTALL_DESTINATION ${DGTAL_INSTALL_DESTINATION} + NO_CHECK_REQUIRED_COMPONENTS_MACRO +) + +install(FILES + "${CMAKE_CURRENT_BINARY_DIR}/DGtalConfig.cmake" + "${CMAKE_CURRENT_BINARY_DIR}/DGtalConfigVersion.cmake" + ${_find_cmake_files} + DESTINATION ${DGTAL_INSTALL_DESTINATION} +) \ No newline at end of file diff --git a/cmake/OSDependentSettings.cmake b/cmake/OSDependentSettings.cmake index 5ca062e884..c78e99043e 100644 --- a/cmake/OSDependentSettings.cmake +++ b/cmake/OSDependentSettings.cmake @@ -20,12 +20,6 @@ if(MSVC) endif() endif() -# Misc -if( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) -# Add -fPIC -set_target_properties(DGtal PROPERTIES POSITION_INDEPENDENT_CODE ON) -endif() - #------------------------------------------------------------------------------ # Remove some MS Visual c++ flags #------------------------------------------------------------------------------ @@ -47,15 +41,4 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") if ( ${CMAKE_BUILD_TYPE} MATCHES "Debug" ) target_compile_options(DGtal PRIVATE -Wdocumentation) endif() -endif() - - -# Enable floating point exception when DGtal library is loaded. Only works for gcc. -if (UNIX AND NOT APPLE) - # Only used in Common.cpp - option(DGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS "Enable feenableexcept when DGtal library is loaded." OFF) - mark_as_advanced(DGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS) - if(DGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS) - target_compile_definitions(DGtal PRIVATE -DDGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS) - endif() -endif() +endif() \ No newline at end of file diff --git a/cmake/FindBenchmark.cmake b/cmake/deps/FindBenchmark.cmake similarity index 100% rename from cmake/FindBenchmark.cmake rename to cmake/deps/FindBenchmark.cmake diff --git a/cmake/FindCairo.cmake b/cmake/deps/FindCairo.cmake similarity index 100% rename from cmake/FindCairo.cmake rename to cmake/deps/FindCairo.cmake diff --git a/cmake/FindDoxygen.cmake b/cmake/deps/FindDoxygen.cmake similarity index 100% rename from cmake/FindDoxygen.cmake rename to cmake/deps/FindDoxygen.cmake diff --git a/cmake/FindFFTW3.cmake b/cmake/deps/FindFFTW3.cmake similarity index 100% rename from cmake/FindFFTW3.cmake rename to cmake/deps/FindFFTW3.cmake diff --git a/cmake/FindGMP.cmake b/cmake/deps/FindGMP.cmake similarity index 100% rename from cmake/FindGMP.cmake rename to cmake/deps/FindGMP.cmake diff --git a/cmake/FindPackageHandleStandardArgs.cmake b/cmake/deps/FindPackageHandleStandardArgs.cmake similarity index 100% rename from cmake/FindPackageHandleStandardArgs.cmake rename to cmake/deps/FindPackageHandleStandardArgs.cmake diff --git a/cmake/FindPackageMessage.cmake b/cmake/deps/FindPackageMessage.cmake similarity index 100% rename from cmake/FindPackageMessage.cmake rename to cmake/deps/FindPackageMessage.cmake diff --git a/cmake/FindPatate.cmake b/cmake/deps/FindPatate.cmake similarity index 100% rename from cmake/FindPatate.cmake rename to cmake/deps/FindPatate.cmake diff --git a/cmake/FindQGLVIEWER.cmake b/cmake/deps/FindQGLVIEWER.cmake similarity index 100% rename from cmake/FindQGLVIEWER.cmake rename to cmake/deps/FindQGLVIEWER.cmake diff --git a/conanfile.txt b/conanfile.txt index 7a96e48d16..abe5a7068c 100644 --- a/conanfile.txt +++ b/conanfile.txt @@ -11,4 +11,4 @@ CMakeToolchain [options] boost*:header_only=True -gmp*:enable_cxx=True +gmp*:enable_cxx=True \ No newline at end of file diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 61a6fadf91..daa889ceba 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,17 +1,3 @@ -#CMakeLists associated to the examples subdir - -# Make sure the compiler can find include files. -include_directories (${PROJECT_SOURCE_DIR}/src/) -include_directories (${PROJECT_BINARY_DIR}/src) - -# Make sure the compiler can find include files. -include_directories (${PROJECT_SOURCE_DIR}/examples/) -include_directories (${PROJECT_BINARY_DIR}/examples/) - - -# Make sure the linker can find the Hello library once it is built. -link_directories (${PROJECT_BINARY_DIR}) - # ConfigExamples.h instanciation. configure_file(${PROJECT_SOURCE_DIR}/examples/ConfigExamples.h.in ${PROJECT_BINARY_DIR}/examples/ConfigExamples.h) diff --git a/examples/doc-examples/exampleCatch.cpp b/examples/doc-examples/exampleCatch.cpp index 2f78ccc9c3..2fb2e062db 100644 --- a/examples/doc-examples/exampleCatch.cpp +++ b/examples/doc-examples/exampleCatch.cpp @@ -36,7 +36,6 @@ DGtal/Catch examples /////////////////////////////////////////////////////////////////////////////// #include -#include "ConfigExamples.h" #include "DGtal/helpers/StdDefs.h" #include "DGtal/base/Common.h" diff --git a/examples/geometry/curves/exampleDigitalConvexity.cpp b/examples/geometry/curves/exampleDigitalConvexity.cpp index daa14543e8..70e1e22671 100644 --- a/examples/geometry/curves/exampleDigitalConvexity.cpp +++ b/examples/geometry/curves/exampleDigitalConvexity.cpp @@ -61,7 +61,7 @@ using namespace Z2i; /////////////////////////////////////////////////////////////////////////////// -int main( int argc, char** argv ) +int main( ) { trace.beginBlock ( "Example for 2d gridcurves" ); string S = examplesPath + "samples/contourS.fc"; diff --git a/examples/geometry/curves/exampleRationalConvexity.cpp b/examples/geometry/curves/exampleRationalConvexity.cpp index 44d1a2b635..3c91ab6193 100644 --- a/examples/geometry/curves/exampleRationalConvexity.cpp +++ b/examples/geometry/curves/exampleRationalConvexity.cpp @@ -62,7 +62,7 @@ using namespace Z2i; /////////////////////////////////////////////////////////////////////////////// -int main( int argc, char** argv ) +int main( ) { trace.beginBlock ( "Example for 2d gridcurves" ); string S = examplesPath + "samples/contourS.fc"; diff --git a/examples/geometry/meshes/curvature-comparator-ii-cnc-3d.cpp b/examples/geometry/meshes/curvature-comparator-ii-cnc-3d.cpp index a307cef91c..1e7a6986da 100644 --- a/examples/geometry/meshes/curvature-comparator-ii-cnc-3d.cpp +++ b/examples/geometry/meshes/curvature-comparator-ii-cnc-3d.cpp @@ -97,7 +97,7 @@ makeColorMap( double min_value, double max_value ) return gradcmap; } -void usage( int argc, char* argv[] ) +void usage( char* argv[] ) { using namespace DGtal; using namespace DGtal::Z3i; @@ -127,7 +127,7 @@ int main( int argc, char* argv[] ) { if ( argc <= 1 ) { - usage( argc, argv ); + usage( argv ); return 0; } //! [curvature-comparator-Typedefs] @@ -191,7 +191,7 @@ int main( int argc, char* argv[] ) auto pointels = SH::getPointelRange( c2i, surface ); auto vertices = SH::RealPoints( pointels.size() ); std::transform( pointels.cbegin(), pointels.cend(), vertices.begin(), - [&] (const SH::Cell& c) { return h * embedder( c ); } ); + [&] (const SH::Cell& cell) { return h * embedder( cell ); } ); for ( auto&& surfel : surfels ) { const auto primal_surfel_vtcs = SH::getPointelRange( K, surfel ); diff --git a/examples/geometry/meshes/curvature-measures-icnc-3d.cpp b/examples/geometry/meshes/curvature-measures-icnc-3d.cpp index b592fe1724..96f6246269 100644 --- a/examples/geometry/meshes/curvature-measures-icnc-3d.cpp +++ b/examples/geometry/meshes/curvature-measures-icnc-3d.cpp @@ -105,7 +105,7 @@ makeColorMap( double min_value, double max_value ) return gradcmap; } -void usage( int argc, char* argv[] ) +void usage( char* argv[] ) { std::cout << "Usage: " << std::endl << "\t" << argv[ 0 ] << " " << std::endl @@ -125,7 +125,7 @@ int main( int argc, char* argv[] ) { if ( argc <= 1 ) { - usage( argc, argv ); + usage( argv ); return 0; } //! [curvature-measures-Typedefs] diff --git a/examples/geometry/meshes/curvature-measures-icnc-XY-3d.cpp b/examples/geometry/meshes/curvature-measures-icnc-XY-3d.cpp index 36653e1b26..5b7ed3d744 100644 --- a/examples/geometry/meshes/curvature-measures-icnc-XY-3d.cpp +++ b/examples/geometry/meshes/curvature-measures-icnc-XY-3d.cpp @@ -119,7 +119,7 @@ makeColorMap( double min_value, double max_value ) return gradcmap; } -void usage( int argc, char* argv[] ) +void usage( char* argv[] ) { std::cout << "Usage: " << std::endl << "\t" << argv[ 0 ] << " " << std::endl @@ -140,7 +140,7 @@ int main( int argc, char* argv[] ) { if ( argc <= 1 ) { - usage( argc, argv ); + usage( argv ); return 0; } //! [curvature-measures-Typedefs] diff --git a/examples/geometry/meshes/curvature-measures-nc-3d.cpp b/examples/geometry/meshes/curvature-measures-nc-3d.cpp index 41518248b5..9f84553f32 100644 --- a/examples/geometry/meshes/curvature-measures-nc-3d.cpp +++ b/examples/geometry/meshes/curvature-measures-nc-3d.cpp @@ -101,7 +101,7 @@ makeColorMap( double min_value, double max_value ) return gradcmap; } -void usage( int argc, char* argv[] ) +void usage( char* argv[] ) { std::cout << "Usage: " << std::endl << "\t" << argv[ 0 ] << " " << std::endl @@ -121,7 +121,7 @@ int main( int argc, char* argv[] ) { if ( argc <= 1 ) { - usage( argc, argv ); + usage( argv ); return 0; } //! [curvature-measures-Typedefs] diff --git a/examples/geometry/meshes/curvature-measures-nc-XY-3d.cpp b/examples/geometry/meshes/curvature-measures-nc-XY-3d.cpp index fd8e82bfec..673d6a0d07 100644 --- a/examples/geometry/meshes/curvature-measures-nc-XY-3d.cpp +++ b/examples/geometry/meshes/curvature-measures-nc-XY-3d.cpp @@ -105,7 +105,7 @@ makeColorMap( double min_value, double max_value ) return gradcmap; } -void usage( int argc, char* argv[] ) +void usage( char* argv[] ) { std::cout << "Usage: " << std::endl << "\t" << argv[ 0 ] << " " << std::endl @@ -125,7 +125,7 @@ int main( int argc, char* argv[] ) { if ( argc <= 1 ) { - usage( argc, argv ); + usage( argv ); return 0; } //! [curvature-measures-Typedefs] diff --git a/examples/geometry/meshes/digpoly-curvature-measures-cnc-3d.cpp b/examples/geometry/meshes/digpoly-curvature-measures-cnc-3d.cpp index 40dd39773e..51fe836335 100644 --- a/examples/geometry/meshes/digpoly-curvature-measures-cnc-3d.cpp +++ b/examples/geometry/meshes/digpoly-curvature-measures-cnc-3d.cpp @@ -136,7 +136,7 @@ makeColorMap( double min_value, double max_value ) return gradcmap; } -void usage( int argc, char* argv[] ) +void usage( char* argv[] ) { using namespace DGtal; using namespace DGtal::Z3i; @@ -169,7 +169,7 @@ int main( int argc, char* argv[] ) { if ( argc <= 1 ) { - usage( argc, argv ); + usage( argv ); return 0; } //! [curvature-measures-Typedefs] diff --git a/examples/geometry/meshes/digpoly-curvature-measures-cnc-XY-3d.cpp b/examples/geometry/meshes/digpoly-curvature-measures-cnc-XY-3d.cpp index 07513b0847..651acf17a5 100644 --- a/examples/geometry/meshes/digpoly-curvature-measures-cnc-XY-3d.cpp +++ b/examples/geometry/meshes/digpoly-curvature-measures-cnc-XY-3d.cpp @@ -137,7 +137,7 @@ makeColorMap( double min_value, double max_value ) return gradcmap; } -void usage( int argc, char* argv[] ) +void usage( char* argv[] ) { using namespace DGtal; using namespace DGtal::Z3i; @@ -171,7 +171,7 @@ int main( int argc, char* argv[] ) { if ( argc <= 1 ) { - usage( argc, argv ); + usage( argv ); return 0; } //! [curvature-measures-Typedefs] diff --git a/examples/geometry/meshes/obj-curvature-measures-icnc-3d.cpp b/examples/geometry/meshes/obj-curvature-measures-icnc-3d.cpp index 3eb212f0eb..167defb787 100644 --- a/examples/geometry/meshes/obj-curvature-measures-icnc-3d.cpp +++ b/examples/geometry/meshes/obj-curvature-measures-icnc-3d.cpp @@ -86,7 +86,7 @@ makeColorMap( double min_value, double max_value ) return gradcmap; } -void usage( int argc, char* argv[] ) +void usage( char* argv[] ) { std::cout << "Usage: " << std::endl << "\t" << argv[ 0 ] << " " << std::endl @@ -109,7 +109,7 @@ int main( int argc, char* argv[] ) { if ( argc <= 1 ) { - usage( argc, argv ); + usage( argv ); return 0; } //! [curvature-measures-Typedefs] diff --git a/examples/geometry/meshes/obj-curvature-measures-icnc-XY-3d.cpp b/examples/geometry/meshes/obj-curvature-measures-icnc-XY-3d.cpp index 433455c98c..83a15b2b46 100644 --- a/examples/geometry/meshes/obj-curvature-measures-icnc-XY-3d.cpp +++ b/examples/geometry/meshes/obj-curvature-measures-icnc-XY-3d.cpp @@ -89,7 +89,7 @@ makeColorMap( double min_value, double max_value ) return gradcmap; } -void usage( int argc, char* argv[] ) +void usage( char* argv[] ) { std::cout << "Usage: " << std::endl << "\t" << argv[ 0 ] << " " << std::endl @@ -111,7 +111,7 @@ int main( int argc, char* argv[] ) { if ( argc <= 1 ) { - usage( argc, argv ); + usage( argv ); return 0; } //! [curvature-measures-Typedefs] diff --git a/examples/geometry/meshes/vol-curvature-measures-icnc-3d.cpp b/examples/geometry/meshes/vol-curvature-measures-icnc-3d.cpp index d54f3b1481..a1fb8e0f82 100644 --- a/examples/geometry/meshes/vol-curvature-measures-icnc-3d.cpp +++ b/examples/geometry/meshes/vol-curvature-measures-icnc-3d.cpp @@ -96,7 +96,7 @@ makeColorMap( double min_value, double max_value ) return gradcmap; } -void usage( int argc, char* argv[] ) +void usage( char* argv[] ) { std::cout << "Usage: " << std::endl << "\t" << argv[ 0 ] << " " << std::endl @@ -121,7 +121,7 @@ int main( int argc, char* argv[] ) { if ( argc <= 1 ) { - usage( argc, argv ); + usage( argv ); return 0; } //! [curvature-measures-Typedefs] diff --git a/examples/geometry/meshes/vol-curvature-measures-icnc-XY-3d.cpp b/examples/geometry/meshes/vol-curvature-measures-icnc-XY-3d.cpp index 84f1afde31..c33fcc18e8 100644 --- a/examples/geometry/meshes/vol-curvature-measures-icnc-XY-3d.cpp +++ b/examples/geometry/meshes/vol-curvature-measures-icnc-XY-3d.cpp @@ -101,7 +101,7 @@ makeColorMap( double min_value, double max_value ) return gradcmap; } -void usage( int argc, char* argv[] ) +void usage( char* argv[] ) { std::cout << "Usage: " << std::endl << "\t" << argv[ 0 ] << " " << std::endl @@ -125,7 +125,7 @@ int main( int argc, char* argv[] ) { if ( argc <= 1 ) { - usage( argc, argv ); + usage( argv ); return 0; } //! [curvature-measures-Typedefs] @@ -208,9 +208,9 @@ int main( int argc, char* argv[] ) const auto b = smesh.faceCentroid( f ); const auto N = smesh.faceNormals()[ f ]; const auto area = mu0 .measure( b, R, f ); - const auto M = muXY.measure( b, R, f ); + const auto M2 = muXY.measure( b, R, f ); std::tie( K1[ f ], K2[ f ], D1[ f ], D2[ f ] ) - = cnc.principalCurvatures( area, M, N ); + = cnc.principalCurvatures( area, M2, N ); } //! [curvature-measures-estimations] diff --git a/examples/geometry/volumes/checkFullConvexityTheorems.cpp b/examples/geometry/volumes/checkFullConvexityTheorems.cpp index 434c41d247..84b1ca3812 100644 --- a/examples/geometry/volumes/checkFullConvexityTheorems.cpp +++ b/examples/geometry/volumes/checkFullConvexityTheorems.cpp @@ -97,8 +97,7 @@ checkSkelStarCvxHFullConvexity( int width ) typedef DGtal::KhalimskySpaceND< Space::dimension, Integer > KSpace; typedef DGtal::DigitalConvexity< KSpace > DConvexity; typedef typename KSpace::Point Point; - typedef std::vector PointRange; - + // Generate a random polytope in the specified domain Point lo = Point::zero; Point hi = Point::diagonal( width ); @@ -138,7 +137,7 @@ checkCvxHPlusHypercubeFullConvexity( int width ) typedef DGtal::KhalimskySpaceND< Space::dimension, Integer > KSpace; typedef DGtal::DigitalConvexity< KSpace > DConvexity; typedef typename KSpace::Point Point; - typedef std::vector PointRange; + // typedef std::vector PointRange; // Generate a random polytope in the specified domain Point lo = Point::zero; @@ -184,11 +183,11 @@ checkProjectionFullConvexity( int width ) typedef DGtal::KhalimskySpaceND< Space::dimension, Integer > KSpace; typedef DGtal::DigitalConvexity< KSpace > DConvexity; typedef typename KSpace::Point Point; - typedef std::vector PointRange; + // typedef std::vector PointRange; typedef DGtal::KhalimskySpaceND< Space::dimension-1, Integer > ProjKSpace; typedef DGtal::DigitalConvexity< ProjKSpace > ProjDConvexity; typedef typename ProjKSpace::Point ProjPoint; - typedef std::vector ProjPointRange; + // typedef std::vector ProjPointRange; // Generate a random polytope in the specified domain Point lo = Point::zero; @@ -247,11 +246,11 @@ checkFullConvexityCharacterization( int width ) typedef DGtal::KhalimskySpaceND< Space::dimension, Integer > KSpace; typedef DGtal::DigitalConvexity< KSpace > DConvexity; typedef typename KSpace::Point Point; - typedef std::vector PointRange; + // typedef std::vector PointRange; typedef DGtal::KhalimskySpaceND< Space::dimension-1, Integer > ProjKSpace; typedef DGtal::DigitalConvexity< ProjKSpace > ProjDConvexity; typedef typename ProjKSpace::Point ProjPoint; - typedef std::vector ProjPointRange; + // typedef std::vector ProjPointRange; // Generate a random polytope in the specified domain Point lo = Point::zero; @@ -296,7 +295,7 @@ checkFullConvexityCharacterization( int width ) return fc == proj_fc; } -int main( int argc, char* argv[] ) +int main( ) { int NB_TEST1 = 5; int NB_TEST2 = 5; diff --git a/examples/geometry/volumes/distance/exampleFMM3D.cpp b/examples/geometry/volumes/distance/exampleFMM3D.cpp index 98d388e859..bf60d49a8e 100644 --- a/examples/geometry/volumes/distance/exampleFMM3D.cpp +++ b/examples/geometry/volumes/distance/exampleFMM3D.cpp @@ -127,7 +127,7 @@ int main( int argc, char** argv ) << bel << std::endl; - } catch (DGtal::InputException i) { + } catch (const DGtal::InputException& i) { trace.emphase() << "starting bel not found" << std::endl; return 0; } diff --git a/examples/geometry/volumes/exampleBoundedLatticePolytopeCount2D.cpp b/examples/geometry/volumes/exampleBoundedLatticePolytopeCount2D.cpp index 363f773dd4..6c6dceefd0 100644 --- a/examples/geometry/volumes/exampleBoundedLatticePolytopeCount2D.cpp +++ b/examples/geometry/volumes/exampleBoundedLatticePolytopeCount2D.cpp @@ -76,7 +76,7 @@ int main( int argc, char* argv[] ) for ( int i = 0; i < N; i++ ) { std::vector< Point > V; - for ( int i = 0; i < nb; i++ ) { + for ( int j = 0; j < nb; j++ ) { Point p( rand() % (2*R+1) - R, rand() % (2*R+1) - R ); V.push_back( p ); } @@ -94,9 +94,9 @@ int main( int argc, char* argv[] ) std::vector< Integer > slow_counts; for ( const auto& P : polytopes ) { - const auto nb = P.countByScanning(); - slow_nb += nb; - slow_counts.push_back( nb ); + const auto nb2 = P.countByScanning(); + slow_nb += nb2; + slow_counts.push_back( nb2 ); } double t2 = DGtal::trace.endBlock(); // Count interior points (fast method) @@ -105,9 +105,9 @@ int main( int argc, char* argv[] ) std::vector< Integer > fast_counts; for ( const auto& P : polytopes ) { - const auto nb = P.count(); - fast_nb += nb; - fast_counts.push_back( nb ); + const auto nb2 = P.count(); + fast_nb += nb2; + fast_counts.push_back( nb2 ); } double t3 = DGtal::trace.endBlock(); bool ok = std::equal( slow_counts.cbegin(), slow_counts.cend(), fast_counts.cbegin() ); diff --git a/examples/geometry/volumes/exampleBoundedLatticePolytopeCount3D.cpp b/examples/geometry/volumes/exampleBoundedLatticePolytopeCount3D.cpp index a4ba6fab87..85ac75ea0c 100644 --- a/examples/geometry/volumes/exampleBoundedLatticePolytopeCount3D.cpp +++ b/examples/geometry/volumes/exampleBoundedLatticePolytopeCount3D.cpp @@ -76,7 +76,7 @@ int main( int argc, char* argv[] ) for ( int i = 0; i < N; i++ ) { std::vector< Point > V; - for ( int i = 0; i < nb; i++ ) { + for ( int j = 0; j < nb; j++ ) { Point p( rand() % (2*R+1) - R, rand() % (2*R+1) - R, rand() % (2*R+1) - R ); V.push_back( p ); } @@ -94,9 +94,9 @@ int main( int argc, char* argv[] ) std::vector< Integer > slow_counts; for ( const auto& P : polytopes ) { - const auto nb = P.countByScanning(); - slow_nb += nb; - slow_counts.push_back( nb ); + const auto nb2 = P.countByScanning(); + slow_nb += nb2; + slow_counts.push_back( nb2 ); } double t2 = DGtal::trace.endBlock(); // Count interior points (fast method) @@ -105,9 +105,9 @@ int main( int argc, char* argv[] ) std::vector< Integer > fast_counts; for ( const auto& P : polytopes ) { - const auto nb = P.count(); - fast_nb += nb; - fast_counts.push_back( nb ); + const auto nb2 = P.count(); + fast_nb += nb2; + fast_counts.push_back( nb2 ); } double t3 = DGtal::trace.endBlock(); bool ok = std::equal( slow_counts.cbegin(), slow_counts.cend(), fast_counts.cbegin() ); diff --git a/examples/geometry/volumes/exampleBoundedLatticePolytopeCount4D.cpp b/examples/geometry/volumes/exampleBoundedLatticePolytopeCount4D.cpp index a0ede4cf17..fe32172073 100644 --- a/examples/geometry/volumes/exampleBoundedLatticePolytopeCount4D.cpp +++ b/examples/geometry/volumes/exampleBoundedLatticePolytopeCount4D.cpp @@ -76,7 +76,7 @@ int main( int argc, char* argv[] ) for ( int i = 0; i < N; i++ ) { std::vector< Point > V; - for ( int i = 0; i < nb; i++ ) { + for ( int j = 0; j < nb; j++ ) { Point p( rand() % (2*R+1) - R, rand() % (2*R+1) - R, rand() % (2*R+1) - R, rand() % (2*R+1) - R ); V.push_back( p ); @@ -95,9 +95,9 @@ int main( int argc, char* argv[] ) std::vector< Integer > slow_counts; for ( const auto& P : polytopes ) { - const auto nb = P.countByScanning(); - slow_nb += nb; - slow_counts.push_back( nb ); + const auto nb2 = P.countByScanning(); + slow_nb += nb2; + slow_counts.push_back( nb2 ); } double t2 = DGtal::trace.endBlock(); // Count interior points (fast method) @@ -106,9 +106,9 @@ int main( int argc, char* argv[] ) std::vector< Integer > fast_counts; for ( const auto& P : polytopes ) { - const auto nb = P.count(); - fast_nb += nb; - fast_counts.push_back( nb ); + const auto nb2 = P.count(); + fast_nb += nb2; + fast_counts.push_back( nb2 ); } double t3 = DGtal::trace.endBlock(); bool ok = std::equal( slow_counts.cbegin(), slow_counts.cend(), fast_counts.cbegin() ); diff --git a/examples/geometry/volumes/fullConvexityAnalysis3D.cpp b/examples/geometry/volumes/fullConvexityAnalysis3D.cpp index 87ed8e74cc..a1137e4418 100644 --- a/examples/geometry/volumes/fullConvexityAnalysis3D.cpp +++ b/examples/geometry/volumes/fullConvexityAnalysis3D.cpp @@ -206,7 +206,7 @@ struct MultiScaleAnalyzer { ImagePtr bimage ) { auto prev_geometry - = MultiScaleAnalyzer< KSpace, N-1>::multiscale_run( aK, pts, bimage ); + = MultiScaleAnalyzer< KSpace, N-1>::multiscale_run( pts ); trace.info() << "------- Analyzing scale " << N << " --------" << std::endl; std::vector< int > geom( prev_geometry.size() ); for ( int i = 0; i < geom.size(); i++ ) @@ -230,9 +230,7 @@ struct MultiScaleAnalyzer< KSpace, 0 > { template < typename ImagePtr > static std::vector< Geometry > - multiscale_run( const KSpace& aK, - std::vector pts, - ImagePtr bimage ) + multiscale_run( const std::vector& pts ) { return std::vector< Geometry >( pts.size(), std::make_pair( 0, 0 ) ); } @@ -335,7 +333,7 @@ int main( int argc, char** argv ) { trace.beginBlock ( "Multiscale analysis" ); auto geometry = - MultiScaleAnalyzer< KSpace, 5 >::multiscale_run( K, points, bimage ); + MultiScaleAnalyzer< KSpace, 5 >::multiscale_run( points ); trace.endBlock(); Color colors_planar[ 6 ] = { Color( 0, 255, 255, 255), diff --git a/examples/geometry/volumes/fullConvexityLUT2D.cpp b/examples/geometry/volumes/fullConvexityLUT2D.cpp index 8e177ef605..1f25d054fe 100644 --- a/examples/geometry/volumes/fullConvexityLUT2D.cpp +++ b/examples/geometry/volumes/fullConvexityLUT2D.cpp @@ -167,7 +167,7 @@ displaySimplicityTable( Board2D & board, } -int main( int argc, char** argv ) +int main( ) { DConv dconv( Point::diagonal( -5 ), Point::diagonal( 5 ) ); diff --git a/examples/geometry/volumes/fullConvexityShortestPaths3D.cpp b/examples/geometry/volumes/fullConvexityShortestPaths3D.cpp index 0d84a1bb2e..e36e0f3902 100644 --- a/examples/geometry/volumes/fullConvexityShortestPaths3D.cpp +++ b/examples/geometry/volumes/fullConvexityShortestPaths3D.cpp @@ -89,6 +89,8 @@ typedef Space::Vector Vector; // Called when an user clicks on a surfel. int reaction( void* viewer, DGtal::int32_t name, void* data ) { + ((void) viewer); + DGtal::int32_t* selected = (DGtal::int32_t*) data; *selected = name; std::cout << "Selected surfel=" << *selected << std::endl; @@ -257,16 +259,16 @@ int main( int argc, char** argv ) std::vector< Index > Q; //< the output shortest path while ( ! SP0.finished() && ! SP1.finished() ) { - auto n0 = SP0.current(); - auto n1 = SP1.current(); - auto p0 = std::get<0>( n0 ); - auto p1 = std::get<0>( n1 ); + auto n0_ = SP0.current(); ((void) n0_); + auto n1_ = SP1.current(); + // auto p0_ = std::get<0>( n0_ ); + auto p1_ = std::get<0>( n1_ ); SP0.expand(); SP1.expand(); - if ( SP0.isVisited( p1 ) ) + if ( SP0.isVisited( p1_ ) ) { - auto c0 = SP0.pathToSource( p1 ); - auto c1 = SP1.pathToSource( p1 ); + auto c0 = SP0.pathToSource( p1_ ); + auto c1 = SP1.pathToSource( p1_ ); std::copy(c0.rbegin(), c0.rend(), std::back_inserter(Q)); Q.pop_back(); std::copy(c1.begin(), c1.end(), std::back_inserter(Q)); @@ -302,9 +304,9 @@ int main( int argc, char** argv ) viewerCore.setLineColor( Color::Green ); for ( auto i = 1; i < Q.size(); i++ ) { - Point p1 = TC.point( Q[ i-1 ] ); - Point p2 = TC.point( Q[ i ] ); - viewerCore.addLine( p1, p2, 18.0 ); + Point p1_ = TC.point( Q[ i-1 ] ); + Point p2_ = TC.point( Q[ i ] ); + viewerCore.addLine( p1_, p2_, 18.0 ); } viewerCore << MViewer3D::updateDisplay; application.exec(); @@ -339,9 +341,9 @@ int main( int argc, char** argv ) { for ( auto i = 1; i < path.size(); i++ ) { - Point p1 = TC.point( path[ i-1 ] ); - Point p2 = TC.point( path[ i ] ); - viewerCore.addLine( p1, p2, 18.0 ); + Point p1_ = TC.point( path[ i-1 ] ); + Point p2_ = TC.point( path[ i ] ); + viewerCore.addLine( p1_, p2_, 18.0 ); } trace.info() << "length=" << TC.length( path ) << std::endl; } diff --git a/examples/geometry/volumes/fullConvexitySphereGeodesics.cpp b/examples/geometry/volumes/fullConvexitySphereGeodesics.cpp index d115a3541b..200714495e 100644 --- a/examples/geometry/volumes/fullConvexitySphereGeodesics.cpp +++ b/examples/geometry/volumes/fullConvexitySphereGeodesics.cpp @@ -219,14 +219,14 @@ int main( int argc, char** argv ) } // Extracts shortest paths to a target - typedef TangencyComputer< KSpace >::Index Index; + typedef TangencyComputer< KSpace >::Index tcIndex; trace.beginBlock( "Compute geodesics" ); TangencyComputer< KSpace > TC( K ); TC.init( lattice_points.cbegin(), lattice_points.cend() ); auto SP = TC.makeShortestPaths( opt ); SP.init( lowest ); //< set source double last_distance = 0.0; - Index last = 0; + tcIndex last = 0; while ( ! SP.finished() ) { last = std::get<0>( SP.current() ); @@ -241,7 +241,7 @@ int main( int argc, char** argv ) // Export surface for display std::vector distances = SP.distances(); - for ( Index i = 0; i < distances.size(); i++ ) + for ( tcIndex i = 0; i < distances.size(); i++ ) distances[ i ] *= h; saveToObj( "sphere1-geodesics", smesh, distances, 10, 0.1 ); return 0; diff --git a/examples/geometry/volumes/fullConvexityThinning3D.cpp b/examples/geometry/volumes/fullConvexityThinning3D.cpp index 710d698f4c..d9b9091e6c 100644 --- a/examples/geometry/volumes/fullConvexityThinning3D.cpp +++ b/examples/geometry/volumes/fullConvexityThinning3D.cpp @@ -122,7 +122,7 @@ int main( int argc, char** argv ) { params( "surfaceComponents" , "All" ); auto surface = SH3::makeDigitalSurface( bimage, K, params ); - bool ok = SH3::saveOBJ( surface, "source.obj" ); + SH3::saveOBJ( surface, "source.obj" ); } trace.beginBlock ( "Thinning" ); @@ -137,7 +137,7 @@ int main( int argc, char** argv ) nb_simple = 0; trace.info() << "Pass #S=" << shape_set.size() << " #Q=" << to_process.size() << std::endl; - for ( auto it = to_process.begin(), itE = to_process.end(); it != itE; ++it ) + for ( it = to_process.begin(), itE = to_process.end(); it != itE; ++it ) { Point p = *it; if ( ! image( p ) ) continue; // already removed diff --git a/examples/geometry/volumes/pConvexity-benchmark.cpp b/examples/geometry/volumes/pConvexity-benchmark.cpp index 1044934b3b..79cc0e67a7 100644 --- a/examples/geometry/volumes/pConvexity-benchmark.cpp +++ b/examples/geometry/volumes/pConvexity-benchmark.cpp @@ -388,7 +388,7 @@ void outputResults( Dimension dim, */ -int main( int argc, char* argv[] ) +int main( ) { // P-convexity srand( 0 ); diff --git a/examples/io/viewers/viewer3D-11-extension.cpp b/examples/io/viewers/viewer3D-11-extension.cpp index 2df4c5f37c..1bd1899076 100644 --- a/examples/io/viewers/viewer3D-11-extension.cpp +++ b/examples/io/viewers/viewer3D-11-extension.cpp @@ -87,7 +87,7 @@ struct RandomPointKeyExtension : public Viewer3D::Extension // description in the help window. virtual void init( Viewer & viewer ) { - viewer.setKeyDescription( Qt::ShiftModifier + Qt::Key_R, + viewer.setKeyDescription( (int)Qt::ShiftModifier + (int)Qt::Key_R, "Creates a random digital point." ); } diff --git a/src/Board/CMakeLists.txt b/src/Board/CMakeLists.txt new file mode 100644 index 0000000000..17e956127e --- /dev/null +++ b/src/Board/CMakeLists.txt @@ -0,0 +1,19 @@ +set(BOARD_SRC + Board.cpp + Path.cpp + PSFonts.cpp + Rect.cpp + ShapeList.cpp + Shapes.cpp + Tools.cpp + Transforms.cpp) + +# @TODO : proper parent directory +add_library(DGTAL_LibBoard STATIC ${BOARD_SRC}) + +target_include_directories(DGTAL_LibBoard PUBLIC + $ + $ + # INSTALL_INTERFACE must not contain absolute paths + $ +) diff --git a/src/Board/ModuleSRC.cmake b/src/Board/ModuleSRC.cmake deleted file mode 100644 index 71223e7208..0000000000 --- a/src/Board/ModuleSRC.cmake +++ /dev/null @@ -1,10 +0,0 @@ - -set(BOARD_SRC ${BOARD_SRC} - Board/Board.cpp - Board/Path.cpp - Board/PSFonts.cpp - Board/Rect.cpp - Board/ShapeList.cpp - Board/Shapes.cpp - Board/Tools.cpp - Board/Transforms.cpp) diff --git a/src/Board/Shapes.cpp b/src/Board/Shapes.cpp index b42c442e7e..4c36d9cc12 100644 --- a/src/Board/Shapes.cpp +++ b/src/Board/Shapes.cpp @@ -690,7 +690,7 @@ Image::flushCairo( cairo_t *cr, cairo_surface_t *image; cairo_save (cr); std::string extension = _filename.substr(_filename.find_last_of(".") + 1); - ASSERT(extension=="png"); + assert(extension=="png"); image = cairo_image_surface_create_from_png (_filename.c_str()); assert(cairo_surface_status (image) == CAIRO_STATUS_SUCCESS); w = cairo_image_surface_get_width (image); diff --git a/src/BoostAddons/CMakeLists.txt b/src/BoostAddons/CMakeLists.txt new file mode 100644 index 0000000000..cad801fc39 --- /dev/null +++ b/src/BoostAddons/CMakeLists.txt @@ -0,0 +1,6 @@ +set(BOOSTADDONS_SRC + zlib.cpp) + +# @TODO Link to Boost +add_library(DGTAL_BoostAddons STATIC ${BOOSTADDONS_SRC}) +set_property(TARGET DGTAL_BoostAddons PROPERTY POSITION_INDEPENDENT_CODE ON) \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000..0de2cf4ec4 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,5 @@ +add_subdirectory(Board) +add_subdirectory(BoostAddons) +add_subdirectory(stb) + +add_subdirectory(DGtal) \ No newline at end of file diff --git a/src/DGtal/CMakeLists.txt b/src/DGtal/CMakeLists.txt new file mode 100644 index 0000000000..8c50eb82a8 --- /dev/null +++ b/src/DGtal/CMakeLists.txt @@ -0,0 +1,22 @@ +if (BUILD_SHARED_LIBS) + add_library(DGtal SHARED helpers/StdDefs.cpp) +else() + add_library(DGtal STATIC helpers/StdDefs.cpp) +endif() + +if( CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) + # Add -fPIC + set_target_properties(DGtal PROPERTIES POSITION_INDEPENDENT_CODE ON) +endif() + + +target_include_directories(DGtal PUBLIC + # src/DGtal + $ + # build/src/DGtal + $ + # INSTALL_INTERFACE must not contain absolute paths + $ +) + +target_link_libraries(DGtal PUBLIC DGtal_STB DGTAL_LibBoard DGTAL_BoostAddons) \ No newline at end of file diff --git a/src/DGtal/base/BasicTypes.h b/src/DGtal/base/BasicTypes.h index f27663cf6a..52ea3f9230 100644 --- a/src/DGtal/base/BasicTypes.h +++ b/src/DGtal/base/BasicTypes.h @@ -44,7 +44,7 @@ // Inclusions #include #include -#include +#include #ifdef DGTAL_WITH_GMP #include @@ -56,22 +56,22 @@ namespace DGtal { ///unsigned 8-bit integer. - typedef boost::uint8_t uint8_t; + typedef std::uint8_t uint8_t; ///unsigned 16-bit integer. - typedef boost::uint16_t uint16_t; + typedef std::uint16_t uint16_t; ///unsigned 32-bit integer. - typedef boost::uint32_t uint32_t; + typedef std::uint32_t uint32_t; ///unsigned 64-bit integer. - typedef boost::uint64_t uint64_t; + typedef std::uint64_t uint64_t; ///signed 8-bit integer. - typedef boost::int8_t int8_t; + typedef std::int8_t int8_t; ///signed 16-bit integer. - typedef boost::int16_t int16_t; + typedef std::int16_t int16_t; ///signed 32-bit integer. - typedef boost::int32_t int32_t; + typedef std::int32_t int32_t; ///signed 94-bit integer. - typedef boost::int64_t int64_t; + typedef std::int64_t int64_t; #ifdef DGTAL_WITH_GMP #define WITH_BIGINTEGER diff --git a/src/DGtal/base/Bits.cpp b/src/DGtal/base/Bits.cpp deleted file mode 100644 index b32953a256..0000000000 --- a/src/DGtal/base/Bits.cpp +++ /dev/null @@ -1,502 +0,0 @@ -/** - * This program is free software: 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - **/ - -/** - * @file Bits.cpp - * @author Jacques-Olivier Lachaud (\c jacques-olivier.lachaud@univ-savoie.fr ) - * Laboratory of Mathematics (CNRS, UMR 5807), University of Savoie, France - * - * @date 2009/12/10 - * - * Implementation of methods defined in Bits.h - * - * This file is part of the DGtal library. - */ - -/////////////////////////////////////////////////////////////////////////////// -#include "DGtal/base/Bits.h" -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// class Bits -/////////////////////////////////////////////////////////////////////////////// - -/** DGtal Global variables - * - **/ -namespace DGtal -{ - // Lookup tables for find and count operations. - /** - Lookup table for counting the number of bits set to 1 in a byte. - ( Taken from STL \ ) - */ - const DGtal::uint8_t Bits::myBitCount[] = { - 0, /* 0 */ 1, /* 1 */ 1, /* 2 */ 2, /* 3 */ 1, /* 4 */ - 2, /* 5 */ 2, /* 6 */ 3, /* 7 */ 1, /* 8 */ 2, /* 9 */ - 2, /* 10 */ 3, /* 11 */ 2, /* 12 */ 3, /* 13 */ 3, /* 14 */ - 4, /* 15 */ 1, /* 16 */ 2, /* 17 */ 2, /* 18 */ 3, /* 19 */ - 2, /* 20 */ 3, /* 21 */ 3, /* 22 */ 4, /* 23 */ 2, /* 24 */ - 3, /* 25 */ 3, /* 26 */ 4, /* 27 */ 3, /* 28 */ 4, /* 29 */ - 4, /* 30 */ 5, /* 31 */ 1, /* 32 */ 2, /* 33 */ 2, /* 34 */ - 3, /* 35 */ 2, /* 36 */ 3, /* 37 */ 3, /* 38 */ 4, /* 39 */ - 2, /* 40 */ 3, /* 41 */ 3, /* 42 */ 4, /* 43 */ 3, /* 44 */ - 4, /* 45 */ 4, /* 46 */ 5, /* 47 */ 2, /* 48 */ 3, /* 49 */ - 3, /* 50 */ 4, /* 51 */ 3, /* 52 */ 4, /* 53 */ 4, /* 54 */ - 5, /* 55 */ 3, /* 56 */ 4, /* 57 */ 4, /* 58 */ 5, /* 59 */ - 4, /* 60 */ 5, /* 61 */ 5, /* 62 */ 6, /* 63 */ 1, /* 64 */ - 2, /* 65 */ 2, /* 66 */ 3, /* 67 */ 2, /* 68 */ 3, /* 69 */ - 3, /* 70 */ 4, /* 71 */ 2, /* 72 */ 3, /* 73 */ 3, /* 74 */ - 4, /* 75 */ 3, /* 76 */ 4, /* 77 */ 4, /* 78 */ 5, /* 79 */ - 2, /* 80 */ 3, /* 81 */ 3, /* 82 */ 4, /* 83 */ 3, /* 84 */ - 4, /* 85 */ 4, /* 86 */ 5, /* 87 */ 3, /* 88 */ 4, /* 89 */ - 4, /* 90 */ 5, /* 91 */ 4, /* 92 */ 5, /* 93 */ 5, /* 94 */ - 6, /* 95 */ 2, /* 96 */ 3, /* 97 */ 3, /* 98 */ 4, /* 99 */ - 3, /* 100 */ 4, /* 101 */ 4, /* 102 */ 5, /* 103 */ 3, /* 104 */ - 4, /* 105 */ 4, /* 106 */ 5, /* 107 */ 4, /* 108 */ 5, /* 109 */ - 5, /* 110 */ 6, /* 111 */ 3, /* 112 */ 4, /* 113 */ 4, /* 114 */ - 5, /* 115 */ 4, /* 116 */ 5, /* 117 */ 5, /* 118 */ 6, /* 119 */ - 4, /* 120 */ 5, /* 121 */ 5, /* 122 */ 6, /* 123 */ 5, /* 124 */ - 6, /* 125 */ 6, /* 126 */ 7, /* 127 */ 1, /* 128 */ 2, /* 129 */ - 2, /* 130 */ 3, /* 131 */ 2, /* 132 */ 3, /* 133 */ 3, /* 134 */ - 4, /* 135 */ 2, /* 136 */ 3, /* 137 */ 3, /* 138 */ 4, /* 139 */ - 3, /* 140 */ 4, /* 141 */ 4, /* 142 */ 5, /* 143 */ 2, /* 144 */ - 3, /* 145 */ 3, /* 146 */ 4, /* 147 */ 3, /* 148 */ 4, /* 149 */ - 4, /* 150 */ 5, /* 151 */ 3, /* 152 */ 4, /* 153 */ 4, /* 154 */ - 5, /* 155 */ 4, /* 156 */ 5, /* 157 */ 5, /* 158 */ 6, /* 159 */ - 2, /* 160 */ 3, /* 161 */ 3, /* 162 */ 4, /* 163 */ 3, /* 164 */ - 4, /* 165 */ 4, /* 166 */ 5, /* 167 */ 3, /* 168 */ 4, /* 169 */ - 4, /* 170 */ 5, /* 171 */ 4, /* 172 */ 5, /* 173 */ 5, /* 174 */ - 6, /* 175 */ 3, /* 176 */ 4, /* 177 */ 4, /* 178 */ 5, /* 179 */ - 4, /* 180 */ 5, /* 181 */ 5, /* 182 */ 6, /* 183 */ 4, /* 184 */ - 5, /* 185 */ 5, /* 186 */ 6, /* 187 */ 5, /* 188 */ 6, /* 189 */ - 6, /* 190 */ 7, /* 191 */ 2, /* 192 */ 3, /* 193 */ 3, /* 194 */ - 4, /* 195 */ 3, /* 196 */ 4, /* 197 */ 4, /* 198 */ 5, /* 199 */ - 3, /* 200 */ 4, /* 201 */ 4, /* 202 */ 5, /* 203 */ 4, /* 204 */ - 5, /* 205 */ 5, /* 206 */ 6, /* 207 */ 3, /* 208 */ 4, /* 209 */ - 4, /* 210 */ 5, /* 211 */ 4, /* 212 */ 5, /* 213 */ 5, /* 214 */ - 6, /* 215 */ 4, /* 216 */ 5, /* 217 */ 5, /* 218 */ 6, /* 219 */ - 5, /* 220 */ 6, /* 221 */ 6, /* 222 */ 7, /* 223 */ 3, /* 224 */ - 4, /* 225 */ 4, /* 226 */ 5, /* 227 */ 4, /* 228 */ 5, /* 229 */ - 5, /* 230 */ 6, /* 231 */ 4, /* 232 */ 5, /* 233 */ 5, /* 234 */ - 6, /* 235 */ 5, /* 236 */ 6, /* 237 */ 6, /* 238 */ 7, /* 239 */ - 4, /* 240 */ 5, /* 241 */ 5, /* 242 */ 6, /* 243 */ 5, /* 244 */ - 6, /* 245 */ 6, /* 246 */ 7, /* 247 */ 5, /* 248 */ 6, /* 249 */ - 6, /* 250 */ 7, /* 251 */ 6, /* 252 */ 7, /* 253 */ 7, /* 254 */ - 8 /* 255 */ - }; // end _Bit_count - - /** - * Lookup table for finding the least significant bit. - *

- * NB: Can also be obtained with:

-   * 
- */ - const DGtal::uint8_t Bits::myLSB[] = { - 0, /* 0 */ 0, /* 1 */ 1, /* 2 */ 0, /* 3 */ 2, /* 4 */ - 0, /* 5 */ 1, /* 6 */ 0, /* 7 */ 3, /* 8 */ 0, /* 9 */ - 1, /* 10 */ 0, /* 11 */ 2, /* 12 */ 0, /* 13 */ 1, /* 14 */ - 0, /* 15 */ 4, /* 16 */ 0, /* 17 */ 1, /* 18 */ 0, /* 19 */ - 2, /* 20 */ 0, /* 21 */ 1, /* 22 */ 0, /* 23 */ 3, /* 24 */ - 0, /* 25 */ 1, /* 26 */ 0, /* 27 */ 2, /* 28 */ 0, /* 29 */ - 1, /* 30 */ 0, /* 31 */ 5, /* 32 */ 0, /* 33 */ 1, /* 34 */ - 0, /* 35 */ 2, /* 36 */ 0, /* 37 */ 1, /* 38 */ 0, /* 39 */ - 3, /* 40 */ 0, /* 41 */ 1, /* 42 */ 0, /* 43 */ 2, /* 44 */ - 0, /* 45 */ 1, /* 46 */ 0, /* 47 */ 4, /* 48 */ 0, /* 49 */ - 1, /* 50 */ 0, /* 51 */ 2, /* 52 */ 0, /* 53 */ 1, /* 54 */ - 0, /* 55 */ 3, /* 56 */ 0, /* 57 */ 1, /* 58 */ 0, /* 59 */ - 2, /* 60 */ 0, /* 61 */ 1, /* 62 */ 0, /* 63 */ 6, /* 64 */ - 0, /* 65 */ 1, /* 66 */ 0, /* 67 */ 2, /* 68 */ 0, /* 69 */ - 1, /* 70 */ 0, /* 71 */ 3, /* 72 */ 0, /* 73 */ 1, /* 74 */ - 0, /* 75 */ 2, /* 76 */ 0, /* 77 */ 1, /* 78 */ 0, /* 79 */ - 4, /* 80 */ 0, /* 81 */ 1, /* 82 */ 0, /* 83 */ 2, /* 84 */ - 0, /* 85 */ 1, /* 86 */ 0, /* 87 */ 3, /* 88 */ 0, /* 89 */ - 1, /* 90 */ 0, /* 91 */ 2, /* 92 */ 0, /* 93 */ 1, /* 94 */ - 0, /* 95 */ 5, /* 96 */ 0, /* 97 */ 1, /* 98 */ 0, /* 99 */ - 2, /* 100 */ 0, /* 101 */ 1, /* 102 */ 0, /* 103 */ 3, /* 104 */ - 0, /* 105 */ 1, /* 106 */ 0, /* 107 */ 2, /* 108 */ 0, /* 109 */ - 1, /* 110 */ 0, /* 111 */ 4, /* 112 */ 0, /* 113 */ 1, /* 114 */ - 0, /* 115 */ 2, /* 116 */ 0, /* 117 */ 1, /* 118 */ 0, /* 119 */ - 3, /* 120 */ 0, /* 121 */ 1, /* 122 */ 0, /* 123 */ 2, /* 124 */ - 0, /* 125 */ 1, /* 126 */ 0, /* 127 */ 7, /* 128 */ 0, /* 129 */ - 1, /* 130 */ 0, /* 131 */ 2, /* 132 */ 0, /* 133 */ 1, /* 134 */ - 0, /* 135 */ 3, /* 136 */ 0, /* 137 */ 1, /* 138 */ 0, /* 139 */ - 2, /* 140 */ 0, /* 141 */ 1, /* 142 */ 0, /* 143 */ 4, /* 144 */ - 0, /* 145 */ 1, /* 146 */ 0, /* 147 */ 2, /* 148 */ 0, /* 149 */ - 1, /* 150 */ 0, /* 151 */ 3, /* 152 */ 0, /* 153 */ 1, /* 154 */ - 0, /* 155 */ 2, /* 156 */ 0, /* 157 */ 1, /* 158 */ 0, /* 159 */ - 5, /* 160 */ 0, /* 161 */ 1, /* 162 */ 0, /* 163 */ 2, /* 164 */ - 0, /* 165 */ 1, /* 166 */ 0, /* 167 */ 3, /* 168 */ 0, /* 169 */ - 1, /* 170 */ 0, /* 171 */ 2, /* 172 */ 0, /* 173 */ 1, /* 174 */ - 0, /* 175 */ 4, /* 176 */ 0, /* 177 */ 1, /* 178 */ 0, /* 179 */ - 2, /* 180 */ 0, /* 181 */ 1, /* 182 */ 0, /* 183 */ 3, /* 184 */ - 0, /* 185 */ 1, /* 186 */ 0, /* 187 */ 2, /* 188 */ 0, /* 189 */ - 1, /* 190 */ 0, /* 191 */ 6, /* 192 */ 0, /* 193 */ 1, /* 194 */ - 0, /* 195 */ 2, /* 196 */ 0, /* 197 */ 1, /* 198 */ 0, /* 199 */ - 3, /* 200 */ 0, /* 201 */ 1, /* 202 */ 0, /* 203 */ 2, /* 204 */ - 0, /* 205 */ 1, /* 206 */ 0, /* 207 */ 4, /* 208 */ 0, /* 209 */ - 1, /* 210 */ 0, /* 211 */ 2, /* 212 */ 0, /* 213 */ 1, /* 214 */ - 0, /* 215 */ 3, /* 216 */ 0, /* 217 */ 1, /* 218 */ 0, /* 219 */ - 2, /* 220 */ 0, /* 221 */ 1, /* 222 */ 0, /* 223 */ 5, /* 224 */ - 0, /* 225 */ 1, /* 226 */ 0, /* 227 */ 2, /* 228 */ 0, /* 229 */ - 1, /* 230 */ 0, /* 231 */ 3, /* 232 */ 0, /* 233 */ 1, /* 234 */ - 0, /* 235 */ 2, /* 236 */ 0, /* 237 */ 1, /* 238 */ 0, /* 239 */ - 4, /* 240 */ 0, /* 241 */ 1, /* 242 */ 0, /* 243 */ 2, /* 244 */ - 0, /* 245 */ 1, /* 246 */ 0, /* 247 */ 3, /* 248 */ 0, /* 249 */ - 1, /* 250 */ 0, /* 251 */ 2, /* 252 */ 0, /* 253 */ 1, /* 254 */ - 0, /* 255 */ - }; // end _First_one - - -/** - * Lookup table for finding the least significant bit. - *

- * NB: Can also be obtained with:

-   * 
- */ - const DGtal::uint8_t Bits::myMSB[] = { -0 /* 0*/ , -0 /* 1*/ ,1 /* 2*/ ,1 /* 3*/ ,2 /* 4*/ ,2 /* 5*/ , -2 /* 6*/ ,2 /* 7*/ ,3 /* 8*/ ,3 /* 9*/ ,3 /* 10*/ , -3 /* 11*/ ,3 /* 12*/ ,3 /* 13*/ ,3 /* 14*/ ,3 /* 15*/ , -4 /* 16*/ ,4 /* 17*/ ,4 /* 18*/ ,4 /* 19*/ ,4 /* 20*/ , -4 /* 21*/ ,4 /* 22*/ ,4 /* 23*/ ,4 /* 24*/ ,4 /* 25*/ , -4 /* 26*/ ,4 /* 27*/ ,4 /* 28*/ ,4 /* 29*/ ,4 /* 30*/ , -4 /* 31*/ ,5 /* 32*/ ,5 /* 33*/ ,5 /* 34*/ ,5 /* 35*/ , -5 /* 36*/ ,5 /* 37*/ ,5 /* 38*/ ,5 /* 39*/ ,5 /* 40*/ , -5 /* 41*/ ,5 /* 42*/ ,5 /* 43*/ ,5 /* 44*/ ,5 /* 45*/ , -5 /* 46*/ ,5 /* 47*/ ,5 /* 48*/ ,5 /* 49*/ ,5 /* 50*/ , -5 /* 51*/ ,5 /* 52*/ ,5 /* 53*/ ,5 /* 54*/ ,5 /* 55*/ , -5 /* 56*/ ,5 /* 57*/ ,5 /* 58*/ ,5 /* 59*/ ,5 /* 60*/ , -5 /* 61*/ ,5 /* 62*/ ,5 /* 63*/ ,6 /* 64*/ ,6 /* 65*/ , -6 /* 66*/ ,6 /* 67*/ ,6 /* 68*/ ,6 /* 69*/ ,6 /* 70*/ , -6 /* 71*/ ,6 /* 72*/ ,6 /* 73*/ ,6 /* 74*/ ,6 /* 75*/ , -6 /* 76*/ ,6 /* 77*/ ,6 /* 78*/ ,6 /* 79*/ ,6 /* 80*/ , -6 /* 81*/ ,6 /* 82*/ ,6 /* 83*/ ,6 /* 84*/ ,6 /* 85*/ , -6 /* 86*/ ,6 /* 87*/ ,6 /* 88*/ ,6 /* 89*/ ,6 /* 90*/ , -6 /* 91*/ ,6 /* 92*/ ,6 /* 93*/ ,6 /* 94*/ ,6 /* 95*/ , -6 /* 96*/ ,6 /* 97*/ ,6 /* 98*/ ,6 /* 99*/ ,6 /* 100*/ , -6 /* 101*/ ,6 /* 102*/ ,6 /* 103*/ ,6 /* 104*/ ,6 /* 105*/ , -6 /* 106*/ ,6 /* 107*/ ,6 /* 108*/ ,6 /* 109*/ ,6 /* 110*/ , -6 /* 111*/ ,6 /* 112*/ ,6 /* 113*/ ,6 /* 114*/ ,6 /* 115*/ , -6 /* 116*/ ,6 /* 117*/ ,6 /* 118*/ ,6 /* 119*/ ,6 /* 120*/ , -6 /* 121*/ ,6 /* 122*/ ,6 /* 123*/ ,6 /* 124*/ ,6 /* 125*/ , -6 /* 126*/ ,6 /* 127*/ ,7 /* 128*/ ,7 /* 129*/ ,7 /* 130*/ , -7 /* 131*/ ,7 /* 132*/ ,7 /* 133*/ ,7 /* 134*/ ,7 /* 135*/ , -7 /* 136*/ ,7 /* 137*/ ,7 /* 138*/ ,7 /* 139*/ ,7 /* 140*/ , -7 /* 141*/ ,7 /* 142*/ ,7 /* 143*/ ,7 /* 144*/ ,7 /* 145*/ , -7 /* 146*/ ,7 /* 147*/ ,7 /* 148*/ ,7 /* 149*/ ,7 /* 150*/ , -7 /* 151*/ ,7 /* 152*/ ,7 /* 153*/ ,7 /* 154*/ ,7 /* 155*/ , -7 /* 156*/ ,7 /* 157*/ ,7 /* 158*/ ,7 /* 159*/ ,7 /* 160*/ , -7 /* 161*/ ,7 /* 162*/ ,7 /* 163*/ ,7 /* 164*/ ,7 /* 165*/ , -7 /* 166*/ ,7 /* 167*/ ,7 /* 168*/ ,7 /* 169*/ ,7 /* 170*/ , -7 /* 171*/ ,7 /* 172*/ ,7 /* 173*/ ,7 /* 174*/ ,7 /* 175*/ , -7 /* 176*/ ,7 /* 177*/ ,7 /* 178*/ ,7 /* 179*/ ,7 /* 180*/ , -7 /* 181*/ ,7 /* 182*/ ,7 /* 183*/ ,7 /* 184*/ ,7 /* 185*/ , -7 /* 186*/ ,7 /* 187*/ ,7 /* 188*/ ,7 /* 189*/ ,7 /* 190*/ , -7 /* 191*/ ,7 /* 192*/ ,7 /* 193*/ ,7 /* 194*/ ,7 /* 195*/ , -7 /* 196*/ ,7 /* 197*/ ,7 /* 198*/ ,7 /* 199*/ ,7 /* 200*/ , -7 /* 201*/ ,7 /* 202*/ ,7 /* 203*/ ,7 /* 204*/ ,7 /* 205*/ , -7 /* 206*/ ,7 /* 207*/ ,7 /* 208*/ ,7 /* 209*/ ,7 /* 210*/ , -7 /* 211*/ ,7 /* 212*/ ,7 /* 213*/ ,7 /* 214*/ ,7 /* 215*/ , -7 /* 216*/ ,7 /* 217*/ ,7 /* 218*/ ,7 /* 219*/ ,7 /* 220*/ , -7 /* 221*/ ,7 /* 222*/ ,7 /* 223*/ ,7 /* 224*/ ,7 /* 225*/ , -7 /* 226*/ ,7 /* 227*/ ,7 /* 228*/ ,7 /* 229*/ ,7 /* 230*/ , -7 /* 231*/ ,7 /* 232*/ ,7 /* 233*/ ,7 /* 234*/ ,7 /* 235*/ , -7 /* 236*/ ,7 /* 237*/ ,7 /* 238*/ ,7 /* 239*/ ,7 /* 240*/ , -7 /* 241*/ ,7 /* 242*/ ,7 /* 243*/ ,7 /* 244*/ ,7 /* 245*/ , -7 /* 246*/ ,7 /* 247*/ ,7 /* 248*/ ,7 /* 249*/ ,7 /* 250*/ , -7 /* 251*/ ,7 /* 252*/ ,7 /* 253*/ ,7 /* 254*/ ,7 /* 255*/ }; // end _First_one - - /** - Usage: myIndexInSetBits[ b ][ n ] - - \a b in 0..7 - - \a n in 0..255 - Set bits are numbered from 1 to x when reading the word from the - least significant to the most significant bit. This number is the - index of bit \a b in the number \a n. - return this index or 0 if the bit is not set. - */ - const DGtal::uint8_t Bits::myIndexInSetBits[ 8 ][ 256 ] = { - // Table for bit 0. - { 0 /*0*/, 1 /*1*/, 0 /*2*/, 1 /*3*/, 0 /*4*/, 1 /*5*/, 0 /*6*/, 1 /*7*/, - 0 /*8*/, 1 /*9*/, 0 /*10*/, 1 /*11*/, 0 /*12*/, 1 /*13*/, 0 /*14*/, 1 /*15*/, - 0 /*16*/, 1 /*17*/, 0 /*18*/, 1 /*19*/, 0 /*20*/, 1 /*21*/, 0 /*22*/, 1 /*23*/, - 0 /*24*/, 1 /*25*/, 0 /*26*/, 1 /*27*/, 0 /*28*/, 1 /*29*/, 0 /*30*/, 1 /*31*/, - 0 /*32*/, 1 /*33*/, 0 /*34*/, 1 /*35*/, 0 /*36*/, 1 /*37*/, 0 /*38*/, 1 /*39*/, - 0 /*40*/, 1 /*41*/, 0 /*42*/, 1 /*43*/, 0 /*44*/, 1 /*45*/, 0 /*46*/, 1 /*47*/, - 0 /*48*/, 1 /*49*/, 0 /*50*/, 1 /*51*/, 0 /*52*/, 1 /*53*/, 0 /*54*/, 1 /*55*/, - 0 /*56*/, 1 /*57*/, 0 /*58*/, 1 /*59*/, 0 /*60*/, 1 /*61*/, 0 /*62*/, 1 /*63*/, - 0 /*64*/, 1 /*65*/, 0 /*66*/, 1 /*67*/, 0 /*68*/, 1 /*69*/, 0 /*70*/, 1 /*71*/, - 0 /*72*/, 1 /*73*/, 0 /*74*/, 1 /*75*/, 0 /*76*/, 1 /*77*/, 0 /*78*/, 1 /*79*/, - 0 /*80*/, 1 /*81*/, 0 /*82*/, 1 /*83*/, 0 /*84*/, 1 /*85*/, 0 /*86*/, 1 /*87*/, - 0 /*88*/, 1 /*89*/, 0 /*90*/, 1 /*91*/, 0 /*92*/, 1 /*93*/, 0 /*94*/, 1 /*95*/, - 0 /*96*/, 1 /*97*/, 0 /*98*/, 1 /*99*/, 0 /*100*/, 1 /*101*/, 0 /*102*/, 1 /*103*/, - 0 /*104*/, 1 /*105*/, 0 /*106*/, 1 /*107*/, 0 /*108*/, 1 /*109*/, 0 /*110*/, 1 /*111*/, - 0 /*112*/, 1 /*113*/, 0 /*114*/, 1 /*115*/, 0 /*116*/, 1 /*117*/, 0 /*118*/, 1 /*119*/, - 0 /*120*/, 1 /*121*/, 0 /*122*/, 1 /*123*/, 0 /*124*/, 1 /*125*/, 0 /*126*/, 1 /*127*/, - 0 /*128*/, 1 /*129*/, 0 /*130*/, 1 /*131*/, 0 /*132*/, 1 /*133*/, 0 /*134*/, 1 /*135*/, - 0 /*136*/, 1 /*137*/, 0 /*138*/, 1 /*139*/, 0 /*140*/, 1 /*141*/, 0 /*142*/, 1 /*143*/, - 0 /*144*/, 1 /*145*/, 0 /*146*/, 1 /*147*/, 0 /*148*/, 1 /*149*/, 0 /*150*/, 1 /*151*/, - 0 /*152*/, 1 /*153*/, 0 /*154*/, 1 /*155*/, 0 /*156*/, 1 /*157*/, 0 /*158*/, 1 /*159*/, - 0 /*160*/, 1 /*161*/, 0 /*162*/, 1 /*163*/, 0 /*164*/, 1 /*165*/, 0 /*166*/, 1 /*167*/, - 0 /*168*/, 1 /*169*/, 0 /*170*/, 1 /*171*/, 0 /*172*/, 1 /*173*/, 0 /*174*/, 1 /*175*/, - 0 /*176*/, 1 /*177*/, 0 /*178*/, 1 /*179*/, 0 /*180*/, 1 /*181*/, 0 /*182*/, 1 /*183*/, - 0 /*184*/, 1 /*185*/, 0 /*186*/, 1 /*187*/, 0 /*188*/, 1 /*189*/, 0 /*190*/, 1 /*191*/, - 0 /*192*/, 1 /*193*/, 0 /*194*/, 1 /*195*/, 0 /*196*/, 1 /*197*/, 0 /*198*/, 1 /*199*/, - 0 /*200*/, 1 /*201*/, 0 /*202*/, 1 /*203*/, 0 /*204*/, 1 /*205*/, 0 /*206*/, 1 /*207*/, - 0 /*208*/, 1 /*209*/, 0 /*210*/, 1 /*211*/, 0 /*212*/, 1 /*213*/, 0 /*214*/, 1 /*215*/, - 0 /*216*/, 1 /*217*/, 0 /*218*/, 1 /*219*/, 0 /*220*/, 1 /*221*/, 0 /*222*/, 1 /*223*/, - 0 /*224*/, 1 /*225*/, 0 /*226*/, 1 /*227*/, 0 /*228*/, 1 /*229*/, 0 /*230*/, 1 /*231*/, - 0 /*232*/, 1 /*233*/, 0 /*234*/, 1 /*235*/, 0 /*236*/, 1 /*237*/, 0 /*238*/, 1 /*239*/, - 0 /*240*/, 1 /*241*/, 0 /*242*/, 1 /*243*/, 0 /*244*/, 1 /*245*/, 0 /*246*/, 1 /*247*/, - 0 /*248*/, 1 /*249*/, 0 /*250*/, 1 /*251*/, 0 /*252*/, 1 /*253*/, 0 /*254*/, 1 /*255*/ }, - // Table for bit 1. - { 0 /*0*/, 0 /*1*/, 1 /*2*/, 2 /*3*/, 0 /*4*/, 0 /*5*/, 1 /*6*/, 2 /*7*/, - 0 /*8*/, 0 /*9*/, 1 /*10*/, 2 /*11*/, 0 /*12*/, 0 /*13*/, 1 /*14*/, 2 /*15*/, - 0 /*16*/, 0 /*17*/, 1 /*18*/, 2 /*19*/, 0 /*20*/, 0 /*21*/, 1 /*22*/, 2 /*23*/, - 0 /*24*/, 0 /*25*/, 1 /*26*/, 2 /*27*/, 0 /*28*/, 0 /*29*/, 1 /*30*/, 2 /*31*/, - 0 /*32*/, 0 /*33*/, 1 /*34*/, 2 /*35*/, 0 /*36*/, 0 /*37*/, 1 /*38*/, 2 /*39*/, - 0 /*40*/, 0 /*41*/, 1 /*42*/, 2 /*43*/, 0 /*44*/, 0 /*45*/, 1 /*46*/, 2 /*47*/, - 0 /*48*/, 0 /*49*/, 1 /*50*/, 2 /*51*/, 0 /*52*/, 0 /*53*/, 1 /*54*/, 2 /*55*/, - 0 /*56*/, 0 /*57*/, 1 /*58*/, 2 /*59*/, 0 /*60*/, 0 /*61*/, 1 /*62*/, 2 /*63*/, - 0 /*64*/, 0 /*65*/, 1 /*66*/, 2 /*67*/, 0 /*68*/, 0 /*69*/, 1 /*70*/, 2 /*71*/, - 0 /*72*/, 0 /*73*/, 1 /*74*/, 2 /*75*/, 0 /*76*/, 0 /*77*/, 1 /*78*/, 2 /*79*/, - 0 /*80*/, 0 /*81*/, 1 /*82*/, 2 /*83*/, 0 /*84*/, 0 /*85*/, 1 /*86*/, 2 /*87*/, - 0 /*88*/, 0 /*89*/, 1 /*90*/, 2 /*91*/, 0 /*92*/, 0 /*93*/, 1 /*94*/, 2 /*95*/, - 0 /*96*/, 0 /*97*/, 1 /*98*/, 2 /*99*/, 0 /*100*/, 0 /*101*/, 1 /*102*/, 2 /*103*/, - 0 /*104*/, 0 /*105*/, 1 /*106*/, 2 /*107*/, 0 /*108*/, 0 /*109*/, 1 /*110*/, 2 /*111*/, - 0 /*112*/, 0 /*113*/, 1 /*114*/, 2 /*115*/, 0 /*116*/, 0 /*117*/, 1 /*118*/, 2 /*119*/, - 0 /*120*/, 0 /*121*/, 1 /*122*/, 2 /*123*/, 0 /*124*/, 0 /*125*/, 1 /*126*/, 2 /*127*/, - 0 /*128*/, 0 /*129*/, 1 /*130*/, 2 /*131*/, 0 /*132*/, 0 /*133*/, 1 /*134*/, 2 /*135*/, - 0 /*136*/, 0 /*137*/, 1 /*138*/, 2 /*139*/, 0 /*140*/, 0 /*141*/, 1 /*142*/, 2 /*143*/, - 0 /*144*/, 0 /*145*/, 1 /*146*/, 2 /*147*/, 0 /*148*/, 0 /*149*/, 1 /*150*/, 2 /*151*/, - 0 /*152*/, 0 /*153*/, 1 /*154*/, 2 /*155*/, 0 /*156*/, 0 /*157*/, 1 /*158*/, 2 /*159*/, - 0 /*160*/, 0 /*161*/, 1 /*162*/, 2 /*163*/, 0 /*164*/, 0 /*165*/, 1 /*166*/, 2 /*167*/, - 0 /*168*/, 0 /*169*/, 1 /*170*/, 2 /*171*/, 0 /*172*/, 0 /*173*/, 1 /*174*/, 2 /*175*/, - 0 /*176*/, 0 /*177*/, 1 /*178*/, 2 /*179*/, 0 /*180*/, 0 /*181*/, 1 /*182*/, 2 /*183*/, - 0 /*184*/, 0 /*185*/, 1 /*186*/, 2 /*187*/, 0 /*188*/, 0 /*189*/, 1 /*190*/, 2 /*191*/, - 0 /*192*/, 0 /*193*/, 1 /*194*/, 2 /*195*/, 0 /*196*/, 0 /*197*/, 1 /*198*/, 2 /*199*/, - 0 /*200*/, 0 /*201*/, 1 /*202*/, 2 /*203*/, 0 /*204*/, 0 /*205*/, 1 /*206*/, 2 /*207*/, - 0 /*208*/, 0 /*209*/, 1 /*210*/, 2 /*211*/, 0 /*212*/, 0 /*213*/, 1 /*214*/, 2 /*215*/, - 0 /*216*/, 0 /*217*/, 1 /*218*/, 2 /*219*/, 0 /*220*/, 0 /*221*/, 1 /*222*/, 2 /*223*/, - 0 /*224*/, 0 /*225*/, 1 /*226*/, 2 /*227*/, 0 /*228*/, 0 /*229*/, 1 /*230*/, 2 /*231*/, - 0 /*232*/, 0 /*233*/, 1 /*234*/, 2 /*235*/, 0 /*236*/, 0 /*237*/, 1 /*238*/, 2 /*239*/, - 0 /*240*/, 0 /*241*/, 1 /*242*/, 2 /*243*/, 0 /*244*/, 0 /*245*/, 1 /*246*/, 2 /*247*/, - 0 /*248*/, 0 /*249*/, 1 /*250*/, 2 /*251*/, 0 /*252*/, 0 /*253*/, 1 /*254*/, 2 /*255*/}, - // Table for bit 2. - { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 1 /*4*/, 2 /*5*/, 2 /*6*/, 3 /*7*/, - 0 /*8*/, 0 /*9*/, 0 /*10*/, 0 /*11*/, 1 /*12*/, 2 /*13*/, 2 /*14*/, 3 /*15*/, - 0 /*16*/, 0 /*17*/, 0 /*18*/, 0 /*19*/, 1 /*20*/, 2 /*21*/, 2 /*22*/, 3 /*23*/, - 0 /*24*/, 0 /*25*/, 0 /*26*/, 0 /*27*/, 1 /*28*/, 2 /*29*/, 2 /*30*/, 3 /*31*/, - 0 /*32*/, 0 /*33*/, 0 /*34*/, 0 /*35*/, 1 /*36*/, 2 /*37*/, 2 /*38*/, 3 /*39*/, - 0 /*40*/, 0 /*41*/, 0 /*42*/, 0 /*43*/, 1 /*44*/, 2 /*45*/, 2 /*46*/, 3 /*47*/, - 0 /*48*/, 0 /*49*/, 0 /*50*/, 0 /*51*/, 1 /*52*/, 2 /*53*/, 2 /*54*/, 3 /*55*/, - 0 /*56*/, 0 /*57*/, 0 /*58*/, 0 /*59*/, 1 /*60*/, 2 /*61*/, 2 /*62*/, 3 /*63*/, - 0 /*64*/, 0 /*65*/, 0 /*66*/, 0 /*67*/, 1 /*68*/, 2 /*69*/, 2 /*70*/, 3 /*71*/, - 0 /*72*/, 0 /*73*/, 0 /*74*/, 0 /*75*/, 1 /*76*/, 2 /*77*/, 2 /*78*/, 3 /*79*/, - 0 /*80*/, 0 /*81*/, 0 /*82*/, 0 /*83*/, 1 /*84*/, 2 /*85*/, 2 /*86*/, 3 /*87*/, - 0 /*88*/, 0 /*89*/, 0 /*90*/, 0 /*91*/, 1 /*92*/, 2 /*93*/, 2 /*94*/, 3 /*95*/, - 0 /*96*/, 0 /*97*/, 0 /*98*/, 0 /*99*/, 1 /*100*/, 2 /*101*/, 2 /*102*/, 3 /*103*/, - 0 /*104*/, 0 /*105*/, 0 /*106*/, 0 /*107*/, 1 /*108*/, 2 /*109*/, 2 /*110*/, 3 /*111*/, - 0 /*112*/, 0 /*113*/, 0 /*114*/, 0 /*115*/, 1 /*116*/, 2 /*117*/, 2 /*118*/, 3 /*119*/, - 0 /*120*/, 0 /*121*/, 0 /*122*/, 0 /*123*/, 1 /*124*/, 2 /*125*/, 2 /*126*/, 3 /*127*/, - 0 /*128*/, 0 /*129*/, 0 /*130*/, 0 /*131*/, 1 /*132*/, 2 /*133*/, 2 /*134*/, 3 /*135*/, - 0 /*136*/, 0 /*137*/, 0 /*138*/, 0 /*139*/, 1 /*140*/, 2 /*141*/, 2 /*142*/, 3 /*143*/, - 0 /*144*/, 0 /*145*/, 0 /*146*/, 0 /*147*/, 1 /*148*/, 2 /*149*/, 2 /*150*/, 3 /*151*/, - 0 /*152*/, 0 /*153*/, 0 /*154*/, 0 /*155*/, 1 /*156*/, 2 /*157*/, 2 /*158*/, 3 /*159*/, - 0 /*160*/, 0 /*161*/, 0 /*162*/, 0 /*163*/, 1 /*164*/, 2 /*165*/, 2 /*166*/, 3 /*167*/, - 0 /*168*/, 0 /*169*/, 0 /*170*/, 0 /*171*/, 1 /*172*/, 2 /*173*/, 2 /*174*/, 3 /*175*/, - 0 /*176*/, 0 /*177*/, 0 /*178*/, 0 /*179*/, 1 /*180*/, 2 /*181*/, 2 /*182*/, 3 /*183*/, - 0 /*184*/, 0 /*185*/, 0 /*186*/, 0 /*187*/, 1 /*188*/, 2 /*189*/, 2 /*190*/, 3 /*191*/, - 0 /*192*/, 0 /*193*/, 0 /*194*/, 0 /*195*/, 1 /*196*/, 2 /*197*/, 2 /*198*/, 3 /*199*/, - 0 /*200*/, 0 /*201*/, 0 /*202*/, 0 /*203*/, 1 /*204*/, 2 /*205*/, 2 /*206*/, 3 /*207*/, - 0 /*208*/, 0 /*209*/, 0 /*210*/, 0 /*211*/, 1 /*212*/, 2 /*213*/, 2 /*214*/, 3 /*215*/, - 0 /*216*/, 0 /*217*/, 0 /*218*/, 0 /*219*/, 1 /*220*/, 2 /*221*/, 2 /*222*/, 3 /*223*/, - 0 /*224*/, 0 /*225*/, 0 /*226*/, 0 /*227*/, 1 /*228*/, 2 /*229*/, 2 /*230*/, 3 /*231*/, - 0 /*232*/, 0 /*233*/, 0 /*234*/, 0 /*235*/, 1 /*236*/, 2 /*237*/, 2 /*238*/, 3 /*239*/, - 0 /*240*/, 0 /*241*/, 0 /*242*/, 0 /*243*/, 1 /*244*/, 2 /*245*/, 2 /*246*/, 3 /*247*/, - 0 /*248*/, 0 /*249*/, 0 /*250*/, 0 /*251*/, 1 /*252*/, 2 /*253*/, 2 /*254*/, 3 /*255*/}, - // Table for bit 3. - { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 0 /*4*/, 0 /*5*/, 0 /*6*/, 0 /*7*/, - 1 /*8*/, 2 /*9*/, 2 /*10*/, 3 /*11*/, 2 /*12*/, 3 /*13*/, 3 /*14*/, 4 /*15*/, - 0 /*16*/, 0 /*17*/, 0 /*18*/, 0 /*19*/, 0 /*20*/, 0 /*21*/, 0 /*22*/, 0 /*23*/, - 1 /*24*/, 2 /*25*/, 2 /*26*/, 3 /*27*/, 2 /*28*/, 3 /*29*/, 3 /*30*/, 4 /*31*/, - 0 /*32*/, 0 /*33*/, 0 /*34*/, 0 /*35*/, 0 /*36*/, 0 /*37*/, 0 /*38*/, 0 /*39*/, - 1 /*40*/, 2 /*41*/, 2 /*42*/, 3 /*43*/, 2 /*44*/, 3 /*45*/, 3 /*46*/, 4 /*47*/, - 0 /*48*/, 0 /*49*/, 0 /*50*/, 0 /*51*/, 0 /*52*/, 0 /*53*/, 0 /*54*/, 0 /*55*/, - 1 /*56*/, 2 /*57*/, 2 /*58*/, 3 /*59*/, 2 /*60*/, 3 /*61*/, 3 /*62*/, 4 /*63*/, - 0 /*64*/, 0 /*65*/, 0 /*66*/, 0 /*67*/, 0 /*68*/, 0 /*69*/, 0 /*70*/, 0 /*71*/, - 1 /*72*/, 2 /*73*/, 2 /*74*/, 3 /*75*/, 2 /*76*/, 3 /*77*/, 3 /*78*/, 4 /*79*/, - 0 /*80*/, 0 /*81*/, 0 /*82*/, 0 /*83*/, 0 /*84*/, 0 /*85*/, 0 /*86*/, 0 /*87*/, - 1 /*88*/, 2 /*89*/, 2 /*90*/, 3 /*91*/, 2 /*92*/, 3 /*93*/, 3 /*94*/, 4 /*95*/, - 0 /*96*/, 0 /*97*/, 0 /*98*/, 0 /*99*/, 0 /*100*/, 0 /*101*/, 0 /*102*/, 0 /*103*/, - 1 /*104*/, 2 /*105*/, 2 /*106*/, 3 /*107*/, 2 /*108*/, 3 /*109*/, 3 /*110*/, 4 /*111*/, - 0 /*112*/, 0 /*113*/, 0 /*114*/, 0 /*115*/, 0 /*116*/, 0 /*117*/, 0 /*118*/, 0 /*119*/, - 1 /*120*/, 2 /*121*/, 2 /*122*/, 3 /*123*/, 2 /*124*/, 3 /*125*/, 3 /*126*/, 4 /*127*/, - 0 /*128*/, 0 /*129*/, 0 /*130*/, 0 /*131*/, 0 /*132*/, 0 /*133*/, 0 /*134*/, 0 /*135*/, - 1 /*136*/, 2 /*137*/, 2 /*138*/, 3 /*139*/, 2 /*140*/, 3 /*141*/, 3 /*142*/, 4 /*143*/, - 0 /*144*/, 0 /*145*/, 0 /*146*/, 0 /*147*/, 0 /*148*/, 0 /*149*/, 0 /*150*/, 0 /*151*/, - 1 /*152*/, 2 /*153*/, 2 /*154*/, 3 /*155*/, 2 /*156*/, 3 /*157*/, 3 /*158*/, 4 /*159*/, - 0 /*160*/, 0 /*161*/, 0 /*162*/, 0 /*163*/, 0 /*164*/, 0 /*165*/, 0 /*166*/, 0 /*167*/, - 1 /*168*/, 2 /*169*/, 2 /*170*/, 3 /*171*/, 2 /*172*/, 3 /*173*/, 3 /*174*/, 4 /*175*/, - 0 /*176*/, 0 /*177*/, 0 /*178*/, 0 /*179*/, 0 /*180*/, 0 /*181*/, 0 /*182*/, 0 /*183*/, - 1 /*184*/, 2 /*185*/, 2 /*186*/, 3 /*187*/, 2 /*188*/, 3 /*189*/, 3 /*190*/, 4 /*191*/, - 0 /*192*/, 0 /*193*/, 0 /*194*/, 0 /*195*/, 0 /*196*/, 0 /*197*/, 0 /*198*/, 0 /*199*/, - 1 /*200*/, 2 /*201*/, 2 /*202*/, 3 /*203*/, 2 /*204*/, 3 /*205*/, 3 /*206*/, 4 /*207*/, - 0 /*208*/, 0 /*209*/, 0 /*210*/, 0 /*211*/, 0 /*212*/, 0 /*213*/, 0 /*214*/, 0 /*215*/, - 1 /*216*/, 2 /*217*/, 2 /*218*/, 3 /*219*/, 2 /*220*/, 3 /*221*/, 3 /*222*/, 4 /*223*/, - 0 /*224*/, 0 /*225*/, 0 /*226*/, 0 /*227*/, 0 /*228*/, 0 /*229*/, 0 /*230*/, 0 /*231*/, - 1 /*232*/, 2 /*233*/, 2 /*234*/, 3 /*235*/, 2 /*236*/, 3 /*237*/, 3 /*238*/, 4 /*239*/, - 0 /*240*/, 0 /*241*/, 0 /*242*/, 0 /*243*/, 0 /*244*/, 0 /*245*/, 0 /*246*/, 0 /*247*/, - 1 /*248*/, 2 /*249*/, 2 /*250*/, 3 /*251*/, 2 /*252*/, 3 /*253*/, 3 /*254*/, 4 /*255*/}, - // Table for bit 4. - { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 0 /*4*/, 0 /*5*/, 0 /*6*/, 0 /*7*/, - 0 /*8*/, 0 /*9*/, 0 /*10*/, 0 /*11*/, 0 /*12*/, 0 /*13*/, 0 /*14*/, 0 /*15*/, - 1 /*16*/, 2 /*17*/, 2 /*18*/, 3 /*19*/, 2 /*20*/, 3 /*21*/, 3 /*22*/, 4 /*23*/, - 2 /*24*/, 3 /*25*/, 3 /*26*/, 4 /*27*/, 3 /*28*/, 4 /*29*/, 4 /*30*/, 5 /*31*/, - 0 /*32*/, 0 /*33*/, 0 /*34*/, 0 /*35*/, 0 /*36*/, 0 /*37*/, 0 /*38*/, 0 /*39*/, - 0 /*40*/, 0 /*41*/, 0 /*42*/, 0 /*43*/, 0 /*44*/, 0 /*45*/, 0 /*46*/, 0 /*47*/, - 1 /*48*/, 2 /*49*/, 2 /*50*/, 3 /*51*/, 2 /*52*/, 3 /*53*/, 3 /*54*/, 4 /*55*/, - 2 /*56*/, 3 /*57*/, 3 /*58*/, 4 /*59*/, 3 /*60*/, 4 /*61*/, 4 /*62*/, 5 /*63*/, - 0 /*64*/, 0 /*65*/, 0 /*66*/, 0 /*67*/, 0 /*68*/, 0 /*69*/, 0 /*70*/, 0 /*71*/, - 0 /*72*/, 0 /*73*/, 0 /*74*/, 0 /*75*/, 0 /*76*/, 0 /*77*/, 0 /*78*/, 0 /*79*/, - 1 /*80*/, 2 /*81*/, 2 /*82*/, 3 /*83*/, 2 /*84*/, 3 /*85*/, 3 /*86*/, 4 /*87*/, - 2 /*88*/, 3 /*89*/, 3 /*90*/, 4 /*91*/, 3 /*92*/, 4 /*93*/, 4 /*94*/, 5 /*95*/, - 0 /*96*/, 0 /*97*/, 0 /*98*/, 0 /*99*/, 0 /*100*/, 0 /*101*/, 0 /*102*/, 0 /*103*/, - 0 /*104*/, 0 /*105*/, 0 /*106*/, 0 /*107*/, 0 /*108*/, 0 /*109*/, 0 /*110*/, 0 /*111*/, - 1 /*112*/, 2 /*113*/, 2 /*114*/, 3 /*115*/, 2 /*116*/, 3 /*117*/, 3 /*118*/, 4 /*119*/, - 2 /*120*/, 3 /*121*/, 3 /*122*/, 4 /*123*/, 3 /*124*/, 4 /*125*/, 4 /*126*/, 5 /*127*/, - 0 /*128*/, 0 /*129*/, 0 /*130*/, 0 /*131*/, 0 /*132*/, 0 /*133*/, 0 /*134*/, 0 /*135*/, - 0 /*136*/, 0 /*137*/, 0 /*138*/, 0 /*139*/, 0 /*140*/, 0 /*141*/, 0 /*142*/, 0 /*143*/, - 1 /*144*/, 2 /*145*/, 2 /*146*/, 3 /*147*/, 2 /*148*/, 3 /*149*/, 3 /*150*/, 4 /*151*/, - 2 /*152*/, 3 /*153*/, 3 /*154*/, 4 /*155*/, 3 /*156*/, 4 /*157*/, 4 /*158*/, 5 /*159*/, - 0 /*160*/, 0 /*161*/, 0 /*162*/, 0 /*163*/, 0 /*164*/, 0 /*165*/, 0 /*166*/, 0 /*167*/, - 0 /*168*/, 0 /*169*/, 0 /*170*/, 0 /*171*/, 0 /*172*/, 0 /*173*/, 0 /*174*/, 0 /*175*/, - 1 /*176*/, 2 /*177*/, 2 /*178*/, 3 /*179*/, 2 /*180*/, 3 /*181*/, 3 /*182*/, 4 /*183*/, - 2 /*184*/, 3 /*185*/, 3 /*186*/, 4 /*187*/, 3 /*188*/, 4 /*189*/, 4 /*190*/, 5 /*191*/, - 0 /*192*/, 0 /*193*/, 0 /*194*/, 0 /*195*/, 0 /*196*/, 0 /*197*/, 0 /*198*/, 0 /*199*/, - 0 /*200*/, 0 /*201*/, 0 /*202*/, 0 /*203*/, 0 /*204*/, 0 /*205*/, 0 /*206*/, 0 /*207*/, - 1 /*208*/, 2 /*209*/, 2 /*210*/, 3 /*211*/, 2 /*212*/, 3 /*213*/, 3 /*214*/, 4 /*215*/, - 2 /*216*/, 3 /*217*/, 3 /*218*/, 4 /*219*/, 3 /*220*/, 4 /*221*/, 4 /*222*/, 5 /*223*/, - 0 /*224*/, 0 /*225*/, 0 /*226*/, 0 /*227*/, 0 /*228*/, 0 /*229*/, 0 /*230*/, 0 /*231*/, - 0 /*232*/, 0 /*233*/, 0 /*234*/, 0 /*235*/, 0 /*236*/, 0 /*237*/, 0 /*238*/, 0 /*239*/, - 1 /*240*/, 2 /*241*/, 2 /*242*/, 3 /*243*/, 2 /*244*/, 3 /*245*/, 3 /*246*/, 4 /*247*/, - 2 /*248*/, 3 /*249*/, 3 /*250*/, 4 /*251*/, 3 /*252*/, 4 /*253*/, 4 /*254*/, 5 /*255*/ }, - // Table for bit 5. - { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 0 /*4*/, 0 /*5*/, 0 /*6*/, 0 /*7*/, - 0 /*8*/, 0 /*9*/, 0 /*10*/, 0 /*11*/, 0 /*12*/, 0 /*13*/, 0 /*14*/, 0 /*15*/, - 0 /*16*/, 0 /*17*/, 0 /*18*/, 0 /*19*/, 0 /*20*/, 0 /*21*/, 0 /*22*/, 0 /*23*/, - 0 /*24*/, 0 /*25*/, 0 /*26*/, 0 /*27*/, 0 /*28*/, 0 /*29*/, 0 /*30*/, 0 /*31*/, - 1 /*32*/, 2 /*33*/, 2 /*34*/, 3 /*35*/, 2 /*36*/, 3 /*37*/, 3 /*38*/, 4 /*39*/, - 2 /*40*/, 3 /*41*/, 3 /*42*/, 4 /*43*/, 3 /*44*/, 4 /*45*/, 4 /*46*/, 5 /*47*/, - 2 /*48*/, 3 /*49*/, 3 /*50*/, 4 /*51*/, 3 /*52*/, 4 /*53*/, 4 /*54*/, 5 /*55*/, - 3 /*56*/, 4 /*57*/, 4 /*58*/, 5 /*59*/, 4 /*60*/, 5 /*61*/, 5 /*62*/, 6 /*63*/, - 0 /*64*/, 0 /*65*/, 0 /*66*/, 0 /*67*/, 0 /*68*/, 0 /*69*/, 0 /*70*/, 0 /*71*/, - 0 /*72*/, 0 /*73*/, 0 /*74*/, 0 /*75*/, 0 /*76*/, 0 /*77*/, 0 /*78*/, 0 /*79*/, - 0 /*80*/, 0 /*81*/, 0 /*82*/, 0 /*83*/, 0 /*84*/, 0 /*85*/, 0 /*86*/, 0 /*87*/, - 0 /*88*/, 0 /*89*/, 0 /*90*/, 0 /*91*/, 0 /*92*/, 0 /*93*/, 0 /*94*/, 0 /*95*/, - 1 /*96*/, 2 /*97*/, 2 /*98*/, 3 /*99*/, 2 /*100*/, 3 /*101*/, 3 /*102*/, 4 /*103*/, - 2 /*104*/, 3 /*105*/, 3 /*106*/, 4 /*107*/, 3 /*108*/, 4 /*109*/, 4 /*110*/, 5 /*111*/, - 2 /*112*/, 3 /*113*/, 3 /*114*/, 4 /*115*/, 3 /*116*/, 4 /*117*/, 4 /*118*/, 5 /*119*/, - 3 /*120*/, 4 /*121*/, 4 /*122*/, 5 /*123*/, 4 /*124*/, 5 /*125*/, 5 /*126*/, 6 /*127*/, - 0 /*128*/, 0 /*129*/, 0 /*130*/, 0 /*131*/, 0 /*132*/, 0 /*133*/, 0 /*134*/, 0 /*135*/, - 0 /*136*/, 0 /*137*/, 0 /*138*/, 0 /*139*/, 0 /*140*/, 0 /*141*/, 0 /*142*/, 0 /*143*/, - 0 /*144*/, 0 /*145*/, 0 /*146*/, 0 /*147*/, 0 /*148*/, 0 /*149*/, 0 /*150*/, 0 /*151*/, - 0 /*152*/, 0 /*153*/, 0 /*154*/, 0 /*155*/, 0 /*156*/, 0 /*157*/, 0 /*158*/, 0 /*159*/, - 1 /*160*/, 2 /*161*/, 2 /*162*/, 3 /*163*/, 2 /*164*/, 3 /*165*/, 3 /*166*/, 4 /*167*/, - 2 /*168*/, 3 /*169*/, 3 /*170*/, 4 /*171*/, 3 /*172*/, 4 /*173*/, 4 /*174*/, 5 /*175*/, - 2 /*176*/, 3 /*177*/, 3 /*178*/, 4 /*179*/, 3 /*180*/, 4 /*181*/, 4 /*182*/, 5 /*183*/, - 3 /*184*/, 4 /*185*/, 4 /*186*/, 5 /*187*/, 4 /*188*/, 5 /*189*/, 5 /*190*/, 6 /*191*/, - 0 /*192*/, 0 /*193*/, 0 /*194*/, 0 /*195*/, 0 /*196*/, 0 /*197*/, 0 /*198*/, 0 /*199*/, - 0 /*200*/, 0 /*201*/, 0 /*202*/, 0 /*203*/, 0 /*204*/, 0 /*205*/, 0 /*206*/, 0 /*207*/, - 0 /*208*/, 0 /*209*/, 0 /*210*/, 0 /*211*/, 0 /*212*/, 0 /*213*/, 0 /*214*/, 0 /*215*/, - 0 /*216*/, 0 /*217*/, 0 /*218*/, 0 /*219*/, 0 /*220*/, 0 /*221*/, 0 /*222*/, 0 /*223*/, - 1 /*224*/, 2 /*225*/, 2 /*226*/, 3 /*227*/, 2 /*228*/, 3 /*229*/, 3 /*230*/, 4 /*231*/, - 2 /*232*/, 3 /*233*/, 3 /*234*/, 4 /*235*/, 3 /*236*/, 4 /*237*/, 4 /*238*/, 5 /*239*/, - 2 /*240*/, 3 /*241*/, 3 /*242*/, 4 /*243*/, 3 /*244*/, 4 /*245*/, 4 /*246*/, 5 /*247*/, - 3 /*248*/, 4 /*249*/, 4 /*250*/, 5 /*251*/, 4 /*252*/, 5 /*253*/, 5 /*254*/, 6 /*255*/}, - // Table for bit 6. - { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 0 /*4*/, 0 /*5*/, 0 /*6*/, 0 /*7*/, - 0 /*8*/, 0 /*9*/, 0 /*10*/, 0 /*11*/, 0 /*12*/, 0 /*13*/, 0 /*14*/, 0 /*15*/, - 0 /*16*/, 0 /*17*/, 0 /*18*/, 0 /*19*/, 0 /*20*/, 0 /*21*/, 0 /*22*/, 0 /*23*/, - 0 /*24*/, 0 /*25*/, 0 /*26*/, 0 /*27*/, 0 /*28*/, 0 /*29*/, 0 /*30*/, 0 /*31*/, - 0 /*32*/, 0 /*33*/, 0 /*34*/, 0 /*35*/, 0 /*36*/, 0 /*37*/, 0 /*38*/, 0 /*39*/, - 0 /*40*/, 0 /*41*/, 0 /*42*/, 0 /*43*/, 0 /*44*/, 0 /*45*/, 0 /*46*/, 0 /*47*/, - 0 /*48*/, 0 /*49*/, 0 /*50*/, 0 /*51*/, 0 /*52*/, 0 /*53*/, 0 /*54*/, 0 /*55*/, - 0 /*56*/, 0 /*57*/, 0 /*58*/, 0 /*59*/, 0 /*60*/, 0 /*61*/, 0 /*62*/, 0 /*63*/, - 1 /*64*/, 2 /*65*/, 2 /*66*/, 3 /*67*/, 2 /*68*/, 3 /*69*/, 3 /*70*/, 4 /*71*/, - 2 /*72*/, 3 /*73*/, 3 /*74*/, 4 /*75*/, 3 /*76*/, 4 /*77*/, 4 /*78*/, 5 /*79*/, - 2 /*80*/, 3 /*81*/, 3 /*82*/, 4 /*83*/, 3 /*84*/, 4 /*85*/, 4 /*86*/, 5 /*87*/, - 3 /*88*/, 4 /*89*/, 4 /*90*/, 5 /*91*/, 4 /*92*/, 5 /*93*/, 5 /*94*/, 6 /*95*/, - 2 /*96*/, 3 /*97*/, 3 /*98*/, 4 /*99*/, 3 /*100*/, 4 /*101*/, 4 /*102*/, 5 /*103*/, - 3 /*104*/, 4 /*105*/, 4 /*106*/, 5 /*107*/, 4 /*108*/, 5 /*109*/, 5 /*110*/, 6 /*111*/, - 3 /*112*/, 4 /*113*/, 4 /*114*/, 5 /*115*/, 4 /*116*/, 5 /*117*/, 5 /*118*/, 6 /*119*/, - 4 /*120*/, 5 /*121*/, 5 /*122*/, 6 /*123*/, 5 /*124*/, 6 /*125*/, 6 /*126*/, 7 /*127*/, - 0 /*128*/, 0 /*129*/, 0 /*130*/, 0 /*131*/, 0 /*132*/, 0 /*133*/, 0 /*134*/, 0 /*135*/, - 0 /*136*/, 0 /*137*/, 0 /*138*/, 0 /*139*/, 0 /*140*/, 0 /*141*/, 0 /*142*/, 0 /*143*/, - 0 /*144*/, 0 /*145*/, 0 /*146*/, 0 /*147*/, 0 /*148*/, 0 /*149*/, 0 /*150*/, 0 /*151*/, - 0 /*152*/, 0 /*153*/, 0 /*154*/, 0 /*155*/, 0 /*156*/, 0 /*157*/, 0 /*158*/, 0 /*159*/, - 0 /*160*/, 0 /*161*/, 0 /*162*/, 0 /*163*/, 0 /*164*/, 0 /*165*/, 0 /*166*/, 0 /*167*/, - 0 /*168*/, 0 /*169*/, 0 /*170*/, 0 /*171*/, 0 /*172*/, 0 /*173*/, 0 /*174*/, 0 /*175*/, - 0 /*176*/, 0 /*177*/, 0 /*178*/, 0 /*179*/, 0 /*180*/, 0 /*181*/, 0 /*182*/, 0 /*183*/, - 0 /*184*/, 0 /*185*/, 0 /*186*/, 0 /*187*/, 0 /*188*/, 0 /*189*/, 0 /*190*/, 0 /*191*/, - 1 /*192*/, 2 /*193*/, 2 /*194*/, 3 /*195*/, 2 /*196*/, 3 /*197*/, 3 /*198*/, 4 /*199*/, - 2 /*200*/, 3 /*201*/, 3 /*202*/, 4 /*203*/, 3 /*204*/, 4 /*205*/, 4 /*206*/, 5 /*207*/, - 2 /*208*/, 3 /*209*/, 3 /*210*/, 4 /*211*/, 3 /*212*/, 4 /*213*/, 4 /*214*/, 5 /*215*/, - 3 /*216*/, 4 /*217*/, 4 /*218*/, 5 /*219*/, 4 /*220*/, 5 /*221*/, 5 /*222*/, 6 /*223*/, - 2 /*224*/, 3 /*225*/, 3 /*226*/, 4 /*227*/, 3 /*228*/, 4 /*229*/, 4 /*230*/, 5 /*231*/, - 3 /*232*/, 4 /*233*/, 4 /*234*/, 5 /*235*/, 4 /*236*/, 5 /*237*/, 5 /*238*/, 6 /*239*/, - 3 /*240*/, 4 /*241*/, 4 /*242*/, 5 /*243*/, 4 /*244*/, 5 /*245*/, 5 /*246*/, 6 /*247*/, - 4 /*248*/, 5 /*249*/, 5 /*250*/, 6 /*251*/, 5 /*252*/, 6 /*253*/, 6 /*254*/, 7 /*255*/ }, - // Table for bit 7. - { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 0 /*4*/, 0 /*5*/, 0 /*6*/, 0 /*7*/, - 0 /*8*/, 0 /*9*/, 0 /*10*/, 0 /*11*/, 0 /*12*/, 0 /*13*/, 0 /*14*/, 0 /*15*/, - 0 /*16*/, 0 /*17*/, 0 /*18*/, 0 /*19*/, 0 /*20*/, 0 /*21*/, 0 /*22*/, 0 /*23*/, - 0 /*24*/, 0 /*25*/, 0 /*26*/, 0 /*27*/, 0 /*28*/, 0 /*29*/, 0 /*30*/, 0 /*31*/, - 0 /*32*/, 0 /*33*/, 0 /*34*/, 0 /*35*/, 0 /*36*/, 0 /*37*/, 0 /*38*/, 0 /*39*/, - 0 /*40*/, 0 /*41*/, 0 /*42*/, 0 /*43*/, 0 /*44*/, 0 /*45*/, 0 /*46*/, 0 /*47*/, - 0 /*48*/, 0 /*49*/, 0 /*50*/, 0 /*51*/, 0 /*52*/, 0 /*53*/, 0 /*54*/, 0 /*55*/, - 0 /*56*/, 0 /*57*/, 0 /*58*/, 0 /*59*/, 0 /*60*/, 0 /*61*/, 0 /*62*/, 0 /*63*/, - 0 /*64*/, 0 /*65*/, 0 /*66*/, 0 /*67*/, 0 /*68*/, 0 /*69*/, 0 /*70*/, 0 /*71*/, - 0 /*72*/, 0 /*73*/, 0 /*74*/, 0 /*75*/, 0 /*76*/, 0 /*77*/, 0 /*78*/, 0 /*79*/, - 0 /*80*/, 0 /*81*/, 0 /*82*/, 0 /*83*/, 0 /*84*/, 0 /*85*/, 0 /*86*/, 0 /*87*/, - 0 /*88*/, 0 /*89*/, 0 /*90*/, 0 /*91*/, 0 /*92*/, 0 /*93*/, 0 /*94*/, 0 /*95*/, - 0 /*96*/, 0 /*97*/, 0 /*98*/, 0 /*99*/, 0 /*100*/, 0 /*101*/, 0 /*102*/, 0 /*103*/, - 0 /*104*/, 0 /*105*/, 0 /*106*/, 0 /*107*/, 0 /*108*/, 0 /*109*/, 0 /*110*/, 0 /*111*/, - 0 /*112*/, 0 /*113*/, 0 /*114*/, 0 /*115*/, 0 /*116*/, 0 /*117*/, 0 /*118*/, 0 /*119*/, - 0 /*120*/, 0 /*121*/, 0 /*122*/, 0 /*123*/, 0 /*124*/, 0 /*125*/, 0 /*126*/, 0 /*127*/, - 1 /*128*/, 2 /*129*/, 2 /*130*/, 3 /*131*/, 2 /*132*/, 3 /*133*/, 3 /*134*/, 4 /*135*/, - 2 /*136*/, 3 /*137*/, 3 /*138*/, 4 /*139*/, 3 /*140*/, 4 /*141*/, 4 /*142*/, 5 /*143*/, - 2 /*144*/, 3 /*145*/, 3 /*146*/, 4 /*147*/, 3 /*148*/, 4 /*149*/, 4 /*150*/, 5 /*151*/, - 3 /*152*/, 4 /*153*/, 4 /*154*/, 5 /*155*/, 4 /*156*/, 5 /*157*/, 5 /*158*/, 6 /*159*/, - 2 /*160*/, 3 /*161*/, 3 /*162*/, 4 /*163*/, 3 /*164*/, 4 /*165*/, 4 /*166*/, 5 /*167*/, - 3 /*168*/, 4 /*169*/, 4 /*170*/, 5 /*171*/, 4 /*172*/, 5 /*173*/, 5 /*174*/, 6 /*175*/, - 3 /*176*/, 4 /*177*/, 4 /*178*/, 5 /*179*/, 4 /*180*/, 5 /*181*/, 5 /*182*/, 6 /*183*/, - 4 /*184*/, 5 /*185*/, 5 /*186*/, 6 /*187*/, 5 /*188*/, 6 /*189*/, 6 /*190*/, 7 /*191*/, - 2 /*192*/, 3 /*193*/, 3 /*194*/, 4 /*195*/, 3 /*196*/, 4 /*197*/, 4 /*198*/, 5 /*199*/, - 3 /*200*/, 4 /*201*/, 4 /*202*/, 5 /*203*/, 4 /*204*/, 5 /*205*/, 5 /*206*/, 6 /*207*/, - 3 /*208*/, 4 /*209*/, 4 /*210*/, 5 /*211*/, 4 /*212*/, 5 /*213*/, 5 /*214*/, 6 /*215*/, - 4 /*216*/, 5 /*217*/, 5 /*218*/, 6 /*219*/, 5 /*220*/, 6 /*221*/, 6 /*222*/, 7 /*223*/, - 3 /*224*/, 4 /*225*/, 4 /*226*/, 5 /*227*/, 4 /*228*/, 5 /*229*/, 5 /*230*/, 6 /*231*/, - 4 /*232*/, 5 /*233*/, 5 /*234*/, 6 /*235*/, 5 /*236*/, 6 /*237*/, 6 /*238*/, 7 /*239*/, - 4 /*240*/, 5 /*241*/, 5 /*242*/, 6 /*243*/, 5 /*244*/, 6 /*245*/, 6 /*246*/, 7 /*247*/, - 5 /*248*/, 6 /*249*/, 6 /*250*/, 7 /*251*/, 6 /*252*/, 7 /*253*/, 7 /*254*/, 8 /*255*/ } - }; - -} -// // -/////////////////////////////////////////////////////////////////////////////// diff --git a/src/DGtal/base/Bits.h b/src/DGtal/base/Bits.h index 931ea81337..ea5b93a2ad 100644 --- a/src/DGtal/base/Bits.h +++ b/src/DGtal/base/Bits.h @@ -411,4 +411,477 @@ namespace DGtal };//struct } + +/////////////////////////////////////////////////////////////////////////////// +// class Bits +/////////////////////////////////////////////////////////////////////////////// + +/** DGtal Constants + * + **/ +namespace DGtal +{ + // Lookup tables for find and count operations. + /** + Lookup table for counting the number of bits set to 1 in a byte. + ( Taken from STL \ ) + */ + constexpr inline DGtal::uint8_t Bits::myBitCount[] = { + 0, /* 0 */ 1, /* 1 */ 1, /* 2 */ 2, /* 3 */ 1, /* 4 */ + 2, /* 5 */ 2, /* 6 */ 3, /* 7 */ 1, /* 8 */ 2, /* 9 */ + 2, /* 10 */ 3, /* 11 */ 2, /* 12 */ 3, /* 13 */ 3, /* 14 */ + 4, /* 15 */ 1, /* 16 */ 2, /* 17 */ 2, /* 18 */ 3, /* 19 */ + 2, /* 20 */ 3, /* 21 */ 3, /* 22 */ 4, /* 23 */ 2, /* 24 */ + 3, /* 25 */ 3, /* 26 */ 4, /* 27 */ 3, /* 28 */ 4, /* 29 */ + 4, /* 30 */ 5, /* 31 */ 1, /* 32 */ 2, /* 33 */ 2, /* 34 */ + 3, /* 35 */ 2, /* 36 */ 3, /* 37 */ 3, /* 38 */ 4, /* 39 */ + 2, /* 40 */ 3, /* 41 */ 3, /* 42 */ 4, /* 43 */ 3, /* 44 */ + 4, /* 45 */ 4, /* 46 */ 5, /* 47 */ 2, /* 48 */ 3, /* 49 */ + 3, /* 50 */ 4, /* 51 */ 3, /* 52 */ 4, /* 53 */ 4, /* 54 */ + 5, /* 55 */ 3, /* 56 */ 4, /* 57 */ 4, /* 58 */ 5, /* 59 */ + 4, /* 60 */ 5, /* 61 */ 5, /* 62 */ 6, /* 63 */ 1, /* 64 */ + 2, /* 65 */ 2, /* 66 */ 3, /* 67 */ 2, /* 68 */ 3, /* 69 */ + 3, /* 70 */ 4, /* 71 */ 2, /* 72 */ 3, /* 73 */ 3, /* 74 */ + 4, /* 75 */ 3, /* 76 */ 4, /* 77 */ 4, /* 78 */ 5, /* 79 */ + 2, /* 80 */ 3, /* 81 */ 3, /* 82 */ 4, /* 83 */ 3, /* 84 */ + 4, /* 85 */ 4, /* 86 */ 5, /* 87 */ 3, /* 88 */ 4, /* 89 */ + 4, /* 90 */ 5, /* 91 */ 4, /* 92 */ 5, /* 93 */ 5, /* 94 */ + 6, /* 95 */ 2, /* 96 */ 3, /* 97 */ 3, /* 98 */ 4, /* 99 */ + 3, /* 100 */ 4, /* 101 */ 4, /* 102 */ 5, /* 103 */ 3, /* 104 */ + 4, /* 105 */ 4, /* 106 */ 5, /* 107 */ 4, /* 108 */ 5, /* 109 */ + 5, /* 110 */ 6, /* 111 */ 3, /* 112 */ 4, /* 113 */ 4, /* 114 */ + 5, /* 115 */ 4, /* 116 */ 5, /* 117 */ 5, /* 118 */ 6, /* 119 */ + 4, /* 120 */ 5, /* 121 */ 5, /* 122 */ 6, /* 123 */ 5, /* 124 */ + 6, /* 125 */ 6, /* 126 */ 7, /* 127 */ 1, /* 128 */ 2, /* 129 */ + 2, /* 130 */ 3, /* 131 */ 2, /* 132 */ 3, /* 133 */ 3, /* 134 */ + 4, /* 135 */ 2, /* 136 */ 3, /* 137 */ 3, /* 138 */ 4, /* 139 */ + 3, /* 140 */ 4, /* 141 */ 4, /* 142 */ 5, /* 143 */ 2, /* 144 */ + 3, /* 145 */ 3, /* 146 */ 4, /* 147 */ 3, /* 148 */ 4, /* 149 */ + 4, /* 150 */ 5, /* 151 */ 3, /* 152 */ 4, /* 153 */ 4, /* 154 */ + 5, /* 155 */ 4, /* 156 */ 5, /* 157 */ 5, /* 158 */ 6, /* 159 */ + 2, /* 160 */ 3, /* 161 */ 3, /* 162 */ 4, /* 163 */ 3, /* 164 */ + 4, /* 165 */ 4, /* 166 */ 5, /* 167 */ 3, /* 168 */ 4, /* 169 */ + 4, /* 170 */ 5, /* 171 */ 4, /* 172 */ 5, /* 173 */ 5, /* 174 */ + 6, /* 175 */ 3, /* 176 */ 4, /* 177 */ 4, /* 178 */ 5, /* 179 */ + 4, /* 180 */ 5, /* 181 */ 5, /* 182 */ 6, /* 183 */ 4, /* 184 */ + 5, /* 185 */ 5, /* 186 */ 6, /* 187 */ 5, /* 188 */ 6, /* 189 */ + 6, /* 190 */ 7, /* 191 */ 2, /* 192 */ 3, /* 193 */ 3, /* 194 */ + 4, /* 195 */ 3, /* 196 */ 4, /* 197 */ 4, /* 198 */ 5, /* 199 */ + 3, /* 200 */ 4, /* 201 */ 4, /* 202 */ 5, /* 203 */ 4, /* 204 */ + 5, /* 205 */ 5, /* 206 */ 6, /* 207 */ 3, /* 208 */ 4, /* 209 */ + 4, /* 210 */ 5, /* 211 */ 4, /* 212 */ 5, /* 213 */ 5, /* 214 */ + 6, /* 215 */ 4, /* 216 */ 5, /* 217 */ 5, /* 218 */ 6, /* 219 */ + 5, /* 220 */ 6, /* 221 */ 6, /* 222 */ 7, /* 223 */ 3, /* 224 */ + 4, /* 225 */ 4, /* 226 */ 5, /* 227 */ 4, /* 228 */ 5, /* 229 */ + 5, /* 230 */ 6, /* 231 */ 4, /* 232 */ 5, /* 233 */ 5, /* 234 */ + 6, /* 235 */ 5, /* 236 */ 6, /* 237 */ 6, /* 238 */ 7, /* 239 */ + 4, /* 240 */ 5, /* 241 */ 5, /* 242 */ 6, /* 243 */ 5, /* 244 */ + 6, /* 245 */ 6, /* 246 */ 7, /* 247 */ 5, /* 248 */ 6, /* 249 */ + 6, /* 250 */ 7, /* 251 */ 6, /* 252 */ 7, /* 253 */ 7, /* 254 */ + 8 /* 255 */ + }; // end _Bit_count + + /** + * Lookup table for finding the least significant bit. + *

+ * NB: Can also be obtained with:

+   * 
+ */ + constexpr inline DGtal::uint8_t Bits::myLSB[] = { + 0, /* 0 */ 0, /* 1 */ 1, /* 2 */ 0, /* 3 */ 2, /* 4 */ + 0, /* 5 */ 1, /* 6 */ 0, /* 7 */ 3, /* 8 */ 0, /* 9 */ + 1, /* 10 */ 0, /* 11 */ 2, /* 12 */ 0, /* 13 */ 1, /* 14 */ + 0, /* 15 */ 4, /* 16 */ 0, /* 17 */ 1, /* 18 */ 0, /* 19 */ + 2, /* 20 */ 0, /* 21 */ 1, /* 22 */ 0, /* 23 */ 3, /* 24 */ + 0, /* 25 */ 1, /* 26 */ 0, /* 27 */ 2, /* 28 */ 0, /* 29 */ + 1, /* 30 */ 0, /* 31 */ 5, /* 32 */ 0, /* 33 */ 1, /* 34 */ + 0, /* 35 */ 2, /* 36 */ 0, /* 37 */ 1, /* 38 */ 0, /* 39 */ + 3, /* 40 */ 0, /* 41 */ 1, /* 42 */ 0, /* 43 */ 2, /* 44 */ + 0, /* 45 */ 1, /* 46 */ 0, /* 47 */ 4, /* 48 */ 0, /* 49 */ + 1, /* 50 */ 0, /* 51 */ 2, /* 52 */ 0, /* 53 */ 1, /* 54 */ + 0, /* 55 */ 3, /* 56 */ 0, /* 57 */ 1, /* 58 */ 0, /* 59 */ + 2, /* 60 */ 0, /* 61 */ 1, /* 62 */ 0, /* 63 */ 6, /* 64 */ + 0, /* 65 */ 1, /* 66 */ 0, /* 67 */ 2, /* 68 */ 0, /* 69 */ + 1, /* 70 */ 0, /* 71 */ 3, /* 72 */ 0, /* 73 */ 1, /* 74 */ + 0, /* 75 */ 2, /* 76 */ 0, /* 77 */ 1, /* 78 */ 0, /* 79 */ + 4, /* 80 */ 0, /* 81 */ 1, /* 82 */ 0, /* 83 */ 2, /* 84 */ + 0, /* 85 */ 1, /* 86 */ 0, /* 87 */ 3, /* 88 */ 0, /* 89 */ + 1, /* 90 */ 0, /* 91 */ 2, /* 92 */ 0, /* 93 */ 1, /* 94 */ + 0, /* 95 */ 5, /* 96 */ 0, /* 97 */ 1, /* 98 */ 0, /* 99 */ + 2, /* 100 */ 0, /* 101 */ 1, /* 102 */ 0, /* 103 */ 3, /* 104 */ + 0, /* 105 */ 1, /* 106 */ 0, /* 107 */ 2, /* 108 */ 0, /* 109 */ + 1, /* 110 */ 0, /* 111 */ 4, /* 112 */ 0, /* 113 */ 1, /* 114 */ + 0, /* 115 */ 2, /* 116 */ 0, /* 117 */ 1, /* 118 */ 0, /* 119 */ + 3, /* 120 */ 0, /* 121 */ 1, /* 122 */ 0, /* 123 */ 2, /* 124 */ + 0, /* 125 */ 1, /* 126 */ 0, /* 127 */ 7, /* 128 */ 0, /* 129 */ + 1, /* 130 */ 0, /* 131 */ 2, /* 132 */ 0, /* 133 */ 1, /* 134 */ + 0, /* 135 */ 3, /* 136 */ 0, /* 137 */ 1, /* 138 */ 0, /* 139 */ + 2, /* 140 */ 0, /* 141 */ 1, /* 142 */ 0, /* 143 */ 4, /* 144 */ + 0, /* 145 */ 1, /* 146 */ 0, /* 147 */ 2, /* 148 */ 0, /* 149 */ + 1, /* 150 */ 0, /* 151 */ 3, /* 152 */ 0, /* 153 */ 1, /* 154 */ + 0, /* 155 */ 2, /* 156 */ 0, /* 157 */ 1, /* 158 */ 0, /* 159 */ + 5, /* 160 */ 0, /* 161 */ 1, /* 162 */ 0, /* 163 */ 2, /* 164 */ + 0, /* 165 */ 1, /* 166 */ 0, /* 167 */ 3, /* 168 */ 0, /* 169 */ + 1, /* 170 */ 0, /* 171 */ 2, /* 172 */ 0, /* 173 */ 1, /* 174 */ + 0, /* 175 */ 4, /* 176 */ 0, /* 177 */ 1, /* 178 */ 0, /* 179 */ + 2, /* 180 */ 0, /* 181 */ 1, /* 182 */ 0, /* 183 */ 3, /* 184 */ + 0, /* 185 */ 1, /* 186 */ 0, /* 187 */ 2, /* 188 */ 0, /* 189 */ + 1, /* 190 */ 0, /* 191 */ 6, /* 192 */ 0, /* 193 */ 1, /* 194 */ + 0, /* 195 */ 2, /* 196 */ 0, /* 197 */ 1, /* 198 */ 0, /* 199 */ + 3, /* 200 */ 0, /* 201 */ 1, /* 202 */ 0, /* 203 */ 2, /* 204 */ + 0, /* 205 */ 1, /* 206 */ 0, /* 207 */ 4, /* 208 */ 0, /* 209 */ + 1, /* 210 */ 0, /* 211 */ 2, /* 212 */ 0, /* 213 */ 1, /* 214 */ + 0, /* 215 */ 3, /* 216 */ 0, /* 217 */ 1, /* 218 */ 0, /* 219 */ + 2, /* 220 */ 0, /* 221 */ 1, /* 222 */ 0, /* 223 */ 5, /* 224 */ + 0, /* 225 */ 1, /* 226 */ 0, /* 227 */ 2, /* 228 */ 0, /* 229 */ + 1, /* 230 */ 0, /* 231 */ 3, /* 232 */ 0, /* 233 */ 1, /* 234 */ + 0, /* 235 */ 2, /* 236 */ 0, /* 237 */ 1, /* 238 */ 0, /* 239 */ + 4, /* 240 */ 0, /* 241 */ 1, /* 242 */ 0, /* 243 */ 2, /* 244 */ + 0, /* 245 */ 1, /* 246 */ 0, /* 247 */ 3, /* 248 */ 0, /* 249 */ + 1, /* 250 */ 0, /* 251 */ 2, /* 252 */ 0, /* 253 */ 1, /* 254 */ + 0, /* 255 */ + }; // end _First_one + + +/** + * Lookup table for finding the least significant bit. + *

+ * NB: Can also be obtained with:

+   * 
+ */ + constexpr inline DGtal::uint8_t Bits::myMSB[] = { + 0 /* 0*/ , + 0 /* 1*/ ,1 /* 2*/ ,1 /* 3*/ ,2 /* 4*/ ,2 /* 5*/ , + 2 /* 6*/ ,2 /* 7*/ ,3 /* 8*/ ,3 /* 9*/ ,3 /* 10*/ , + 3 /* 11*/ ,3 /* 12*/ ,3 /* 13*/ ,3 /* 14*/ ,3 /* 15*/ , + 4 /* 16*/ ,4 /* 17*/ ,4 /* 18*/ ,4 /* 19*/ ,4 /* 20*/ , + 4 /* 21*/ ,4 /* 22*/ ,4 /* 23*/ ,4 /* 24*/ ,4 /* 25*/ , + 4 /* 26*/ ,4 /* 27*/ ,4 /* 28*/ ,4 /* 29*/ ,4 /* 30*/ , + 4 /* 31*/ ,5 /* 32*/ ,5 /* 33*/ ,5 /* 34*/ ,5 /* 35*/ , + 5 /* 36*/ ,5 /* 37*/ ,5 /* 38*/ ,5 /* 39*/ ,5 /* 40*/ , + 5 /* 41*/ ,5 /* 42*/ ,5 /* 43*/ ,5 /* 44*/ ,5 /* 45*/ , + 5 /* 46*/ ,5 /* 47*/ ,5 /* 48*/ ,5 /* 49*/ ,5 /* 50*/ , + 5 /* 51*/ ,5 /* 52*/ ,5 /* 53*/ ,5 /* 54*/ ,5 /* 55*/ , + 5 /* 56*/ ,5 /* 57*/ ,5 /* 58*/ ,5 /* 59*/ ,5 /* 60*/ , + 5 /* 61*/ ,5 /* 62*/ ,5 /* 63*/ ,6 /* 64*/ ,6 /* 65*/ , + 6 /* 66*/ ,6 /* 67*/ ,6 /* 68*/ ,6 /* 69*/ ,6 /* 70*/ , + 6 /* 71*/ ,6 /* 72*/ ,6 /* 73*/ ,6 /* 74*/ ,6 /* 75*/ , + 6 /* 76*/ ,6 /* 77*/ ,6 /* 78*/ ,6 /* 79*/ ,6 /* 80*/ , + 6 /* 81*/ ,6 /* 82*/ ,6 /* 83*/ ,6 /* 84*/ ,6 /* 85*/ , + 6 /* 86*/ ,6 /* 87*/ ,6 /* 88*/ ,6 /* 89*/ ,6 /* 90*/ , + 6 /* 91*/ ,6 /* 92*/ ,6 /* 93*/ ,6 /* 94*/ ,6 /* 95*/ , + 6 /* 96*/ ,6 /* 97*/ ,6 /* 98*/ ,6 /* 99*/ ,6 /* 100*/ , + 6 /* 101*/ ,6 /* 102*/ ,6 /* 103*/ ,6 /* 104*/ ,6 /* 105*/ , + 6 /* 106*/ ,6 /* 107*/ ,6 /* 108*/ ,6 /* 109*/ ,6 /* 110*/ , + 6 /* 111*/ ,6 /* 112*/ ,6 /* 113*/ ,6 /* 114*/ ,6 /* 115*/ , + 6 /* 116*/ ,6 /* 117*/ ,6 /* 118*/ ,6 /* 119*/ ,6 /* 120*/ , + 6 /* 121*/ ,6 /* 122*/ ,6 /* 123*/ ,6 /* 124*/ ,6 /* 125*/ , + 6 /* 126*/ ,6 /* 127*/ ,7 /* 128*/ ,7 /* 129*/ ,7 /* 130*/ , + 7 /* 131*/ ,7 /* 132*/ ,7 /* 133*/ ,7 /* 134*/ ,7 /* 135*/ , + 7 /* 136*/ ,7 /* 137*/ ,7 /* 138*/ ,7 /* 139*/ ,7 /* 140*/ , + 7 /* 141*/ ,7 /* 142*/ ,7 /* 143*/ ,7 /* 144*/ ,7 /* 145*/ , + 7 /* 146*/ ,7 /* 147*/ ,7 /* 148*/ ,7 /* 149*/ ,7 /* 150*/ , + 7 /* 151*/ ,7 /* 152*/ ,7 /* 153*/ ,7 /* 154*/ ,7 /* 155*/ , + 7 /* 156*/ ,7 /* 157*/ ,7 /* 158*/ ,7 /* 159*/ ,7 /* 160*/ , + 7 /* 161*/ ,7 /* 162*/ ,7 /* 163*/ ,7 /* 164*/ ,7 /* 165*/ , + 7 /* 166*/ ,7 /* 167*/ ,7 /* 168*/ ,7 /* 169*/ ,7 /* 170*/ , + 7 /* 171*/ ,7 /* 172*/ ,7 /* 173*/ ,7 /* 174*/ ,7 /* 175*/ , + 7 /* 176*/ ,7 /* 177*/ ,7 /* 178*/ ,7 /* 179*/ ,7 /* 180*/ , + 7 /* 181*/ ,7 /* 182*/ ,7 /* 183*/ ,7 /* 184*/ ,7 /* 185*/ , + 7 /* 186*/ ,7 /* 187*/ ,7 /* 188*/ ,7 /* 189*/ ,7 /* 190*/ , + 7 /* 191*/ ,7 /* 192*/ ,7 /* 193*/ ,7 /* 194*/ ,7 /* 195*/ , + 7 /* 196*/ ,7 /* 197*/ ,7 /* 198*/ ,7 /* 199*/ ,7 /* 200*/ , + 7 /* 201*/ ,7 /* 202*/ ,7 /* 203*/ ,7 /* 204*/ ,7 /* 205*/ , + 7 /* 206*/ ,7 /* 207*/ ,7 /* 208*/ ,7 /* 209*/ ,7 /* 210*/ , + 7 /* 211*/ ,7 /* 212*/ ,7 /* 213*/ ,7 /* 214*/ ,7 /* 215*/ , + 7 /* 216*/ ,7 /* 217*/ ,7 /* 218*/ ,7 /* 219*/ ,7 /* 220*/ , + 7 /* 221*/ ,7 /* 222*/ ,7 /* 223*/ ,7 /* 224*/ ,7 /* 225*/ , + 7 /* 226*/ ,7 /* 227*/ ,7 /* 228*/ ,7 /* 229*/ ,7 /* 230*/ , + 7 /* 231*/ ,7 /* 232*/ ,7 /* 233*/ ,7 /* 234*/ ,7 /* 235*/ , + 7 /* 236*/ ,7 /* 237*/ ,7 /* 238*/ ,7 /* 239*/ ,7 /* 240*/ , + 7 /* 241*/ ,7 /* 242*/ ,7 /* 243*/ ,7 /* 244*/ ,7 /* 245*/ , + 7 /* 246*/ ,7 /* 247*/ ,7 /* 248*/ ,7 /* 249*/ ,7 /* 250*/ , + 7 /* 251*/ ,7 /* 252*/ ,7 /* 253*/ ,7 /* 254*/ ,7 /* 255*/ }; // end _First_one + + /** + Usage: myIndexInSetBits[ b ][ n ] + - \a b in 0..7 + - \a n in 0..255 + Set bits are numbered from 1 to x when reading the word from the + least significant to the most significant bit. This number is the + index of bit \a b in the number \a n. + return this index or 0 if the bit is not set. + */ + constexpr inline DGtal::uint8_t Bits::myIndexInSetBits[ 8 ][ 256 ] = { + // Table for bit 0. + { 0 /*0*/, 1 /*1*/, 0 /*2*/, 1 /*3*/, 0 /*4*/, 1 /*5*/, 0 /*6*/, 1 /*7*/, + 0 /*8*/, 1 /*9*/, 0 /*10*/, 1 /*11*/, 0 /*12*/, 1 /*13*/, 0 /*14*/, 1 /*15*/, + 0 /*16*/, 1 /*17*/, 0 /*18*/, 1 /*19*/, 0 /*20*/, 1 /*21*/, 0 /*22*/, 1 /*23*/, + 0 /*24*/, 1 /*25*/, 0 /*26*/, 1 /*27*/, 0 /*28*/, 1 /*29*/, 0 /*30*/, 1 /*31*/, + 0 /*32*/, 1 /*33*/, 0 /*34*/, 1 /*35*/, 0 /*36*/, 1 /*37*/, 0 /*38*/, 1 /*39*/, + 0 /*40*/, 1 /*41*/, 0 /*42*/, 1 /*43*/, 0 /*44*/, 1 /*45*/, 0 /*46*/, 1 /*47*/, + 0 /*48*/, 1 /*49*/, 0 /*50*/, 1 /*51*/, 0 /*52*/, 1 /*53*/, 0 /*54*/, 1 /*55*/, + 0 /*56*/, 1 /*57*/, 0 /*58*/, 1 /*59*/, 0 /*60*/, 1 /*61*/, 0 /*62*/, 1 /*63*/, + 0 /*64*/, 1 /*65*/, 0 /*66*/, 1 /*67*/, 0 /*68*/, 1 /*69*/, 0 /*70*/, 1 /*71*/, + 0 /*72*/, 1 /*73*/, 0 /*74*/, 1 /*75*/, 0 /*76*/, 1 /*77*/, 0 /*78*/, 1 /*79*/, + 0 /*80*/, 1 /*81*/, 0 /*82*/, 1 /*83*/, 0 /*84*/, 1 /*85*/, 0 /*86*/, 1 /*87*/, + 0 /*88*/, 1 /*89*/, 0 /*90*/, 1 /*91*/, 0 /*92*/, 1 /*93*/, 0 /*94*/, 1 /*95*/, + 0 /*96*/, 1 /*97*/, 0 /*98*/, 1 /*99*/, 0 /*100*/, 1 /*101*/, 0 /*102*/, 1 /*103*/, + 0 /*104*/, 1 /*105*/, 0 /*106*/, 1 /*107*/, 0 /*108*/, 1 /*109*/, 0 /*110*/, 1 /*111*/, + 0 /*112*/, 1 /*113*/, 0 /*114*/, 1 /*115*/, 0 /*116*/, 1 /*117*/, 0 /*118*/, 1 /*119*/, + 0 /*120*/, 1 /*121*/, 0 /*122*/, 1 /*123*/, 0 /*124*/, 1 /*125*/, 0 /*126*/, 1 /*127*/, + 0 /*128*/, 1 /*129*/, 0 /*130*/, 1 /*131*/, 0 /*132*/, 1 /*133*/, 0 /*134*/, 1 /*135*/, + 0 /*136*/, 1 /*137*/, 0 /*138*/, 1 /*139*/, 0 /*140*/, 1 /*141*/, 0 /*142*/, 1 /*143*/, + 0 /*144*/, 1 /*145*/, 0 /*146*/, 1 /*147*/, 0 /*148*/, 1 /*149*/, 0 /*150*/, 1 /*151*/, + 0 /*152*/, 1 /*153*/, 0 /*154*/, 1 /*155*/, 0 /*156*/, 1 /*157*/, 0 /*158*/, 1 /*159*/, + 0 /*160*/, 1 /*161*/, 0 /*162*/, 1 /*163*/, 0 /*164*/, 1 /*165*/, 0 /*166*/, 1 /*167*/, + 0 /*168*/, 1 /*169*/, 0 /*170*/, 1 /*171*/, 0 /*172*/, 1 /*173*/, 0 /*174*/, 1 /*175*/, + 0 /*176*/, 1 /*177*/, 0 /*178*/, 1 /*179*/, 0 /*180*/, 1 /*181*/, 0 /*182*/, 1 /*183*/, + 0 /*184*/, 1 /*185*/, 0 /*186*/, 1 /*187*/, 0 /*188*/, 1 /*189*/, 0 /*190*/, 1 /*191*/, + 0 /*192*/, 1 /*193*/, 0 /*194*/, 1 /*195*/, 0 /*196*/, 1 /*197*/, 0 /*198*/, 1 /*199*/, + 0 /*200*/, 1 /*201*/, 0 /*202*/, 1 /*203*/, 0 /*204*/, 1 /*205*/, 0 /*206*/, 1 /*207*/, + 0 /*208*/, 1 /*209*/, 0 /*210*/, 1 /*211*/, 0 /*212*/, 1 /*213*/, 0 /*214*/, 1 /*215*/, + 0 /*216*/, 1 /*217*/, 0 /*218*/, 1 /*219*/, 0 /*220*/, 1 /*221*/, 0 /*222*/, 1 /*223*/, + 0 /*224*/, 1 /*225*/, 0 /*226*/, 1 /*227*/, 0 /*228*/, 1 /*229*/, 0 /*230*/, 1 /*231*/, + 0 /*232*/, 1 /*233*/, 0 /*234*/, 1 /*235*/, 0 /*236*/, 1 /*237*/, 0 /*238*/, 1 /*239*/, + 0 /*240*/, 1 /*241*/, 0 /*242*/, 1 /*243*/, 0 /*244*/, 1 /*245*/, 0 /*246*/, 1 /*247*/, + 0 /*248*/, 1 /*249*/, 0 /*250*/, 1 /*251*/, 0 /*252*/, 1 /*253*/, 0 /*254*/, 1 /*255*/ }, + // Table for bit 1. + { 0 /*0*/, 0 /*1*/, 1 /*2*/, 2 /*3*/, 0 /*4*/, 0 /*5*/, 1 /*6*/, 2 /*7*/, + 0 /*8*/, 0 /*9*/, 1 /*10*/, 2 /*11*/, 0 /*12*/, 0 /*13*/, 1 /*14*/, 2 /*15*/, + 0 /*16*/, 0 /*17*/, 1 /*18*/, 2 /*19*/, 0 /*20*/, 0 /*21*/, 1 /*22*/, 2 /*23*/, + 0 /*24*/, 0 /*25*/, 1 /*26*/, 2 /*27*/, 0 /*28*/, 0 /*29*/, 1 /*30*/, 2 /*31*/, + 0 /*32*/, 0 /*33*/, 1 /*34*/, 2 /*35*/, 0 /*36*/, 0 /*37*/, 1 /*38*/, 2 /*39*/, + 0 /*40*/, 0 /*41*/, 1 /*42*/, 2 /*43*/, 0 /*44*/, 0 /*45*/, 1 /*46*/, 2 /*47*/, + 0 /*48*/, 0 /*49*/, 1 /*50*/, 2 /*51*/, 0 /*52*/, 0 /*53*/, 1 /*54*/, 2 /*55*/, + 0 /*56*/, 0 /*57*/, 1 /*58*/, 2 /*59*/, 0 /*60*/, 0 /*61*/, 1 /*62*/, 2 /*63*/, + 0 /*64*/, 0 /*65*/, 1 /*66*/, 2 /*67*/, 0 /*68*/, 0 /*69*/, 1 /*70*/, 2 /*71*/, + 0 /*72*/, 0 /*73*/, 1 /*74*/, 2 /*75*/, 0 /*76*/, 0 /*77*/, 1 /*78*/, 2 /*79*/, + 0 /*80*/, 0 /*81*/, 1 /*82*/, 2 /*83*/, 0 /*84*/, 0 /*85*/, 1 /*86*/, 2 /*87*/, + 0 /*88*/, 0 /*89*/, 1 /*90*/, 2 /*91*/, 0 /*92*/, 0 /*93*/, 1 /*94*/, 2 /*95*/, + 0 /*96*/, 0 /*97*/, 1 /*98*/, 2 /*99*/, 0 /*100*/, 0 /*101*/, 1 /*102*/, 2 /*103*/, + 0 /*104*/, 0 /*105*/, 1 /*106*/, 2 /*107*/, 0 /*108*/, 0 /*109*/, 1 /*110*/, 2 /*111*/, + 0 /*112*/, 0 /*113*/, 1 /*114*/, 2 /*115*/, 0 /*116*/, 0 /*117*/, 1 /*118*/, 2 /*119*/, + 0 /*120*/, 0 /*121*/, 1 /*122*/, 2 /*123*/, 0 /*124*/, 0 /*125*/, 1 /*126*/, 2 /*127*/, + 0 /*128*/, 0 /*129*/, 1 /*130*/, 2 /*131*/, 0 /*132*/, 0 /*133*/, 1 /*134*/, 2 /*135*/, + 0 /*136*/, 0 /*137*/, 1 /*138*/, 2 /*139*/, 0 /*140*/, 0 /*141*/, 1 /*142*/, 2 /*143*/, + 0 /*144*/, 0 /*145*/, 1 /*146*/, 2 /*147*/, 0 /*148*/, 0 /*149*/, 1 /*150*/, 2 /*151*/, + 0 /*152*/, 0 /*153*/, 1 /*154*/, 2 /*155*/, 0 /*156*/, 0 /*157*/, 1 /*158*/, 2 /*159*/, + 0 /*160*/, 0 /*161*/, 1 /*162*/, 2 /*163*/, 0 /*164*/, 0 /*165*/, 1 /*166*/, 2 /*167*/, + 0 /*168*/, 0 /*169*/, 1 /*170*/, 2 /*171*/, 0 /*172*/, 0 /*173*/, 1 /*174*/, 2 /*175*/, + 0 /*176*/, 0 /*177*/, 1 /*178*/, 2 /*179*/, 0 /*180*/, 0 /*181*/, 1 /*182*/, 2 /*183*/, + 0 /*184*/, 0 /*185*/, 1 /*186*/, 2 /*187*/, 0 /*188*/, 0 /*189*/, 1 /*190*/, 2 /*191*/, + 0 /*192*/, 0 /*193*/, 1 /*194*/, 2 /*195*/, 0 /*196*/, 0 /*197*/, 1 /*198*/, 2 /*199*/, + 0 /*200*/, 0 /*201*/, 1 /*202*/, 2 /*203*/, 0 /*204*/, 0 /*205*/, 1 /*206*/, 2 /*207*/, + 0 /*208*/, 0 /*209*/, 1 /*210*/, 2 /*211*/, 0 /*212*/, 0 /*213*/, 1 /*214*/, 2 /*215*/, + 0 /*216*/, 0 /*217*/, 1 /*218*/, 2 /*219*/, 0 /*220*/, 0 /*221*/, 1 /*222*/, 2 /*223*/, + 0 /*224*/, 0 /*225*/, 1 /*226*/, 2 /*227*/, 0 /*228*/, 0 /*229*/, 1 /*230*/, 2 /*231*/, + 0 /*232*/, 0 /*233*/, 1 /*234*/, 2 /*235*/, 0 /*236*/, 0 /*237*/, 1 /*238*/, 2 /*239*/, + 0 /*240*/, 0 /*241*/, 1 /*242*/, 2 /*243*/, 0 /*244*/, 0 /*245*/, 1 /*246*/, 2 /*247*/, + 0 /*248*/, 0 /*249*/, 1 /*250*/, 2 /*251*/, 0 /*252*/, 0 /*253*/, 1 /*254*/, 2 /*255*/}, + // Table for bit 2. + { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 1 /*4*/, 2 /*5*/, 2 /*6*/, 3 /*7*/, + 0 /*8*/, 0 /*9*/, 0 /*10*/, 0 /*11*/, 1 /*12*/, 2 /*13*/, 2 /*14*/, 3 /*15*/, + 0 /*16*/, 0 /*17*/, 0 /*18*/, 0 /*19*/, 1 /*20*/, 2 /*21*/, 2 /*22*/, 3 /*23*/, + 0 /*24*/, 0 /*25*/, 0 /*26*/, 0 /*27*/, 1 /*28*/, 2 /*29*/, 2 /*30*/, 3 /*31*/, + 0 /*32*/, 0 /*33*/, 0 /*34*/, 0 /*35*/, 1 /*36*/, 2 /*37*/, 2 /*38*/, 3 /*39*/, + 0 /*40*/, 0 /*41*/, 0 /*42*/, 0 /*43*/, 1 /*44*/, 2 /*45*/, 2 /*46*/, 3 /*47*/, + 0 /*48*/, 0 /*49*/, 0 /*50*/, 0 /*51*/, 1 /*52*/, 2 /*53*/, 2 /*54*/, 3 /*55*/, + 0 /*56*/, 0 /*57*/, 0 /*58*/, 0 /*59*/, 1 /*60*/, 2 /*61*/, 2 /*62*/, 3 /*63*/, + 0 /*64*/, 0 /*65*/, 0 /*66*/, 0 /*67*/, 1 /*68*/, 2 /*69*/, 2 /*70*/, 3 /*71*/, + 0 /*72*/, 0 /*73*/, 0 /*74*/, 0 /*75*/, 1 /*76*/, 2 /*77*/, 2 /*78*/, 3 /*79*/, + 0 /*80*/, 0 /*81*/, 0 /*82*/, 0 /*83*/, 1 /*84*/, 2 /*85*/, 2 /*86*/, 3 /*87*/, + 0 /*88*/, 0 /*89*/, 0 /*90*/, 0 /*91*/, 1 /*92*/, 2 /*93*/, 2 /*94*/, 3 /*95*/, + 0 /*96*/, 0 /*97*/, 0 /*98*/, 0 /*99*/, 1 /*100*/, 2 /*101*/, 2 /*102*/, 3 /*103*/, + 0 /*104*/, 0 /*105*/, 0 /*106*/, 0 /*107*/, 1 /*108*/, 2 /*109*/, 2 /*110*/, 3 /*111*/, + 0 /*112*/, 0 /*113*/, 0 /*114*/, 0 /*115*/, 1 /*116*/, 2 /*117*/, 2 /*118*/, 3 /*119*/, + 0 /*120*/, 0 /*121*/, 0 /*122*/, 0 /*123*/, 1 /*124*/, 2 /*125*/, 2 /*126*/, 3 /*127*/, + 0 /*128*/, 0 /*129*/, 0 /*130*/, 0 /*131*/, 1 /*132*/, 2 /*133*/, 2 /*134*/, 3 /*135*/, + 0 /*136*/, 0 /*137*/, 0 /*138*/, 0 /*139*/, 1 /*140*/, 2 /*141*/, 2 /*142*/, 3 /*143*/, + 0 /*144*/, 0 /*145*/, 0 /*146*/, 0 /*147*/, 1 /*148*/, 2 /*149*/, 2 /*150*/, 3 /*151*/, + 0 /*152*/, 0 /*153*/, 0 /*154*/, 0 /*155*/, 1 /*156*/, 2 /*157*/, 2 /*158*/, 3 /*159*/, + 0 /*160*/, 0 /*161*/, 0 /*162*/, 0 /*163*/, 1 /*164*/, 2 /*165*/, 2 /*166*/, 3 /*167*/, + 0 /*168*/, 0 /*169*/, 0 /*170*/, 0 /*171*/, 1 /*172*/, 2 /*173*/, 2 /*174*/, 3 /*175*/, + 0 /*176*/, 0 /*177*/, 0 /*178*/, 0 /*179*/, 1 /*180*/, 2 /*181*/, 2 /*182*/, 3 /*183*/, + 0 /*184*/, 0 /*185*/, 0 /*186*/, 0 /*187*/, 1 /*188*/, 2 /*189*/, 2 /*190*/, 3 /*191*/, + 0 /*192*/, 0 /*193*/, 0 /*194*/, 0 /*195*/, 1 /*196*/, 2 /*197*/, 2 /*198*/, 3 /*199*/, + 0 /*200*/, 0 /*201*/, 0 /*202*/, 0 /*203*/, 1 /*204*/, 2 /*205*/, 2 /*206*/, 3 /*207*/, + 0 /*208*/, 0 /*209*/, 0 /*210*/, 0 /*211*/, 1 /*212*/, 2 /*213*/, 2 /*214*/, 3 /*215*/, + 0 /*216*/, 0 /*217*/, 0 /*218*/, 0 /*219*/, 1 /*220*/, 2 /*221*/, 2 /*222*/, 3 /*223*/, + 0 /*224*/, 0 /*225*/, 0 /*226*/, 0 /*227*/, 1 /*228*/, 2 /*229*/, 2 /*230*/, 3 /*231*/, + 0 /*232*/, 0 /*233*/, 0 /*234*/, 0 /*235*/, 1 /*236*/, 2 /*237*/, 2 /*238*/, 3 /*239*/, + 0 /*240*/, 0 /*241*/, 0 /*242*/, 0 /*243*/, 1 /*244*/, 2 /*245*/, 2 /*246*/, 3 /*247*/, + 0 /*248*/, 0 /*249*/, 0 /*250*/, 0 /*251*/, 1 /*252*/, 2 /*253*/, 2 /*254*/, 3 /*255*/}, + // Table for bit 3. + { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 0 /*4*/, 0 /*5*/, 0 /*6*/, 0 /*7*/, + 1 /*8*/, 2 /*9*/, 2 /*10*/, 3 /*11*/, 2 /*12*/, 3 /*13*/, 3 /*14*/, 4 /*15*/, + 0 /*16*/, 0 /*17*/, 0 /*18*/, 0 /*19*/, 0 /*20*/, 0 /*21*/, 0 /*22*/, 0 /*23*/, + 1 /*24*/, 2 /*25*/, 2 /*26*/, 3 /*27*/, 2 /*28*/, 3 /*29*/, 3 /*30*/, 4 /*31*/, + 0 /*32*/, 0 /*33*/, 0 /*34*/, 0 /*35*/, 0 /*36*/, 0 /*37*/, 0 /*38*/, 0 /*39*/, + 1 /*40*/, 2 /*41*/, 2 /*42*/, 3 /*43*/, 2 /*44*/, 3 /*45*/, 3 /*46*/, 4 /*47*/, + 0 /*48*/, 0 /*49*/, 0 /*50*/, 0 /*51*/, 0 /*52*/, 0 /*53*/, 0 /*54*/, 0 /*55*/, + 1 /*56*/, 2 /*57*/, 2 /*58*/, 3 /*59*/, 2 /*60*/, 3 /*61*/, 3 /*62*/, 4 /*63*/, + 0 /*64*/, 0 /*65*/, 0 /*66*/, 0 /*67*/, 0 /*68*/, 0 /*69*/, 0 /*70*/, 0 /*71*/, + 1 /*72*/, 2 /*73*/, 2 /*74*/, 3 /*75*/, 2 /*76*/, 3 /*77*/, 3 /*78*/, 4 /*79*/, + 0 /*80*/, 0 /*81*/, 0 /*82*/, 0 /*83*/, 0 /*84*/, 0 /*85*/, 0 /*86*/, 0 /*87*/, + 1 /*88*/, 2 /*89*/, 2 /*90*/, 3 /*91*/, 2 /*92*/, 3 /*93*/, 3 /*94*/, 4 /*95*/, + 0 /*96*/, 0 /*97*/, 0 /*98*/, 0 /*99*/, 0 /*100*/, 0 /*101*/, 0 /*102*/, 0 /*103*/, + 1 /*104*/, 2 /*105*/, 2 /*106*/, 3 /*107*/, 2 /*108*/, 3 /*109*/, 3 /*110*/, 4 /*111*/, + 0 /*112*/, 0 /*113*/, 0 /*114*/, 0 /*115*/, 0 /*116*/, 0 /*117*/, 0 /*118*/, 0 /*119*/, + 1 /*120*/, 2 /*121*/, 2 /*122*/, 3 /*123*/, 2 /*124*/, 3 /*125*/, 3 /*126*/, 4 /*127*/, + 0 /*128*/, 0 /*129*/, 0 /*130*/, 0 /*131*/, 0 /*132*/, 0 /*133*/, 0 /*134*/, 0 /*135*/, + 1 /*136*/, 2 /*137*/, 2 /*138*/, 3 /*139*/, 2 /*140*/, 3 /*141*/, 3 /*142*/, 4 /*143*/, + 0 /*144*/, 0 /*145*/, 0 /*146*/, 0 /*147*/, 0 /*148*/, 0 /*149*/, 0 /*150*/, 0 /*151*/, + 1 /*152*/, 2 /*153*/, 2 /*154*/, 3 /*155*/, 2 /*156*/, 3 /*157*/, 3 /*158*/, 4 /*159*/, + 0 /*160*/, 0 /*161*/, 0 /*162*/, 0 /*163*/, 0 /*164*/, 0 /*165*/, 0 /*166*/, 0 /*167*/, + 1 /*168*/, 2 /*169*/, 2 /*170*/, 3 /*171*/, 2 /*172*/, 3 /*173*/, 3 /*174*/, 4 /*175*/, + 0 /*176*/, 0 /*177*/, 0 /*178*/, 0 /*179*/, 0 /*180*/, 0 /*181*/, 0 /*182*/, 0 /*183*/, + 1 /*184*/, 2 /*185*/, 2 /*186*/, 3 /*187*/, 2 /*188*/, 3 /*189*/, 3 /*190*/, 4 /*191*/, + 0 /*192*/, 0 /*193*/, 0 /*194*/, 0 /*195*/, 0 /*196*/, 0 /*197*/, 0 /*198*/, 0 /*199*/, + 1 /*200*/, 2 /*201*/, 2 /*202*/, 3 /*203*/, 2 /*204*/, 3 /*205*/, 3 /*206*/, 4 /*207*/, + 0 /*208*/, 0 /*209*/, 0 /*210*/, 0 /*211*/, 0 /*212*/, 0 /*213*/, 0 /*214*/, 0 /*215*/, + 1 /*216*/, 2 /*217*/, 2 /*218*/, 3 /*219*/, 2 /*220*/, 3 /*221*/, 3 /*222*/, 4 /*223*/, + 0 /*224*/, 0 /*225*/, 0 /*226*/, 0 /*227*/, 0 /*228*/, 0 /*229*/, 0 /*230*/, 0 /*231*/, + 1 /*232*/, 2 /*233*/, 2 /*234*/, 3 /*235*/, 2 /*236*/, 3 /*237*/, 3 /*238*/, 4 /*239*/, + 0 /*240*/, 0 /*241*/, 0 /*242*/, 0 /*243*/, 0 /*244*/, 0 /*245*/, 0 /*246*/, 0 /*247*/, + 1 /*248*/, 2 /*249*/, 2 /*250*/, 3 /*251*/, 2 /*252*/, 3 /*253*/, 3 /*254*/, 4 /*255*/}, + // Table for bit 4. + { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 0 /*4*/, 0 /*5*/, 0 /*6*/, 0 /*7*/, + 0 /*8*/, 0 /*9*/, 0 /*10*/, 0 /*11*/, 0 /*12*/, 0 /*13*/, 0 /*14*/, 0 /*15*/, + 1 /*16*/, 2 /*17*/, 2 /*18*/, 3 /*19*/, 2 /*20*/, 3 /*21*/, 3 /*22*/, 4 /*23*/, + 2 /*24*/, 3 /*25*/, 3 /*26*/, 4 /*27*/, 3 /*28*/, 4 /*29*/, 4 /*30*/, 5 /*31*/, + 0 /*32*/, 0 /*33*/, 0 /*34*/, 0 /*35*/, 0 /*36*/, 0 /*37*/, 0 /*38*/, 0 /*39*/, + 0 /*40*/, 0 /*41*/, 0 /*42*/, 0 /*43*/, 0 /*44*/, 0 /*45*/, 0 /*46*/, 0 /*47*/, + 1 /*48*/, 2 /*49*/, 2 /*50*/, 3 /*51*/, 2 /*52*/, 3 /*53*/, 3 /*54*/, 4 /*55*/, + 2 /*56*/, 3 /*57*/, 3 /*58*/, 4 /*59*/, 3 /*60*/, 4 /*61*/, 4 /*62*/, 5 /*63*/, + 0 /*64*/, 0 /*65*/, 0 /*66*/, 0 /*67*/, 0 /*68*/, 0 /*69*/, 0 /*70*/, 0 /*71*/, + 0 /*72*/, 0 /*73*/, 0 /*74*/, 0 /*75*/, 0 /*76*/, 0 /*77*/, 0 /*78*/, 0 /*79*/, + 1 /*80*/, 2 /*81*/, 2 /*82*/, 3 /*83*/, 2 /*84*/, 3 /*85*/, 3 /*86*/, 4 /*87*/, + 2 /*88*/, 3 /*89*/, 3 /*90*/, 4 /*91*/, 3 /*92*/, 4 /*93*/, 4 /*94*/, 5 /*95*/, + 0 /*96*/, 0 /*97*/, 0 /*98*/, 0 /*99*/, 0 /*100*/, 0 /*101*/, 0 /*102*/, 0 /*103*/, + 0 /*104*/, 0 /*105*/, 0 /*106*/, 0 /*107*/, 0 /*108*/, 0 /*109*/, 0 /*110*/, 0 /*111*/, + 1 /*112*/, 2 /*113*/, 2 /*114*/, 3 /*115*/, 2 /*116*/, 3 /*117*/, 3 /*118*/, 4 /*119*/, + 2 /*120*/, 3 /*121*/, 3 /*122*/, 4 /*123*/, 3 /*124*/, 4 /*125*/, 4 /*126*/, 5 /*127*/, + 0 /*128*/, 0 /*129*/, 0 /*130*/, 0 /*131*/, 0 /*132*/, 0 /*133*/, 0 /*134*/, 0 /*135*/, + 0 /*136*/, 0 /*137*/, 0 /*138*/, 0 /*139*/, 0 /*140*/, 0 /*141*/, 0 /*142*/, 0 /*143*/, + 1 /*144*/, 2 /*145*/, 2 /*146*/, 3 /*147*/, 2 /*148*/, 3 /*149*/, 3 /*150*/, 4 /*151*/, + 2 /*152*/, 3 /*153*/, 3 /*154*/, 4 /*155*/, 3 /*156*/, 4 /*157*/, 4 /*158*/, 5 /*159*/, + 0 /*160*/, 0 /*161*/, 0 /*162*/, 0 /*163*/, 0 /*164*/, 0 /*165*/, 0 /*166*/, 0 /*167*/, + 0 /*168*/, 0 /*169*/, 0 /*170*/, 0 /*171*/, 0 /*172*/, 0 /*173*/, 0 /*174*/, 0 /*175*/, + 1 /*176*/, 2 /*177*/, 2 /*178*/, 3 /*179*/, 2 /*180*/, 3 /*181*/, 3 /*182*/, 4 /*183*/, + 2 /*184*/, 3 /*185*/, 3 /*186*/, 4 /*187*/, 3 /*188*/, 4 /*189*/, 4 /*190*/, 5 /*191*/, + 0 /*192*/, 0 /*193*/, 0 /*194*/, 0 /*195*/, 0 /*196*/, 0 /*197*/, 0 /*198*/, 0 /*199*/, + 0 /*200*/, 0 /*201*/, 0 /*202*/, 0 /*203*/, 0 /*204*/, 0 /*205*/, 0 /*206*/, 0 /*207*/, + 1 /*208*/, 2 /*209*/, 2 /*210*/, 3 /*211*/, 2 /*212*/, 3 /*213*/, 3 /*214*/, 4 /*215*/, + 2 /*216*/, 3 /*217*/, 3 /*218*/, 4 /*219*/, 3 /*220*/, 4 /*221*/, 4 /*222*/, 5 /*223*/, + 0 /*224*/, 0 /*225*/, 0 /*226*/, 0 /*227*/, 0 /*228*/, 0 /*229*/, 0 /*230*/, 0 /*231*/, + 0 /*232*/, 0 /*233*/, 0 /*234*/, 0 /*235*/, 0 /*236*/, 0 /*237*/, 0 /*238*/, 0 /*239*/, + 1 /*240*/, 2 /*241*/, 2 /*242*/, 3 /*243*/, 2 /*244*/, 3 /*245*/, 3 /*246*/, 4 /*247*/, + 2 /*248*/, 3 /*249*/, 3 /*250*/, 4 /*251*/, 3 /*252*/, 4 /*253*/, 4 /*254*/, 5 /*255*/ }, + // Table for bit 5. + { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 0 /*4*/, 0 /*5*/, 0 /*6*/, 0 /*7*/, + 0 /*8*/, 0 /*9*/, 0 /*10*/, 0 /*11*/, 0 /*12*/, 0 /*13*/, 0 /*14*/, 0 /*15*/, + 0 /*16*/, 0 /*17*/, 0 /*18*/, 0 /*19*/, 0 /*20*/, 0 /*21*/, 0 /*22*/, 0 /*23*/, + 0 /*24*/, 0 /*25*/, 0 /*26*/, 0 /*27*/, 0 /*28*/, 0 /*29*/, 0 /*30*/, 0 /*31*/, + 1 /*32*/, 2 /*33*/, 2 /*34*/, 3 /*35*/, 2 /*36*/, 3 /*37*/, 3 /*38*/, 4 /*39*/, + 2 /*40*/, 3 /*41*/, 3 /*42*/, 4 /*43*/, 3 /*44*/, 4 /*45*/, 4 /*46*/, 5 /*47*/, + 2 /*48*/, 3 /*49*/, 3 /*50*/, 4 /*51*/, 3 /*52*/, 4 /*53*/, 4 /*54*/, 5 /*55*/, + 3 /*56*/, 4 /*57*/, 4 /*58*/, 5 /*59*/, 4 /*60*/, 5 /*61*/, 5 /*62*/, 6 /*63*/, + 0 /*64*/, 0 /*65*/, 0 /*66*/, 0 /*67*/, 0 /*68*/, 0 /*69*/, 0 /*70*/, 0 /*71*/, + 0 /*72*/, 0 /*73*/, 0 /*74*/, 0 /*75*/, 0 /*76*/, 0 /*77*/, 0 /*78*/, 0 /*79*/, + 0 /*80*/, 0 /*81*/, 0 /*82*/, 0 /*83*/, 0 /*84*/, 0 /*85*/, 0 /*86*/, 0 /*87*/, + 0 /*88*/, 0 /*89*/, 0 /*90*/, 0 /*91*/, 0 /*92*/, 0 /*93*/, 0 /*94*/, 0 /*95*/, + 1 /*96*/, 2 /*97*/, 2 /*98*/, 3 /*99*/, 2 /*100*/, 3 /*101*/, 3 /*102*/, 4 /*103*/, + 2 /*104*/, 3 /*105*/, 3 /*106*/, 4 /*107*/, 3 /*108*/, 4 /*109*/, 4 /*110*/, 5 /*111*/, + 2 /*112*/, 3 /*113*/, 3 /*114*/, 4 /*115*/, 3 /*116*/, 4 /*117*/, 4 /*118*/, 5 /*119*/, + 3 /*120*/, 4 /*121*/, 4 /*122*/, 5 /*123*/, 4 /*124*/, 5 /*125*/, 5 /*126*/, 6 /*127*/, + 0 /*128*/, 0 /*129*/, 0 /*130*/, 0 /*131*/, 0 /*132*/, 0 /*133*/, 0 /*134*/, 0 /*135*/, + 0 /*136*/, 0 /*137*/, 0 /*138*/, 0 /*139*/, 0 /*140*/, 0 /*141*/, 0 /*142*/, 0 /*143*/, + 0 /*144*/, 0 /*145*/, 0 /*146*/, 0 /*147*/, 0 /*148*/, 0 /*149*/, 0 /*150*/, 0 /*151*/, + 0 /*152*/, 0 /*153*/, 0 /*154*/, 0 /*155*/, 0 /*156*/, 0 /*157*/, 0 /*158*/, 0 /*159*/, + 1 /*160*/, 2 /*161*/, 2 /*162*/, 3 /*163*/, 2 /*164*/, 3 /*165*/, 3 /*166*/, 4 /*167*/, + 2 /*168*/, 3 /*169*/, 3 /*170*/, 4 /*171*/, 3 /*172*/, 4 /*173*/, 4 /*174*/, 5 /*175*/, + 2 /*176*/, 3 /*177*/, 3 /*178*/, 4 /*179*/, 3 /*180*/, 4 /*181*/, 4 /*182*/, 5 /*183*/, + 3 /*184*/, 4 /*185*/, 4 /*186*/, 5 /*187*/, 4 /*188*/, 5 /*189*/, 5 /*190*/, 6 /*191*/, + 0 /*192*/, 0 /*193*/, 0 /*194*/, 0 /*195*/, 0 /*196*/, 0 /*197*/, 0 /*198*/, 0 /*199*/, + 0 /*200*/, 0 /*201*/, 0 /*202*/, 0 /*203*/, 0 /*204*/, 0 /*205*/, 0 /*206*/, 0 /*207*/, + 0 /*208*/, 0 /*209*/, 0 /*210*/, 0 /*211*/, 0 /*212*/, 0 /*213*/, 0 /*214*/, 0 /*215*/, + 0 /*216*/, 0 /*217*/, 0 /*218*/, 0 /*219*/, 0 /*220*/, 0 /*221*/, 0 /*222*/, 0 /*223*/, + 1 /*224*/, 2 /*225*/, 2 /*226*/, 3 /*227*/, 2 /*228*/, 3 /*229*/, 3 /*230*/, 4 /*231*/, + 2 /*232*/, 3 /*233*/, 3 /*234*/, 4 /*235*/, 3 /*236*/, 4 /*237*/, 4 /*238*/, 5 /*239*/, + 2 /*240*/, 3 /*241*/, 3 /*242*/, 4 /*243*/, 3 /*244*/, 4 /*245*/, 4 /*246*/, 5 /*247*/, + 3 /*248*/, 4 /*249*/, 4 /*250*/, 5 /*251*/, 4 /*252*/, 5 /*253*/, 5 /*254*/, 6 /*255*/}, + // Table for bit 6. + { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 0 /*4*/, 0 /*5*/, 0 /*6*/, 0 /*7*/, + 0 /*8*/, 0 /*9*/, 0 /*10*/, 0 /*11*/, 0 /*12*/, 0 /*13*/, 0 /*14*/, 0 /*15*/, + 0 /*16*/, 0 /*17*/, 0 /*18*/, 0 /*19*/, 0 /*20*/, 0 /*21*/, 0 /*22*/, 0 /*23*/, + 0 /*24*/, 0 /*25*/, 0 /*26*/, 0 /*27*/, 0 /*28*/, 0 /*29*/, 0 /*30*/, 0 /*31*/, + 0 /*32*/, 0 /*33*/, 0 /*34*/, 0 /*35*/, 0 /*36*/, 0 /*37*/, 0 /*38*/, 0 /*39*/, + 0 /*40*/, 0 /*41*/, 0 /*42*/, 0 /*43*/, 0 /*44*/, 0 /*45*/, 0 /*46*/, 0 /*47*/, + 0 /*48*/, 0 /*49*/, 0 /*50*/, 0 /*51*/, 0 /*52*/, 0 /*53*/, 0 /*54*/, 0 /*55*/, + 0 /*56*/, 0 /*57*/, 0 /*58*/, 0 /*59*/, 0 /*60*/, 0 /*61*/, 0 /*62*/, 0 /*63*/, + 1 /*64*/, 2 /*65*/, 2 /*66*/, 3 /*67*/, 2 /*68*/, 3 /*69*/, 3 /*70*/, 4 /*71*/, + 2 /*72*/, 3 /*73*/, 3 /*74*/, 4 /*75*/, 3 /*76*/, 4 /*77*/, 4 /*78*/, 5 /*79*/, + 2 /*80*/, 3 /*81*/, 3 /*82*/, 4 /*83*/, 3 /*84*/, 4 /*85*/, 4 /*86*/, 5 /*87*/, + 3 /*88*/, 4 /*89*/, 4 /*90*/, 5 /*91*/, 4 /*92*/, 5 /*93*/, 5 /*94*/, 6 /*95*/, + 2 /*96*/, 3 /*97*/, 3 /*98*/, 4 /*99*/, 3 /*100*/, 4 /*101*/, 4 /*102*/, 5 /*103*/, + 3 /*104*/, 4 /*105*/, 4 /*106*/, 5 /*107*/, 4 /*108*/, 5 /*109*/, 5 /*110*/, 6 /*111*/, + 3 /*112*/, 4 /*113*/, 4 /*114*/, 5 /*115*/, 4 /*116*/, 5 /*117*/, 5 /*118*/, 6 /*119*/, + 4 /*120*/, 5 /*121*/, 5 /*122*/, 6 /*123*/, 5 /*124*/, 6 /*125*/, 6 /*126*/, 7 /*127*/, + 0 /*128*/, 0 /*129*/, 0 /*130*/, 0 /*131*/, 0 /*132*/, 0 /*133*/, 0 /*134*/, 0 /*135*/, + 0 /*136*/, 0 /*137*/, 0 /*138*/, 0 /*139*/, 0 /*140*/, 0 /*141*/, 0 /*142*/, 0 /*143*/, + 0 /*144*/, 0 /*145*/, 0 /*146*/, 0 /*147*/, 0 /*148*/, 0 /*149*/, 0 /*150*/, 0 /*151*/, + 0 /*152*/, 0 /*153*/, 0 /*154*/, 0 /*155*/, 0 /*156*/, 0 /*157*/, 0 /*158*/, 0 /*159*/, + 0 /*160*/, 0 /*161*/, 0 /*162*/, 0 /*163*/, 0 /*164*/, 0 /*165*/, 0 /*166*/, 0 /*167*/, + 0 /*168*/, 0 /*169*/, 0 /*170*/, 0 /*171*/, 0 /*172*/, 0 /*173*/, 0 /*174*/, 0 /*175*/, + 0 /*176*/, 0 /*177*/, 0 /*178*/, 0 /*179*/, 0 /*180*/, 0 /*181*/, 0 /*182*/, 0 /*183*/, + 0 /*184*/, 0 /*185*/, 0 /*186*/, 0 /*187*/, 0 /*188*/, 0 /*189*/, 0 /*190*/, 0 /*191*/, + 1 /*192*/, 2 /*193*/, 2 /*194*/, 3 /*195*/, 2 /*196*/, 3 /*197*/, 3 /*198*/, 4 /*199*/, + 2 /*200*/, 3 /*201*/, 3 /*202*/, 4 /*203*/, 3 /*204*/, 4 /*205*/, 4 /*206*/, 5 /*207*/, + 2 /*208*/, 3 /*209*/, 3 /*210*/, 4 /*211*/, 3 /*212*/, 4 /*213*/, 4 /*214*/, 5 /*215*/, + 3 /*216*/, 4 /*217*/, 4 /*218*/, 5 /*219*/, 4 /*220*/, 5 /*221*/, 5 /*222*/, 6 /*223*/, + 2 /*224*/, 3 /*225*/, 3 /*226*/, 4 /*227*/, 3 /*228*/, 4 /*229*/, 4 /*230*/, 5 /*231*/, + 3 /*232*/, 4 /*233*/, 4 /*234*/, 5 /*235*/, 4 /*236*/, 5 /*237*/, 5 /*238*/, 6 /*239*/, + 3 /*240*/, 4 /*241*/, 4 /*242*/, 5 /*243*/, 4 /*244*/, 5 /*245*/, 5 /*246*/, 6 /*247*/, + 4 /*248*/, 5 /*249*/, 5 /*250*/, 6 /*251*/, 5 /*252*/, 6 /*253*/, 6 /*254*/, 7 /*255*/ }, + // Table for bit 7. + { 0 /*0*/, 0 /*1*/, 0 /*2*/, 0 /*3*/, 0 /*4*/, 0 /*5*/, 0 /*6*/, 0 /*7*/, + 0 /*8*/, 0 /*9*/, 0 /*10*/, 0 /*11*/, 0 /*12*/, 0 /*13*/, 0 /*14*/, 0 /*15*/, + 0 /*16*/, 0 /*17*/, 0 /*18*/, 0 /*19*/, 0 /*20*/, 0 /*21*/, 0 /*22*/, 0 /*23*/, + 0 /*24*/, 0 /*25*/, 0 /*26*/, 0 /*27*/, 0 /*28*/, 0 /*29*/, 0 /*30*/, 0 /*31*/, + 0 /*32*/, 0 /*33*/, 0 /*34*/, 0 /*35*/, 0 /*36*/, 0 /*37*/, 0 /*38*/, 0 /*39*/, + 0 /*40*/, 0 /*41*/, 0 /*42*/, 0 /*43*/, 0 /*44*/, 0 /*45*/, 0 /*46*/, 0 /*47*/, + 0 /*48*/, 0 /*49*/, 0 /*50*/, 0 /*51*/, 0 /*52*/, 0 /*53*/, 0 /*54*/, 0 /*55*/, + 0 /*56*/, 0 /*57*/, 0 /*58*/, 0 /*59*/, 0 /*60*/, 0 /*61*/, 0 /*62*/, 0 /*63*/, + 0 /*64*/, 0 /*65*/, 0 /*66*/, 0 /*67*/, 0 /*68*/, 0 /*69*/, 0 /*70*/, 0 /*71*/, + 0 /*72*/, 0 /*73*/, 0 /*74*/, 0 /*75*/, 0 /*76*/, 0 /*77*/, 0 /*78*/, 0 /*79*/, + 0 /*80*/, 0 /*81*/, 0 /*82*/, 0 /*83*/, 0 /*84*/, 0 /*85*/, 0 /*86*/, 0 /*87*/, + 0 /*88*/, 0 /*89*/, 0 /*90*/, 0 /*91*/, 0 /*92*/, 0 /*93*/, 0 /*94*/, 0 /*95*/, + 0 /*96*/, 0 /*97*/, 0 /*98*/, 0 /*99*/, 0 /*100*/, 0 /*101*/, 0 /*102*/, 0 /*103*/, + 0 /*104*/, 0 /*105*/, 0 /*106*/, 0 /*107*/, 0 /*108*/, 0 /*109*/, 0 /*110*/, 0 /*111*/, + 0 /*112*/, 0 /*113*/, 0 /*114*/, 0 /*115*/, 0 /*116*/, 0 /*117*/, 0 /*118*/, 0 /*119*/, + 0 /*120*/, 0 /*121*/, 0 /*122*/, 0 /*123*/, 0 /*124*/, 0 /*125*/, 0 /*126*/, 0 /*127*/, + 1 /*128*/, 2 /*129*/, 2 /*130*/, 3 /*131*/, 2 /*132*/, 3 /*133*/, 3 /*134*/, 4 /*135*/, + 2 /*136*/, 3 /*137*/, 3 /*138*/, 4 /*139*/, 3 /*140*/, 4 /*141*/, 4 /*142*/, 5 /*143*/, + 2 /*144*/, 3 /*145*/, 3 /*146*/, 4 /*147*/, 3 /*148*/, 4 /*149*/, 4 /*150*/, 5 /*151*/, + 3 /*152*/, 4 /*153*/, 4 /*154*/, 5 /*155*/, 4 /*156*/, 5 /*157*/, 5 /*158*/, 6 /*159*/, + 2 /*160*/, 3 /*161*/, 3 /*162*/, 4 /*163*/, 3 /*164*/, 4 /*165*/, 4 /*166*/, 5 /*167*/, + 3 /*168*/, 4 /*169*/, 4 /*170*/, 5 /*171*/, 4 /*172*/, 5 /*173*/, 5 /*174*/, 6 /*175*/, + 3 /*176*/, 4 /*177*/, 4 /*178*/, 5 /*179*/, 4 /*180*/, 5 /*181*/, 5 /*182*/, 6 /*183*/, + 4 /*184*/, 5 /*185*/, 5 /*186*/, 6 /*187*/, 5 /*188*/, 6 /*189*/, 6 /*190*/, 7 /*191*/, + 2 /*192*/, 3 /*193*/, 3 /*194*/, 4 /*195*/, 3 /*196*/, 4 /*197*/, 4 /*198*/, 5 /*199*/, + 3 /*200*/, 4 /*201*/, 4 /*202*/, 5 /*203*/, 4 /*204*/, 5 /*205*/, 5 /*206*/, 6 /*207*/, + 3 /*208*/, 4 /*209*/, 4 /*210*/, 5 /*211*/, 4 /*212*/, 5 /*213*/, 5 /*214*/, 6 /*215*/, + 4 /*216*/, 5 /*217*/, 5 /*218*/, 6 /*219*/, 5 /*220*/, 6 /*221*/, 6 /*222*/, 7 /*223*/, + 3 /*224*/, 4 /*225*/, 4 /*226*/, 5 /*227*/, 4 /*228*/, 5 /*229*/, 5 /*230*/, 6 /*231*/, + 4 /*232*/, 5 /*233*/, 5 /*234*/, 6 /*235*/, 5 /*236*/, 6 /*237*/, 6 /*238*/, 7 /*239*/, + 4 /*240*/, 5 /*241*/, 5 /*242*/, 6 /*243*/, 5 /*244*/, 6 /*245*/, 6 /*246*/, 7 /*247*/, + 5 /*248*/, 6 /*249*/, 6 /*250*/, 7 /*251*/, 6 /*252*/, 7 /*253*/, 7 /*254*/, 8 /*255*/ } + }; + +} +// // +/////////////////////////////////////////////////////////////////////////////// + + #endif diff --git a/src/DGtal/base/Common.cpp b/src/DGtal/base/Common.cpp deleted file mode 100644 index 15691ea3de..0000000000 --- a/src/DGtal/base/Common.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/** - * This program is free software: 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - **/ - -/** - * @file Common.cpp - * @author David Coeurjolly (\c david.coeurjolly@liris.cnrs.fr ) - * Laboratoire d'InfoRmatique en Image et Systèmes d'information - LIRIS (CNRS, UMR 5205), CNRS, France - * @author Jacques-Olivier Lachaud (\c jacques-olivier.lachaud@univ-savoie.fr ) - * Laboratory of Mathematics (CNRS, UMR 5807), University of Savoie, France - * - * @date 2009/12/10 - * - * Implementation of methods defined in Common.h - * - * This file is part of the DGtal library. - */ - -/////////////////////////////////////////////////////////////////////////////// -#include "DGtal/base/Common.h" -/////////////////////////////////////////////////////////////////////////////// - -#include - - -/////////////////////////////////////////////////////////////////////////////// -// class Common -/////////////////////////////////////////////////////////////////////////////// - -/** DGtal Global variables -* -**/ -namespace DGtal -{ - -#ifndef NDEBUG -#ifdef __linux__ -#ifdef DGTAL_ENABLE_FLOATING_POINT_EXCEPTIONS - void beforeMain (void) __attribute__((constructor)); - void beforeMain (void) - { - feenableexcept ( FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW ); - } -#endif -#endif -#endif - - TraceWriterTerm traceWriterTerm(std::cerr); - Trace trace(traceWriterTerm); -} -// // -/////////////////////////////////////////////////////////////////////////////// diff --git a/src/DGtal/base/Common.h b/src/DGtal/base/Common.h index 29672c6007..8b4e6892fc 100644 --- a/src/DGtal/base/Common.h +++ b/src/DGtal/base/Common.h @@ -149,8 +149,8 @@ namespace DGtal /** DGtal Global variables * **/ - extern TraceWriterTerm traceWriterTerm; - extern Trace trace; + inline TraceWriterTerm traceWriterTerm(std::cerr); + inline Trace trace(traceWriterTerm); class Board2D; diff --git a/src/DGtal/base/ConstRangeFromPointAdapter.h b/src/DGtal/base/ConstRangeFromPointAdapter.h index 934971be4b..6ade2be5b7 100644 --- a/src/DGtal/base/ConstRangeFromPointAdapter.h +++ b/src/DGtal/base/ConstRangeFromPointAdapter.h @@ -49,6 +49,7 @@ #include "DGtal/base/CConstBidirectionalRangeFromPoint.h" #include "DGtal/base/ConstIteratorAdapter.h" #include "boost/concept_check.hpp" +#include "boost/iterator/reverse_iterator.hpp" ////////////////////////////////////////////////////////////////////////////// namespace DGtal @@ -93,7 +94,7 @@ namespace DGtal typedef typename TRange::Point Point; typedef ConstIteratorAdapter ConstIterator; - typedef std::reverse_iterator ConstReverseIterator; + typedef boost::reverse_iterator ConstReverseIterator; // ------------------------- standard services -------------------------------- diff --git a/src/DGtal/base/ModuleSRC.cmake b/src/DGtal/base/ModuleSRC.cmake deleted file mode 100644 index 72d840ba00..0000000000 --- a/src/DGtal/base/ModuleSRC.cmake +++ /dev/null @@ -1,5 +0,0 @@ - -set(DGTAL_SRC ${DGTAL_SRC} - DGtal/base/Bits.cpp - DGtal/base/Common.cpp) - diff --git a/src/DGtal/base/SimpleConstRange.h b/src/DGtal/base/SimpleConstRange.h index 06d6e18290..f8eea7d478 100644 --- a/src/DGtal/base/SimpleConstRange.h +++ b/src/DGtal/base/SimpleConstRange.h @@ -48,6 +48,7 @@ #include "DGtal/base/Circulator.h" #include "DGtal/base/ConstIteratorAdapter.h" #include "boost/concept_check.hpp" +#include "boost/iterator/reverse_iterator.hpp" ////////////////////////////////////////////////////////////////////////////// namespace DGtal @@ -78,10 +79,10 @@ namespace DGtal public: typedef TConstIterator ConstIterator; - typedef std::reverse_iterator ConstReverseIterator; + typedef boost::reverse_iterator ConstReverseIterator; typedef Circulator ConstCirculator; - typedef std::reverse_iterator ConstReverseCirculator; + typedef boost::reverse_iterator ConstReverseCirculator; // ------------------------- standard services -------------------------------- diff --git a/src/DGtal/base/SimpleRandomAccessConstRangeFromPoint.h b/src/DGtal/base/SimpleRandomAccessConstRangeFromPoint.h index f18b9bae05..3fc104bd6d 100644 --- a/src/DGtal/base/SimpleRandomAccessConstRangeFromPoint.h +++ b/src/DGtal/base/SimpleRandomAccessConstRangeFromPoint.h @@ -47,6 +47,7 @@ #include "DGtal/base/ConstIteratorAdapter.h" #include "DGtal/base/CConstBidirectionalRangeFromPoint.h" #include "boost/concept_check.hpp" +#include "boost/iterator/reverse_iterator.hpp" ////////////////////////////////////////////////////////////////////////////// namespace DGtal @@ -84,10 +85,10 @@ namespace DGtal typedef typename DistanceFunctor::Point Point; typedef TConstIterator ConstIterator; - typedef std::reverse_iterator ConstReverseIterator; + typedef boost::reverse_iterator ConstReverseIterator; typedef Circulator ConstCirculator; - typedef std::reverse_iterator ConstReverseCirculator; + typedef boost::reverse_iterator ConstReverseCirculator; // ------------------------- standard services -------------------------------- diff --git a/src/DGtal/base/SimpleRandomAccessRangeFromPoint.h b/src/DGtal/base/SimpleRandomAccessRangeFromPoint.h index 19b416d81f..831459b4f4 100644 --- a/src/DGtal/base/SimpleRandomAccessRangeFromPoint.h +++ b/src/DGtal/base/SimpleRandomAccessRangeFromPoint.h @@ -47,6 +47,7 @@ #include "DGtal/base/IteratorAdapter.h" #include "DGtal/base/CBidirectionalRangeFromPoint.h" #include "boost/concept_check.hpp" +#include "boost/iterator/reverse_iterator.hpp" ////////////////////////////////////////////////////////////////////////////// namespace DGtal @@ -86,17 +87,17 @@ namespace DGtal typedef TIterator Iterator; typedef TConstIterator ConstIterator; - typedef std::reverse_iterator ReverseIterator; - typedef std::reverse_iterator ConstReverseIterator; + typedef boost::reverse_iterator ReverseIterator; + typedef boost::reverse_iterator ConstReverseIterator; typedef TIterator OutputIterator; - typedef std::reverse_iterator ReverseOutputIterator; + typedef boost::reverse_iterator ReverseOutputIterator; typedef DGtal::Circulator Circulator; - typedef std::reverse_iterator ReverseCirculator; + typedef boost::reverse_iterator ReverseCirculator; typedef DGtal::Circulator ConstCirculator; - typedef std::reverse_iterator ConstReverseCirculator; + typedef boost::reverse_iterator ConstReverseCirculator; // ------------------------- standard services -------------------------------- diff --git a/src/DGtal/base/TiledImageBidirectionalConstRangeFromPoint.h b/src/DGtal/base/TiledImageBidirectionalConstRangeFromPoint.h index bfb2565367..1466b9f957 100644 --- a/src/DGtal/base/TiledImageBidirectionalConstRangeFromPoint.h +++ b/src/DGtal/base/TiledImageBidirectionalConstRangeFromPoint.h @@ -47,6 +47,7 @@ #include "DGtal/base/ConstIteratorAdapter.h" #include "DGtal/base/CConstBidirectionalRangeFromPoint.h" #include "boost/concept_check.hpp" +#include "boost/iterator/reverse_iterator.hpp" ////////////////////////////////////////////////////////////////////////////// namespace DGtal @@ -82,10 +83,10 @@ namespace DGtal typedef typename TiledImage::Point Point; typedef typename TiledImage::ConstIterator ConstIterator; - typedef std::reverse_iterator ConstReverseIterator; + typedef boost::reverse_iterator ConstReverseIterator; typedef Circulator ConstCirculator; - typedef std::reverse_iterator ConstReverseCirculator; + typedef boost::reverse_iterator ConstReverseCirculator; // ------------------------- standard services -------------------------------- diff --git a/src/DGtal/base/TiledImageBidirectionalRangeFromPoint.h b/src/DGtal/base/TiledImageBidirectionalRangeFromPoint.h index a729943531..c2beeb9eac 100644 --- a/src/DGtal/base/TiledImageBidirectionalRangeFromPoint.h +++ b/src/DGtal/base/TiledImageBidirectionalRangeFromPoint.h @@ -47,6 +47,7 @@ #include "DGtal/base/IteratorAdapter.h" #include "DGtal/base/CBidirectionalRangeFromPoint.h" #include "boost/concept_check.hpp" +#include "boost/iterator/reverse_iterator.hpp" ////////////////////////////////////////////////////////////////////////////// namespace DGtal @@ -85,14 +86,14 @@ namespace DGtal typedef typename TiledImage::OutputIterator Iterator; typedef typename TiledImage::ConstIterator ConstIterator; - typedef std::reverse_iterator ReverseIterator; - typedef std::reverse_iterator ConstReverseIterator; + typedef boost::reverse_iterator ReverseIterator; + typedef boost::reverse_iterator ConstReverseIterator; typedef typename TiledImage::OutputIterator OutputIterator; - typedef std::reverse_iterator ReverseOutputIterator; + typedef boost::reverse_iterator ReverseOutputIterator; // typedef Circulator Circulator; - // typedef std::reverse_iterator ReverseCirculator; + // typedef boost::reverse_iterator ReverseCirculator; // ------------------------- standard services -------------------------------- diff --git a/src/DGtal/base/doc/moduleFunctors.dox b/src/DGtal/base/doc/moduleFunctors.dox index 0c1fca1e03..82c94fe50f 100644 --- a/src/DGtal/base/doc/moduleFunctors.dox +++ b/src/DGtal/base/doc/moduleFunctors.dox @@ -710,7 +710,7 @@ public: // Ranges and iterators using ConstIterator = boost::transform_iterator< std::reference_wrapper, typename Domain::ConstIterator >; - using ConstReverseIterator = std::reverse_iterator< ConstIterator >; + using ConstReverseIterator = boost::reverse_iterator< ConstIterator >; class ConstRange; // To be defined... // Constructor diff --git a/src/DGtal/base/doc/moduleIteratorsRanges.dox b/src/DGtal/base/doc/moduleIteratorsRanges.dox index 5354bc4cd7..92f2744379 100644 --- a/src/DGtal/base/doc/moduleIteratorsRanges.dox +++ b/src/DGtal/base/doc/moduleIteratorsRanges.dox @@ -220,7 +220,7 @@ as follows: In order to take profit of the whole DGtal framework, you should use -DGtal::ReverseIterator instead of std::reverse_iterator or +DGtal::ReverseIterator instead of boost::reverse_iterator or even boost::reverse_iterator. #include "DGtal/base/ReverseIterator.h" diff --git a/src/DGtal/dec/ATSolver2D.h b/src/DGtal/dec/ATSolver2D.h index bbc95323d3..ba916038ff 100644 --- a/src/DGtal/dec/ATSolver2D.h +++ b/src/DGtal/dec/ATSolver2D.h @@ -903,7 +903,7 @@ namespace DGtal void updateSmallestEpsilonMap( const double threshold = .5 ) { const KSpace& K = ptrCalculus->myKSpace; - for ( const SCell surfel : ptrCalculus->template getIndexedSCells<2, PRIMAL>() ) + for ( const SCell& surfel : ptrCalculus->template getIndexedSCells<2, PRIMAL>() ) { const Cell face = K.unsigns( surfel ); const Dimension k1 = * K.uDirs( face ); diff --git a/src/DGtal/doc/moduleBuildDGtal.dox b/src/DGtal/doc/moduleBuildDGtal.dox index 1ea3f0be4b..c7405b52da 100644 --- a/src/DGtal/doc/moduleBuildDGtal.dox +++ b/src/DGtal/doc/moduleBuildDGtal.dox @@ -33,9 +33,9 @@ manage the project build on various systems. To build DGtal in is minimal configuration, you need at least these dependencies: -- \e c++ compiler (g++, clang++, ...) with C++17 features -- \e [cmake](http://cmake.org) (>3.1, optionally cmake-gui), -- \e |boost](http://www.boost.org) boost >= 1.50.0 (no need to have the libraries installed) +- \e c++ compiler (g++, clang++, ...) with C++20 features +- \e [cmake](http://cmake.org) (>3.2, optionally cmake-gui), +- \e [boost](http://www.boost.org) boost >= 1.50.0 (no need to have the libraries installed) - \e zlib (already available in most OS) To build DGtal in is full configuration, you may need these dependencies too: @@ -45,7 +45,7 @@ To build DGtal in is full configuration, you may need these dependencies too: - \e [libIGL](https://libigl.github.io), - \e cairo, - \e qglviewer, -- \e insighttoolkit (ITK), +- \e insighttoolkit, itk >= 5.0 - \e [HDF5](http://www.hdfgroup.org/HDF5/) If you want to generate the documentation, you would need: @@ -59,7 +59,7 @@ cmake will install all libraries (which may take some time for the first build). ``` conan profile detect --force ##Conan profile cd build -conan install .. --build=missing +conan install .. --build=missing -s:a compiler.cppstd=20 cmake .. -G "Visual Studio 15 2017" -DCMAKE_TOOLCHAIN_FILE="conan_toolchain.cmake" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW ``` diff --git a/src/DGtal/doc/moduleHowToUseDGtal.dox b/src/DGtal/doc/moduleHowToUseDGtal.dox index 04780ae48d..644765884a 100644 --- a/src/DGtal/doc/moduleHowToUseDGtal.dox +++ b/src/DGtal/doc/moduleHowToUseDGtal.dox @@ -77,8 +77,8 @@ CMakeLists.txt such that: PROJECT(Helloworld) #Required in DGtal -CMAKE_MINIMUM_REQUIRED(VERSION 3.11) -set(CMAKE_CXX_STANDARD 11) +CMAKE_MINIMUM_REQUIRED(VERSION 3.20) +set(CMAKE_CXX_STANDARD 20) FIND_PACKAGE(DGtal REQUIRED) INCLUDE_DIRECTORIES(${DGTAL_INCLUDE_DIRS}) diff --git a/src/DGtal/geometry/curves/CSegmentFactory.h b/src/DGtal/geometry/curves/CSegmentFactory.h index 15396a0f04..5c8f6d3e2d 100644 --- a/src/DGtal/geometry/curves/CSegmentFactory.h +++ b/src/DGtal/geometry/curves/CSegmentFactory.h @@ -62,7 +62,7 @@ namespace DGtal # Associated types - Self, its own type - - Reverse, same as Self but using std::reverse_iterator + - Reverse, same as Self but using boost::reverse_iterator instead of Self::ConstIterator as the underlying iterator # Notation diff --git a/src/DGtal/geometry/curves/FrechetShortcut.h b/src/DGtal/geometry/curves/FrechetShortcut.h index a126464700..a2178a47ad 100644 --- a/src/DGtal/geometry/curves/FrechetShortcut.h +++ b/src/DGtal/geometry/curves/FrechetShortcut.h @@ -46,6 +46,7 @@ #include "DGtal/kernel/PointVector.h" #include "DGtal/arithmetic/IntegerComputer.h" #include +#include #include ////////////////////////////////////////////////////////////////////////////// @@ -122,7 +123,7 @@ namespace DGtal //required types typedef TIterator ConstIterator; typedef FrechetShortcut Self; - typedef FrechetShortcut,Integer> Reverse; + typedef FrechetShortcut,Integer> Reverse; //2D point and 2D vector typedef typename IteratorCirculatorTraits::Value Point; diff --git a/src/DGtal/geometry/curves/FrechetShortcut.ih b/src/DGtal/geometry/curves/FrechetShortcut.ih index af20530c12..acc914f86e 100644 --- a/src/DGtal/geometry/curves/FrechetShortcut.ih +++ b/src/DGtal/geometry/curves/FrechetShortcut.ih @@ -633,7 +633,7 @@ DGtal::FrechetShortcut & DGtal::FrechetShortcut inline -DGtal::FrechetShortcut,TInteger> +DGtal::FrechetShortcut,TInteger> DGtal::FrechetShortcut ::getReverse() const { diff --git a/src/DGtal/geometry/curves/FreemanChain.h b/src/DGtal/geometry/curves/FreemanChain.h index 457d54e58b..e0267cec6f 100644 --- a/src/DGtal/geometry/curves/FreemanChain.h +++ b/src/DGtal/geometry/curves/FreemanChain.h @@ -62,6 +62,8 @@ #include "DGtal/topology/KhalimskySpaceND.h" #include "DGtal/base/ConstAlias.h" +#include "boost/iterator/reverse_iterator.hpp" + ////////////////////////////////////////////////////////////////////////////// @@ -399,7 +401,7 @@ class CodesRange typedef std::string::const_iterator ConstIterator; typedef std::string::const_reverse_iterator ConstReverseIterator; typedef Circulator ConstCirculator; - typedef std::reverse_iterator ConstReverseCirculator; + typedef boost::reverse_iterator ConstReverseCirculator; // ------------------------- standard services -------------------------------- diff --git a/src/DGtal/geometry/curves/StabbingCircleComputer.h b/src/DGtal/geometry/curves/StabbingCircleComputer.h index 0d490c951b..e8a750eb70 100644 --- a/src/DGtal/geometry/curves/StabbingCircleComputer.h +++ b/src/DGtal/geometry/curves/StabbingCircleComputer.h @@ -51,6 +51,7 @@ #include "DGtal/geometry/tools/Preimage2D.h" #include "DGtal/shapes/fromPoints/CircleFrom3Points.h" #include "DGtal/shapes/fromPoints/Point2ShapePredicate.h" +#include "boost/iterator/reverse_iterator.hpp" ////////////////////////////////////////////////////////////////////////////// diff --git a/src/DGtal/geometry/curves/StabbingCircleComputer.ih b/src/DGtal/geometry/curves/StabbingCircleComputer.ih index a65cdf9f42..ba406027b2 100644 --- a/src/DGtal/geometry/curves/StabbingCircleComputer.ih +++ b/src/DGtal/geometry/curves/StabbingCircleComputer.ih @@ -100,9 +100,9 @@ DGtal::StabbingCircleComputer::operator==( const Self& other ) c } bool flag2 = true; { - std::reverse_iterator rfirst1(myEnd); + boost::reverse_iterator rfirst1(myEnd); ConstIterator first2 = other.myBegin; - while ( ( ( rfirst1 != std::reverse_iterator(myBegin) ) + while ( ( ( rfirst1 != boost::reverse_iterator(myBegin) ) ||( first2 != other.myEnd ) ) && (flag2) ) { @@ -111,7 +111,7 @@ DGtal::StabbingCircleComputer::operator==( const Self& other ) c if ( (pair1.first != pair2.first)||(pair1.second != pair2.second) ) flag2 = false; ++rfirst1; ++first2; } - if ( (rfirst1 != std::reverse_iterator(myBegin)) + if ( (rfirst1 != boost::reverse_iterator(myBegin)) || (first2 != other.myEnd) ) flag2 = false; } @@ -456,16 +456,16 @@ DGtal::StabbingCircleComputer::isExtendableBack() if (!p1(aP)) { Point Pf, Pl, Qf, Ql; - std::reverse_iterator ritb(myEnd); - std::reverse_iterator rite(myBegin); + boost::reverse_iterator ritb(myEnd); + boost::reverse_iterator rite(myBegin); if (isCircularlySeparable(ritb,rite,aP,Pf,Pl,Qf,Ql)) isOK = true; } else if (!p2(aQ)) { Point Pf, Pl, Qf, Ql; - std::reverse_iterator ritb(myEnd); - std::reverse_iterator rite(myBegin); + boost::reverse_iterator ritb(myEnd); + boost::reverse_iterator rite(myBegin); if (isCircularlySeparable(ritb,rite,aQ,Pf,Pl,Qf,Ql)) isOK = true; } @@ -479,8 +479,8 @@ DGtal::StabbingCircleComputer::isExtendableBack() else { Point Pf, Pl, Qf, Ql; - std::reverse_iterator ritb(myEnd); - std::reverse_iterator rite(myBegin); + boost::reverse_iterator ritb(myEnd); + boost::reverse_iterator rite(myBegin); if (mySegPtr->isOppositeEndConvex()) { //convex part if (isCircularlySeparable(ritb,rite,aQ,Pf,Pl,Qf,Ql)) @@ -525,8 +525,8 @@ DGtal::StabbingCircleComputer::extendBack() if (!p1(aP)) { Point Pf, Pl, Qf, Ql; - std::reverse_iterator ritb(myEnd); - std::reverse_iterator rite(myBegin); + boost::reverse_iterator ritb(myEnd); + boost::reverse_iterator rite(myBegin); if (isCircularlySeparable(ritb,rite,aP,Pf,Pl,Qf,Ql)) { myCircle.init(aP,Pf,Ql); @@ -536,8 +536,8 @@ DGtal::StabbingCircleComputer::extendBack() else if (!p2(aQ)) { Point Pf, Pl, Qf, Ql; - std::reverse_iterator ritb(myEnd); - std::reverse_iterator rite(myBegin); + boost::reverse_iterator ritb(myEnd); + boost::reverse_iterator rite(myBegin); if (isCircularlySeparable(ritb,rite,aQ,Pf,Pl,Qf,Ql)) { myCircle.init(aQ,Qf,Pl); @@ -554,8 +554,8 @@ DGtal::StabbingCircleComputer::extendBack() else { Point Pf, Pl, Qf, Ql; - std::reverse_iterator ritb(myEnd); - std::reverse_iterator rite(myBegin); + boost::reverse_iterator ritb(myEnd); + boost::reverse_iterator rite(myBegin); if (mySegPtr->isOppositeEndConvex()) { //convex part diff --git a/src/DGtal/geometry/doc/moduleGridCurveAnalysis.dox b/src/DGtal/geometry/doc/moduleGridCurveAnalysis.dox index 1ef5162122..41da993d81 100644 --- a/src/DGtal/geometry/doc/moduleGridCurveAnalysis.dox +++ b/src/DGtal/geometry/doc/moduleGridCurveAnalysis.dox @@ -216,7 +216,7 @@ the following nested types: - Reverse (like Self but based on reverse iterators) Reverse is a type that behaves like Self but based on -std::reverse_iterator instead of ConstIterator. +boost::reverse_iterator instead of ConstIterator. Moreover, in order to build an instance of Self (resp. Reverse) from a segment computer, the following methods should be defined: diff --git a/src/DGtal/geometry/surfaces/ParallelStrip.h b/src/DGtal/geometry/surfaces/ParallelStrip.h index f699c6fc32..901e255849 100644 --- a/src/DGtal/geometry/surfaces/ParallelStrip.h +++ b/src/DGtal/geometry/surfaces/ParallelStrip.h @@ -155,7 +155,7 @@ namespace DGtal Scalar mu() const; /** - Same as \ref width(). + Same as \ref ParallelStrip::width(). @return the width of the strip, i.e. the parameter \f$\nu\f$ such that \f$N \cdot X \le \mu + \nu\f$. */ diff --git a/src/DGtal/geometry/tools/MelkmanConvexHull.h b/src/DGtal/geometry/tools/MelkmanConvexHull.h index 8261994a96..86293b257f 100644 --- a/src/DGtal/geometry/tools/MelkmanConvexHull.h +++ b/src/DGtal/geometry/tools/MelkmanConvexHull.h @@ -208,7 +208,11 @@ namespace DGtal // ------------------------- Private Datas -------------------------------- - private: + private: + /** + * Used to define a default functor to allow default constructor + **/ + Functor myDefaultFunctor{}; /** * Deque container, which stores the vertices of the convex hull * NB: the first and last point is the same. @@ -221,11 +225,7 @@ namespace DGtal /** * Predicate devoted to the forward scan */ - ForwardPredicate myForwardPredicate; - /** - * Used to define a default functor to allow default constructor - **/ - Functor myDefaultFunctor; + ForwardPredicate myForwardPredicate; /** * first point used to reverse the convexhull container. **/ diff --git a/src/DGtal/geometry/volumes/BoundedLatticePolytopeCounter.h b/src/DGtal/geometry/volumes/BoundedLatticePolytopeCounter.h index b1fbd1b752..5da81b2aa5 100644 --- a/src/DGtal/geometry/volumes/BoundedLatticePolytopeCounter.h +++ b/src/DGtal/geometry/volumes/BoundedLatticePolytopeCounter.h @@ -161,7 +161,6 @@ namespace DGtal /// @param[out] pts the range of lattice points that are interior to this polytope. /// @param a any axis with 0 <= a < d, where d is the dimension of the space. - /// @return the lattice points strictly inside the current polytope. /// /// @note The result does not depend on parameter \a a, but the /// speed of computation depends on this choice. The best choice diff --git a/src/DGtal/graph/DigitalSurfaceBoostGraphInterface.h b/src/DGtal/graph/DigitalSurfaceBoostGraphInterface.h index fdc71100a7..08cd61cbb3 100644 --- a/src/DGtal/graph/DigitalSurfaceBoostGraphInterface.h +++ b/src/DGtal/graph/DigitalSurfaceBoostGraphInterface.h @@ -148,10 +148,10 @@ namespace boost other (potentially) iterators, through a DGtal::CountedPtr. When the last iterator pointing in this structure is desallocated, the container is automatically desallocated. This is for instance - used by function \ref adjacent_vertices, which returns a pair + used by function \ref boost::adjacent_vertices, which returns a pair of adjacency_iterator, both points on the same container. Another problem is that the user may have called - twice \ref adjacent_vertices on the same vertex, and may wish + twice \ref boost::adjacent_vertices on the same vertex, and may wish to compare iterators obtained by two different calls. @code @@ -227,9 +227,9 @@ namespace boost (potentially) iterators, through a DGtal::CountedPtr. When the last iterator pointing in this structure is desallocated, the container is automatically desallocated. This is for instance - used by function \ref out_edges, which returns a pair of + used by function \ref boost::out_edges, which returns a pair of out_edge_iterator, both points on the same container. Another - problem is that the user may have called twice \ref out_edges + problem is that the user may have called twice \ref boost::out_edges on the same vertex, and may wish to compare iterators obtained by two different calls.. @@ -304,9 +304,9 @@ namespace boost provide a method that outputs them. Therefore, this iterator mixes a vertex_iterator (to visit all vertices) and a local out_edge_iterator (to visit all out edges of each vertex). This - is for instance used by function \ref edges, which returns a + is for instance used by function \ref boost::edges, which returns a pair of edge_iterator. A potential problem is that the user may - have called twice \ref edges, and may wish to compare iterators + have called twice \ref boost::edges, and may wish to compare iterators obtained by two different calls. Here, edges are constructed on the fly, hence iterators may not point on the same container even if the values are the same. diff --git a/src/DGtal/graph/ObjectBoostGraphInterface.h b/src/DGtal/graph/ObjectBoostGraphInterface.h index 122876add9..7081655962 100644 --- a/src/DGtal/graph/ObjectBoostGraphInterface.h +++ b/src/DGtal/graph/ObjectBoostGraphInterface.h @@ -141,10 +141,10 @@ namespace boost other (potentially) iterators, through a DGtal::CountedPtr. When the last iterator pointing in this structure is deallocated, the container is automatically deallocated. This is for instance - used by function \ref adjacent_vertices, which returns a pair + used by function \ref boost::adjacent_vertices, which returns a pair of adjacency_iterator, both points on the same container. Another problem is that the user may have called - twice \ref adjacent_vertices on the same vertex, and may wish + twice \ref boost::adjacent_vertices on the same vertex, and may wish to compare iterators obtained by two different calls. @code @@ -258,9 +258,9 @@ namespace boost (potentially) iterators, through a DGtal::CountedPtr. When the last iterator pointing in this structure is deallocated, the container is automatically deallocated. This is for instance - used by function \ref out_edges, which returns a pair of + used by function \ref boost::out_edges, which returns a pair of out_edge_iterator, both points on the same container. Another - problem is that the user may have called twice \ref out_edges + problem is that the user may have called twice \ref boost::out_edges on the same vertex, and may wish to compare iterators obtained by two different calls.. @@ -373,9 +373,9 @@ namespace boost provide a method that outputs them. Therefore, this iterator mixes a vertex_iterator (to visit all vertices) and a local out_edge_iterator (to visit all out edges of each vertex). This - is for instance used by function \ref edges, which returns a + is for instance used by function \ref boost::edges, which returns a pair of edge_iterator. A potential problem is that the user may - have called twice \ref edges, and may wish to compare iterators + have called twice \ref boost::edges, and may wish to compare iterators obtained by two different calls. Here, edges are constructed on the fly, hence iterators may not point on the same container even if the values are the same. diff --git a/src/DGtal/images/ConstImageFunctorHolder.h b/src/DGtal/images/ConstImageFunctorHolder.h index 263813a72b..04006ab87e 100644 --- a/src/DGtal/images/ConstImageFunctorHolder.h +++ b/src/DGtal/images/ConstImageFunctorHolder.h @@ -45,6 +45,7 @@ #include #include +#include #include "DGtal/kernel/domains/CDomain.h" #include "DGtal/base/FunctorHolder.h" @@ -120,7 +121,7 @@ class ConstImageFunctorHolder using Functor = TFunctor; using ConstIterator = boost::transform_iterator< std::reference_wrapper, typename Domain::ConstIterator >; - using ConstReverseIterator = std::reverse_iterator< ConstIterator >; + using ConstReverseIterator = boost::reverse_iterator< ConstIterator >; class ConstRange; BOOST_STATIC_CONSTANT( Dimension, dimension = Domain::Space::dimension ); diff --git a/src/DGtal/images/DefaultConstImageRange.h b/src/DGtal/images/DefaultConstImageRange.h index 10340719a7..d807219937 100644 --- a/src/DGtal/images/DefaultConstImageRange.h +++ b/src/DGtal/images/DefaultConstImageRange.h @@ -48,6 +48,7 @@ #include "DGtal/images/CTrivialConstImage.h" #include "DGtal/images/SetValueIterator.h" #include "boost/concept_check.hpp" +#include "boost/iterator/reverse_iterator.hpp" ////////////////////////////////////////////////////////////////////////////// namespace DGtal @@ -88,7 +89,7 @@ namespace DGtal /// constant iterator types BOOST_CONCEPT_ASSERT(( concepts::CDomain )); typedef ConstIteratorAdapter ConstIterator; - typedef std::reverse_iterator ConstReverseIterator; + typedef boost::reverse_iterator ConstReverseIterator; // ------------------------- standard services -------------------------------- diff --git a/src/DGtal/images/DefaultImageRange.h b/src/DGtal/images/DefaultImageRange.h index a34b6490f4..2e74687fff 100644 --- a/src/DGtal/images/DefaultImageRange.h +++ b/src/DGtal/images/DefaultImageRange.h @@ -47,6 +47,7 @@ #include "DGtal/images/CTrivialImage.h" #include "DGtal/images/SetValueIterator.h" #include "boost/concept_check.hpp" +#include "boost/iterator/reverse_iterator.hpp" ////////////////////////////////////////////////////////////////////////////// namespace DGtal @@ -88,7 +89,7 @@ namespace DGtal /// constant iterator types BOOST_CONCEPT_ASSERT(( concepts::CDomain )); typedef ConstIteratorAdapter ConstIterator; - typedef std::reverse_iterator ConstReverseIterator; + typedef boost::reverse_iterator ConstReverseIterator; /// output iterator types typedef SetValueIterator OutputIterator; diff --git a/src/DGtal/images/ImageSelector.h b/src/DGtal/images/ImageSelector.h index 7221a1140b..ee7eb3bbda 100644 --- a/src/DGtal/images/ImageSelector.h +++ b/src/DGtal/images/ImageSelector.h @@ -54,9 +54,15 @@ namespace DGtal { - enum ImageIterability { HIGH_ITER_IMAGE = 0 , LOW_ITER_I = 1}; - enum ImageBelongTestability { HIGH_BEL_I = 0, LOW_BEL_I = 2 }; - enum ImageSpecificContainer { NORMAL_CONTAINER_I = 0, VTKIMAGEDATA_CONTAINER_I = 4, ITKIMAGEDATA_CONTAINER_I = 5}; + // Since c++20, arithmetic between different enums types are disabled + // (https://eel.is/c++draft/diff.iso#diff.expr-2) + inline constexpr int HIGH_ITER_IMAGE = 0; + inline constexpr int LOW_ITER_I = 1; + inline constexpr int HIGH_BEL_I = 0; + inline constexpr int LOW_BEL_I = 2; + inline constexpr int NORMAL_CONTAINER_I = 0; + inline constexpr int VTKIMAGEDATA_CONTAINER_I = 4; + inline constexpr int ITKIMAGEDATA_CONTAINER_I = 5; ///////////////////////////////////////////////////////////////////////////// // template class ImageSelector diff --git a/src/DGtal/images/TiledImage.h b/src/DGtal/images/TiledImage.h index 6174f9dfe6..5f4f4bfbd7 100644 --- a/src/DGtal/images/TiledImage.h +++ b/src/DGtal/images/TiledImage.h @@ -53,6 +53,8 @@ #include "DGtal/base/TiledImageBidirectionalConstRangeFromPoint.h" #include "DGtal/base/TiledImageBidirectionalRangeFromPoint.h" + +#include "boost/iterator/reverse_iterator.hpp" ////////////////////////////////////////////////////////////////////////////// namespace DGtal @@ -449,7 +451,7 @@ namespace DGtal typedef TiledIterator ConstIterator; typedef TiledIterator OutputIterator; - typedef std::reverse_iterator ReverseTiledIterator; + typedef boost::reverse_iterator ReverseTiledIterator; typedef ReverseTiledIterator ConstReverseIterator; typedef ReverseTiledIterator ReverseOutputIterator; diff --git a/src/DGtal/io/Color.cpp b/src/DGtal/io/Color.cpp deleted file mode 100644 index e737ac6c9a..0000000000 --- a/src/DGtal/io/Color.cpp +++ /dev/null @@ -1,246 +0,0 @@ -/** - * This program is free software: 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - **/ - -/** - * @file Color.cpp - * @author Bertrand Kerautret (\c kerautre@loria.fr ) - * LORIA (CNRS, UMR 7503), University of Nancy, France - * - * @date 2011/07/17 - * - * Implementation of methods defined in Color.h - * - * This file is part of the DGtal library. - */ - -/////////////////////////////////////////////////////////////////////////////// -#include "DGtal/io/Color.h" -/////////////////////////////////////////////////////////////////////////////// - -using namespace std; - -/////////////////////////////////////////////////////////////////////////////// -// class Color -/////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -// Standard services - public : - - -DGtal::Color::Color( const unsigned int rgb, unsigned char aAlphaValue ) - :myAlpha( aAlphaValue ) -{ - myRed = ( rgb & 0xFF0000u ) >> 16; - myGreen = ( rgb & 0xFF00u ) >> 8; - myBlue = rgb & 0xFF; -} - - -DGtal::Color & -DGtal::Color::setRGBA( const DGtal::uint32_t aRGBA ) -{ - myRed = ( aRGBA & 0xFF000000u ) >> 24; - myGreen = ( aRGBA & 0xFF0000u ) >> 16; - myBlue = ( aRGBA & 0xFF00u ) >> 8; - myAlpha = aRGBA & 0xFF; - return *this; -} - - -DGtal::Color & -DGtal::Color::setRGBf( float aRedValue, - float aGreenValue, - float aBlueValue, - float aAlphaValue ) { - if ( aRedValue > 1.0f ) aRedValue = 1.0f; - if ( aRedValue < 0.0f ) aRedValue = 0.0f; - myRed = static_cast( 255 * aRedValue ); - if ( aGreenValue > 1.0f ) aGreenValue = 1.0f; - if ( aGreenValue < 0.0f ) aGreenValue = 0.0f; - myGreen = static_cast( 255 * aGreenValue ); - if ( aBlueValue > 1.0f ) aBlueValue = 1.0f; - if ( aBlueValue < 0.0f ) aBlueValue = 0.0f; - myBlue = static_cast( 255 * aBlueValue ); - if ( aAlphaValue > 1.0f ) aAlphaValue = 1.0f; - if ( aAlphaValue < 0.0f ) aAlphaValue = 0.0f; - myAlpha = static_cast( 255 * aAlphaValue ); - return *this; -} - - - -bool -DGtal::Color::operator==( const Color & aColor ) const -{ - return myRed == aColor.myRed - && myGreen == aColor.myGreen - && myBlue == aColor.myBlue - && myAlpha == aColor.myAlpha; -} - -bool -DGtal::Color::operator!=( const Color & aColor ) const -{ - return myRed != aColor.myRed - || myGreen != aColor.myGreen - || myBlue != aColor.myBlue - || myAlpha != aColor.myAlpha; -} - -bool -DGtal::Color::operator<( const Color & aColor ) const -{ - if ( myRed < aColor.myRed ) - return true; - if ( myRed == aColor.myRed ) { - if ( myGreen < aColor.myGreen ) - return true; - if ( myGreen == aColor.myGreen ) { - if ( myBlue < aColor.myBlue ) - return true; - if ( myBlue == aColor.myBlue ) - return myAlpha < aColor.myAlpha; - } - } - return false; -} - -bool -DGtal::Color::operator>( const Color & aColor ) const -{ - return !this->operator<(aColor); -} - -bool -DGtal::Color::operator<=( const Color & aColor ) const -{ - return this->operator<(aColor) || this->operator==(aColor); -} - -bool -DGtal::Color::operator>=( const Color & aColor ) const -{ - return this->operator>(aColor) || this->operator==(aColor); -} - - -void -DGtal::Color::flushPostscript( std::ostream & stream ) const -{ - stream << ((double)myRed/255.0) << " " - << ((double)myGreen/255.0) << " " - << ((double)myBlue/255.0) << " srgb\n"; -} - -string -DGtal::Color::postscript() const -{ - char buffer[255]; - secured_sprintf( buffer, 255, "%.4f %.4f %.4f", myRed/255.0, myGreen/255.0, myBlue/255.0 ); - return buffer; -} - -string -DGtal::Color::svg() const -{ - char buffer[255]; - if ( *this == DGtal::Color::None ) return "none"; - secured_sprintf( buffer, 255, "rgb(%d,%d,%d)",myRed, myGreen, myBlue ); - return buffer; -} - -string -DGtal::Color::svgAlpha( const char * prefix ) const -{ - char buffer[255]; - if ( myAlpha == 255 || *this == DGtal::Color::None ) return ""; - secured_sprintf( buffer, 255, " %s-opacity=\"%f\"", prefix, myAlpha/255.0f ); - return buffer; -} - -string -DGtal::Color::tikz() const -{ - // see tex/generic/pgf/utilities/pgfutil-plain.def for color definitions - char buffer[255]; - if ( *this == DGtal::Color::None ) return "none"; - if ( *this == DGtal::Color::Black ) return "black"; - if ( *this == DGtal::Color::Gray ) return "gray"; - if ( *this == DGtal::Color::White ) return "white"; - if ( *this == DGtal::Color::Red ) return "red"; - if ( *this == DGtal::Color::Green ) return "green!50!black"; - if ( *this == DGtal::Color::Lime ) return "green"; - if ( *this == DGtal::Color::Blue ) return "blue"; -// if ( *this == DGtal::Color::Cyan ) return "cyan"; -// if ( *this == DGtal::Color::Magenta ) return "magenta"; -// if ( *this == DGtal::Color::Yellow ) return "yellow"; - if ( *this == DGtal::Color::Silver ) return "white!75!black"; - if ( *this == DGtal::Color::Purple ) return "purple"; - if ( *this == DGtal::Color::Navy ) return "blue!50!black"; -// if ( *this == DGtal::Color::Aqua ) return "cyan"; // ???: Is Color::Aqua meant to be equal to Color::Cyan? - secured_sprintf( buffer, 255, "{rgb,255:red,%d;green,%d;blue,%d}", myRed, myGreen, myBlue ); - return buffer; -} - - -/////////////////////////////////////////////////////////////////////////////// -// Interface - public : - -const DGtal::Color DGtal::Color::None(0,0,0,0); -const DGtal::Color DGtal::Color::Black((unsigned char)0,(unsigned char)0,(unsigned char)0); -const DGtal::Color DGtal::Color::Gray((unsigned char)128,(unsigned char)128,(unsigned char)128); -const DGtal::Color DGtal::Color::White((unsigned char)255,(unsigned char)255,(unsigned char)255); -const DGtal::Color DGtal::Color::Red((unsigned char)255,(unsigned char)0,(unsigned char)0); -const DGtal::Color DGtal::Color::Green((unsigned char)0,(unsigned char)255,(unsigned char)0); -const DGtal::Color DGtal::Color::Lime((unsigned char)0,(unsigned char)255,(unsigned char)0); -const DGtal::Color DGtal::Color::Blue((unsigned char)0,(unsigned char)0,(unsigned char)255); -const DGtal::Color DGtal::Color::Cyan((unsigned char)0,(unsigned char)255,(unsigned char)255); -const DGtal::Color DGtal::Color::Magenta((unsigned char)255,(unsigned char)0,(unsigned char)255); -const DGtal::Color DGtal::Color::Yellow((unsigned char)255,(unsigned char)255,(unsigned char)0); -const DGtal::Color DGtal::Color::Silver((unsigned char)190,(unsigned char)190,(unsigned char)190); -const DGtal::Color DGtal::Color::Purple((unsigned char)128,(unsigned char)0,(unsigned char)128); -const DGtal::Color DGtal::Color::Navy((unsigned char)0,(unsigned char)0,(unsigned char)128); -const DGtal::Color DGtal::Color::Aqua((unsigned char)0,(unsigned char)255,(unsigned char)255); - - -/** - * Writes/Displays the object on an output stream. - * @param out the output stream where the object is written. - */ -void -DGtal::Color::selfDisplay ( std::ostream & out ) const -{ - out << "[Color] RGBA("<<(int)myRed<<","<<(int)myGreen<<","<<(int)myBlue<<","<<(int)myAlpha<<")"; -} - -/** - * Checks the validity/consistency of the object. - * @return 'true' if the object is valid, 'false' otherwise. - */ -bool -DGtal::Color::isValid() const -{ - return true; -} - - - -/////////////////////////////////////////////////////////////////////////////// -// Internals - private : - -// // -/////////////////////////////////////////////////////////////////////////////// diff --git a/src/DGtal/io/Color.h b/src/DGtal/io/Color.h index a3d9a29345..84e690681a 100644 --- a/src/DGtal/io/Color.h +++ b/src/DGtal/io/Color.h @@ -41,13 +41,22 @@ ////////////////////////////////////////////////////////////////////////////// // Inclusions +#include #include -#include "DGtal/base/Common.h" -#include #include #include +#include ////////////////////////////////////////////////////////////////////////////// +#ifndef secured_sprintf +#if defined( WIN32 ) +#define secured_sprintf sprintf_s +#else +#include +#define secured_sprintf snprintf +#endif // defined( WIN32 ) +#endif + namespace DGtal { diff --git a/src/DGtal/io/Color.ih b/src/DGtal/io/Color.ih index 08066713e6..63121222d0 100644 --- a/src/DGtal/io/Color.ih +++ b/src/DGtal/io/Color.ih @@ -32,6 +32,7 @@ ////////////////////////////////////////////////////////////////////////////// #include +#include ////////////////////////////////////////////////////////////////////////////// @@ -263,4 +264,244 @@ DGtal::Color::RGBtoHSV // // /////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// class Color +/////////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +// Standard services - public : + + +inline +DGtal::Color::Color( const unsigned int rgb, unsigned char aAlphaValue ) + :myAlpha( aAlphaValue ) +{ + myRed = ( rgb & 0xFF0000u ) >> 16; + myGreen = ( rgb & 0xFF00u ) >> 8; + myBlue = rgb & 0xFF; +} + + +inline +DGtal::Color & +DGtal::Color::setRGBA( const DGtal::uint32_t aRGBA ) +{ + myRed = ( aRGBA & 0xFF000000u ) >> 24; + myGreen = ( aRGBA & 0xFF0000u ) >> 16; + myBlue = ( aRGBA & 0xFF00u ) >> 8; + myAlpha = aRGBA & 0xFF; + return *this; +} + + +inline +DGtal::Color & +DGtal::Color::setRGBf( float aRedValue, + float aGreenValue, + float aBlueValue, + float aAlphaValue ) { + if ( aRedValue > 1.0f ) aRedValue = 1.0f; + if ( aRedValue < 0.0f ) aRedValue = 0.0f; + myRed = static_cast( 255 * aRedValue ); + if ( aGreenValue > 1.0f ) aGreenValue = 1.0f; + if ( aGreenValue < 0.0f ) aGreenValue = 0.0f; + myGreen = static_cast( 255 * aGreenValue ); + if ( aBlueValue > 1.0f ) aBlueValue = 1.0f; + if ( aBlueValue < 0.0f ) aBlueValue = 0.0f; + myBlue = static_cast( 255 * aBlueValue ); + if ( aAlphaValue > 1.0f ) aAlphaValue = 1.0f; + if ( aAlphaValue < 0.0f ) aAlphaValue = 0.0f; + myAlpha = static_cast( 255 * aAlphaValue ); + return *this; +} + + +inline +bool +DGtal::Color::operator==( const Color & aColor ) const +{ + return myRed == aColor.myRed + && myGreen == aColor.myGreen + && myBlue == aColor.myBlue + && myAlpha == aColor.myAlpha; +} + + +inline +bool +DGtal::Color::operator!=( const Color & aColor ) const +{ + return myRed != aColor.myRed + || myGreen != aColor.myGreen + || myBlue != aColor.myBlue + || myAlpha != aColor.myAlpha; +} + + +inline +bool +DGtal::Color::operator<( const Color & aColor ) const +{ + if ( myRed < aColor.myRed ) + return true; + if ( myRed == aColor.myRed ) { + if ( myGreen < aColor.myGreen ) + return true; + if ( myGreen == aColor.myGreen ) { + if ( myBlue < aColor.myBlue ) + return true; + if ( myBlue == aColor.myBlue ) + return myAlpha < aColor.myAlpha; + } + } + return false; +} + + +inline +bool +DGtal::Color::operator>( const Color & aColor ) const +{ + return !this->operator<(aColor); +} + + +inline +bool +DGtal::Color::operator<=( const Color & aColor ) const +{ + return this->operator<(aColor) || this->operator==(aColor); +} + + +inline +bool +DGtal::Color::operator>=( const Color & aColor ) const +{ + return this->operator>(aColor) || this->operator==(aColor); +} + + +inline +void +DGtal::Color::flushPostscript( std::ostream & stream ) const +{ + stream << ((double)myRed/255.0) << " " + << ((double)myGreen/255.0) << " " + << ((double)myBlue/255.0) << " srgb\n"; +} + + +inline +std::string +DGtal::Color::postscript() const +{ + char buffer[255]; + secured_sprintf( buffer, 255, "%.4f %.4f %.4f", myRed/255.0, myGreen/255.0, myBlue/255.0 ); + return buffer; +} + + +inline +std::string +DGtal::Color::svg() const +{ + char buffer[255]; + if ( *this == DGtal::Color::None ) return "none"; + secured_sprintf( buffer, 255, "rgb(%d,%d,%d)",myRed, myGreen, myBlue ); + return buffer; +} + + +inline +std::string +DGtal::Color::svgAlpha( const char * prefix ) const +{ + char buffer[255]; + if ( myAlpha == 255 || *this == DGtal::Color::None ) return ""; + secured_sprintf( buffer, 255, " %s-opacity=\"%f\"", prefix, myAlpha/255.0f ); + return buffer; +} + + +inline +std::string +DGtal::Color::tikz() const +{ + // see tex/generic/pgf/utilities/pgfutil-plain.def for color definitions + char buffer[255]; + if ( *this == DGtal::Color::None ) return "none"; + if ( *this == DGtal::Color::Black ) return "black"; + if ( *this == DGtal::Color::Gray ) return "gray"; + if ( *this == DGtal::Color::White ) return "white"; + if ( *this == DGtal::Color::Red ) return "red"; + if ( *this == DGtal::Color::Green ) return "green!50!black"; + if ( *this == DGtal::Color::Lime ) return "green"; + if ( *this == DGtal::Color::Blue ) return "blue"; +// if ( *this == DGtal::Color::Cyan ) return "cyan"; +// if ( *this == DGtal::Color::Magenta ) return "magenta"; +// if ( *this == DGtal::Color::Yellow ) return "yellow"; + if ( *this == DGtal::Color::Silver ) return "white!75!black"; + if ( *this == DGtal::Color::Purple ) return "purple"; + if ( *this == DGtal::Color::Navy ) return "blue!50!black"; +// if ( *this == DGtal::Color::Aqua ) return "cyan"; // ???: Is Color::Aqua meant to be equal to Color::Cyan? + secured_sprintf( buffer, 255, "{rgb,255:red,%d;green,%d;blue,%d}", myRed, myGreen, myBlue ); + return buffer; +} + +/////////////////////////////////////////////////////////////////////////////// +// Interface - public : + +/** + * Writes/Displays the object on an output stream. + * @param out the output stream where the object is written. + */ +inline +void +DGtal::Color::selfDisplay ( std::ostream & out ) const +{ + out << "[Color] RGBA("<<(int)myRed<<","<<(int)myGreen<<","<<(int)myBlue<<","<<(int)myAlpha<<")"; +} + +/** + * Checks the validity/consistency of the object. + * @return 'true' if the object is valid, 'false' otherwise. + */ +inline +bool +DGtal::Color::isValid() const +{ + return true; +} + + +/////////////////////////////////////////////////////////////////////////////// +// Interface - Constants : + +inline const DGtal::Color DGtal::Color::None(0,0,0,0); +inline const DGtal::Color DGtal::Color::Black((unsigned char)0,(unsigned char)0,(unsigned char)0); +inline const DGtal::Color DGtal::Color::Gray((unsigned char)128,(unsigned char)128,(unsigned char)128); +inline const DGtal::Color DGtal::Color::White((unsigned char)255,(unsigned char)255,(unsigned char)255); +inline const DGtal::Color DGtal::Color::Red((unsigned char)255,(unsigned char)0,(unsigned char)0); +inline const DGtal::Color DGtal::Color::Green((unsigned char)0,(unsigned char)255,(unsigned char)0); +inline const DGtal::Color DGtal::Color::Lime((unsigned char)0,(unsigned char)255,(unsigned char)0); +inline const DGtal::Color DGtal::Color::Blue((unsigned char)0,(unsigned char)0,(unsigned char)255); +inline const DGtal::Color DGtal::Color::Cyan((unsigned char)0,(unsigned char)255,(unsigned char)255); +inline const DGtal::Color DGtal::Color::Magenta((unsigned char)255,(unsigned char)0,(unsigned char)255); +inline const DGtal::Color DGtal::Color::Yellow((unsigned char)255,(unsigned char)255,(unsigned char)0); +inline const DGtal::Color DGtal::Color::Silver((unsigned char)190,(unsigned char)190,(unsigned char)190); +inline const DGtal::Color DGtal::Color::Purple((unsigned char)128,(unsigned char)0,(unsigned char)128); +inline const DGtal::Color DGtal::Color::Navy((unsigned char)0,(unsigned char)0,(unsigned char)128); +inline const DGtal::Color DGtal::Color::Aqua((unsigned char)0,(unsigned char)255,(unsigned char)255); + +// // +/////////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +// Internals - private : + +// // +/////////////////////////////////////////////////////////////////////////////// diff --git a/src/DGtal/io/Display2DFactory.ih b/src/DGtal/io/Display2DFactory.ih index c7979dd552..25b89e06f9 100644 --- a/src/DGtal/io/Display2DFactory.ih +++ b/src/DGtal/io/Display2DFactory.ih @@ -1432,8 +1432,9 @@ inline void DGtal::Display2DFactory::drawWithAdjacencies( DGtal::Board2D & aBoard, const DGtal::Object & o ) { + typedef TDigitalSet DigitalSet; - typedef typename DigitalSet::Point Point; + // typedef typename DigitalSet::Point Point; typedef TDigitalTopology DigitalTopology; typedef typename DigitalSet::Domain Domain; @@ -1442,8 +1443,6 @@ void DGtal::Display2DFactory::drawWithAdjacencies( DGtal::Board2D & aBoard, SMALL_DS + HIGH_ITER_DS >::Type SmallSet; typedef Object SmallObject; - Point p; - for (typename TDigitalSet::ConstIterator it = o.pointSet().begin(); it != o.pointSet().end(); ++it) @@ -1454,7 +1453,7 @@ void DGtal::Display2DFactory::drawWithAdjacencies( DGtal::Board2D & aBoard, it2 != neig.pointSet().end(); ++it2) { - p = (*it2) - (*it); + auto p = (*it2) - (*it); draw(aBoard, p, (*it)); } } diff --git a/src/DGtal/io/boards/Board2D.cpp b/src/DGtal/io/boards/Board2D.cpp deleted file mode 100644 index 3537f055d4..0000000000 --- a/src/DGtal/io/boards/Board2D.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/** - * This program is free software: 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - **/ - -/** - * @file Board2D.cpp - * @author Jacques-Olivier Lachaud (\c jacques-olivier.lachaud@univ-savoie.fr ) - * Laboratory of Mathematics (CNRS, UMR 5807), University of Savoie, France - * - * @date 2010/10/11 - * - * Implementation of methods defined in Board2D.h - * - * This file is part of the DGtal library. - */ - -/////////////////////////////////////////////////////////////////////////////// -#include "DGtal/io/boards/Board2D.h" -/////////////////////////////////////////////////////////////////////////////// - -using namespace std; - -/////////////////////////////////////////////////////////////////////////////// -// class Board2D -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// Standard services - public : - -/** - * Destructor. - */ -DGtal::Board2D::~Board2D() -{ -} - -/** - * Constructs a new board and sets the background color, if any. - * - * @param aBackgroundColor A color for the drawing's background. - */ -DGtal::Board2D::Board2D( const Color & aBackgroundColor ) - : LibBoard::Board( aBackgroundColor ), - myStyles() -{ - this->setUnit(LibBoard::Board::UCentimeter); -} - -/** - * Copy constructor. - * - * @param other The object to be copied. - */ -DGtal::Board2D::Board2D( const Board2D & other ) - : LibBoard::Board( other ), - myStyles( other.myStyles ) -{ -} - -/** - * Assignment. - * @param other the object to copy. - * @return a reference on 'this'. - */ -DGtal::Board2D & -DGtal::Board2D::operator= ( const Board2D & other ) -{ - if ( this != &other ) - { - LibBoard::Board::operator=( other ); - myStyles = other.myStyles; - } - return *this; -} - - -/////////////////////////////////////////////////////////////////////////////// -// Interface - public : - -/** - * Writes/Displays the object on an output stream. - * @param out the output stream where the object is written. - */ -void -DGtal::Board2D::selfDisplay ( std::ostream & out ) const -{ - out << "[Board2D]"; -} - -/** - * Checks the validity/consistency of the object. - * @return 'true' if the object is valid, 'false' otherwise. - */ -bool -DGtal::Board2D::isValid() const -{ - return true; -} - - - -/////////////////////////////////////////////////////////////////////////////// -// Internals - private : - -// // -/////////////////////////////////////////////////////////////////////////////// diff --git a/src/DGtal/io/boards/Board2D.ih b/src/DGtal/io/boards/Board2D.ih index 9217792a4f..e88d5e3163 100644 --- a/src/DGtal/io/boards/Board2D.ih +++ b/src/DGtal/io/boards/Board2D.ih @@ -156,3 +156,87 @@ DGtal::operator<< ( std::ostream & out, /////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// class Board2D +/////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////// +// Standard services - public : + +/** + * Destructor. + */ +DGtal::Board2D::~Board2D() +{ +} + +/** + * Constructs a new board and sets the background color, if any. + * + * @param aBackgroundColor A color for the drawing's background. + */ +DGtal::Board2D::Board2D( const Color & aBackgroundColor ) + : LibBoard::Board( aBackgroundColor ), + myStyles() +{ + this->setUnit(LibBoard::Board::UCentimeter); +} + +/** + * Copy constructor. + * + * @param other The object to be copied. + */ +DGtal::Board2D::Board2D( const Board2D & other ) + : LibBoard::Board( other ), + myStyles( other.myStyles ) +{ +} + +/** + * Assignment. + * @param other the object to copy. + * @return a reference on 'this'. + */ +DGtal::Board2D & +DGtal::Board2D::operator= ( const Board2D & other ) +{ + if ( this != &other ) + { + LibBoard::Board::operator=( other ); + myStyles = other.myStyles; + } + return *this; +} + + +/////////////////////////////////////////////////////////////////////////////// +// Interface - public : + +/** + * Writes/Displays the object on an output stream. + * @param out the output stream where the object is written. + */ +void +DGtal::Board2D::selfDisplay ( std::ostream & out ) const +{ + out << "[Board2D]"; +} + +/** + * Checks the validity/consistency of the object. + * @return 'true' if the object is valid, 'false' otherwise. + */ +bool +DGtal::Board2D::isValid() const +{ + return true; +} + + + +/////////////////////////////////////////////////////////////////////////////// +// Internals - private : + +// // +/////////////////////////////////////////////////////////////////////////////// diff --git a/src/DGtal/io/boards/Board3D.cpp b/src/DGtal/io/boards/Board3D.cpp deleted file mode 100644 index 17c56a3236..0000000000 --- a/src/DGtal/io/boards/Board3D.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * This program is free software: 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; withoutOBJ even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - * - **/ - -/** - * @file Board3D.cpp - * @author Aline Martin - * @date vendredi 7 juin 2013 - * - * @brief - * - * Class for OBJ export - * This is the implementation of methods defined in Board3D.h - * - * This file is part of the DGtal library. - */ - -/////////////////////////////////////////////////////////////////////////////// -#include "DGtal/io/boards/Board3D.h" -#include -//#include - - - - -/////////////////////////////////////////////////////////////////////////////// - -using namespace std; -using namespace DGtal; - -/////////////////////////////////////////////////////////////////////////////// -// class Board3D -/////////////////////////////////////////////////////////////////////////////// - diff --git a/src/DGtal/io/boards/Board3DTo2D.cpp b/src/DGtal/io/boards/Board3DTo2D.cpp deleted file mode 100644 index 031ef83fca..0000000000 --- a/src/DGtal/io/boards/Board3DTo2D.cpp +++ /dev/null @@ -1,29 +0,0 @@ -/** -* This program is free software: 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. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program. If not, see . -* -**/ - -/** -* @file Board3DTo2D.cpp -* @author Martial Tola -* @date mercredi 22 juin 2011 -* -* @brief -* -* Class for PDF, PNG, PS, EPS, SVG export drawings with Cairo with 3D->2D projection -* This is the implementation of methods defined in Board3DTo2D.h -* -* This file is part of the DGtal library. -*/ - diff --git a/src/DGtal/io/viewers/Viewer3D.ih b/src/DGtal/io/viewers/Viewer3D.ih index 2624e2eab1..777143f2ad 100644 --- a/src/DGtal/io/viewers/Viewer3D.ih +++ b/src/DGtal/io/viewers/Viewer3D.ih @@ -865,7 +865,7 @@ void DGtal::Viewer3D::init() setKeyDescription ( Qt::Key_W, "Switch display with and without wired view of triangle and quad faces." ); setKeyDescription ( Qt::Key_T, "Sort elements for display improvements." ); setKeyDescription ( Qt::Key_L, "Load last visualisation settings (from a .qglviewer.xml file generated by using SHIFT+L)"); - setKeyDescription ( Qt::ShiftModifier+Qt::Key_L, "Save visualisation settings." ); + setKeyDescription ( (int)Qt::ShiftModifier+(int)Qt::Key_L, "Save visualisation settings." ); setKeyDescription ( Qt::Key_B, "Switch background color with White/Black colors." ); setKeyDescription ( Qt::Key_C, "Show camera informations." ); setKeyDescription ( Qt::Key_R, "Reset default scale for 3 axes to 1.0f." ); @@ -876,12 +876,12 @@ void DGtal::Viewer3D::init() setKeyDescription( Qt::Key_Z, "Move away the light source according to the scence " "center (move closer with SHIFT+Z)" ); - setKeyDescription( Qt::ShiftModifier + Qt::Key_Z, + setKeyDescription( (int)Qt::ShiftModifier + (int)Qt::Key_Z, "Move closer the light source according to the scence " "center (move awya with key Z)" ); #if !defined (QGLVIEWER_VERSION) || QGLVIEWER_VERSION < 0x020500 - setMouseBindingDescription((Qt::ControlModifier|Qt::ShiftModifier) + Qt::LeftButton, "move light source position defined in the main coordinate system (an x-axis (resp. y-axis) mouse move changes the azimuth (resp. inclination) angle of the light source). Note that light source is always looking at the center point (0,0,0)."); + setMouseBindingDescription(int(Qt::ControlModifier|Qt::ShiftModifier) + (int)Qt::LeftButton, "move light source position defined in the main coordinate system (an x-axis (resp. y-axis) mouse move changes the azimuth (resp. inclination) angle of the light source). Note that light source is always looking at the center point (0,0,0)."); #else setMouseBindingDescription(Qt::KeyboardModifiers( Qt::ControlModifier|Qt::ShiftModifier ), Qt::LeftButton, "move light source position defined in the main coordinate system (an x-axis (resp. y-axis) mouse move changes the azimuth (resp. inclination) angle of the light source). Note that light source is always looking at the center point (0,0,0)."); #endif @@ -890,7 +890,7 @@ void DGtal::Viewer3D::init() glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE); #if !defined (QGLVIEWER_VERSION) || QGLVIEWER_VERSION < 0x020500 - setMouseBindingDescription ( Qt::ShiftModifier+Qt::RightButton, "Delete the mouse selected list." ); + setMouseBindingDescription ( (int)Qt::ShiftModifier+(int)Qt::RightButton, "Delete the mouse selected list." ); #else setMouseBindingDescription ( Qt::ShiftModifier, Qt::RightButton, "Delete the mouse selected list." ); #endif diff --git a/src/DGtal/io/writers/SurfaceMeshWriter.ih b/src/DGtal/io/writers/SurfaceMeshWriter.ih index c4a5f6601d..8e4b13ee4e 100644 --- a/src/DGtal/io/writers/SurfaceMeshWriter.ih +++ b/src/DGtal/io/writers/SurfaceMeshWriter.ih @@ -211,7 +211,6 @@ writeIsoLinesOBJ( std::string objfile, RealPoints positions; RealVectors edge_vectors; - Scalar lengths = 0.0; // We have: (1-t)*v0 + t*v1 = v const auto t = [] ( Scalar v0, Scalar v1, Scalar v ) { return ( v - v0 ) / ( v1 - v0 ); }; diff --git a/src/DGtal/kernel/domains/HyperRectDomain_Iterator.h b/src/DGtal/kernel/domains/HyperRectDomain_Iterator.h index 69fd42b2f3..0e25481b92 100644 --- a/src/DGtal/kernel/domains/HyperRectDomain_Iterator.h +++ b/src/DGtal/kernel/domains/HyperRectDomain_Iterator.h @@ -58,7 +58,7 @@ namespace DGtal * @tparam TIterator Iterator type on HyperRectDomain * * @note We need this specific implementation of a reverse iterator instead - * of a std::reverse_iterator because the latter works only on non-stashing + * of a boost::reverse_iterator because the latter works only on non-stashing * iterators (i.e. iterators that don't own its pointed data). * Otherwise, it will lead to dangling reference! */ diff --git a/src/DGtal/kernel/sets/DigitalSetSelector.h b/src/DGtal/kernel/sets/DigitalSetSelector.h index 679794233a..fce24e8a25 100644 --- a/src/DGtal/kernel/sets/DigitalSetSelector.h +++ b/src/DGtal/kernel/sets/DigitalSetSelector.h @@ -57,11 +57,19 @@ namespace DGtal { // ----------------------- Related enumerations ----------------------------- - enum DigitalSetSize { SMALL_DS = 0, MEDIUM_DS = 1, BIG_DS = 2, WHOLE_DS = 3 }; - enum DigitalSetVariability { LOW_VAR_DS = 0, HIGH_VAR_DS = 4 }; - enum DigitalSetIterability { LOW_ITER_DS = 0, HIGH_ITER_DS = 8 }; - enum DigitalSetBelongTestability { LOW_BEL_DS = 0, HIGH_BEL_DS = 16 }; - + // Since c++20, arithmetic between different enums types are disabled + // (https://eel.is/c++draft/diff.iso#diff.expr-2) + inline constexpr int SMALL_DS = 0; + inline constexpr int MEDIUM_DS = 1; + inline constexpr int BIG_DS = 2; + inline constexpr int WHOLE_DS = 3; + inline constexpr int LOW_VAR_DS = 0; + inline constexpr int HIGH_VAR_DS = 4; + inline constexpr int LOW_ITER_DS = 0; + inline constexpr int HIGH_ITER_DS = 8; + inline constexpr int LOW_BEL_DS = 0; + inline constexpr int HIGH_BEL_DS = 16; + ///////////////////////////////////////////////////////////////////////////// // template class DigitalSetSelector /** diff --git a/src/DGtal/math/MPolynomial.h b/src/DGtal/math/MPolynomial.h index 18f5392127..2d8b0e87ba 100644 --- a/src/DGtal/math/MPolynomial.h +++ b/src/DGtal/math/MPolynomial.h @@ -57,6 +57,8 @@ // Inclusions #include #include +// std::allocator_traits (as a replacement of removes Alloc::rebind) +#include #include "DGtal/base/Common.h" ////////////////////////////////////////////////////////////////////////////// @@ -206,7 +208,7 @@ namespace DGtal (i.e. X). */ typedef MPolynomial< n - 1, X, - typename Alloc::template rebind::other > MPolyNM1; + typename std::allocator_traits::template rebind_alloc > MPolyNM1; template friend class MPolynomialEvaluator; @@ -420,7 +422,7 @@ namespace DGtal typedef TX X; typedef MPolynomial< n, Ring, Alloc > MPolyN; typedef MPolynomial< n - 1, X, - typename Alloc::template rebind::other > MPolyNM1; + typename std::allocator_traits::template rebind_alloc > MPolyNM1; private: const MPolyN & myPoly; ///< The polynomial in question const X & myEvalPoint; ///< the evaluation point @@ -804,18 +806,21 @@ namespace DGtal { public: typedef TAlloc Alloc; - typedef typename std::vector::other>::size_type Size; + typedef typename std::allocator_traits::pointer TPointer; + typedef typename std::vector::template rebind_alloc >::size_type Size; private: Alloc myAllocator; - std::vector::other> myVec; + std::vector::template rebind_alloc > myVec; - void create( Size begin, Size end, typename Alloc::const_reference entry) + // Previous : typename Alloc::const_reference + // const value_type& should be equivalent according to : https://stackoverflow.com/questions/16360068/why-is-allocatorreference-being-phased-out + void create( Size begin, Size end, const typename Alloc::value_type& entry) { for (Size i = begin; i < end; ++i) { myVec[i] = myAllocator.allocate(sizeof(T)); - myAllocator.construct(myVec[i], entry); + std::allocator_traits::construct(myAllocator, myVec[i], entry); } } @@ -823,18 +828,18 @@ namespace DGtal { for (Size i = begin; i < end; ++i) { - myAllocator.destroy(myVec[i]); + std::allocator_traits::destroy(myAllocator, myVec[i]); myAllocator.deallocate(myVec[i], sizeof(T)); } } template - void copy_from(const std::vector & source) + void copy_from(const std::vector & source) { for (Size i = 0; i < myVec.size(); ++i) { myVec[i] = myAllocator.allocate(sizeof(T)); - myAllocator.construct(myVec[i], *source[i]); + std::allocator_traits::construct(myAllocator, myVec[i], *source[i]); } } @@ -991,7 +996,7 @@ namespace DGtal adequate allocators. This is for efficiency purposes. */ typedef IVector< MPolyNM1, - typename Alloc::template rebind::other, (n>1) > + typename std::allocator_traits::template rebind_alloc, (n > 1) > Storage; typedef typename Storage::Size Size; diff --git a/src/DGtal/shapes/IntersectionTarget.h b/src/DGtal/shapes/IntersectionTarget.h index a1d9fd4671..2169e74cfc 100644 --- a/src/DGtal/shapes/IntersectionTarget.h +++ b/src/DGtal/shapes/IntersectionTarget.h @@ -168,7 +168,7 @@ namespace DGtal /** * Default constructor */ - IntersectionTarget() + IntersectionTarget() { const double coef = 1. / std::sqrt(3.); diff --git a/src/DGtal/shapes/doc/moduleShape.dox b/src/DGtal/shapes/doc/moduleShape.dox index adb861411c..e158af3e2a 100644 --- a/src/DGtal/shapes/doc/moduleShape.dox +++ b/src/DGtal/shapes/doc/moduleShape.dox @@ -23,7 +23,7 @@ namespace DGtal { [TOC] @see shapes/exampleEuclideanShapesDecorator.cpp -@seeDGtalTools @ref shapeGenerator +@seeDGtalTools shapeGenerator \section sectmoduleShape1 Introduction of Concepts diff --git a/src/DGtal/topology/doc/moduleDigitalTopology.dox b/src/DGtal/topology/doc/moduleDigitalTopology.dox index 2bd076239d..af71c0ea9d 100644 --- a/src/DGtal/topology/doc/moduleDigitalTopology.dox +++ b/src/DGtal/topology/doc/moduleDigitalTopology.dox @@ -190,7 +190,7 @@ namespace DGtal { DT6_18 dt6_18( adj6, adj18, JORDAN_DT ); @endcode - The foreground adjacency is classically called \e kappa \f$ \kappa + The foreground adjacency is classically called kappa \f$ \kappa \f$ while the background is called \e lambda \f$ \lambda \f$ . Any topology has a reversed topology which is the topology \f$ (\lambda,\kappa) \f$. diff --git a/src/DGtal/topology/tables/NeighborhoodTables.h.in b/src/DGtal/topology/tables/NeighborhoodTables.h.in index 5da865add2..30b0daa86d 100644 --- a/src/DGtal/topology/tables/NeighborhoodTables.h.in +++ b/src/DGtal/topology/tables/NeighborhoodTables.h.in @@ -10,32 +10,33 @@ * @see NeighborhoodConfigurations.h * **/ +#pragma once #include namespace DGtal { namespace simplicity { ///Path to the DGtal look up tables. Compressed with zlib. - const std::string tableDir = "@TABLE_DIR@"; - const std::string tableSimple26_6 = + inline const std::string tableDir = "@TABLE_DIR@"; + inline const std::string tableSimple26_6 = "@TABLE_DIR@/simplicity_table26_6.zlib"; - const std::string tableSimple18_6 = + inline const std::string tableSimple18_6 = "@TABLE_DIR@/simplicity_table18_6.zlib"; - const std::string tableSimple6_26 = + inline const std::string tableSimple6_26 = "@TABLE_DIR@/simplicity_table6_26.zlib"; - const std::string tableSimple6_18 = + inline const std::string tableSimple6_18 = "@TABLE_DIR@/simplicity_table6_18.zlib"; - const std::string tableSimple8_4 = + inline const std::string tableSimple8_4 = "@TABLE_DIR@/simplicity_table8_4.zlib"; - const std::string tableSimple4_8 = + inline const std::string tableSimple4_8 = "@TABLE_DIR@/simplicity_table4_8.zlib"; } // simplicity namespace namespace isthmusicity { - const std::string tableIsthmus = + inline const std::string tableIsthmus = "@TABLE_DIR@/isthmusicity_table26_6.zlib"; - const std::string tableOneIsthmus = + inline const std::string tableOneIsthmus = "@TABLE_DIR@/isthmusicityOne_table26_6.zlib"; - const std::string tableTwoIsthmus = + inline const std::string tableTwoIsthmus = "@TABLE_DIR@/isthmusicityTwo_table26_6.zlib"; } // isthmusicity namespace } // DGtal namespace diff --git a/src/stb/CMakeLists.txt b/src/stb/CMakeLists.txt new file mode 100644 index 0000000000..91205a8cc2 --- /dev/null +++ b/src/stb/CMakeLists.txt @@ -0,0 +1,2 @@ +# Gadget, should be changed ! +add_library(DGtal_STB INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) \ No newline at end of file diff --git a/tests/base/testCirculator.cpp b/tests/base/testCirculator.cpp index c305353254..aa3c285889 100644 --- a/tests/base/testCirculator.cpp +++ b/tests/base/testCirculator.cpp @@ -35,6 +35,7 @@ #include "DGtal/base/Common.h" #include "DGtal/base/Circulator.h" +#include "boost/iterator/reverse_iterator.hpp" /////////////////////////////////////////////////////////////////////////////// @@ -298,7 +299,7 @@ int main( int argc, char** argv ) res = res && (c1 == c2) && (c1 == c3); trace.info() << "(reverse_iterator / Circulator)" << endl; - std::reverse_iterator::iterator> > rc1( c1 ); + boost::reverse_iterator::iterator> > rc1( c1 ); Circulator ::reverse_iterator> c4( v.rend(), v.rbegin(), v.rend() ); res = res && (rc1.base().base() == c4.base().base()); trace.info() << "first element: (" << *--rc1 << " == " << *--c4 << ")" << endl; diff --git a/tests/base/testConstIteratorAdapter.cpp b/tests/base/testConstIteratorAdapter.cpp index acca070216..b4cad9fc51 100644 --- a/tests/base/testConstIteratorAdapter.cpp +++ b/tests/base/testConstIteratorAdapter.cpp @@ -152,7 +152,7 @@ bool testProjection() trace.info() << nbok << "/" << nb << std::endl; trace.info() << "backward scanning" << endl; - std::reverse_iterator raitBegin( aitEnd ); + boost::reverse_iterator raitBegin( aitEnd ); if ( std::equal( rtrue.rbegin(), rtrue.rend(), raitBegin ) == true ) nbok++; nb++; diff --git a/tests/geometry/curves/testArithmeticalDSSConvexHull.cpp b/tests/geometry/curves/testArithmeticalDSSConvexHull.cpp index c42df65939..48e6e12799 100644 --- a/tests/geometry/curves/testArithmeticalDSSConvexHull.cpp +++ b/tests/geometry/curves/testArithmeticalDSSConvexHull.cpp @@ -29,6 +29,7 @@ /////////////////////////////////////////////////////////////////////////////// #include +#include #include "DGtal/base/Common.h" #include "DGtal/geometry/curves/ArithmeticalDSL.h" #include "DGtal/geometry/curves/ArithmeticalDSSConvexHull.h" diff --git a/tests/geometry/curves/testFreemanChain.cpp b/tests/geometry/curves/testFreemanChain.cpp index 7cd3d56dc7..5327a365cc 100644 --- a/tests/geometry/curves/testFreemanChain.cpp +++ b/tests/geometry/curves/testFreemanChain.cpp @@ -232,7 +232,7 @@ bool testPointsIterators() typedef FreemanChain FreemanChain; typedef FreemanChain::Point Point; typedef FreemanChain::ConstIterator PointIterator; - typedef std::reverse_iterator ReverseIterator; + typedef boost::reverse_iterator ReverseIterator; trace.beginBlock ( "Testing FreemanChain Iterator" ); @@ -283,7 +283,7 @@ bool testCodesIterators() typedef FreemanChain FreemanChain; typedef FreemanChain::CodesRange Range; // typedef Range::ConstIterator PointIterator; -// typedef std::reverse_iterator ReverseIterator; +// typedef boost::reverse_iterator ReverseIterator; trace.beginBlock ( "Testing CodesRange Iterator" ); diff --git a/tests/topology/testVoxelComplex.cpp b/tests/topology/testVoxelComplex.cpp index 61010b5698..c9ad8ec0cf 100644 --- a/tests/topology/testVoxelComplex.cpp +++ b/tests/topology/testVoxelComplex.cpp @@ -80,8 +80,8 @@ struct Fixture_complex_diamond { /////////////////////////////////////////////////////////// // fixture data - FixtureComplex complex_fixture; KSpace ks_fixture; // needed because ConstAlias in CC constructor. + FixtureComplex complex_fixture; /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// @@ -461,8 +461,8 @@ struct Fixture_complex_fig4 { /////////////////////////////////////////////////////////// // fixture data - FixtureComplex complex_fixture; KSpace ks_fixture; // needed because ConstAlias in CC constructor. + FixtureComplex complex_fixture; /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// @@ -627,9 +627,9 @@ struct Fixture_isthmus { /////////////////////////////////////////////////////////// // fixture data + KSpace ks_fixture; // needed because ConstAlias in CC constructor. FixtureComplex complex_fixture; FixtureDigitalSet set_fixture; - KSpace ks_fixture; // needed because ConstAlias in CC constructor. /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// @@ -898,9 +898,9 @@ struct Fixture_X { /////////////////////////////////////////////////////////// // fixture data + KSpace ks_fixture; // needed because ConstAlias in CC constructor. FixtureComplex complex_fixture; FixtureDigitalSet set_fixture; - KSpace ks_fixture; // needed because ConstAlias in CC constructor. /////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////