From 64d101a24ddcecd84771cfa4dd536ee46f226bf8 Mon Sep 17 00:00:00 2001 From: ROUVREAU Vincent Date: Fri, 14 Jun 2019 19:33:15 +0200 Subject: Add CGAL dependency for Contraction instead of including CGAL files --- src/Contraction/example/CMakeLists.txt | 22 ++--- .../CGAL_queue/Modifiable_priority_queue.h | 101 --------------------- .../include/gudhi/Contraction/Edge_profile.h | 1 + .../include/gudhi/Skeleton_blocker_contractor.h | 5 +- 4 files changed, 14 insertions(+), 115 deletions(-) delete mode 100644 src/Contraction/include/gudhi/Contraction/CGAL_queue/Modifiable_priority_queue.h (limited to 'src/Contraction') 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 $ + add_test(NAME Contraction_example_tore3D_0.2 COMMAND $ "${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 $ -# "${CMAKE_SOURCE_DIR}/data/points/sphere3D_2646.off" "0.2") -#add_test(NAME Contraction_example_SO3_0.3 COMMAND $ -# "${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 $ + # "${CMAKE_SOURCE_DIR}/data/points/sphere3D_2646.off" "0.2") + #add_test(NAME Contraction_example_SO3_0.3 COMMAND $ + # "${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 -// -#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 -#include - -#include // Neeeded by the following Boost header for CHAR_BIT. -#include // for less - -namespace CGAL { - -template , 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 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 extract_top() { - boost::optional r; - if (!empty()) { - value_type v = top(); - pop(); - r = boost::optional(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 +#include 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 - #include #include #include @@ -29,6 +26,8 @@ #include #include +// todo remove the queue to be independent from cgald +#include #include #include -- cgit v1.2.3