diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2019-06-14 19:33:15 +0200 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2019-06-14 19:33:15 +0200 |
commit | 64d101a24ddcecd84771cfa4dd536ee46f226bf8 (patch) | |
tree | 422c43623f00f66977c8b8a879d1dd3938913bbb /src | |
parent | a7ae66a868d655a9bd76b208327f00cda9089df6 (diff) |
Add CGAL dependency for Contraction instead of including CGAL files
Diffstat (limited to 'src')
5 files changed, 18 insertions, 119 deletions
diff --git a/src/Contraction/example/CMakeLists.txt b/src/Contraction/example/CMakeLists.txt index 582b7ab8..f0dc885d 100644 --- a/src/Contraction/example/CMakeLists.txt +++ b/src/Contraction/example/CMakeLists.txt @@ -1,17 +1,17 @@ project(Contraction_examples) -add_executable(RipsContraction Rips_contraction.cpp) +if (NOT CGAL_VERSION VERSION_LESS 4.11.0) + add_executable(RipsContraction Rips_contraction.cpp) -add_executable(GarlandHeckbert Garland_heckbert.cpp) -target_link_libraries(GarlandHeckbert ${Boost_TIMER_LIBRARY}) + add_executable(GarlandHeckbert Garland_heckbert.cpp) + target_link_libraries(GarlandHeckbert ${Boost_TIMER_LIBRARY}) -add_test(NAME Contraction_example_tore3D_0.2 COMMAND $<TARGET_FILE:RipsContraction> + add_test(NAME Contraction_example_tore3D_0.2 COMMAND $<TARGET_FILE:RipsContraction> "${CMAKE_SOURCE_DIR}/data/points/tore3D_1307.off" "0.2") -# TODO(DS) : These tests are too long under Windows -#add_test(NAME Contraction_example_sphere_0.2 COMMAND $<TARGET_FILE:RipsContraction> -# "${CMAKE_SOURCE_DIR}/data/points/sphere3D_2646.off" "0.2") -#add_test(NAME Contraction_example_SO3_0.3 COMMAND $<TARGET_FILE:RipsContraction> -# "${CMAKE_SOURCE_DIR}/data/points/SO3_10000.off" "0.3") + # TODO(DS) : These tests are too long under Windows + #add_test(NAME Contraction_example_sphere_0.2 COMMAND $<TARGET_FILE:RipsContraction> + # "${CMAKE_SOURCE_DIR}/data/points/sphere3D_2646.off" "0.2") + #add_test(NAME Contraction_example_SO3_0.3 COMMAND $<TARGET_FILE:RipsContraction> + # "${CMAKE_SOURCE_DIR}/data/points/SO3_10000.off" "0.3") -install(TARGETS RipsContraction DESTINATION bin) -install(TARGETS GarlandHeckbert DESTINATION bin) +endif (NOT CGAL_VERSION VERSION_LESS 4.11.0) diff --git a/src/Contraction/include/gudhi/Contraction/CGAL_queue/Modifiable_priority_queue.h b/src/Contraction/include/gudhi/Contraction/CGAL_queue/Modifiable_priority_queue.h deleted file mode 100644 index 5a55c513..00000000 --- a/src/Contraction/include/gudhi/Contraction/CGAL_queue/Modifiable_priority_queue.h +++ /dev/null @@ -1,101 +0,0 @@ -// Copyright (c) 2006-2011 GeometryFactory (France). All rights reserved. -// -// This file is part of CGAL (www.cgal.org); you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public License as -// published by the Free Software Foundation; either version 3 of the License, -// or (at your option) any later version. -// -// Licensees holding a valid commercial license may use this file in -// accordance with the commercial license agreement provided with the software. -// -// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE -// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. -// -// $URL$ -// $Id$ -// -// Author(s) : Fernando Cacciola <fernando.cacciola@geometryfactory.com> -// -#ifndef CONTRACTION_CGAL_QUEUE_MODIFIABLE_PRIORITY_QUEUE_H_ -#define CONTRACTION_CGAL_QUEUE_MODIFIABLE_PRIORITY_QUEUE_H_ - -#define CGAL_SURFACE_MESH_SIMPLIFICATION_USE_RELAXED_HEAP - -#include <boost/optional.hpp> -#include <boost/pending/relaxed_heap.hpp> - -#include <climits> // Neeeded by the following Boost header for CHAR_BIT. -#include <functional> // for less - -namespace CGAL { - -template <class IndexedType_, class Compare_ = std::less<IndexedType_>, class ID_ = boost::identity_property_map> -class Modifiable_priority_queue { - public: - typedef Modifiable_priority_queue Self; - - typedef IndexedType_ IndexedType; - typedef Compare_ Compare; - typedef ID_ ID; - - typedef boost::relaxed_heap<IndexedType, Compare, ID> Heap; - typedef typename Heap::value_type value_type; - typedef typename Heap::size_type size_type; - - typedef bool handle; - - public: - Modifiable_priority_queue(size_type largest_ID, Compare const& c, ID const& id) : mHeap(largest_ID, c, id) { } - - handle push(value_type const& v) { - mHeap.push(v); - return handle(true); - } - - handle update(value_type const& v, handle h) { - mHeap.update(v); - return h; - } - - handle erase(value_type const& v, handle) { - mHeap.remove(v); - return null_handle(); - } - - value_type top() const { - return mHeap.top(); - } - - void pop() { - mHeap.pop(); - } - - bool empty() const { - return mHeap.empty(); - } - - bool contains(value_type const& v) { - return mHeap.contains(v); - } - - boost::optional<value_type> extract_top() { - boost::optional<value_type> r; - if (!empty()) { - value_type v = top(); - pop(); - r = boost::optional<value_type>(v); - } - return r; - } - - static handle null_handle() { - return handle(false); - } - - private: - Heap mHeap; -}; - -} // namespace CGAL - -#endif // CONTRACTION_CGAL_QUEUE_MODIFIABLE_PRIORITY_QUEUE_H_ diff --git a/src/Contraction/include/gudhi/Contraction/Edge_profile.h b/src/Contraction/include/gudhi/Contraction/Edge_profile.h index 78a7afd1..0e914de9 100644 --- a/src/Contraction/include/gudhi/Contraction/Edge_profile.h +++ b/src/Contraction/include/gudhi/Contraction/Edge_profile.h @@ -12,6 +12,7 @@ #define CONTRACTION_EDGE_PROFILE_H_ #include <ostream> +#include <cassert> namespace Gudhi { diff --git a/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h b/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h index e1f3b3c2..7a99548d 100644 --- a/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h +++ b/src/Contraction/include/gudhi/Skeleton_blocker_contractor.h @@ -13,9 +13,6 @@ #ifndef SKELETON_BLOCKER_CONTRACTOR_H_ #define SKELETON_BLOCKER_CONTRACTOR_H_ -// todo remove the queue to be independent from cgald -#include <gudhi/Contraction/CGAL_queue/Modifiable_priority_queue.h> - #include <gudhi/Contraction/Edge_profile.h> #include <gudhi/Contraction/policies/Cost_policy.h> #include <gudhi/Contraction/policies/Edge_length_cost.h> @@ -29,6 +26,8 @@ #include <gudhi/Skeleton_blocker/Skeleton_blocker_complex_visitor.h> #include <gudhi/Debug_utils.h> +// todo remove the queue to be independent from cgald +#include <CGAL/Modifiable_priority_queue.h> #include <boost/scoped_array.hpp> #include <boost/scoped_ptr.hpp> diff --git a/src/common/doc/main_page.md b/src/common/doc/main_page.md index 18bf0ce2..fe25b1e7 100644 --- a/src/common/doc/main_page.md +++ b/src/common/doc/main_page.md @@ -50,8 +50,7 @@ <b>Author:</b> Vincent Rouvreau<br> <b>Introduced in:</b> GUDHI 1.3.0<br> <b>Copyright:</b> MIT [(GPL v3)](../../licensing/)<br> - <b>Requires:</b> \ref eigen3 and<br> - \ref cgal 4.11.0 + <b>Requires:</b> \ref eigen3 and \ref cgal ≥ 4.11.0 </td> </tr> <tr> @@ -127,7 +126,7 @@ <b>Author:</b> Siargey Kachanovich<br> <b>Introduced in:</b> GUDHI 1.3.0<br> <b>Copyright:</b> MIT ([GPL v3](../../licensing/) for Euclidean version)<br> - <b>Euclidean version requires:</b> \ref cgal ≥ 4.11.0 and \ref eigen3 + <b>Euclidean version requires:</b> \ref eigen3 and \ref cgal ≥ 4.11.0 </td> </tr> <tr> @@ -263,6 +262,7 @@ <b>Author:</b> David Salinas<br> <b>Introduced in:</b> GUDHI 1.1.0<br> <b>Copyright:</b> MIT [(GPL v3)](../../licensing/)<br> + <b>Requires:</b> \ref cgal ≥ 4.11.0 </td> </tr> <tr> @@ -324,7 +324,7 @@ <b>Author:</b> Clément Jamin<br> <b>Introduced in:</b> GUDHI 2.0.0<br> <b>Copyright:</b> MIT [(GPL v3)](../../licensing/)<br> - <b>Requires:</b> \ref cgal ≥ 4.11.0 and \ref eigen3 + <b>Requires:</b> \ref eigen3 and \ref cgal ≥ 4.11.0 </td> </tr> <tr> |