mirror of https://github.com/CGAL/cgal
Simplify 'Hash_handles_with_or_without_timestamps' (use 'Get_time_stamper')
This commit is contained in:
parent
b9e320659e
commit
53d4c9b580
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include <CGAL/license/Mesh_3.h>
|
#include <CGAL/license/Mesh_3.h>
|
||||||
|
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
#include <CGAL/Time_stamper.h>
|
||||||
|
|
||||||
#include <vtkPoints.h>
|
#include <vtkPoints.h>
|
||||||
#include <vtkUnstructuredGrid.h>
|
#include <vtkUnstructuredGrid.h>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#include <CGAL/license/Mesh_3.h>
|
#include <CGAL/license/Mesh_3.h>
|
||||||
|
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
#include <CGAL/Time_stamper.h>
|
||||||
#include <CGAL/utility.h>
|
#include <CGAL/utility.h>
|
||||||
|
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
#include <CGAL/license/Mesh_3.h>
|
#include <CGAL/license/Mesh_3.h>
|
||||||
|
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
#include <CGAL/Time_stamper.h>
|
||||||
#include <CGAL/IO/File_medit.h>
|
#include <CGAL/IO/File_medit.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@
|
||||||
|
|
||||||
#include <CGAL/array.h>
|
#include <CGAL/array.h>
|
||||||
#include <CGAL/boost/graph/Euler_operations.h>
|
#include <CGAL/boost/graph/Euler_operations.h>
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
|
||||||
#include <CGAL/Polygon_mesh_processing/orient_polygon_soup.h>
|
#include <CGAL/Polygon_mesh_processing/orient_polygon_soup.h>
|
||||||
#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>
|
#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>
|
||||||
|
#include <CGAL/Time_stamper.h>
|
||||||
|
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include <CGAL/linear_least_squares_fitting_3.h>
|
#include <CGAL/linear_least_squares_fitting_3.h>
|
||||||
#include <CGAL/Mesh_3/Triangulation_helpers.h>
|
#include <CGAL/Mesh_3/Triangulation_helpers.h>
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
#include <CGAL/Time_stamper.h>
|
||||||
#include <CGAL/tuple.h>
|
#include <CGAL/tuple.h>
|
||||||
#include <CGAL/iterator.h>
|
#include <CGAL/iterator.h>
|
||||||
#include <CGAL/array.h>
|
#include <CGAL/array.h>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
#include <CGAL/Compare_handles_with_or_without_timestamps.h>
|
#include <CGAL/Compare_handles_with_or_without_timestamps.h>
|
||||||
#include <CGAL/Mesh_3/Detect_polylines_in_polyhedra_fwd.h>
|
#include <CGAL/Mesh_3/Detect_polylines_in_polyhedra_fwd.h>
|
||||||
#include <CGAL/Default.h>
|
#include <CGAL/Default.h>
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
#include <CGAL/Time_stamper.h>
|
||||||
|
|
||||||
#include <boost/mpl/if.hpp>
|
#include <boost/mpl/if.hpp>
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
#include <CGAL/Mesh_3/config.h>
|
#include <CGAL/Mesh_3/config.h>
|
||||||
#include <CGAL/Mesh_3/Uniform_sizing_field.h>
|
#include <CGAL/Mesh_3/Uniform_sizing_field.h>
|
||||||
|
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
#include <CGAL/Time_stamper.h>
|
||||||
#include <CGAL/convex_hull_2.h>
|
#include <CGAL/convex_hull_2.h>
|
||||||
#include <CGAL/ch_graham_andrew.h>
|
#include <CGAL/ch_graham_andrew.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
#include <CGAL/Bbox_3.h>
|
#include <CGAL/Bbox_3.h>
|
||||||
#include <CGAL/Mesh_3/io_signature.h>
|
#include <CGAL/Mesh_3/io_signature.h>
|
||||||
#include <CGAL/Union_find.h>
|
#include <CGAL/Union_find.h>
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
#include <CGAL/Time_stamper.h>
|
||||||
|
|
||||||
#include <boost/functional/hash.hpp>
|
#include <boost/functional/hash.hpp>
|
||||||
#include <boost/unordered_map.hpp>
|
#include <boost/unordered_map.hpp>
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@
|
||||||
#include <CGAL/Origin.h>
|
#include <CGAL/Origin.h>
|
||||||
#include <CGAL/Mesh_optimization_return_code.h>
|
#include <CGAL/Mesh_optimization_return_code.h>
|
||||||
#include <CGAL/Mesh_3/Null_global_optimizer_visitor.h>
|
#include <CGAL/Mesh_3/Null_global_optimizer_visitor.h>
|
||||||
|
#include <CGAL/Time_stamper.h>
|
||||||
|
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
|
||||||
#include <CGAL/iterator.h>
|
#include <CGAL/iterator.h>
|
||||||
#include <CGAL/tuple.h>
|
#include <CGAL/tuple.h>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <CGAL/enum.h>
|
#include <CGAL/enum.h>
|
||||||
#include <CGAL/Has_timestamp.h>
|
#include <CGAL/Time_stamper.h>
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
|
||||||
#include <CGAL/internal/Has_member_visited.h>
|
#include <CGAL/internal/Has_member_visited.h>
|
||||||
#include <CGAL/iterator.h>
|
#include <CGAL/iterator.h>
|
||||||
#include <CGAL/number_utils.h>
|
#include <CGAL/number_utils.h>
|
||||||
|
|
|
||||||
|
|
@ -19,9 +19,9 @@
|
||||||
|
|
||||||
#include <CGAL/Mesh_facet_topology.h>
|
#include <CGAL/Mesh_facet_topology.h>
|
||||||
|
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
|
||||||
#include <CGAL/utility.h>
|
|
||||||
#include <CGAL/atomic.h>
|
#include <CGAL/atomic.h>
|
||||||
|
#include <CGAL/utility.h>
|
||||||
|
#include <CGAL/Time_stamper.h>
|
||||||
|
|
||||||
#include <boost/bimap.hpp>
|
#include <boost/bimap.hpp>
|
||||||
#include <boost/bimap/unordered_set_of.hpp>
|
#include <boost/bimap/unordered_set_of.hpp>
|
||||||
|
|
|
||||||
|
|
@ -42,8 +42,7 @@
|
||||||
#include <CGAL/Real_timer.h>
|
#include <CGAL/Real_timer.h>
|
||||||
#include <CGAL/Mesh_3/Null_perturber_visitor.h>
|
#include <CGAL/Mesh_3/Null_perturber_visitor.h>
|
||||||
#include <CGAL/Mesh_3/sliver_criteria.h>
|
#include <CGAL/Mesh_3/sliver_criteria.h>
|
||||||
#include <CGAL/Has_timestamp.h>
|
#include <CGAL/Time_stamper.h>
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
|
||||||
|
|
||||||
#include <CGAL/Mesh_3/Concurrent_mesher_config.h>
|
#include <CGAL/Mesh_3/Concurrent_mesher_config.h>
|
||||||
#include <CGAL/Mesh_3/Worksharing_data_structures.h>
|
#include <CGAL/Mesh_3/Worksharing_data_structures.h>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
#include <CGAL/enum.h>
|
#include <CGAL/enum.h>
|
||||||
#include <CGAL/internal/Has_nested_type_Bare_point.h>
|
#include <CGAL/internal/Has_nested_type_Bare_point.h>
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
#include <CGAL/Time_stamper.h>
|
||||||
|
|
||||||
#include <boost/mpl/if.hpp>
|
#include <boost/mpl/if.hpp>
|
||||||
#include <boost/mpl/identity.hpp>
|
#include <boost/mpl/identity.hpp>
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <CGAL/Mesh_3/C3T3_helpers.h>
|
#include <CGAL/Mesh_3/C3T3_helpers.h>
|
||||||
#include <CGAL/Mesh_3/Triangulation_helpers.h>
|
#include <CGAL/Mesh_3/Triangulation_helpers.h>
|
||||||
|
#include <CGAL/Time_stamper.h>
|
||||||
|
|
||||||
#ifdef CGAL_MESH_3_PERTURBER_VERBOSE
|
#ifdef CGAL_MESH_3_PERTURBER_VERBOSE
|
||||||
#include <CGAL/Timer.h>
|
#include <CGAL/Timer.h>
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,10 @@
|
||||||
|
|
||||||
#include <CGAL/disable_warnings.h>
|
#include <CGAL/disable_warnings.h>
|
||||||
#include <CGAL/iterator.h>
|
#include <CGAL/iterator.h>
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
|
||||||
#include <CGAL/Mesh_3/utilities.h>
|
#include <CGAL/Mesh_3/utilities.h>
|
||||||
#include <CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h>
|
#include <CGAL/Mesh_3/Mesh_complex_3_in_triangulation_3_base.h>
|
||||||
#include <CGAL/internal/Mesh_3/Boundary_of_subdomain_of_complex_3_in_triangulation_3_to_off.h>
|
#include <CGAL/internal/Mesh_3/Boundary_of_subdomain_of_complex_3_in_triangulation_3_to_off.h>
|
||||||
|
#include <CGAL/Time_stamper.h>
|
||||||
|
|
||||||
#include <boost/bimap/bimap.hpp>
|
#include <boost/bimap/bimap.hpp>
|
||||||
#include <boost/bimap/multiset_of.hpp>
|
#include <boost/bimap/multiset_of.hpp>
|
||||||
|
|
|
||||||
|
|
@ -40,13 +40,12 @@
|
||||||
#include <CGAL/Mesh_3/Triangulation_helpers.h>
|
#include <CGAL/Mesh_3/Triangulation_helpers.h>
|
||||||
|
|
||||||
#include <CGAL/enum.h>
|
#include <CGAL/enum.h>
|
||||||
#include <CGAL/Has_timestamp.h>
|
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
|
||||||
#include <CGAL/internal/Has_member_visited.h>
|
#include <CGAL/internal/Has_member_visited.h>
|
||||||
#include <CGAL/iterator.h>
|
#include <CGAL/iterator.h>
|
||||||
#include <CGAL/number_utils.h>
|
#include <CGAL/number_utils.h>
|
||||||
#include <CGAL/Periodic_3_Delaunay_triangulation_traits_3.h>
|
#include <CGAL/Periodic_3_Delaunay_triangulation_traits_3.h>
|
||||||
#include <CGAL/Periodic_3_Delaunay_triangulation_3.h>
|
#include <CGAL/Periodic_3_Delaunay_triangulation_3.h>
|
||||||
|
#include <CGAL/Time_stamper.h>
|
||||||
|
|
||||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,7 @@
|
||||||
#include <CGAL/Mesh_3/Dump_c3t3.h>
|
#include <CGAL/Mesh_3/Dump_c3t3.h>
|
||||||
#include <CGAL/Mesh_3/Triangulation_helpers.h>
|
#include <CGAL/Mesh_3/Triangulation_helpers.h>
|
||||||
#include <CGAL/refine_mesh_3.h>
|
#include <CGAL/refine_mesh_3.h>
|
||||||
|
#include <CGAL/Time_stamper.h>
|
||||||
#include <CGAL/Hash_handles_with_or_without_timestamps.h>
|
|
||||||
|
|
||||||
#include <boost/parameter/preprocessor.hpp>
|
#include <boost/parameter/preprocessor.hpp>
|
||||||
#include <boost/unordered_set.hpp>
|
#include <boost/unordered_set.hpp>
|
||||||
|
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
// Copyright (c) 2014-2017 GeometryFactory Sarl (France)
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org)
|
|
||||||
//
|
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
|
|
||||||
//
|
|
||||||
// Author(s) : Laurent Rineau,
|
|
||||||
// Mael Rouxel-Labbé
|
|
||||||
|
|
||||||
#ifndef CGAL_HASH_HANDLES_WITH_OR_WITHOUT_TIMESTAMPS_H
|
|
||||||
#define CGAL_HASH_HANDLES_WITH_OR_WITHOUT_TIMESTAMPS_H
|
|
||||||
|
|
||||||
#include <CGAL/Has_timestamp.h>
|
|
||||||
|
|
||||||
#include <boost/functional/hash.hpp>
|
|
||||||
|
|
||||||
#include <cstddef>
|
|
||||||
#include <iterator>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
struct Hash_handles_with_or_without_timestamps
|
|
||||||
{
|
|
||||||
template <typename Handle>
|
|
||||||
std::size_t operator()(const Handle h) const
|
|
||||||
{
|
|
||||||
typedef typename std::iterator_traits<Handle>::value_type Type;
|
|
||||||
|
|
||||||
return hash(h, Boolean_tag<CGAL::internal::Has_timestamp<Type>::value>());
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Handle>
|
|
||||||
std::size_t hash(const Handle h, Tag_false) const
|
|
||||||
{
|
|
||||||
return boost::hash_value(&*h);
|
|
||||||
}
|
|
||||||
|
|
||||||
template<typename Handle>
|
|
||||||
std::size_t hash(const Handle h, Tag_true) const
|
|
||||||
{
|
|
||||||
return h->time_stamp();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace CGAL
|
|
||||||
|
|
||||||
#endif // CGAL_HASH_HANDLES_WITH_OR_WITHOUT_TIMESTAMPS_H
|
|
||||||
|
|
@ -149,6 +149,17 @@ struct Get_time_stamper<T,false>{
|
||||||
template <class T>
|
template <class T>
|
||||||
struct Time_stamper_impl : public Get_time_stamper<T>::type {};
|
struct Time_stamper_impl : public Get_time_stamper<T>::type {};
|
||||||
|
|
||||||
|
struct Hash_handles_with_or_without_timestamps
|
||||||
|
{
|
||||||
|
template <typename Handle>
|
||||||
|
std::size_t operator()(const Handle h) const
|
||||||
|
{
|
||||||
|
typedef typename std::iterator_traits<Handle>::value_type Type;
|
||||||
|
|
||||||
|
return Get_time_stamper<Type>::type::hash_value(&*h);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} //end of namespace CGAL
|
} //end of namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_TIME_STAMPER_H
|
#endif // CGAL_TIME_STAMPER_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue