mirror of https://github.com/CGAL/cgal
Merge branch 'master' into Stream_support-Dont_use_vtk_for_vtu-GF
This commit is contained in:
commit
c9164a0660
63
.travis.yml
63
.travis.yml
|
|
@ -19,37 +19,38 @@ env:
|
|||
- PACKAGE='Distance_2 Distance_3 Envelope_2 '
|
||||
- PACKAGE='Envelope_3 Filtered_kernel Generalized_map '
|
||||
- PACKAGE='Generator Geomview GraphicsView '
|
||||
- PACKAGE='HalfedgeDS Hash_map Homogeneous_kernel '
|
||||
- PACKAGE='Inscribed_areas Installation Interpolation '
|
||||
- PACKAGE='Intersections_2 Intersections_3 Interval_skip_list '
|
||||
- PACKAGE='Interval_support Inventor Jet_fitting_3 '
|
||||
- PACKAGE='Kernel_23 Kernel_d LEDA '
|
||||
- PACKAGE='Linear_cell_complex MacOSX Maintenance '
|
||||
- PACKAGE='Matrix_search Mesh_2 Mesh_3 '
|
||||
- PACKAGE='Mesher_level Minkowski_sum_2 Minkowski_sum_3 '
|
||||
- PACKAGE='Modifier Modular_arithmetic Nef_2 '
|
||||
- PACKAGE='Nef_3 Nef_S2 NewKernel_d '
|
||||
- PACKAGE='Number_types OpenNL Optimal_transportation_reconstruction_2 '
|
||||
- PACKAGE='Optimisation_basic Partition_2 Periodic_2_triangulation_2 '
|
||||
- PACKAGE='Periodic_3_mesh_3 Periodic_3_triangulation_3 Point_set_2 '
|
||||
- PACKAGE='Point_set_3 Point_set_processing_3 Point_set_shape_detection_3 '
|
||||
- PACKAGE='Poisson_surface_reconstruction_3 Polygon Polygon_mesh_processing '
|
||||
- PACKAGE='Polyhedron Polyhedron_IO Polyline_simplification_2 '
|
||||
- PACKAGE='Polynomial Polytope_distance_d Principal_component_analysis '
|
||||
- PACKAGE='Principal_component_analysis_LGPL Profiling_tools Property_map '
|
||||
- PACKAGE='QP_solver Random_numbers Ridges_3 '
|
||||
- PACKAGE='Scale_space_reconstruction_3 Scripts SearchStructures '
|
||||
- PACKAGE='Segment_Delaunay_graph_2 Segment_Delaunay_graph_Linf_2 Set_movable_separability_2 '
|
||||
- PACKAGE='Skin_surface_3 Snap_rounding_2 Solver_interface '
|
||||
- PACKAGE='Spatial_searching Spatial_sorting STL_Extension '
|
||||
- PACKAGE='Straight_skeleton_2 Stream_lines_2 Stream_support '
|
||||
- PACKAGE='Subdivision_method_3 Surface_mesh Surface_mesh_deformation '
|
||||
- PACKAGE='Surface_mesher Surface_mesh_parameterization Surface_mesh_segmentation '
|
||||
- PACKAGE='Surface_mesh_shortest_path Surface_mesh_simplification Surface_mesh_skeletonization '
|
||||
- PACKAGE='Surface_sweep_2 TDS_2 TDS_3 '
|
||||
- PACKAGE='Testsuite Three Triangulation '
|
||||
- PACKAGE='Triangulation_2 Triangulation_3 Union_find '
|
||||
- PACKAGE='Visibility_2 Voronoi_diagram_2 wininst '
|
||||
- PACKAGE='HalfedgeDS Hash_map Heat_method_3 '
|
||||
- PACKAGE='Homogeneous_kernel Inscribed_areas Installation '
|
||||
- PACKAGE='Interpolation Intersections_2 Intersections_3 '
|
||||
- PACKAGE='Interval_skip_list Interval_support Inventor '
|
||||
- PACKAGE='Jet_fitting_3 Kernel_23 Kernel_d '
|
||||
- PACKAGE='LEDA Linear_cell_complex MacOSX '
|
||||
- PACKAGE='Maintenance Matrix_search Mesh_2 '
|
||||
- PACKAGE='Mesh_3 Mesher_level Minkowski_sum_2 '
|
||||
- PACKAGE='Minkowski_sum_3 Modifier Modular_arithmetic '
|
||||
- PACKAGE='Nef_2 Nef_3 Nef_S2 '
|
||||
- PACKAGE='NewKernel_d Number_types OpenNL '
|
||||
- PACKAGE='Optimal_transportation_reconstruction_2 Optimisation_basic Partition_2 '
|
||||
- PACKAGE='Periodic_2_triangulation_2 Periodic_3_mesh_3 Periodic_3_triangulation_3 '
|
||||
- PACKAGE='Point_set_2 Point_set_3 Point_set_processing_3 '
|
||||
- PACKAGE='Point_set_shape_detection_3 Poisson_surface_reconstruction_3 Polygon '
|
||||
- PACKAGE='Polygon_mesh_processing Polyhedron Polyhedron_IO '
|
||||
- PACKAGE='Polyline_simplification_2 Polynomial Polytope_distance_d '
|
||||
- PACKAGE='Principal_component_analysis Principal_component_analysis_LGPL Profiling_tools '
|
||||
- PACKAGE='Property_map QP_solver Random_numbers '
|
||||
- PACKAGE='Ridges_3 Scale_space_reconstruction_3 Scripts '
|
||||
- PACKAGE='SearchStructures Segment_Delaunay_graph_2 Segment_Delaunay_graph_Linf_2 '
|
||||
- PACKAGE='Set_movable_separability_2 Skin_surface_3 Snap_rounding_2 '
|
||||
- PACKAGE='Solver_interface Spatial_searching Spatial_sorting '
|
||||
- PACKAGE='STL_Extension Straight_skeleton_2 Stream_lines_2 '
|
||||
- PACKAGE='Stream_support Subdivision_method_3 Surface_mesh '
|
||||
- PACKAGE='Surface_mesh_approximation Surface_mesh_deformation Surface_mesher '
|
||||
- PACKAGE='Surface_mesh_parameterization Surface_mesh_segmentation Surface_mesh_shortest_path '
|
||||
- PACKAGE='Surface_mesh_simplification Surface_mesh_skeletonization Surface_sweep_2 '
|
||||
- PACKAGE='TDS_2 TDS_3 Testsuite '
|
||||
- PACKAGE='Three Triangulation Triangulation_2 '
|
||||
- PACKAGE='Triangulation_3 Union_find Visibility_2 '
|
||||
- PACKAGE='Voronoi_diagram_2 wininst '
|
||||
compiler: clang-3.6
|
||||
install:
|
||||
- echo "$PWD"
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ Geomview
|
|||
GraphicsView
|
||||
HalfedgeDS
|
||||
Hash_map
|
||||
Heat_method_3
|
||||
Homogeneous_kernel
|
||||
Inscribed_areas
|
||||
Installation
|
||||
|
|
@ -111,6 +112,7 @@ Stream_lines_2
|
|||
Stream_support
|
||||
Subdivision_method_3
|
||||
Surface_mesh
|
||||
Surface_mesh_approximation
|
||||
Surface_mesh_deformation
|
||||
Surface_mesher
|
||||
Surface_mesh_parameterization
|
||||
|
|
|
|||
|
|
@ -16,3 +16,4 @@ Property_map
|
|||
STL_Extension
|
||||
Spatial_searching
|
||||
Stream_support
|
||||
Distance_3
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Algebraic_kernel_d/Real_embeddable_extension.h>
|
||||
#include <CGAL/Get_arithmetic_kernel.h>
|
||||
|
||||
#include <CGAL/GMP_arithmetic_kernel.h>
|
||||
#include <CGAL/LEDA_arithmetic_kernel.h>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,78 @@
|
|||
// Copyright (c) 2017 Inria.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 3 of the License,
|
||||
// or (at your option) any later version.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0+
|
||||
//
|
||||
// Author: Marc Glisse <marc.glisse@inria.fr>
|
||||
|
||||
#ifndef CGAL_GMPXX_ARITHMETIC_KERNEL_H
|
||||
#define CGAL_GMPXX_ARITHMETIC_KERNEL_H
|
||||
|
||||
#include <CGAL/Arithmetic_kernel/Arithmetic_kernel_base.h>
|
||||
#include <CGAL/Get_arithmetic_kernel.h>
|
||||
|
||||
#include <CGAL/boost_mp.h>
|
||||
|
||||
#ifdef CGAL_USE_BOOST_MP
|
||||
|
||||
//Currently already included in boost_mp.h
|
||||
//#include <boost/multiprecision/cpp_int.hpp>
|
||||
//#ifdef CGAL_USE_GMP
|
||||
//#include <boost/multiprecision/gmp.hpp>
|
||||
//#endif
|
||||
|
||||
// FIXME: the could be several kernels based on Boost.Multiprecision.
|
||||
|
||||
namespace CGAL {
|
||||
/** \ingroup CGAL_Arithmetic_kernel
|
||||
* \brief The Boost.Multiprecision set of exact number types
|
||||
*/
|
||||
struct BOOST_cpp_arithmetic_kernel : internal::Arithmetic_kernel_base {
|
||||
typedef boost::multiprecision::cpp_int Integer;
|
||||
typedef boost::multiprecision::cpp_rational Rational;
|
||||
};
|
||||
#ifdef CGAL_USE_GMP
|
||||
struct BOOST_gmp_arithmetic_kernel : internal::Arithmetic_kernel_base {
|
||||
typedef boost::multiprecision::mpz_int Integer;
|
||||
typedef boost::multiprecision::mpq_rational Rational;
|
||||
};
|
||||
#endif
|
||||
|
||||
template <class T1, class T2, class T3, class T4, class T5>
|
||||
struct Get_arithmetic_kernel<boost::multiprecision::detail::expression<T1,T2,T3,T4,T5> >
|
||||
: Get_arithmetic_kernel<typename boost::multiprecision::detail::expression<T1,T2,T3,T4,T5>::result_type> {};
|
||||
|
||||
template <>
|
||||
struct Get_arithmetic_kernel<boost::multiprecision::cpp_int> {
|
||||
typedef BOOST_cpp_arithmetic_kernel Arithmetic_kernel;
|
||||
};
|
||||
template <>
|
||||
struct Get_arithmetic_kernel<boost::multiprecision::cpp_rational> {
|
||||
typedef BOOST_cpp_arithmetic_kernel Arithmetic_kernel;
|
||||
};
|
||||
#ifdef CGAL_USE_GMP
|
||||
template <>
|
||||
struct Get_arithmetic_kernel<boost::multiprecision::mpz_int> {
|
||||
typedef BOOST_gmp_arithmetic_kernel Arithmetic_kernel;
|
||||
};
|
||||
template <>
|
||||
struct Get_arithmetic_kernel<boost::multiprecision::mpq_rational> {
|
||||
typedef BOOST_gmp_arithmetic_kernel Arithmetic_kernel;
|
||||
};
|
||||
#endif
|
||||
} //namespace CGAL
|
||||
#endif // CGAL_USE_BOOST_MP
|
||||
#endif
|
||||
|
|
@ -1329,9 +1329,9 @@ flip_edge(typename boost::graph_traits<Graph>::halfedge_descriptor h,
|
|||
/**
|
||||
* \returns `true` if `e` satisfies the *link condition* \cgalCite{degn-tpec-98}, which guarantees that the surface is also 2-manifold after the edge collapse.
|
||||
*/
|
||||
template<typename Graph>
|
||||
template<typename Graph>
|
||||
bool
|
||||
does_satisfy_link_condition(typename boost::graph_traits<Graph>::edge_descriptor e,
|
||||
does_satisfy_link_condition(typename boost::graph_traits<Graph>::edge_descriptor e,
|
||||
Graph& g)
|
||||
{
|
||||
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
|
||||
|
|
@ -1349,7 +1349,6 @@ bool
|
|||
out_edge_iterator eb1, ee1 ;
|
||||
out_edge_iterator eb2, ee2 ;
|
||||
|
||||
|
||||
// The following loop checks the link condition for v0_v1.
|
||||
// Specifically, that for every vertex 'k' adjacent to both 'p and 'q', 'pkq' is a face of the mesh.
|
||||
//
|
||||
|
|
@ -1382,8 +1381,6 @@ bool
|
|||
bool lIsFace = ( vL == k && (! is_border(v0_v1,g)) )
|
||||
|| ( vR == k && (! is_border(v1_v0,g)) ) ;
|
||||
|
||||
|
||||
|
||||
if ( !lIsFace )
|
||||
{
|
||||
// CGAL_ECMS_TRACE(3," k=V" << get(Vertex_index_map,k) << " IS NOT in a face with p-q. NON-COLLAPSABLE edge." ) ;
|
||||
|
|
@ -1398,24 +1395,13 @@ bool
|
|||
}
|
||||
}
|
||||
|
||||
// detect isolated triangle (or triangle attached to a mesh with non-manifold vertices)
|
||||
if (!is_border(v0_v1,g) && is_border(opposite(next(v0_v1,g), g), g)
|
||||
&& is_border(opposite(prev(v0_v1,g), g), g) ) return false;
|
||||
if (!is_border(v1_v0,g) && is_border(opposite(next(v1_v0,g), g), g)
|
||||
&& is_border(opposite(prev(v1_v0,g), g), g) ) return false;
|
||||
|
||||
if ( is_border(v0_v1,g) )
|
||||
{
|
||||
if ( next(next(next(v0_v1,g),g),g) == v0_v1 )
|
||||
{
|
||||
//CGAL_ECMS_TRACE(3," p-q belongs to an open triangle. NON-COLLAPSABLE edge." ) ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
else if ( is_border(v1_v0,g) )
|
||||
{
|
||||
if ( next(next(next(v1_v0,g),g),g) == v1_v0 )
|
||||
{
|
||||
//CGAL_ECMS_TRACE(3," p-q belongs to an open triangle. NON-COLLAPSABLE edge." ) ;
|
||||
return false ;
|
||||
}
|
||||
}
|
||||
else
|
||||
if ( !is_border(v0_v1,g) && !is_border(v1_v0,g) )
|
||||
{
|
||||
if ( is_border(v0,g) && is_border(v1,g) )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -119,3 +119,24 @@ CGAL_add_named_parameter(plane_index_t, plane_index_map, plane_index_map)
|
|||
CGAL_add_named_parameter(select_percentage_t, select_percentage, select_percentage)
|
||||
CGAL_add_named_parameter(require_uniform_sampling_t, require_uniform_sampling, require_uniform_sampling)
|
||||
CGAL_add_named_parameter(point_is_constrained_t, point_is_constrained, point_is_constrained_map)
|
||||
|
||||
// List of named parameters used in Surface_mesh_approximation package
|
||||
CGAL_add_named_parameter(verbose_level_t, verbose_level, verbose_level)
|
||||
CGAL_add_named_parameter(seeding_method_t, seeding_method, seeding_method)
|
||||
CGAL_add_named_parameter(max_number_of_proxies_t, max_number_of_proxies, max_number_of_proxies)
|
||||
CGAL_add_named_parameter(min_error_drop_t, min_error_drop, min_error_drop)
|
||||
CGAL_add_named_parameter(number_of_relaxations_t, number_of_relaxations, number_of_relaxations)
|
||||
|
||||
// meshing parameters
|
||||
CGAL_add_named_parameter(subdivision_ratio_t, subdivision_ratio, subdivision_ratio)
|
||||
CGAL_add_named_parameter(relative_to_chord_t, relative_to_chord, relative_to_chord)
|
||||
CGAL_add_named_parameter(with_dihedral_angle_t, with_dihedral_angle, with_dihedral_angle)
|
||||
CGAL_add_named_parameter(optimize_anchor_location_t, optimize_anchor_location, optimize_anchor_location)
|
||||
CGAL_add_named_parameter(pca_plane_t, pca_plane, pca_plane)
|
||||
|
||||
// output parameters
|
||||
CGAL_add_named_parameter(face_proxy_map_t, face_proxy_map, face_proxy_map)
|
||||
CGAL_add_named_parameter(proxies_t, proxies, proxies)
|
||||
CGAL_add_named_parameter(anchors_t, anchors, anchors)
|
||||
CGAL_add_named_parameter(triangles_t, triangles, triangles)
|
||||
|
||||
|
|
|
|||
|
|
@ -441,17 +441,17 @@ put(boost::vertex_point_t p, OPEN_MESH_CLASS& g,
|
|||
} // namespace OpenMesh
|
||||
|
||||
|
||||
|
||||
// dynamic properties
|
||||
namespace boost {
|
||||
|
||||
template <typename K, typename V>
|
||||
struct property_map<OPEN_MESH_CLASS, CGAL::dynamic_vertex_property_t<V> >
|
||||
struct property_map<OPEN_MESH_CLASS, CGAL::dynamic_vertex_property_t<V> >
|
||||
{
|
||||
typedef OPEN_MESH_CLASS SM;
|
||||
typedef typename boost::graph_traits<SM>::vertex_descriptor vertex_descriptor;
|
||||
typedef CGAL::OM_pmap<SM,vertex_descriptor, V> SMPM;
|
||||
typedef CGAL::internal::Dynamic<SM, SMPM> type;
|
||||
typedef type const_type;
|
||||
typedef CGAL::internal::Dynamic_with_index<vertex_descriptor, V> const_type;
|
||||
};
|
||||
|
||||
template <typename K, typename V>
|
||||
|
|
@ -461,7 +461,7 @@ struct property_map<OPEN_MESH_CLASS, CGAL::dynamic_halfedge_property_t<V> >
|
|||
typedef typename boost::graph_traits<SM>::halfedge_descriptor halfedge_descriptor;
|
||||
typedef CGAL::OM_pmap<SM,halfedge_descriptor, V> SMPM;
|
||||
typedef CGAL::internal::Dynamic<SM, SMPM> type;
|
||||
typedef type const_type;
|
||||
typedef CGAL::internal::Dynamic_with_index<halfedge_descriptor, V> const_type;
|
||||
};
|
||||
|
||||
template <typename K, typename V>
|
||||
|
|
@ -471,7 +471,7 @@ struct property_map<OPEN_MESH_CLASS, CGAL::dynamic_edge_property_t<V> >
|
|||
typedef typename boost::graph_traits<SM>::edge_descriptor edge_descriptor;
|
||||
typedef CGAL::OM_pmap<SM,edge_descriptor, V> SMPM;
|
||||
typedef CGAL::internal::Dynamic<SM, SMPM> type;
|
||||
typedef type const_type;
|
||||
typedef CGAL::internal::Dynamic_with_index<edge_descriptor, V> const_type;
|
||||
};
|
||||
|
||||
template <typename K, typename V>
|
||||
|
|
@ -481,7 +481,7 @@ struct property_map<OPEN_MESH_CLASS, CGAL::dynamic_face_property_t<V> >
|
|||
typedef typename boost::graph_traits<SM>::face_descriptor face_descriptor;
|
||||
typedef CGAL::OM_pmap<SM,face_descriptor, V> SMPM;
|
||||
typedef CGAL::internal::Dynamic<SM, SMPM> type;
|
||||
typedef type const_type;
|
||||
typedef CGAL::internal::Dynamic_with_index<face_descriptor, V> const_type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
|
@ -489,46 +489,84 @@ struct property_map<OPEN_MESH_CLASS, CGAL::dynamic_face_property_t<V> >
|
|||
|
||||
namespace OpenMesh {
|
||||
|
||||
// get function for dynamic properties of mutable graph
|
||||
template <typename K, typename V>
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_vertex_property_t<V> >::const_type
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_vertex_property_t<V> >::type
|
||||
get(CGAL::dynamic_vertex_property_t<V>, OPEN_MESH_CLASS& om)
|
||||
{
|
||||
typedef OPEN_MESH_CLASS OM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_vertex_property_t<V> >::SMPM SMPM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_vertex_property_t<V> >::const_type DPM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_vertex_property_t<V> >::type DPM;
|
||||
return DPM(om, new SMPM(om));
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_halfedge_property_t<V> >::const_type
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_halfedge_property_t<V> >::type
|
||||
get(CGAL::dynamic_halfedge_property_t<V>, OPEN_MESH_CLASS& om)
|
||||
{
|
||||
typedef OPEN_MESH_CLASS OM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_halfedge_property_t<V> >::SMPM SMPM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_halfedge_property_t<V> >::const_type DPM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_halfedge_property_t<V> >::type DPM;
|
||||
return DPM(om, new SMPM(om));
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_edge_property_t<V> >::const_type
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_edge_property_t<V> >::type
|
||||
get(CGAL::dynamic_edge_property_t<V>, OPEN_MESH_CLASS& om)
|
||||
{
|
||||
typedef OPEN_MESH_CLASS OM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_edge_property_t<V> >::SMPM SMPM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_edge_property_t<V> >::const_type DPM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_edge_property_t<V> >::type DPM;
|
||||
return DPM(om, new SMPM(om));
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_face_property_t<V> >::const_type
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_face_property_t<V> >::type
|
||||
get(CGAL::dynamic_face_property_t<V>, OPEN_MESH_CLASS& om)
|
||||
{
|
||||
typedef OPEN_MESH_CLASS OM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_face_property_t<V> >::SMPM SMPM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_face_property_t<V> >::const_type DPM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_face_property_t<V> >::type DPM;
|
||||
return DPM(om, new SMPM(om));
|
||||
}
|
||||
|
||||
// get function for dynamic properties of const graph
|
||||
template <typename K, typename V>
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_vertex_property_t<V> >::const_type
|
||||
get(CGAL::dynamic_vertex_property_t<V>, const OPEN_MESH_CLASS& om)
|
||||
{
|
||||
typedef OPEN_MESH_CLASS OM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_vertex_property_t<V> >::const_type DPM;
|
||||
return DPM(num_vertices(om));
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_halfedge_property_t<V> >::const_type
|
||||
get(CGAL::dynamic_halfedge_property_t<V>, const OPEN_MESH_CLASS& om)
|
||||
{
|
||||
typedef OPEN_MESH_CLASS OM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_halfedge_property_t<V> >::const_type DPM;
|
||||
return DPM(num_halfedges(om));
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_edge_property_t<V> >::const_type
|
||||
get(CGAL::dynamic_edge_property_t<V>, const OPEN_MESH_CLASS& om)
|
||||
{
|
||||
typedef OPEN_MESH_CLASS OM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_edge_property_t<V> >::const_type DPM;
|
||||
return DPM(num_edges(om));
|
||||
}
|
||||
|
||||
template <typename K, typename V>
|
||||
typename boost::property_map<OPEN_MESH_CLASS, CGAL::dynamic_face_property_t<V> >::const_type
|
||||
get(CGAL::dynamic_face_property_t<V>, const OPEN_MESH_CLASS& om)
|
||||
{
|
||||
typedef OPEN_MESH_CLASS OM;
|
||||
typedef typename boost::property_map<OM, CGAL::dynamic_face_property_t<V> >::const_type DPM;
|
||||
return DPM(num_faces(om));
|
||||
}
|
||||
|
||||
// implementation detail: required by Dynamic_property_map_deleter
|
||||
template <typename Pmap, typename K>
|
||||
void remove_property(Pmap pm, OPEN_MESH_CLASS& om)
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include <CGAL/boost/iterator/counting_iterator.hpp>
|
||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
||||
#include <boost/functional.hpp>
|
||||
#include <CGAL/NT_converter.h>
|
||||
|
||||
// here is how it works. We have d+2 variables:
|
||||
// R (big radius), r (small radius), c (center). The problem is
|
||||
|
|
@ -466,7 +467,8 @@ public:
|
|||
{ CGAL_optimisation_precondition(
|
||||
is_empty() || tco.access_dimension_d_object()( p) == d);
|
||||
ET sqr_d = sqr_dist( p);
|
||||
ET h_p_sqr = da_coord(p)[d] * da_coord(p)[d];
|
||||
ET h_p_sqr(da_coord(p)[d]);
|
||||
h_p_sqr *= h_p_sqr;
|
||||
return ( ( sqr_d < h_p_sqr * sqr_i_rad_numer) ||
|
||||
( h_p_sqr * sqr_o_rad_numer < sqr_d)); }
|
||||
|
||||
|
|
@ -623,9 +625,10 @@ private:
|
|||
inner_indices.push_back( 0);
|
||||
outer_indices.push_back( 0);
|
||||
center_coords.resize( d+1);
|
||||
std::copy( da_coord( points[ 0]),
|
||||
std::transform( da_coord( points[ 0]),
|
||||
da_coord( points[ 0])+d+1,
|
||||
center_coords.begin());
|
||||
center_coords.begin(),
|
||||
NT_converter<RT,ET>());
|
||||
sqr_i_rad_numer = ET( 0);
|
||||
sqr_o_rad_numer = ET( 0);
|
||||
sqr_rad_denom = ET( 1);
|
||||
|
|
@ -748,7 +751,8 @@ is_valid( bool verbose, int level) const
|
|||
// all inner support points on inner boundary?
|
||||
Inner_support_point_iterator i_pt_it = inner_support_points_begin();
|
||||
for ( ; i_pt_it != inner_support_points_end(); ++i_pt_it) {
|
||||
ET h_p_sqr = da_coord (*i_pt_it)[d] * da_coord (*i_pt_it)[d];
|
||||
ET h_p_sqr(da_coord (*i_pt_it)[d]);
|
||||
h_p_sqr *= h_p_sqr;
|
||||
if ( sqr_dist( *i_pt_it) != h_p_sqr * sqr_i_rad_numer)
|
||||
return CGAL::_optimisation_is_valid_fail( verr,
|
||||
"annulus does not have all inner support points on its inner boundary");
|
||||
|
|
@ -757,7 +761,8 @@ is_valid( bool verbose, int level) const
|
|||
// all outer support points on outer boundary?
|
||||
Outer_support_point_iterator o_pt_it = outer_support_points_begin();
|
||||
for ( ; o_pt_it != outer_support_points_end(); ++o_pt_it) {
|
||||
ET h_p_sqr = da_coord (*o_pt_it)[d] * da_coord (*o_pt_it)[d];
|
||||
ET h_p_sqr(da_coord (*o_pt_it)[d]);
|
||||
h_p_sqr *= h_p_sqr;
|
||||
if ( sqr_dist( *o_pt_it) != h_p_sqr * sqr_o_rad_numer)
|
||||
return CGAL::_optimisation_is_valid_fail( verr,
|
||||
"annulus does not have all outer support points on its outer boundary");
|
||||
|
|
|
|||
|
|
@ -68,6 +68,19 @@ struct I_Infinity_distance_2
|
|||
: public CGAL::cpp98::binary_function<
|
||||
Point_2< R >, Point_2< R >, typename R::FT >
|
||||
{
|
||||
// Added as workaround for VC2017 with /arch:AVX to fix
|
||||
// https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-4.14-I-95/Rectangular_p_center_2_Examples/TestReport_afabri_x64_Cygwin-Windows10_MSVC2017-Release-64bits.gz
|
||||
I_Infinity_distance_2()
|
||||
{}
|
||||
|
||||
I_Infinity_distance_2(const I_Infinity_distance_2&)
|
||||
{}
|
||||
|
||||
I_Infinity_distance_2& operator=(const I_Infinity_distance_2&)
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
typename R::FT
|
||||
operator()(const Point_2< R >& q1, const Point_2< R >& q2) const {
|
||||
return (std::max)(CGAL_NTS abs(q1.x() - q2.x()),
|
||||
|
|
|
|||
|
|
@ -27,14 +27,18 @@ struct Util {
|
|||
int numBoxes, numDim;
|
||||
int boxNum, dim;
|
||||
|
||||
std::fscanf(infile, "%d %d\n", &numBoxes, &numDim);
|
||||
int n = std::fscanf(infile, "%d %d\n", &numBoxes, &numDim);
|
||||
assert(n == 2); CGAL_USE(n);
|
||||
std::vector< int > minc( numDim ), maxc( numDim );
|
||||
/* Read boxes */
|
||||
for(boxNum = 0; boxNum < numBoxes; boxNum++) {
|
||||
for(dim = 0; dim < numDim; dim++)
|
||||
std::fscanf( infile, "[%d, %d) ", &minc[dim], &maxc[dim] );
|
||||
for(dim = 0; dim < numDim; dim++) {
|
||||
n = std::fscanf( infile, "[%d, %d) ", &minc[dim], &maxc[dim] );
|
||||
assert( n == 2);
|
||||
}
|
||||
boxes.push_back( Box( &minc[0], &maxc[0] ) );
|
||||
std::fscanf(infile, "\n");
|
||||
n = std::fscanf(infile, "\n");
|
||||
assert(n == 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,11 +47,13 @@
|
|||
|
||||
#if !defined CGAL_CFG_NO_CPP0X_ISFINITE
|
||||
#define CGAL_CORE_finite(x) std::isfinite(x)
|
||||
#define CGAL_CORE_ilogb(x) ilogb(x)
|
||||
#elif defined (_MSC_VER) || defined (__MINGW32__) // add support for MinGW
|
||||
#define CGAL_CORE_finite(x) _finite(x)
|
||||
#define ilogb(x) (int)_logb(x)
|
||||
#define CGAL_CORE_ilogb(x) (int)_logb(x)
|
||||
#else
|
||||
#define CGAL_CORE_finite(x) finite(x)
|
||||
#define CGAL_CORE_ilogb(x) ilogb(x)
|
||||
#endif
|
||||
|
||||
#if defined(sun) || defined(__sun)
|
||||
|
|
@ -126,11 +128,11 @@ public:
|
|||
ilogb(x) is floor(log_2(|x|)).
|
||||
Also, ilogb(0) = -INT_MAX. ilogb(NaN) = ilogb(+/-Inf) = INT_MAX */
|
||||
extLong lMSB() const {
|
||||
return extLong(ilogb(core_abs(fpVal)-maxAbs*ind*CORE_EPS));
|
||||
return extLong(CGAL_CORE_ilogb(core_abs(fpVal)-maxAbs*ind*CORE_EPS));
|
||||
}
|
||||
/// upper bound on MSB
|
||||
extLong uMSB() const {
|
||||
return extLong(ilogb(core_abs(fpVal)+maxAbs*ind*CORE_EPS));
|
||||
return extLong(CGAL_CORE_ilogb(core_abs(fpVal)+maxAbs*ind*CORE_EPS));
|
||||
}
|
||||
//@}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,14 +73,23 @@ struct Indicator_factory
|
|||
|
||||
class CGAL_IMAGEIO_EXPORT Image_3
|
||||
{
|
||||
class Image_deleter {
|
||||
const bool own_the_data;
|
||||
|
||||
public:
|
||||
Image_deleter(bool own_the_data) : own_the_data(own_the_data) {}
|
||||
|
||||
struct Image_deleter {
|
||||
void operator()(_image* image)
|
||||
{
|
||||
if(!own_the_data && image != 0) {
|
||||
image->data = 0;
|
||||
}
|
||||
::_freeImage(image);
|
||||
}
|
||||
};
|
||||
public:
|
||||
enum Own { OWN_THE_DATA, DO_NOT_OWN_THE_DATA };
|
||||
|
||||
typedef boost::shared_ptr<_image> Image_shared_ptr;
|
||||
typedef Image_shared_ptr Pointer;
|
||||
|
||||
|
|
@ -88,7 +97,7 @@ protected:
|
|||
Image_shared_ptr image_ptr;
|
||||
|
||||
// implementation in src/CGAL_ImageIO/Image_3.cpp
|
||||
bool private_read(_image* im);
|
||||
bool private_read(_image* im, Own own_the_data = OWN_THE_DATA);
|
||||
|
||||
public:
|
||||
Image_3()
|
||||
|
|
@ -102,9 +111,9 @@ public:
|
|||
// std::cerr << "Image_3::copy_constructor\n";
|
||||
}
|
||||
|
||||
Image_3(_image* im)
|
||||
Image_3(_image* im, Own own_the_data = OWN_THE_DATA)
|
||||
{
|
||||
private_read(im);
|
||||
private_read(im, own_the_data);
|
||||
}
|
||||
|
||||
~Image_3()
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@
|
|||
#define CGAL_INLINE_FUNCTION
|
||||
#endif
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/assertions.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
CGAL_INLINE_FUNCTION
|
||||
bool Image_3::private_read(_image* im)
|
||||
bool Image_3::private_read(_image* im, Own own)
|
||||
{
|
||||
if(im != 0)
|
||||
{
|
||||
|
|
@ -38,7 +38,7 @@ bool Image_3::private_read(_image* im)
|
|||
{
|
||||
::_freeImage(image());
|
||||
}
|
||||
image_ptr = Image_shared_ptr(im, Image_deleter());
|
||||
image_ptr = Image_shared_ptr(im, Image_deleter(own == OWN_THE_DATA));
|
||||
|
||||
// std::cerr <<
|
||||
// boost::format("image=%1% (xdim=%2%, ydim=%3%, zdim=%4%)\n")
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ static const VTK_to_ImageIO_type_mapper VTK_to_ImageIO_type[VTK_ID_TYPE] =
|
|||
|
||||
inline
|
||||
Image_3
|
||||
read_vtk_image_data(vtkImageData* vtk_image)
|
||||
read_vtk_image_data(vtkImageData* vtk_image, Image_3::Own owning = Image_3::OWN_THE_DATA)
|
||||
{
|
||||
if(!vtk_image)
|
||||
return Image_3();
|
||||
|
|
@ -85,16 +85,21 @@ read_vtk_image_data(vtkImageData* vtk_image)
|
|||
image->wdim = imageio_type.wdim;
|
||||
image->wordKind = imageio_type.wordKind;
|
||||
image->sign = imageio_type.sign;
|
||||
image->data = ::ImageIO_alloc(dims[0]*dims[1]*dims[2]*image->wdim);
|
||||
std::cerr << "GetNumberOfTuples()=" << vtk_image->GetPointData()->GetScalars()->GetNumberOfTuples()
|
||||
<< "\nimage->size()=" << dims[0]*dims[1]*dims[2]
|
||||
<< "\nwdim=" << image->wdim << '\n';
|
||||
CGAL_assertion(vtk_image->GetPointData()->GetScalars()->GetNumberOfTuples() == dims[0]*dims[1]*dims[2]);
|
||||
if(owning == Image_3::OWN_THE_DATA) {
|
||||
image->data = ::ImageIO_alloc(dims[0]*dims[1]*dims[2]*image->wdim);
|
||||
// std::cerr << "GetNumberOfTuples()=" << vtk_image->GetPointData()->GetScalars()->GetNumberOfTuples()
|
||||
// << "\nimage->size()=" << dims[0]*dims[1]*dims[2]
|
||||
// << "\nwdim=" << image->wdim << '\n';
|
||||
vtk_image->GetPointData()->GetScalars()->ExportToVoidPointer(image->data);
|
||||
} else {
|
||||
image->data = vtk_image->GetPointData()->GetScalars()->GetVoidPointer(0);
|
||||
}
|
||||
|
||||
return Image_3(image);
|
||||
return Image_3(image, owning);
|
||||
}
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
|
||||
#endif // CGAL_READ_VTK_IMAGE_DATA_H
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public:
|
|||
CGAL_kernel_assertion((p.a() * center.x() +
|
||||
p.b() * center.y() +
|
||||
p.c() * center.z() +
|
||||
p.d()) == CGAL::ZERO);
|
||||
p.d()) == 0);
|
||||
CGAL_kernel_assertion(squared_r >= FT(0));
|
||||
base = Rep(Sphere_3(center,squared_r), p);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ namespace internal {
|
|||
// the circles intersect
|
||||
|
||||
const std::pair<typename CK::Circular_arc_point_2, unsigned>*
|
||||
result = CGAL::internal::intersect_get< std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
result = CGAL::Intersections::internal::intersect_get< std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
if ( result->second == 2 ){ // double solution
|
||||
_begin = result->first;
|
||||
_end = result->first;
|
||||
|
|
@ -202,7 +202,7 @@ namespace internal {
|
|||
_end = result->first;
|
||||
if (!(b_1 && b_2)) {
|
||||
++it;
|
||||
result = CGAL::internal::intersect_get< std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
result = CGAL::Intersections::internal::intersect_get< std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
if (!b_1)
|
||||
_begin = result->first;
|
||||
if (!b_2)
|
||||
|
|
|
|||
|
|
@ -92,13 +92,13 @@ public:
|
|||
// the circles intersect
|
||||
|
||||
const std::pair<typename CK::Circular_arc_point_2, unsigned>*
|
||||
result = CGAL::internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
result = CGAL::Intersections::internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
// get must have succeeded
|
||||
if ( result->second == 2 ) // double solution
|
||||
return result->first;
|
||||
if (b) return result->first;
|
||||
++it;
|
||||
result = CGAL::internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
result = CGAL::Intersections::internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> >(*it);
|
||||
return result->first;
|
||||
}
|
||||
|
||||
|
|
@ -136,14 +136,14 @@ public:
|
|||
CGAL_kernel_precondition(do_intersect(support, l2));
|
||||
//typedef typename Root_of_2::RT RT_2;
|
||||
typename Intersection_traits<CK, Line_2, Line_2>::result_type
|
||||
v = CGAL::internal::intersection(support, l1, CK());
|
||||
v = CGAL::Intersections::internal::intersection(support, l1, CK());
|
||||
CGAL_assertion(bool(v));
|
||||
|
||||
const Point_2 *pt = CGAL::internal::intersect_get<Point_2>(v);
|
||||
const Point_2 *pt = CGAL::Intersections::internal::intersect_get<Point_2>(v);
|
||||
CGAL_assertion(pt != NULL);
|
||||
_begin = Circular_arc_point_2(*pt);
|
||||
v = CGAL::internal::intersection(support, l2, CK());
|
||||
const Point_2 *pt2 = CGAL::internal::intersect_get<Point_2>(v);
|
||||
v = CGAL::Intersections::internal::intersection(support, l2, CK());
|
||||
const Point_2 *pt2 = CGAL::Intersections::internal::intersect_get<Point_2>(v);
|
||||
CGAL_assertion(pt2 != NULL);
|
||||
_end = Circular_arc_point_2(*pt2);
|
||||
reset_flags();
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ namespace CircularFunctors {
|
|||
template <class T1, class T2>
|
||||
result_type
|
||||
operator()(const T1& t1, const T2& t2) const
|
||||
{ return internal::do_intersect(t1, t2, CK()); }
|
||||
{ return Intersections::internal::do_intersect(t1, t2, CK()); }
|
||||
};
|
||||
|
||||
template < class CK >
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ circle_intersect( const typename CK::Circle_2 & c1,
|
|||
// the circles intersect
|
||||
|
||||
const std::pair<typename CK::Circular_arc_point_2, unsigned>*
|
||||
result = internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> > (*it);
|
||||
result = Intersections::internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> > (*it);
|
||||
|
||||
if ( result->second == 2 ) // double solution
|
||||
return result->first;
|
||||
|
|
@ -63,7 +63,7 @@ circle_intersect( const typename CK::Circle_2 & c1,
|
|||
return result->first;
|
||||
|
||||
++it;
|
||||
result = internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> > (*it);
|
||||
result = Intersections::internal::intersect_get<std::pair<typename CK::Circular_arc_point_2, unsigned> > (*it);
|
||||
|
||||
return result->first;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -488,10 +488,10 @@ namespace CircularFunctors {
|
|||
}
|
||||
|
||||
typename Intersection_traits<CK, typename CK::Line_2, typename CK::Line_2>::result_type
|
||||
v = CGAL::internal::intersection(a1.supporting_line(), a2.supporting_line(), CK());
|
||||
v = CGAL::Intersections::internal::intersection(a1.supporting_line(), a2.supporting_line(), CK());
|
||||
if(!v) return res;
|
||||
|
||||
const Point_2 *pt = CGAL::internal::intersect_get<Point_2>(v);
|
||||
const Point_2 *pt = CGAL::Intersections::internal::intersect_get<Point_2>(v);
|
||||
if(pt == NULL) return res;
|
||||
Circular_arc_point_2 intersect_point = Circular_arc_point_2(*pt);
|
||||
// (Root_for_circles_2_2(Root_of_2(pt->x()),Root_of_2(pt->y())));
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@ intersection(const A <K> &c1, const B <K> &c2, OutputIterator res) \
|
|||
{ \
|
||||
return typename K::Intersect_2()(c1, c2, res); \
|
||||
} \
|
||||
namespace internal { \
|
||||
namespace Intersections { \
|
||||
namespace internal { \
|
||||
template <class K> \
|
||||
inline \
|
||||
bool \
|
||||
|
|
@ -59,6 +60,7 @@ namespace internal { \
|
|||
return !res.empty(); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
template <class K> \
|
||||
inline \
|
||||
bool \
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@
|
|||
#include <CGAL/Algebraic_kernel_for_circles_2_2.h>
|
||||
#include <CGAL/MP_Float.h>
|
||||
#include <CGAL/Quotient.h>
|
||||
#include <CGAL/Circular_kernel_2/function_objects_polynomial_circular.h>
|
||||
#include <CGAL/Circular_kernel_2/Circular_arc_2.h>
|
||||
#include <CGAL/Circular_kernel_2/Line_arc_2.h>
|
||||
#include <CGAL/Exact_circular_kernel_2.h>
|
||||
|
|
|
|||
|
|
@ -282,7 +282,15 @@ namespace CGAL {
|
|||
const double dz = z2-z1;
|
||||
const double d_sq = dx*dx + dy*dy + dz*dz;
|
||||
const double r_sq = to_double(squared_radius());
|
||||
const double ap_ang = 2.0 * std::asin(0.5 * std::sqrt(d_sq / r_sq));
|
||||
const double s = 0.5 * std::sqrt(d_sq / r_sq);
|
||||
double ap_ang;
|
||||
if(std::abs(s)<=1) {
|
||||
ap_ang = 2.0 * std::asin(s);
|
||||
} else {
|
||||
// We only allow a small rounding error
|
||||
CGAL_assertion(std::abs(s)<=1.0001);
|
||||
ap_ang = (s < 0) ? -CGAL_PI : CGAL_PI;
|
||||
}
|
||||
if(sign_cross_product() == NEGATIVE) return 2.0 * CGAL_PI - ap_ang;
|
||||
else return ap_ang;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ struct Trait_for_cmp_tgt_theta_0{
|
|||
typename SK::FT
|
||||
unsigned_tkz_coeff_normal( const typename SK::Point_3& C,const typename SK::FT& gamma_k) const
|
||||
{
|
||||
return - CGAL_NTS sign(gamma_k)*C.y();
|
||||
return - (int)CGAL_NTS sign(gamma_k)*C.y();
|
||||
}
|
||||
|
||||
Tk_type
|
||||
|
|
|
|||
|
|
@ -130,8 +130,8 @@ namespace CGAL {
|
|||
intersect_3<SK>(circle,plane,std::back_inserter(inters));
|
||||
CGAL_kernel_precondition(inters.size()==2);
|
||||
const std::pair<typename SK::Circular_arc_point_3,unsigned>* pt[2]={NULL,NULL};
|
||||
pt[0]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
pt[1]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1]);
|
||||
pt[0]=CGAL::Intersections::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
pt[1]=CGAL::Intersections::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1]);
|
||||
CGAL_kernel_precondition(pt[0]!=NULL);
|
||||
CGAL_kernel_precondition(pt[1]!=NULL);
|
||||
|
||||
|
|
|
|||
|
|
@ -103,12 +103,12 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(ca,sol.first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
const Solution& sol1=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(ca,sol1.first,true))
|
||||
*res++ = solutions[0];
|
||||
if(SK().has_on_3_object()(ca,sol2.first,true))
|
||||
|
|
@ -140,12 +140,12 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(ca,sol.first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
const Solution& sol1=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(ca,sol1.first,true))
|
||||
*res++ = solutions[0];
|
||||
if(SK().has_on_3_object()(ca,sol2.first,true))
|
||||
|
|
@ -178,12 +178,12 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(c,sol.first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
const Solution& sol1=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(c,sol1.first,true))
|
||||
*res++ = solutions[0];
|
||||
if(SK().has_on_3_object()(c,sol2.first,true))
|
||||
|
|
@ -215,12 +215,12 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(ca,sol.first,true))
|
||||
*res++ = CGAL::internal::sk3_intersection_return<result_type>(sol);
|
||||
} else {
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
const Solution& sol1=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(ca,sol1.first,true))
|
||||
*res++ = CGAL::internal::sk3_intersection_return<result_type>(sol1);
|
||||
if(SK().has_on_3_object()(ca,sol2.first,true))
|
||||
|
|
@ -247,13 +247,13 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(ca,sol.first,true) &&
|
||||
SK().has_on_3_object()(la,sol.first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
const Solution& sol1=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(ca,sol1.first,true) &&
|
||||
SK().has_on_3_object()(la,sol1.first,true))
|
||||
*res++ = solutions[0];
|
||||
|
|
@ -359,13 +359,13 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution& sol=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(a1,sol.first,true) &&
|
||||
SK().has_on_3_object()(a2,sol.first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution& sol1=*CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
const Solution& sol1=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution& sol2=*CGAL::Intersections::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(a1,sol1.first,true) &&
|
||||
SK().has_on_3_object()(a2,sol1.first,true))
|
||||
*res++ = solutions[0];
|
||||
|
|
@ -481,8 +481,8 @@ namespace CGAL {
|
|||
//one endpoint is extremal: just split the arc
|
||||
if (nb_extrem==1){
|
||||
const std::pair<typename SK::Circular_arc_point_3,unsigned>* pt[2]={NULL,NULL};
|
||||
pt[0]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
pt[1]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1]);
|
||||
pt[0]=CGAL::Intersections::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
pt[1]=CGAL::Intersections::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1]);
|
||||
CGAL_kernel_precondition(pt[0]!=NULL);
|
||||
CGAL_kernel_precondition(pt[1]!=NULL);
|
||||
const typename SK::Circular_arc_point_3& midpt=(arc.source()==pt[0]->first || arc.target()==pt[0]->first)?pt[1]->first:pt[0]->first;
|
||||
|
|
@ -496,7 +496,7 @@ namespace CGAL {
|
|||
//only one intersection points
|
||||
if (inters.size()==1){
|
||||
const std::pair<typename SK::Circular_arc_point_3,unsigned>* midpt=NULL;
|
||||
midpt=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
midpt=CGAL::Intersections::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
CGAL_kernel_precondition(midpt!=NULL);
|
||||
*out_it++=typename SK::Circular_arc_3(arc.supporting_circle(),arc.source(),midpt->first);
|
||||
*out_it++=typename SK::Circular_arc_3(arc.supporting_circle(),midpt->first,arc.target());
|
||||
|
|
@ -505,8 +505,8 @@ namespace CGAL {
|
|||
|
||||
//three arcs are defined by two intersection points
|
||||
const std::pair<typename SK::Circular_arc_point_3,unsigned>* pt[2]={NULL,NULL};
|
||||
pt[0]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
pt[1]=CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1]);
|
||||
pt[0]=CGAL::Intersections::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0]);
|
||||
pt[1]=CGAL::Intersections::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1]);
|
||||
CGAL_kernel_precondition(pt[0]!=NULL);
|
||||
CGAL_kernel_precondition(pt[1]!=NULL);
|
||||
|
||||
|
|
@ -590,16 +590,16 @@ namespace CGAL {
|
|||
CGAL_kernel_precondition(!inters.empty());
|
||||
if (inters.size()==1){
|
||||
const typename SK::Circular_arc_point_3& pt=
|
||||
CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0])->first;
|
||||
CGAL::Intersections::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0])->first;
|
||||
return pt;
|
||||
}
|
||||
|
||||
CGAL_kernel_precondition(classify_circle_3<SK>(arc.supporting_circle(),sphere)!=NORMAL);
|
||||
|
||||
const typename SK::Circular_arc_point_3& pts1 =
|
||||
CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0])->first;
|
||||
CGAL::Intersections::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[0])->first;
|
||||
const typename SK::Circular_arc_point_3& pts2 =
|
||||
CGAL::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1])->first;
|
||||
CGAL::Intersections::internal::intersect_get<std::pair<typename SK::Circular_arc_point_3,unsigned> >(inters[1])->first;
|
||||
|
||||
|
||||
//either a polar (1 pole + 1 pt) or a threaded circle (2 pts with theta-coord = +/- pi)
|
||||
|
|
|
|||
|
|
@ -101,12 +101,12 @@ namespace CGAL {
|
|||
if(!o)
|
||||
return res;
|
||||
|
||||
if(const Point_3* inters_p = CGAL::internal::intersect_get<Point_3>(o)) {
|
||||
if(const Point_3* inters_p = CGAL::Intersections::internal::intersect_get<Point_3>(o)) {
|
||||
Circular_arc_point_3 p = *inters_p;
|
||||
if(!SK().has_on_3_object()(l1,p,true)) return res;
|
||||
if(!SK().has_on_3_object()(l2,p,true)) return res;
|
||||
*res++ = CGAL::internal::sk3_intersection_return<result_type>(std::make_pair(p,1u));
|
||||
} else if( CGAL::internal::intersect_get<Line_3>(o) ) {
|
||||
} else if( CGAL::Intersections::internal::intersect_get<Line_3>(o) ) {
|
||||
if(SK().compare_xyz_3_object()(l1.lower_xyz_extremity(),
|
||||
l2.lower_xyz_extremity()) < 0) {
|
||||
int comparison =
|
||||
|
|
@ -167,9 +167,9 @@ namespace CGAL {
|
|||
if(!o)
|
||||
return res;
|
||||
|
||||
if(const Line_3* inters_l = CGAL::internal::intersect_get<Line_3>(o)) {
|
||||
if(const Line_3* inters_l = CGAL::Intersections::internal::intersect_get<Line_3>(o)) {
|
||||
*res++ = CGAL::internal::sk3_intersection_return<result_type>(la);
|
||||
} else if(const Point_3* inters_p = CGAL::internal::intersect_get<Point_3>(o)) {
|
||||
} else if(const Point_3* inters_p = CGAL::Intersections::internal::intersect_get<Point_3>(o)) {
|
||||
Circular_arc_point_3 p = *inters_p;
|
||||
if(!SK().has_on_3_object()(la,p,true)) return res;
|
||||
*res++ = CGAL::internal::sk3_intersection_return<result_type>(std::make_pair(p,1u));
|
||||
|
|
@ -195,12 +195,12 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution* sol = CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution* sol = CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(l,(*sol).first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution* sol1 = CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution* sol2 = CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
const Solution* sol1 = CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution* sol2 = CGAL::Intersections::internal::intersect_get<Solution>(solutions[1]);
|
||||
|
||||
if(SK().has_on_3_object()(l,(*sol1).first,true))
|
||||
*res++ = solutions[0];
|
||||
|
|
@ -226,12 +226,12 @@ namespace CGAL {
|
|||
std::back_inserter(solutions) );
|
||||
if(solutions.size() == 0) return res;
|
||||
if(solutions.size() == 1) {
|
||||
const Solution* sol = CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution* sol = CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
if(SK().has_on_3_object()(l,(*sol).first,true))
|
||||
*res++ = solutions[0];
|
||||
} else {
|
||||
const Solution* sol1 = CGAL::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution* sol2 = CGAL::internal::intersect_get<Solution>(solutions[1]);
|
||||
const Solution* sol1 = CGAL::Intersections::internal::intersect_get<Solution>(solutions[0]);
|
||||
const Solution* sol2 = CGAL::Intersections::internal::intersect_get<Solution>(solutions[1]);
|
||||
if(SK().has_on_3_object()(l,(*sol1).first,true))
|
||||
*res++ = solutions[0];
|
||||
if(SK().has_on_3_object()(l,(*sol2).first,true))
|
||||
|
|
@ -257,7 +257,7 @@ namespace CGAL {
|
|||
|
||||
if(!o)
|
||||
return res;
|
||||
if((sol = CGAL::internal::intersect_get<Point_3>(o))) {
|
||||
if((sol = CGAL::Intersections::internal::intersect_get<Point_3>(o))) {
|
||||
if(!SK().has_on_3_object()(l,*sol)) return res;
|
||||
Circular_arc_point_3 point = sol;
|
||||
*res++ = result_type(std::make_pair(point,1u));
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ namespace CGAL {
|
|||
typename Intersection_traits<SK, Sphere_3, Sphere_3>::result_type v =
|
||||
SK().intersect_3_object()(s1, s2);
|
||||
if(!v) return res;
|
||||
if(const Point_3* p = CGAL::internal::intersect_get<Point_3>(v)) {
|
||||
if(const Point_3* p = CGAL::Intersections::internal::intersect_get<Point_3>(v)) {
|
||||
if(SK().has_on_3_object()(s3, *p)) {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
*res++ = make_object(std::make_pair(Circular_arc_point_3(*p),2u));
|
||||
|
|
@ -346,7 +346,7 @@ namespace CGAL {
|
|||
}
|
||||
return res;
|
||||
}
|
||||
if(const Circle_3* c = CGAL::internal::intersect_get<Circle_3>(v)) {
|
||||
if(const Circle_3* c = CGAL::Intersections::internal::intersect_get<Circle_3>(v)) {
|
||||
if(SK().has_on_3_object()(s3, *c)) {
|
||||
#if CGAL_INTERSECTION_VERSION < 2
|
||||
*res++ = make_object(*c);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,14 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
#define CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_JUST_INTERSECTION_2_(A,B) \
|
||||
template < class OutputIterator, class K > \
|
||||
OutputIterator \
|
||||
intersection(const A <K> &c1, const B <K> &c2, OutputIterator res) \
|
||||
{ \
|
||||
return typename K::Intersect_3()(c1, c2, res); \
|
||||
}
|
||||
|
||||
#define CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_2_(A,B) \
|
||||
template < class OutputIterator, class K > \
|
||||
OutputIterator \
|
||||
|
|
@ -68,8 +76,8 @@ do_intersect(const A <K> &c1, const B <K> &c2, const C <K> &c3) \
|
|||
return typename K::Do_intersect_3()(c1, c2, c3); \
|
||||
}
|
||||
|
||||
CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_2_(Sphere_3, Line_3)
|
||||
CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_2_(Line_3, Sphere_3)
|
||||
CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_JUST_INTERSECTION_2_(Sphere_3, Line_3)
|
||||
CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_JUST_INTERSECTION_2_(Line_3, Sphere_3)
|
||||
CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_3_(Sphere_3, Sphere_3, Sphere_3)
|
||||
CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_3_(Sphere_3, Sphere_3, Plane_3)
|
||||
CGAL_SPHERICAL_KERNEL_MACRO_GLOBAL_FUNCTION_INTERSECTION_3_(Plane_3, Sphere_3, Sphere_3)
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ void _test_spherical_kernel_compute(SK sk)
|
|||
cp[i] = theConstruct_circular_arc_point_3(rt[i]);
|
||||
}
|
||||
|
||||
const double pi = std::acos(-1.);
|
||||
const double pi = CGAL_PI;
|
||||
|
||||
const Polynomials_for_circle_3 pcc_test =
|
||||
std::make_pair(Polynomial_for_spheres_2_3(0,0,0,1),
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
namespace CGAL {
|
||||
|
||||
/*
|
||||
#include <CGAL/Segment_2_Segment_2_intersection.h>
|
||||
#include <CGAL/Intersections_2/Segment_2_Segment_2.h>
|
||||
template <class ForwardIterator, class OutputIterator, class R>
|
||||
OutputIterator
|
||||
si_brute_force(ForwardIterator first, ForwardIterator last,
|
||||
|
|
|
|||
|
|
@ -14,3 +14,4 @@ Number_types
|
|||
Profiling_tools
|
||||
STL_Extension
|
||||
Stream_support
|
||||
Distance_3
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ Generator
|
|||
Geomview
|
||||
GraphicsView
|
||||
HalfedgeDS
|
||||
Heat_method_3
|
||||
BGL
|
||||
Combinatorial_map
|
||||
Generalized_map
|
||||
|
|
@ -97,3 +98,4 @@ Surface_mesh_shortest_path
|
|||
Polygon_mesh_processing
|
||||
Set_movable_separability_2
|
||||
Classification
|
||||
Surface_mesh_approximation
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ h1 {
|
|||
\package_listing{Surface_mesh_parameterization}
|
||||
\package_listing{Surface_mesh_shortest_path}
|
||||
\package_listing{Surface_mesh_skeletonization}
|
||||
\package_listing{Surface_mesh_approximation}
|
||||
\package_listing{Ridges_3}
|
||||
\package_listing{Jet_fitting_3}
|
||||
\package_listing{Point_set_3}
|
||||
|
|
@ -123,7 +124,7 @@ h1 {
|
|||
\package_listing{Point_set_shape_detection_3}
|
||||
\package_listing{Stream_lines_2}
|
||||
\package_listing{Classification}
|
||||
|
||||
\package_listing{Heat_method_3}
|
||||
|
||||
\section PartSearchStructures Spatial Searching and Sorting
|
||||
|
||||
|
|
|
|||
|
|
@ -299,6 +299,17 @@ Boissonnat}
|
|||
,update = "98.01 schirra"
|
||||
}
|
||||
|
||||
@inproceedings{cgal:cad-vsa-04,
|
||||
title={Variational shape approximation},
|
||||
author={Cohen-Steiner, David and Alliez, Pierre and Desbrun, Mathieu},
|
||||
booktitle={ACM Transactions on Graphics (TOG)},
|
||||
volume={23},
|
||||
number={3},
|
||||
pages={905--914},
|
||||
year={2004},
|
||||
organization={ACM}
|
||||
}
|
||||
|
||||
@inproceedings{cgal::c-mssbo-04,
|
||||
author={Chen, L.},
|
||||
title={{Mesh Smoothing Schemes based on Optimal Delaunay Triangulations}},
|
||||
|
|
@ -464,6 +475,30 @@ note="Conference version: Symp. on Geometry Processing 2003"
|
|||
,update = "97.08 kettner"
|
||||
}
|
||||
|
||||
|
||||
@article{cgal:cww-ghnac-13,
|
||||
author = {Crane, Keenan and Weischedel, Clarisse and Wardetzky, Max},
|
||||
title = {Geodesics in Heat: A New Approach to Computing Distance Based on Heat Flow},
|
||||
journal = {ACM Trans. Graph.},
|
||||
issue_date = {September 2013},
|
||||
volume = {32},
|
||||
number = {5},
|
||||
month = oct,
|
||||
year = {2013},
|
||||
issn = {0730-0301},
|
||||
pages = {152:1--152:11},
|
||||
articleno = {152},
|
||||
numpages = {11},
|
||||
url = {http://doi.acm.org/10.1145/2516971.2516977},
|
||||
doi = {10.1145/2516971.2516977},
|
||||
acmid = {2516977},
|
||||
publisher = {ACM},
|
||||
address = {New York, NY, USA},
|
||||
keywords = {Digital geometry processing, discrete differential geometry, distance transform, geodesic distance, heat kernel},
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PhdThesis{ cgal:d-ccccg-10,
|
||||
author = {Damiand, G.},
|
||||
title = {Contributions aux Cartes Combinatoires et Cartes G\'en\'eralis\'ees : Simplification, Mod\`eles, Invariants Topologiques et Applications},
|
||||
|
|
@ -715,6 +750,23 @@ Teillaud"
|
|||
,update = "95.09 mitchell"
|
||||
}
|
||||
|
||||
@inproceedings{cgal:fsbs-acidt-06,
|
||||
author = {Fisher, Matthew and Springborn, Boris and Bobenko, Alexander I. and Schroder, Peter},
|
||||
title = {An Algorithm for the Construction of Intrinsic Delaunay Triangulations with Applications to Digital Geometry Processing},
|
||||
booktitle = {ACM SIGGRAPH 2006 Courses},
|
||||
series = {SIGGRAPH '06},
|
||||
year = {2006},
|
||||
isbn = {1-59593-364-6},
|
||||
location = {Boston, Massachusetts},
|
||||
pages = {69--74},
|
||||
numpages = {6},
|
||||
url = {http://doi.acm.org/10.1145/1185657.1185668},
|
||||
doi = {10.1145/1185657.1185668},
|
||||
acmid = {1185668},
|
||||
publisher = {ACM},
|
||||
address = {New York, NY, USA},
|
||||
}
|
||||
|
||||
@InCollection{ cgal:fh-survey-05,
|
||||
author = {M. S. Floater and K. Hormann},
|
||||
title = {Surface Parameterization: a Tutorial and Survey},
|
||||
|
|
@ -1089,6 +1141,17 @@ Teillaud"
|
|||
,pages = "307--320"
|
||||
}
|
||||
|
||||
@article{ cgal:l-lsqp-82,
|
||||
title={Least squares quantization in PCM},
|
||||
author={Lloyd, Stuart},
|
||||
journal={IEEE transactions on information theory},
|
||||
volume={28},
|
||||
number={2},
|
||||
pages={129--137},
|
||||
year={1982},
|
||||
publisher={IEEE}
|
||||
}
|
||||
|
||||
@book{ cgal:l-mrfmi-09,
|
||||
author = {Li, Stan Z.},
|
||||
title = {Markov Random %Field Modeling in Image Analysis},
|
||||
|
|
@ -1320,6 +1383,17 @@ Voronoi diagram"
|
|||
,update = "97.04 kettner"
|
||||
}
|
||||
|
||||
@article{cgal:l-lsqp-82,
|
||||
title={Least squares quantization in PCM},
|
||||
author={Lloyd, Stuart},
|
||||
journal={IEEE transactions on information theory},
|
||||
volume={28},
|
||||
number={2},
|
||||
pages={129--137},
|
||||
year={1982},
|
||||
publisher={IEEE}
|
||||
}
|
||||
|
||||
@InProceedings{ cgal:lprm-lscm-02,
|
||||
author = {Bruno L{\'e}vy and Sylvain Petitjean and Nicolas Ray
|
||||
and J{\'e}rome Maillot},
|
||||
|
|
@ -2140,6 +2214,16 @@ location = {Salt Lake City, Utah, USA}
|
|||
Geodesy and Photogrammetry)},
|
||||
url = {https://www.prs.igp.ethz.ch/research/Source_code_and_datasets.html},
|
||||
year = 2014
|
||||
|
||||
@inproceedings{ cgal:wk-srhvs-05,
|
||||
title={Structure recovery via hybrid variational surface approximation},
|
||||
author={Wu, Jianhua and Kobbelt, Leif},
|
||||
booktitle={Computer Graphics Forum},
|
||||
volume={24},
|
||||
number={3},
|
||||
pages={277--284},
|
||||
year={2005},
|
||||
organization={Wiley Online Library}
|
||||
}
|
||||
|
||||
@book{cgal:ww-smgd-02
|
||||
|
|
@ -2177,6 +2261,17 @@ location = {Salt Lake City, Utah, USA}
|
|||
address = {New York, NY, USA},
|
||||
}
|
||||
|
||||
@article{cgal:ywly-vmsqs-12,
|
||||
title={Variational mesh segmentation via quadric surface fitting},
|
||||
author={Yan, Dong-Ming and Wang, Wenping and Liu, Yang and Yang, Zhouwang},
|
||||
journal={Computer-Aided Design},
|
||||
volume={44},
|
||||
number={11},
|
||||
pages={1072--1082},
|
||||
year={2012},
|
||||
publisher={Elsevier}
|
||||
}
|
||||
|
||||
@article{ cgal:ze-fsbi-02
|
||||
,author = "Afra Zomorodian and Herbert Edelsbrunner"
|
||||
,title = "Fast Software for Box Intersection"
|
||||
|
|
|
|||
|
|
@ -69,19 +69,19 @@ public:
|
|||
result_type
|
||||
operator()(const Segment_2 &s, const Segment_2& t) const
|
||||
{
|
||||
return internal::do_intersect(s,t, SFK());
|
||||
return Intersections::internal::do_intersect(s,t, SFK());
|
||||
}
|
||||
|
||||
result_type
|
||||
operator()(const Point_2 &p, const Segment_2& t) const
|
||||
{
|
||||
return internal::do_intersect(p,t, SFK());
|
||||
return Intersections::internal::do_intersect(p,t, SFK());
|
||||
}
|
||||
|
||||
result_type
|
||||
operator()(const Segment_2& t, const Point_2 &p) const
|
||||
{
|
||||
return internal::do_intersect(p,t, SFK());
|
||||
return Intersections::internal::do_intersect(p,t, SFK());
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
#include <CGAL/internal/Static_filters/Static_filter_error.h>
|
||||
#include <CGAL/internal/Static_filters/tools.h>
|
||||
|
||||
#include <CGAL/internal/Intersections_3/Bbox_3_Segment_3_do_intersect.h>
|
||||
#include <CGAL/Intersections_3/Bbox_3_Segment_3.h>
|
||||
// for CGAL::internal::do_intersect_bbox_segment_aux
|
||||
|
||||
#include <iostream>
|
||||
|
|
@ -89,13 +89,13 @@ public:
|
|||
result_type
|
||||
operator()(const Segment_3 &s, const Triangle_3& t) const
|
||||
{
|
||||
return internal::do_intersect(t,s, SFK());
|
||||
return Intersections::internal::do_intersect(t,s, SFK());
|
||||
}
|
||||
|
||||
result_type
|
||||
operator()(const Triangle_3& t, const Segment_3 &s) const
|
||||
{
|
||||
return internal::do_intersect(t,s, SFK());
|
||||
return Intersections::internal::do_intersect(t,s, SFK());
|
||||
}
|
||||
|
||||
result_type
|
||||
|
|
@ -124,7 +124,7 @@ public:
|
|||
CGAL_BRANCH_PROFILER_BRANCH_1(tmp);
|
||||
|
||||
const Uncertain<result_type> ub =
|
||||
do_intersect_bbox_segment_aux
|
||||
Intersections::internal::do_intersect_bbox_segment_aux
|
||||
<double,
|
||||
true, // bounded at t=0
|
||||
true, // bounded at t=1
|
||||
|
|
@ -167,7 +167,7 @@ public:
|
|||
CGAL_BRANCH_PROFILER_BRANCH_1(tmp);
|
||||
|
||||
const Uncertain<result_type> ub =
|
||||
do_intersect_bbox_segment_aux
|
||||
Intersections::internal::do_intersect_bbox_segment_aux
|
||||
<double,
|
||||
true, // bounded at t=0
|
||||
false,// not bounded at t=1
|
||||
|
|
|
|||
|
|
@ -85,8 +85,8 @@ public:
|
|||
FT delta_x = pp2->x() - pp1->x();
|
||||
FT delta_y = pp2->y() - pp1->y();
|
||||
|
||||
FT sign_x = CGAL::sign(delta_x);
|
||||
FT sign_y = CGAL::sign(delta_y);
|
||||
FT sign_x = (int)CGAL::sign(delta_x);
|
||||
FT sign_y = (int)CGAL::sign(delta_y);
|
||||
|
||||
FT abs_x = CGAL::abs(delta_x);
|
||||
FT abs_y = CGAL::abs(delta_y);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,70 @@
|
|||
/*!
|
||||
\ingroup PkgHeatMethodConcepts
|
||||
|
||||
\cgalConcept
|
||||
|
||||
The concept `HeatMethodTraits_3` describes the types,
|
||||
predicates, and constructions required by the traits class parameter of
|
||||
`CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3`.
|
||||
|
||||
\cgalHasModel All the \cgal kernels
|
||||
|
||||
|
||||
*/
|
||||
|
||||
class HeatMethodTraits_3
|
||||
{
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
// The number type. It must be `CopyConstructible` and `DefaultConstructible`,
|
||||
// and be constructible from `double`.
|
||||
typedef unspecified_type FT;
|
||||
|
||||
/// The 3D point type. It must be `CopyConstructible` and `DefaultConstructible`,
|
||||
/// and have a constructor with three parameters of a type constructibe from `double`.
|
||||
typedef unspecified_type Point_3;
|
||||
|
||||
/// The 3D vector type. It must be `CopyConstructible` and `DefaultConstructible`,
|
||||
/// and have a constructor with three parameters of a type constructibe from `double`.
|
||||
typedef unspecified_type Vector_3;
|
||||
|
||||
/// Functor with operator: `Vector_3 operator()(const Point_3& from, const Point_3& to) const`, which constructs the vector from `to - from` .
|
||||
typedef unspecified_type Construct_vector_3;
|
||||
|
||||
/// Functor with operator: `Vector_3 operator()(const Vector_3& v, const Vector_3& w) const`, which constructs the vector `v + w`.
|
||||
typedef unspecified_type Construct_sum_of_vectors_3;
|
||||
|
||||
/// Functor with operator: `Vector_3 operator()(const Vector_3& v, double d) const`, which constructs the vector `d * v`.
|
||||
typedef unspecified_type Construct_scaled_vector_3;
|
||||
|
||||
/// Functor with operator: `Vector_3 operator()(const Vector_3& v, const Vector_3& w) const`, which constructs the cross product of `v` and `w`.
|
||||
typedef unspecified_type Construct_cross_product_vector_3;
|
||||
|
||||
/// Functor with operator: `FT operator()(const Vector_3& v, const Vector_3& w) const, which constructs the scalar product of `v` and `w`.
|
||||
typedef unspecified_type Compute_scalar_product_3;
|
||||
|
||||
/// Functor with operator: `FT operator()(const Point_3& p, const Point_3& q) const` which computes the squared distance between `p` and `q`.
|
||||
typedef unspecified_type Compute_squared_distance_3;
|
||||
|
||||
|
||||
/// @}
|
||||
|
||||
/*! \name Operations
|
||||
For each of the above function object types,
|
||||
`Func_obj_type`, a function must exist with the name
|
||||
`func_obj_type_object` that creates an instance of the function or
|
||||
predicate object type. For example:
|
||||
*/
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
|
||||
*/
|
||||
Construct_vector_3 construct_vector_3_object();
|
||||
|
||||
/// @}
|
||||
|
||||
};
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
@INCLUDE = ${CGAL_DOC_PACKAGE_DEFAULTS}
|
||||
PROJECT_NAME = "CGAL ${CGAL_DOC_VERSION} - The Heat Method"
|
||||
|
|
@ -0,0 +1,256 @@
|
|||
namespace CGAL {
|
||||
/*!
|
||||
|
||||
\mainpage User Manual
|
||||
\anchor Chapter_HeatMethod
|
||||
\cgalAutoToc
|
||||
\author Christina Vaz, Keenan Crane, Andreas Fabri
|
||||
|
||||
\image html octopus.png
|
||||
|
||||
\section sec_HM_introduction Introduction
|
||||
|
||||
The <em>heat method</em> is an algorithm that solves the single- or
|
||||
multiple-source shortest path problem by returning an approximation of the
|
||||
<em>geodesic distance</em> for all vertices of a triangle mesh to the closest vertex in a given set of
|
||||
source vertices. The geodesic distance between two vertices of a mesh
|
||||
is the distance when walking on the surface, potentially through the interior of faces.
|
||||
Two vertices that are close in 3D space may be far away on the surface, for example
|
||||
on neighboring arms of the octopus. In the figures we color code the distance
|
||||
as a gradient red/green corresponding to close/far from the source vertices.
|
||||
|
||||
The heat method is highly efficient, since the algorithm
|
||||
boils down to two standard sparse linear algebra problems. It is especially
|
||||
useful in situations where one wishes to perform repeated distance queries
|
||||
on a fixed domain, since precomputation done for the first query can be re-used.
|
||||
|
||||
As a rule of thumb, the method works well on triangle meshes, which are
|
||||
Delaunay, though in practice may also work fine for meshes that are far from
|
||||
Delaunay. In order to ensure good behavior, we enable a
|
||||
preprocessing step that constructs an <em>intrinsic Delaunay triangulation
|
||||
(iDT)</em>; this triangulation does not change the input geometry, but
|
||||
generally improves the quality of the solution. The cost of this preprocessing
|
||||
step roughly doubles the overall preprocessing cost.
|
||||
|
||||
\cgalFigureBegin{landscape_meshes, landscape.jpg}
|
||||
Isolines placed on a mesh without and with iDT remeshing.
|
||||
\cgalFigureEnd
|
||||
|
||||
In the next section we give some examples. Section \ref sec_HM_definitions presents
|
||||
the mathematical theory of the Heat method. The last section is about the \ref sec_HM_history.
|
||||
|
||||
Note that this package depends on the third party \ref thirdpartyEigen library (3.3 or greater), or another
|
||||
model of the concept `SparseLinearAlgebraWithFactorTraits_d`.
|
||||
This implementation is based on \cgalCite{cgal:cww-ghnac-13} and \cgalCite{cgal:fsbs-acidt-06}
|
||||
|
||||
This package is related to the package \ref PkgSurfaceMeshShortestPath. Both deal with geodesic distances.
|
||||
The heat method package computes for every vertex of a mesh an approximate distance to one or several source vertices.
|
||||
The geodesic shortest path package computes the exact shortest path between any two points on the surface.
|
||||
|
||||
|
||||
|
||||
\section sec_HM_examples Examples
|
||||
|
||||
We give examples for the free function `CGAL::Heat_method_3::estimate_geodesic_distances()`,
|
||||
for the class template `CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3`, with and without the use
|
||||
of intrinsic Delaunay triangulation.
|
||||
|
||||
\subsection HM_example_Free_function Using a Free Function
|
||||
|
||||
The first example calls the free function `Heat_method_3::estimate_geodesic_distances()`,
|
||||
which computes for all vertices of a triangle mesh the distances to a single source vertex.
|
||||
|
||||
The distances are written into an internal property map of the surface mesh.
|
||||
|
||||
\cgalExample{Heat_method_3/heat_method.cpp}
|
||||
|
||||
For a `Polyhedron_3` you can either add a data field to the vertex type, or, as shown
|
||||
in the following example, create a `boost::unordered_map` and pass it to the function
|
||||
`boost::make_assoc_property_map()`, which generates a vertex distance property map.
|
||||
|
||||
\cgalExample{Heat_method_3/heat_method_polyhedron.cpp}
|
||||
|
||||
|
||||
\subsection HM_example_Class Using the Heat Method Class
|
||||
|
||||
The following example shows the heat method class. It can be used
|
||||
when one adds and removes source vertices. It performs a precomputation,
|
||||
which depend only on the input mesh and not the particular
|
||||
set of source vertices. In the example we compute the distances to one
|
||||
source, add the farthest vertex as a second source vertex, and then compute
|
||||
the distances with respect to these two sources.
|
||||
|
||||
\cgalExample{Heat_method_3/heat_method_surface_mesh.cpp}
|
||||
|
||||
|
||||
\subsection HM_example_Intrinsic Switching off the Intrinsic Delaunay Triangulation
|
||||
|
||||
The following example shows the heat method on a triangle mesh without using the
|
||||
intrinsic Delaunay triangulation (iDT) algorithm, for example because by construction
|
||||
your meshes have a good quality (Poor quality in this case means that the input
|
||||
is far from Delaunay, though even in this case one may still get good results without iDT,
|
||||
depending on the specific geometry of the surface). The iDT algorithm is switched off
|
||||
by the template parameter `Heat_method_3::Direct`.
|
||||
|
||||
\cgalExample{Heat_method_3/heat_method_surface_mesh_direct.cpp}
|
||||
|
||||
|
||||
|
||||
\section sec_HM_definitions Theoretical Background
|
||||
|
||||
Section \ref Subsection_HM_Definitions_Intro gives an overview of the theory needed by the Heat method.
|
||||
Section \ref Subsection_HM_IDT_Definitions gives the background needed for the Intrinsic Delaunay triangulation.
|
||||
|
||||
\subsection Subsection_HM_Definitions_Intro The Heat Method Algorithm
|
||||
|
||||
For a detailed overview of the heat method, the reader may consult
|
||||
\cgalCite{cgal:cww-ghnac-13} to read the original article. In the
|
||||
sequel, we introduce the basic notions so as to explain our
|
||||
algorithms. In general, the heat method is applicable to any setting
|
||||
if there exists a gradient operator \f$ \nabla\f$, a divergence
|
||||
operator \f$\nabla \cdot\f$ and a Laplace operator \f$\Delta = \nabla \cdot
|
||||
\nabla\f$, which are standard derivatives from vector calculus.
|
||||
|
||||
The Heat Method consists of three main steps:
|
||||
-# Integrate the heat flow \f$ \dot u = \Delta u\f$ for some fixed time \f$t\f$.
|
||||
-# Evaluate the vector field \f$ X = -\nabla u_t / |\nabla u_t| \f$.
|
||||
-# Solve the Poisson Equation \f$ \Delta \phi = \nabla \cdot X \f$.
|
||||
|
||||
|
||||
The function \f$ \phi \f$ is an approximation of the distance to the given source set and approaches the true distance as t goes to zero.
|
||||
The algorithm must then be translated in to a discrete algorithm by replacing the derivatives in space and time with approximations.
|
||||
|
||||
The heat equation can be discretized in time using a single backward Euler step. This means the following equation must be solved:
|
||||
|
||||
\f$(id-t\Delta)u_t = \delta_{\gamma}(x) \f$ where \f$\delta_{\gamma}(x)\f$ is a Dirac delta encoding an "infinite" spike of heat (1 if x is in the source set \f$\gamma\f$, 0 otherwise), where id is the identity operator.
|
||||
|
||||
The spatial discretization depends on the choice of discrete surface representation.
|
||||
For this package, we use triangle meshes exclusively.
|
||||
Let \f$ u \in \R^{|V|}\f$ specify a piecewise linear function on a
|
||||
triangulated surface with vertices \f$V\f$, edges \f$E\f$ and faces
|
||||
\f$F\f$. A standard discretization of the Laplacian at vertex \f$i\f$
|
||||
is:
|
||||
|
||||
\f$ {Lu}_i = \frac{1}{2A_i} \sum_{j}(cot \alpha_{ij} + cot \beta_{ij})(u_j-u_i)\f$ where \f$A_i\f$ is one third the area of all triangles incident on vertex \f$i\f$.
|
||||
|
||||
The sum is taken over all of the neighboring vertices
|
||||
\f$j\f$. Further, \f$\alpha_{ij}\f$ and \f$\beta_{ij}\f$ are the
|
||||
angles opposing the corresponding edge \f$ij\f$. We express this
|
||||
operation via a matrix \f$L = M^{-1}L_c\f$ where \f$M \in
|
||||
R^{|V|x|V|}\f$ is a diagonal matrix containing the vertex areas and
|
||||
\f$L_c \in R^{|V|x|V|} \f$ is the cotan operator representing the
|
||||
remaining sum.
|
||||
|
||||
From this, the symmetric positive-definite system
|
||||
\f$(M-tL_C)u = \delta_{\gamma}\f$ can be solved to find
|
||||
\f$u\f$ where \f$\delta_{\gamma}\f$ is the Kronecker delta over \f$\gamma\f$.
|
||||
|
||||
Next, the gradient in a given triangle can be expressed as
|
||||
|
||||
\f$\nabla u = \frac{1}{2 A_f} \sum_i u_i ( N \times e_i ) \f$
|
||||
|
||||
where \f$A_f\f$ is the area of the triangle, \f$N\f$ is its outward unit normal, \f$e_i\f$ is the \f$i\f$th edge vector (oriented counter-clockwise), and \f$u_i\f$ is the value of \f$u\f$ at the opposing vertex. The integrated divergence associated with vertex \f$i\f$ can be written as
|
||||
|
||||
\f$\nabla \cdot X = \frac{1}{2} \sum_j cot\theta_1 (e_1 \cdot X_j) + cot \theta_2 (e_2 \cdot X_j)\f$
|
||||
|
||||
where the sum is taken over incident triangles \f$j\f$ each with a vector \f$X_j\f$,
|
||||
\f$e_1\f$ and \f$e_2\f$ are the two edge vectors of triangle \f$j\f$
|
||||
containing \f$i\f$ and \f$\theta_1\f$, \f$\theta_2\f$ are the opposing angles.
|
||||
|
||||
Finally, let \f$b \in R^{|V|}\f$ be the integrated divergences of the normalized vector field X.
|
||||
Thus, solving the symmetric Poisson problem \f$ L_c \phi = b\f$ computes the final distance function.
|
||||
|
||||
\subsection Subsection_HM_IDT_Definitions Intrinsic Delaunay Triangulation
|
||||
|
||||
The standard discretization of the cotan Laplace operator uses the cotangents of the angles in the triangle mesh.
|
||||
The intrinsic Delaunay algorithm constructs an alternative triangulation of the same polyhedral surface, which
|
||||
in turn yields a different (typically more accurate) cotan Laplace operator. Conceptually, the edges of the iDT
|
||||
still connect pairs of vertices from the original (input) surface, but are now allowed to be geodesic paths along
|
||||
the polyhedron and do not have to correspond to edges of the input triangulation. These paths are not stored
|
||||
explicitly; instead, we simply keep track of their lengths as the triangulation is updated. These lengths are
|
||||
sufficient to determine areas and angles of the intrinsic triangles, and in turn, the new cotan Laplace matrix.
|
||||
|
||||
An edge of a mesh is locally Delaunay if the sum of opposite angles is not smaller than pi, or equivalently,
|
||||
if the cotangents of the opposing angles are non-negative. A mesh is Delaunay if all of its edges are locally Delaunay.
|
||||
|
||||
A standard algorithm to convert a given planar triangulation into a Delaunay triangulation is
|
||||
to flip non-Delaunay edges in a mesh until the mesh is Delaunay.
|
||||
Similarly, the intrinsic Delaunay triangulation of a simplicial surface
|
||||
is constructed by performing intrinsic edge flips.
|
||||
|
||||
Let \f$ K = (V,E,T) \f$ be a 2-manifold triangle mesh, where \f$V\f$ is the vertex set,
|
||||
\f$ E \f$ is the edge set and \f$ T \f$ is the face set (triangle set).
|
||||
Let \f$ L \f$ be the set of Euclidean distances, where \f$ L(e_{ij}) = l_{ij} = || p_i - p_j || \f$ ,
|
||||
where \f$ p_i \f$ and \f$ p_j \f$ are the point positions \f$ \in R^3 \f$ of vertices \f$ i \f$ and \f$ j \f$ respectively.
|
||||
Then, let the pair \f$ (K,L) \f$ be the input to the iDT algorithm, which returns the pair \f$(\tilde K, \tilde L)\f$,
|
||||
which are the intrinsic Delaunay mesh and the intrinsic lengths.
|
||||
The algorithm is as follows:
|
||||
|
||||
\code
|
||||
for all edge e in E : Mark(e)
|
||||
Stack s <-- E
|
||||
while !Empty(s) do
|
||||
edge(ij) = Pop(s) and Unmark(edge(ij))
|
||||
if !Delaunay(edge(ij)) then
|
||||
edge(kl) = Flip(edge(ij)) and compute the new length length(kl) using the Cosine Theorem
|
||||
for all edge e in {edge(kj), edge(jl), edge(li), edge(ik)} do
|
||||
if !Mark(e) then
|
||||
Mark(e) and Push(s,e)
|
||||
end if
|
||||
end for
|
||||
end if
|
||||
end while
|
||||
return (~K,~L)
|
||||
\endcode
|
||||
|
||||
|
||||
The new \f$(\tilde K, \tilde L)\f$ are then used to implement the heat method as usual.
|
||||
|
||||
We already in the beginning gave an example where the intrinsic Delaunay triangulation improves the results.
|
||||
The mesh was obtained by giving elevation to a 2D triangulation, which lead to highly elongated triangles.
|
||||
|
||||
The situation is similar for any triangle mesh that has faces with very small angles as can be seen in the figures below.
|
||||
|
||||
\cgalFigureBegin{circle_box, red_circle_box_without_idt_bottom.png}
|
||||
Isolines placed on a mesh without iDT remeshing
|
||||
\cgalFigureEnd
|
||||
\cgalFigureBegin{circle_box_idt, red_circle_box_with_idt_bottom.png}
|
||||
Isolines placed on a mesh with iDT remeshing
|
||||
\cgalFigureEnd
|
||||
|
||||
|
||||
\section sec_HM_Performance Performance
|
||||
|
||||
The time complexity of the algorithm is determined primarily by the
|
||||
choice of linear solver. In the current implementation, Cholesky
|
||||
prefactorization is roughly \f$ O(N^{1.5})\f$ and computation of distances is
|
||||
roughly \f$ O(N)\f$, where \f$ N\f$ is the number of vertices in the triangulation.
|
||||
The algorithm uses two \f$ N \times N\f$ matrices, both with the same pattern of
|
||||
non-zeros (in average 7 non-zeros
|
||||
per row/column). The cost of computation is independent of the size
|
||||
of the source set. Primitive operations include sparse numerical
|
||||
linear algebra (in double precision), and basic arithmetic operations
|
||||
(including square roots).
|
||||
|
||||
We perform the benchmark on an Intel Core i7-7700HQ, 2.8HGz, and compiled with Visual Studio 2013.
|
||||
|
||||
<center>
|
||||
Number of triangles | Initialization iDT (sec) | Distance computation iDT (sec) | Initialization Direct (sec) | Distance computation Direct (sec)
|
||||
--------------------:| ----------- : | ---------------- : | ------------------: | --------------:
|
||||
30,000 | 0.18 | 0.02 | 0.12 | 0.01
|
||||
200,000 | 1.82 | 1.31 | 1.32 | 0.11
|
||||
500,000 | 10.45 | 0.75 | 8.07 | 0.55
|
||||
1,800,000 | 38.91 | 2.24 | 35.68 | 1.1
|
||||
|
||||
</center>
|
||||
|
||||
|
||||
\section sec_HM_history Implementation History
|
||||
|
||||
This package was developed by Christina Vaz, Keenan Crane and Andreas
|
||||
Fabri as a project of the Google Summer of Code 2018.
|
||||
|
||||
|
||||
|
||||
*/
|
||||
} /* namespace CGAL */
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
// The Heat Method
|
||||
|
||||
/// \defgroup PkgHeatMethod Heat Method Reference
|
||||
|
||||
/// \defgroup PkgHeatMethodConcepts Concepts
|
||||
/// \ingroup PkgHeatMethod
|
||||
|
||||
|
||||
/*!
|
||||
\addtogroup PkgHeatMethod
|
||||
|
||||
\cgalPkgDescriptionBegin{The Heat Method,PkgHeatMethodSummary}
|
||||
\cgalPkgPicture{heat-method-small.png}
|
||||
|
||||
\cgalPkgSummaryBegin
|
||||
\cgalPkgAuthors{Keenan Crane, Christina Vaz, Andreas Fabri}
|
||||
\cgalPkgDesc{The package provides an algorithm that solves the single- or
|
||||
multiple-source shortest path problem by returning an approximation of the geodesic distance
|
||||
for all vertices of a triangle mesh to the closest vertex in a given set of
|
||||
source vertices. }
|
||||
\cgalPkgManuals{Chapter_HeatMethod,PkgHeatMethod}
|
||||
\cgalPkgSummaryEnd
|
||||
\cgalPkgShortInfoBegin
|
||||
\cgalPkgSince{4.14}
|
||||
\cgalPkgDependsOn{ \ref PkgSolverInterface}
|
||||
\cgalPkgBib{cgal:cvf-hm3}
|
||||
\cgalPkgLicense{\ref licensesGPL "GPL"}
|
||||
\cgalPkgDemo{Polyhedron demo,polyhedron_3.zip}
|
||||
\cgalPkgShortInfoEnd
|
||||
|
||||
\cgalPkgDescriptionEnd
|
||||
|
||||
\cgalClassifedRefPages
|
||||
|
||||
## Concepts ##
|
||||
- `HeatMethodTraits_3`
|
||||
|
||||
## Classes ##
|
||||
- `CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3`
|
||||
- `CGAL::Heat_method_3::Direct`
|
||||
- `CGAL::Heat_method_3::Intrinsic_Delaunay`
|
||||
|
||||
## Functions ##
|
||||
|
||||
- `CGAL::Heat_method_3::estimate_geodesic_distances()`
|
||||
|
||||
*/
|
||||
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
Manual
|
||||
Kernel_23
|
||||
STL_Extension
|
||||
Algebraic_foundations
|
||||
Circulator
|
||||
Stream_support
|
||||
Surface_mesh
|
||||
Surface_mesh_shortest_path
|
||||
Solver_interface
|
||||
BGL
|
||||
Polyhedron
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
/*!
|
||||
\example Heat_method_3/heat_method.cpp
|
||||
\example Heat_method_3/heat_method_polyhedron.cpp
|
||||
\example Heat_method_3/heat_method_surface_mesh.cpp
|
||||
\example Heat_method_3/heat_method_surface_mesh_direct.cpp
|
||||
*/
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 37 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 159 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 209 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 55 KiB |
|
|
@ -0,0 +1,59 @@
|
|||
# Created by the script cgal_create_CMakeLists
|
||||
# This is the CMake script for compiling a set of CGAL applications.
|
||||
|
||||
project( Heat_method_3_Examples )
|
||||
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
|
||||
# CGAL and its components
|
||||
find_package( CGAL QUIET COMPONENTS )
|
||||
|
||||
if ( NOT CGAL_FOUND )
|
||||
|
||||
message(STATUS "This project requires the CGAL library, and will not be compiled.")
|
||||
return()
|
||||
|
||||
endif()
|
||||
|
||||
# include helper file
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
|
||||
# Boost and its components
|
||||
find_package( Boost REQUIRED )
|
||||
|
||||
if ( NOT Boost_FOUND )
|
||||
|
||||
message(STATUS "This project requires the Boost library, and will not be compiled.")
|
||||
|
||||
return()
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
find_package(Eigen3 3.3.0)
|
||||
|
||||
if (EIGEN3_FOUND)
|
||||
include( ${EIGEN3_USE_FILE} )
|
||||
else()
|
||||
message(STATUS "This project requires the Eigen library (3.3 or greater), and will not be compiled.")
|
||||
|
||||
return()
|
||||
endif()
|
||||
|
||||
|
||||
# include for local directory
|
||||
include_directories( BEFORE include )
|
||||
|
||||
|
||||
|
||||
# Creating entries for all C++ files with "main" routine
|
||||
# ##########################################################
|
||||
|
||||
include( CGAL_CreateSingleSourceCGALProgram )
|
||||
|
||||
create_single_source_cgal_program( "heat_method.cpp" )
|
||||
create_single_source_cgal_program( "heat_method_polyhedron.cpp" )
|
||||
create_single_source_cgal_program( "heat_method_surface_mesh.cpp" )
|
||||
create_single_source_cgal_program( "heat_method_surface_mesh_direct.cpp" )
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,41 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
typedef CGAL::Surface_mesh<Point_3> Triangle_mesh;
|
||||
|
||||
typedef boost::graph_traits<Triangle_mesh>::vertex_descriptor vertex_descriptor;
|
||||
typedef Triangle_mesh::Property_map<vertex_descriptor,double> Vertex_distance_map;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Triangle_mesh tm;
|
||||
const char* filename = (argc > 1) ? argv[1] : "./data/elephant.off";
|
||||
std::ifstream input(filename);
|
||||
if (!input || !(input >> tm) || tm.is_empty()) {
|
||||
std::cerr << "Not a valid off file." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//property map for the distance values to the source set
|
||||
Vertex_distance_map vertex_distance = tm.add_property_map<vertex_descriptor, double>("v:distance", 0).first;
|
||||
|
||||
vertex_descriptor source = *(vertices(tm).first);
|
||||
|
||||
CGAL::Heat_method_3::estimate_geodesic_distances(tm, vertex_distance, source) ;
|
||||
|
||||
std::cout << "Source vertex " << source << " at: " << tm.point(source) << std::endl;
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(tm)){
|
||||
std::cout << vd << " ("<< tm.point(vd) << ")"
|
||||
<< " is at distance " << get(vertex_distance, vd) << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
#include <CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
typedef CGAL::Polyhedron_3<Kernel> Triangle_mesh;
|
||||
|
||||
typedef boost::graph_traits<Triangle_mesh>::vertex_descriptor vertex_descriptor;
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Triangle_mesh tm;
|
||||
const char* filename = (argc > 1) ? argv[1] : "./data/elephant.off";
|
||||
std::ifstream input(filename);
|
||||
if (!input || !(input >> tm) || tm.is_empty()) {
|
||||
std::cerr << "Not a valid off file." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
// map for the distance values to the source set
|
||||
boost::unordered_map<vertex_descriptor, double> vertex_distance;
|
||||
|
||||
vertex_descriptor source = *(vertices(tm).first);
|
||||
|
||||
CGAL::Heat_method_3::estimate_geodesic_distances(tm,
|
||||
boost::make_assoc_property_map(vertex_distance),
|
||||
source) ;
|
||||
|
||||
std::cout << "Source vertex at: " << source->point() << std::endl;
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(tm)){
|
||||
std::cout << vd->point() << " is at distance " << vertex_distance[vd] << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
typedef CGAL::Surface_mesh<Point_3> Triangle_mesh;
|
||||
|
||||
typedef boost::graph_traits<Triangle_mesh>::vertex_descriptor vertex_descriptor;
|
||||
typedef Triangle_mesh::Property_map<vertex_descriptor,double> Vertex_distance_map;
|
||||
typedef CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3<Triangle_mesh> Heat_method;
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Triangle_mesh tm;
|
||||
const char* filename = (argc > 1) ? argv[1] : "./data/sphere.off";
|
||||
std::ifstream input(filename);
|
||||
if (!input || !(input >> tm) || tm.is_empty()) {
|
||||
std::cerr << "Not a valid off file." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//property map for the distance values to the source set
|
||||
Vertex_distance_map vertex_distance = tm.add_property_map<vertex_descriptor, double>("v:distance", 0).first;
|
||||
|
||||
Heat_method hm(tm);
|
||||
|
||||
//add the first vertex as the source set
|
||||
vertex_descriptor source = *(vertices(tm).first);
|
||||
hm.add_source(source);
|
||||
hm.estimate_geodesic_distances(vertex_distance);
|
||||
|
||||
Point_3 sp = tm.point(source);
|
||||
|
||||
std::cout << "source: " << sp << " " << source << std::endl;
|
||||
vertex_descriptor far;
|
||||
double sdistance = 0;
|
||||
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(tm)){
|
||||
std::cout << vd << " is at distance " << get(vertex_distance, vd) << " to " << source << std::endl;
|
||||
if(get(vertex_distance, vd) > sdistance){
|
||||
far = vd;
|
||||
sdistance = get(vertex_distance, vd);
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "far: " << tm.point(far) << " " << far << std::endl;
|
||||
|
||||
hm.add_source(far);
|
||||
hm.estimate_geodesic_distances(vertex_distance);
|
||||
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(tm)){
|
||||
std::cout << vd << " is at distance " << get(vertex_distance, vd) << "to the set of two sources" << std::endl;
|
||||
}
|
||||
|
||||
std::cout << "done" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
typedef CGAL::Surface_mesh<Point_3> Triangle_mesh;
|
||||
|
||||
typedef boost::graph_traits<Triangle_mesh>::vertex_descriptor vertex_descriptor;
|
||||
typedef Triangle_mesh::Property_map<vertex_descriptor,double> Vertex_distance_map;
|
||||
|
||||
typedef CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3<Triangle_mesh, CGAL::Heat_method_3::Direct> Heat_method_idt;
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Triangle_mesh tm;
|
||||
const char* filename = (argc > 1) ? argv[1] : "./data/elephant.off";
|
||||
std::ifstream input(filename);
|
||||
if (!input || !(input >> tm) || tm.is_empty()) {
|
||||
std::cerr << "Not a valid off file." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//property map for the distance values to the source set
|
||||
Vertex_distance_map vertex_distance = tm.add_property_map<vertex_descriptor,double>("v:distance",0).first;
|
||||
|
||||
//pass in the idt object and its vertex_distance_map
|
||||
Heat_method_idt hm_idt(tm);
|
||||
|
||||
//add the first vertex as the source set
|
||||
vertex_descriptor source = *(vertices(tm).first);
|
||||
hm_idt.add_source(source);
|
||||
hm_idt.estimate_geodesic_distances(vertex_distance);
|
||||
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(tm)){
|
||||
std::cout << vd << " is at distance " << get(vertex_distance, vd) << " from " << source << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,876 @@
|
|||
// Copyright (c) 2018 Carnegie Mellon University (USA), 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
|
||||
// General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0+
|
||||
//
|
||||
//
|
||||
// Author(s) : Christina Vaz, Keenan Crane, Andreas Fabri
|
||||
|
||||
|
||||
#ifndef CGAL_INTRINSIC_DELAUNAY_TRIANGULATION_3_H
|
||||
#define CGAL_INTRINSIC_DELAUNAY_TRIANGULATION_3_H
|
||||
|
||||
#include <CGAL/license/Heat_method_3.h>
|
||||
|
||||
#include <CGAL/disable_warnings.h>
|
||||
|
||||
#include <CGAL/property_map.h>
|
||||
#include <CGAL/double.h>
|
||||
#include <CGAL/boost/graph/properties.h>
|
||||
#include <CGAL/Dynamic_property_map.h>
|
||||
#include <CGAL/squared_distance_3.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
#include <CGAL/boost/graph/helpers.h>
|
||||
#include <CGAL/boost/graph/copy_face_graph.h>
|
||||
#include <CGAL/Heat_method_3/internal/V2V.h>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
#include <boost/iterator/transform_iterator.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
#include <set>
|
||||
#include <stack>
|
||||
#include <cmath>
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
|
||||
namespace CGAL {
|
||||
namespace Heat_method_3 {
|
||||
|
||||
|
||||
|
||||
// forward declaration
|
||||
template <typename IDT>
|
||||
struct IDT_vertex_point_property_map;
|
||||
|
||||
// forward declaration
|
||||
template <typename IDT, typename PM>
|
||||
struct IDT_vertex_distance_property_map;
|
||||
|
||||
template <class TriangleMesh>
|
||||
struct Intrinsic_Delaunay_triangulation_3_vertex_descriptor {
|
||||
typedef typename boost::graph_traits<TriangleMesh>::halfedge_descriptor halfedge_descriptor;
|
||||
typedef typename boost::graph_traits<TriangleMesh>::vertex_descriptor vertex_descriptor;
|
||||
halfedge_descriptor hd;
|
||||
|
||||
bool operator<(const Intrinsic_Delaunay_triangulation_3_vertex_descriptor& other) const
|
||||
{
|
||||
return hd < other.hd;
|
||||
}
|
||||
|
||||
Intrinsic_Delaunay_triangulation_3_vertex_descriptor(const halfedge_descriptor& hd)
|
||||
: hd(hd)
|
||||
{}
|
||||
|
||||
explicit Intrinsic_Delaunay_triangulation_3_vertex_descriptor(const vertex_descriptor vd, const TriangleMesh& tm)
|
||||
: hd(halfedge(vd,tm))
|
||||
{}
|
||||
};
|
||||
|
||||
template <class TriangleMesh>
|
||||
struct Intrinsic_Delaunay_triangulation_3_vertex_iterator_functor
|
||||
{
|
||||
typedef typename boost::graph_traits<TriangleMesh>::vertex_descriptor vertex_descriptor;
|
||||
typedef vertex_descriptor argument_type;
|
||||
typedef Intrinsic_Delaunay_triangulation_3_vertex_descriptor<TriangleMesh> result_type;
|
||||
const TriangleMesh& tm;
|
||||
|
||||
Intrinsic_Delaunay_triangulation_3_vertex_iterator_functor(const TriangleMesh& tm)
|
||||
:tm(tm)
|
||||
{}
|
||||
|
||||
result_type
|
||||
operator()(vertex_descriptor vd) const
|
||||
{
|
||||
return result_type(halfedge(vd, tm));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup PkgHeatMethod
|
||||
*
|
||||
* Class `Intrinsic_Delaunay_triangulation_3` is a remeshing algorithm to improve the approximation of the `Surface_mesh_geodesic_distances_3`.
|
||||
* It internally makes a copy of the triangle mesh, performs edge flips, and computes 2D vertex coordinates per face
|
||||
* which are stored in the halfedge with the vertex as target.
|
||||
*
|
||||
* The BGL API of this class .....
|
||||
*
|
||||
*
|
||||
* \tparam TriangleMesh a triangulated surface mesh, model of `FaceListGraph` and `HalfedgeListGraph`
|
||||
* \tparam Traits a model of `HeatMethodTraits_3`
|
||||
*
|
||||
* \cgalModels `FaceListGraph`
|
||||
*/
|
||||
|
||||
template <typename TriangleMesh,
|
||||
typename Traits = typename Kernel_traits<
|
||||
typename boost::property_traits<
|
||||
typename boost::property_map<TriangleMesh, vertex_point_t>::const_type
|
||||
>::value_type
|
||||
>::Kernel >
|
||||
class Intrinsic_Delaunay_triangulation_3
|
||||
{
|
||||
typedef Intrinsic_Delaunay_triangulation_3<TriangleMesh, Traits> Self;
|
||||
|
||||
typedef boost::graph_traits<TriangleMesh> graph_traits;
|
||||
typedef typename graph_traits::vertex_descriptor vertex_descriptor;
|
||||
typedef typename graph_traits::edge_descriptor edge_descriptor;
|
||||
typedef typename graph_traits::halfedge_descriptor halfedge_descriptor;
|
||||
typedef typename graph_traits::face_descriptor face_descriptor;
|
||||
typedef typename std::set<vertex_descriptor>::iterator vertex_iterator;
|
||||
typedef typename std::set<edge_descriptor>::iterator edge_iterator;
|
||||
/// Geometric typedefs
|
||||
typedef typename Traits::Point_3 Point_3;
|
||||
typedef typename Traits::FT FT;
|
||||
typedef typename Traits::Vector_3 Vector_3;
|
||||
|
||||
typedef std::pair<double,double> Point_2;
|
||||
|
||||
typedef int Index;
|
||||
|
||||
typedef CGAL::dynamic_halfedge_property_t<Point_2> Halfedge_coordinate_tag;
|
||||
typedef typename boost::property_map<TriangleMesh, Halfedge_coordinate_tag >::type HalfedgeCoordinateMap;
|
||||
|
||||
typedef typename boost::graph_traits<TriangleMesh>::vertices_size_type vertices_size_type;
|
||||
typedef typename boost::graph_traits<TriangleMesh>::edges_size_type edges_size_type;
|
||||
typedef typename boost::graph_traits<TriangleMesh>::faces_size_type faces_size_type;
|
||||
|
||||
typedef CGAL::dynamic_edge_property_t<Index> Edge_property_tag;
|
||||
typedef typename boost::property_map<TriangleMesh, Edge_property_tag >::type Edge_id_map;
|
||||
typedef typename std::stack<edge_descriptor, std::list<edge_descriptor> > edge_stack;
|
||||
|
||||
|
||||
private:
|
||||
friend struct IDT_vertex_point_property_map<Self>;
|
||||
template <class IDT, class VDM> friend struct IDT_vertex_distance_property_map;
|
||||
|
||||
public: // for the BGL functions below. They should maybe become friend?
|
||||
typedef CGAL::Heat_method_3::IDT_vertex_point_property_map<Self> Vertex_point_map;
|
||||
|
||||
|
||||
typedef Intrinsic_Delaunay_triangulation_3_vertex_descriptor<TriangleMesh> Vertex_descriptor;
|
||||
typedef Intrinsic_Delaunay_triangulation_3_vertex_iterator_functor<TriangleMesh> Vertex_iterator_functor;
|
||||
|
||||
public:
|
||||
/// Constructor
|
||||
/// \param input_tm the triangle mesh
|
||||
Intrinsic_Delaunay_triangulation_3(const TriangleMesh& input_tm)
|
||||
: m_intrinsic_tm(), m_input_tm(input_tm), m_vpm(*this), hcm(get(Halfedge_coordinate_tag(), m_intrinsic_tm))
|
||||
{
|
||||
build();
|
||||
}
|
||||
|
||||
template <class VertexPointMap>
|
||||
Intrinsic_Delaunay_triangulation_3(const TriangleMesh& input_tm, VertexPointMap vpm)
|
||||
: m_intrinsic_tm(), m_input_tm(input_tm), m_vpm(*this), hcm(get(Halfedge_coordinate_tag(), m_intrinsic_tm))
|
||||
{
|
||||
build(vpm);
|
||||
}
|
||||
|
||||
typedef TriangleMesh Triangle_mesh;
|
||||
|
||||
const Triangle_mesh&
|
||||
triangle_mesh() const
|
||||
{
|
||||
return m_intrinsic_tm;
|
||||
}
|
||||
|
||||
|
||||
Triangle_mesh&
|
||||
triangle_mesh()
|
||||
{
|
||||
return m_intrinsic_tm;
|
||||
}
|
||||
|
||||
const HalfedgeCoordinateMap&
|
||||
hcmap() const
|
||||
{
|
||||
return hcm;
|
||||
}
|
||||
|
||||
template <class VertexDistanceMap>
|
||||
IDT_vertex_distance_property_map<Self,VertexDistanceMap>
|
||||
vertex_distance_map(VertexDistanceMap vdm) const
|
||||
{
|
||||
return IDT_vertex_distance_property_map<Self,VertexDistanceMap>(*this, vdm);
|
||||
}
|
||||
|
||||
Vertex_point_map
|
||||
vertex_point_map() const
|
||||
{
|
||||
return m_vpm;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
double
|
||||
get_cotan_weight(edge_descriptor ed)
|
||||
{
|
||||
double cotan_weight = 0;
|
||||
halfedge_descriptor hd = halfedge(ed, m_intrinsic_tm);
|
||||
halfedge_descriptor hd2 = next(hd,m_intrinsic_tm);
|
||||
halfedge_descriptor hd3 = next(hd2,m_intrinsic_tm);
|
||||
Index a_i = get(edge_id_map, ed);
|
||||
Index b_i = get(edge_id_map, edge(hd2,m_intrinsic_tm));
|
||||
Index c_i = get(edge_id_map, edge(hd3,m_intrinsic_tm));
|
||||
double a = edge_lengths[a_i] + 0.0;
|
||||
double b = edge_lengths[b_i] + 0.0;
|
||||
double c = edge_lengths[c_i] + 0.0;
|
||||
|
||||
double tan2 = CGAL::sqrt(CGAL::abs(((a-b+c)*(a+b-c))/((a+b+c)*(-a+b+c))));
|
||||
cotan_weight+=(1-(tan2*tan2))/(2*tan2);
|
||||
|
||||
hd = opposite(hd,m_intrinsic_tm);
|
||||
hd2 =next(hd,m_intrinsic_tm);
|
||||
hd3 = next(hd2,m_intrinsic_tm);
|
||||
b_i = get(edge_id_map, edge(hd2,m_intrinsic_tm));
|
||||
c_i = get(edge_id_map, edge(hd3,m_intrinsic_tm));
|
||||
b = edge_lengths[b_i] + 0.0;
|
||||
c = edge_lengths[c_i] + 0.0;
|
||||
tan2 = CGAL::sqrt(CGAL::abs(((a-b+c)*(a+b-c))/((a+b+c)*(-a+b+c))));
|
||||
cotan_weight+=(1-(tan2*tan2))/(2*tan2);
|
||||
return cotan_weight;
|
||||
}
|
||||
|
||||
|
||||
//returns true if edge is locally Delaunay (opposing angles are less than pi):
|
||||
//Two ways of doing this: taking angles directly (not good with virtual edges)
|
||||
//OR: taking edge length and using law of cosines,
|
||||
//The second way checks cotan weights
|
||||
bool
|
||||
is_edge_locally_delaunay(edge_descriptor ed)
|
||||
{
|
||||
return (get_cotan_weight(ed)>=0);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
change_edge_length(Index i, edge_descriptor ed)
|
||||
{
|
||||
halfedge_descriptor hd = halfedge(ed,m_intrinsic_tm);
|
||||
halfedge_descriptor hd2 = next(hd,m_intrinsic_tm);
|
||||
halfedge_descriptor hd3 = next(hd2,m_intrinsic_tm);
|
||||
Index b_i = get(edge_id_map, edge(hd2,m_intrinsic_tm));
|
||||
Index c_i = get(edge_id_map, edge(hd3,m_intrinsic_tm));
|
||||
double a = edge_lengths[i];
|
||||
double b1 = edge_lengths[b_i];
|
||||
double c1 = edge_lengths[c_i];
|
||||
double tan2a = CGAL::sqrt(CGAL::abs(((c1-a+b1)*(-b1+a+c1))/((a+b1+c1)*(b1+a-c1))));
|
||||
hd = opposite(hd,m_intrinsic_tm);
|
||||
hd2 =next(hd,m_intrinsic_tm);
|
||||
hd3 = next(hd2,m_intrinsic_tm);
|
||||
b_i = get(edge_id_map, edge(hd2,m_intrinsic_tm));
|
||||
c_i = get(edge_id_map, edge(hd3,m_intrinsic_tm));
|
||||
double b2 = edge_lengths[b_i];
|
||||
double c2 = edge_lengths[c_i];
|
||||
double tan2d = CGAL::sqrt(CGAL::abs(((-a+b2+c2)*(a+b2-c2))/((a+b2+c2)*(a-b2+c2))));
|
||||
double tan2ad = (tan2a + tan2d)/(1-tan2a*tan2d);
|
||||
double cosad = (1-tan2ad*tan2ad)/(1+tan2ad*tan2ad);
|
||||
double new_length = CGAL::sqrt( CGAL::abs(b1*b1 + c2*c2 - 2*b1*c2*cosad));
|
||||
edge_lengths[i] = new_length;
|
||||
}
|
||||
|
||||
|
||||
//Heron's formula
|
||||
double
|
||||
face_area(double a, double b, double c)
|
||||
{
|
||||
double S = (a+b+c)/2;
|
||||
return CGAL::sqrt(S*(S-a)*(S-b)*(S-c));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
loop_over_edges(edge_stack stack, std::vector<int>& marked_edges)
|
||||
{
|
||||
int a = 0;
|
||||
while(!stack.empty()) {
|
||||
edge_descriptor ed = stack.top();
|
||||
stack.pop();
|
||||
|
||||
Index edge_i = get(edge_id_map,ed);
|
||||
|
||||
marked_edges[edge_i]=0;
|
||||
//if the edge itself is not locally delaunay, go back
|
||||
if(!(is_edge_locally_delaunay(ed))) {
|
||||
if(!(is_border(ed,m_intrinsic_tm))) {
|
||||
a++;
|
||||
change_edge_length(edge_i,ed);
|
||||
halfedge_descriptor hd = (halfedge(ed, m_intrinsic_tm));
|
||||
CGAL::Euler::flip_edge(hd, m_intrinsic_tm);
|
||||
edge_descriptor next_edge= edge(next(hd,m_intrinsic_tm),m_intrinsic_tm);
|
||||
Index next_edge_i = get(edge_id_map, next_edge);
|
||||
|
||||
//if edge was already checked, go back and check again
|
||||
//for the 4 surrounding edges, since local 'geometry' changed,
|
||||
if(!(marked_edges[next_edge_i])) {
|
||||
stack.push(next_edge);
|
||||
marked_edges[next_edge_i] = 1;
|
||||
}
|
||||
next_edge = edge(prev(hd,m_intrinsic_tm),m_intrinsic_tm);
|
||||
next_edge_i = get(edge_id_map,next_edge);
|
||||
if(!(marked_edges[next_edge_i])) {
|
||||
stack.push(next_edge);
|
||||
marked_edges[next_edge_i] = 1;
|
||||
}
|
||||
next_edge = edge(next(opposite(hd,m_intrinsic_tm),m_intrinsic_tm),m_intrinsic_tm);
|
||||
next_edge_i = get(edge_id_map,next_edge);
|
||||
if(!(marked_edges[next_edge_i])) {
|
||||
stack.push(next_edge);
|
||||
marked_edges[next_edge_i] = 1;
|
||||
}
|
||||
next_edge = edge(prev(opposite(hd,m_intrinsic_tm),m_intrinsic_tm),m_intrinsic_tm);
|
||||
next_edge_i = get(edge_id_map,next_edge);
|
||||
if(!(marked_edges[next_edge_i])) {
|
||||
stack.push(next_edge);
|
||||
marked_edges[next_edge_i] = 1;
|
||||
}
|
||||
}
|
||||
//then go back to top of the stack
|
||||
}
|
||||
}
|
||||
std::cout<< a << " edges were flipped: " << std::endl;
|
||||
}
|
||||
|
||||
|
||||
template <class VertexPointMap>
|
||||
void
|
||||
build(VertexPointMap vpm)
|
||||
{
|
||||
CGAL_precondition(is_triangle_mesh(m_intrinsic_tm));
|
||||
|
||||
typename Traits::Compute_squared_distance_3 squared_distance = Traits().compute_squared_distance_3_object();
|
||||
|
||||
std::vector<std::pair<vertex_descriptor,
|
||||
vertex_descriptor> > pairs;
|
||||
copy_face_graph(m_input_tm, m_intrinsic_tm,
|
||||
parameters::vertex_to_vertex_output_iterator(std::back_inserter(pairs)).
|
||||
vertex_point_map(vpm));
|
||||
|
||||
for(std::size_t i=0; i < pairs.size(); i++) {
|
||||
v2v[pairs[i].second] = pairs[i].first;
|
||||
vtov[pairs[i].first] = pairs[i].second;
|
||||
}
|
||||
|
||||
edge_stack stack;
|
||||
std::size_t number_of_edges = num_edges(m_intrinsic_tm);
|
||||
edge_lengths.resize(number_of_edges);
|
||||
mark_edges.resize(number_of_edges, 1);
|
||||
edge_id_map = get(Edge_property_tag(), m_intrinsic_tm);
|
||||
Index edge_i = 0;
|
||||
VertexPointMap vpm_intrinsic_tm = get(boost::vertex_point,m_intrinsic_tm);
|
||||
|
||||
BOOST_FOREACH(edge_descriptor ed, edges(m_intrinsic_tm)) {
|
||||
edge_lengths[edge_i] = CGAL::sqrt(to_double(squared_distance(get(vpm_intrinsic_tm, source(ed,m_intrinsic_tm)),
|
||||
get(vpm_intrinsic_tm, target(ed,m_intrinsic_tm)))));
|
||||
// Polygon_mesh_processing::edge_length(halfedge(ed,m_intrinsic_tm),m_intrinsic_tm);
|
||||
put(edge_id_map, ed, edge_i++);
|
||||
stack.push(ed);
|
||||
}
|
||||
loop_over_edges(stack, mark_edges);
|
||||
//now that edges are calculated, go through and for each face, calculate the vertex positions around it
|
||||
|
||||
BOOST_FOREACH(face_descriptor f, faces(m_intrinsic_tm)) {
|
||||
CGAL::Vertex_around_face_iterator<TriangleMesh> vbegin, vend, vmiddle;
|
||||
|
||||
boost::tie(vbegin, vend) = vertices_around_face(halfedge(f,m_intrinsic_tm),m_intrinsic_tm);
|
||||
halfedge_descriptor hd = halfedge(f,m_intrinsic_tm);
|
||||
if(face(hd,m_intrinsic_tm) != f) {
|
||||
hd = opposite(hd,m_intrinsic_tm);
|
||||
}
|
||||
hd = next(hd,m_intrinsic_tm);
|
||||
//each 'local' set of coordinates will have 0,0 at the first vertex/halfedge
|
||||
Point_2 p11(0,0);
|
||||
put(hcm, prev(hd,m_intrinsic_tm),p11);
|
||||
edge_descriptor ed1 = edge(hd, m_intrinsic_tm);
|
||||
hd = next(hd,m_intrinsic_tm);
|
||||
//the second local coordinate will be edge_length(first edge),0
|
||||
Point_2 p21(edge_lengths[get(edge_id_map,ed1)], 0);
|
||||
put(hcm,prev(hd,m_intrinsic_tm),p21);
|
||||
|
||||
//use basic trigonometry to compute third coordinate
|
||||
edge_descriptor ed2 = edge(hd, m_intrinsic_tm);
|
||||
hd = next(hd,m_intrinsic_tm);
|
||||
edge_descriptor ed3 = edge(hd, m_intrinsic_tm);
|
||||
Index e1 = get(edge_id_map, ed1);
|
||||
Index e2 = get(edge_id_map, ed2);
|
||||
Index e3 = get(edge_id_map, ed3);
|
||||
double e1_len = edge_lengths[e1];
|
||||
double e2_len = edge_lengths[e2];
|
||||
double e3_len = edge_lengths[e3];
|
||||
double angle_a = -(e2_len*e2_len) + e3_len*e3_len + e1_len*e1_len;
|
||||
angle_a = acos(angle_a/(2*e3_len*e1_len));
|
||||
Point_2 p31(e3_len*std::cos(angle_a), e3_len*std::sin(angle_a));
|
||||
put(hcm,prev(hd,m_intrinsic_tm),p31);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
build()
|
||||
{
|
||||
build( get(boost::vertex_point, m_input_tm) );
|
||||
}
|
||||
|
||||
|
||||
//todo:: determine which can be const
|
||||
TriangleMesh m_intrinsic_tm; // this is the copy where edges get flipped
|
||||
const TriangleMesh& m_input_tm; // this is the reference to the original
|
||||
Vertex_point_map m_vpm;
|
||||
HalfedgeCoordinateMap hcm;
|
||||
Edge_id_map edge_id_map;
|
||||
|
||||
std::vector<double> edge_lengths;
|
||||
std::vector<int> mark_edges;
|
||||
public:
|
||||
|
||||
boost::unordered_map<vertex_descriptor,vertex_descriptor> v2v, vtov;
|
||||
};
|
||||
|
||||
} // namespace Heat_method_3
|
||||
|
||||
namespace Heat_method_3 {
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
struct V2V<CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T> >
|
||||
{
|
||||
typedef CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T> Idt;
|
||||
const Idt& idt;
|
||||
/**
|
||||
* Vertex descriptor for iDT
|
||||
*/
|
||||
typedef typename boost::graph_traits<Idt>::vertex_descriptor Idt_vertex_descriptor;
|
||||
/**
|
||||
* Vertex descriptor for TriangleMesh
|
||||
*/
|
||||
typedef typename boost::graph_traits<TM>::vertex_descriptor TM_vertex_descriptor;
|
||||
|
||||
|
||||
/**
|
||||
* Default constructor
|
||||
*/
|
||||
V2V(const Idt& idt)
|
||||
: idt(idt)
|
||||
{}
|
||||
|
||||
/**
|
||||
* Create iDT vertex descriptor map for vertex bijection between original mesh and iDT mesh for Heat method
|
||||
*/
|
||||
Idt_vertex_descriptor operator()(const TM_vertex_descriptor& vd) const
|
||||
{
|
||||
return Idt_vertex_descriptor(idt.vtov.at(vd),idt.triangle_mesh());
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Heat_method_3
|
||||
} // namespace CGAL
|
||||
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
struct graph_traits<CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T> > {
|
||||
|
||||
typedef CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3_vertex_descriptor<TM> vertex_descriptor;
|
||||
typedef boost::transform_iterator<
|
||||
CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3_vertex_iterator_functor<TM>,
|
||||
typename boost::graph_traits<TM>::vertex_iterator> vertex_iterator;
|
||||
|
||||
typedef typename boost::graph_traits<TM>::halfedge_descriptor halfedge_descriptor;
|
||||
typedef typename boost::graph_traits<TM>::halfedge_iterator halfedge_iterator;
|
||||
typedef typename boost::graph_traits<TM>::edge_descriptor edge_descriptor;
|
||||
typedef typename boost::graph_traits<TM>::edge_iterator edge_iterator;
|
||||
typedef typename boost::graph_traits<TM>::face_descriptor face_descriptor;
|
||||
typedef typename boost::graph_traits<TM>::face_iterator face_iterator;
|
||||
|
||||
typedef typename boost::graph_traits<TM>::vertices_size_type vertices_size_type;
|
||||
|
||||
static face_descriptor null_face() { return boost::graph_traits<TM>::null_face(); }
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
namespace CGAL {
|
||||
namespace Heat_method_3 {
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::graph_traits<TM>::vertices_size_type
|
||||
num_vertices(const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return num_vertices(idt.triangle_mesh());
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::graph_traits<TM>::edges_size_type
|
||||
num_edges(const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return num_edges(idt.triangle_mesh());
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::graph_traits<TM>::faces_size_type
|
||||
num_faces(const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return num_faces(idt.triangle_mesh());
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename std::pair<typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::vertex_iterator,
|
||||
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::vertex_iterator>
|
||||
vertices(const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
std::pair<typename boost::graph_traits<TM>::vertex_iterator,
|
||||
typename boost::graph_traits<TM>::vertex_iterator> p = vertices(idt.triangle_mesh());
|
||||
|
||||
typedef typename Intrinsic_Delaunay_triangulation_3<TM,T>::Vertex_iterator_functor Fct;
|
||||
Fct fct(idt.triangle_mesh());
|
||||
return std::make_pair(boost::make_transform_iterator(p.first, fct),
|
||||
boost::make_transform_iterator(p.second,fct));
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename std::pair<typename boost::graph_traits<TM>::halfedge_iterator,
|
||||
typename boost::graph_traits<TM>::halfedge_iterator>
|
||||
halfedges(const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return halfedges(idt.triangle_mesh());
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename std::pair<typename boost::graph_traits<TM>::edge_iterator,
|
||||
typename boost::graph_traits<TM>::edge_iterator>
|
||||
edges(const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return edges(idt.triangle_mesh());
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename std::pair<typename boost::graph_traits<TM>::face_iterator,
|
||||
typename boost::graph_traits<TM>::face_iterator>
|
||||
faces(const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return faces(idt.triangle_mesh());
|
||||
}
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::vertex_descriptor
|
||||
vertex(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor hd,
|
||||
const Intrinsic_Delaunay_triangulation_3<TM,T>& )
|
||||
{
|
||||
return typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::vertex_descriptor(hd);
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor
|
||||
halfedge(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::face_descriptor fd,
|
||||
const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return halfedge(fd, idt.triangle_mesh());
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor
|
||||
halfedge(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::edge_descriptor ed,
|
||||
const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return halfedge(ed, idt.triangle_mesh());
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor
|
||||
opposite(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor hd,
|
||||
const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return opposite(hd, idt.triangle_mesh());
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor
|
||||
next(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor hd,
|
||||
const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return next(hd, idt.triangle_mesh());
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::face_descriptor
|
||||
face(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor hd,
|
||||
const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return face(hd, idt.triangle_mesh());
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::vertex_descriptor
|
||||
source(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor hd,
|
||||
const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
typedef typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::vertex_descriptor vertex_descriptor;
|
||||
|
||||
return vertex_descriptor(opposite(hd, idt.triangle_mesh()));
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::vertex_descriptor
|
||||
target(typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::halfedge_descriptor hd,
|
||||
const Intrinsic_Delaunay_triangulation_3<TM,T>&)
|
||||
{
|
||||
typedef typename boost::graph_traits<Intrinsic_Delaunay_triangulation_3<TM,T> >::vertex_descriptor vertex_descriptor;
|
||||
|
||||
return vertex_descriptor(hd);
|
||||
}
|
||||
|
||||
template <typename IDT>
|
||||
struct IDT_vertex_point_property_map {
|
||||
const IDT& idt;
|
||||
typedef typename IDT::Triangle_mesh TM;
|
||||
typedef typename boost::graph_traits<IDT>::vertex_descriptor key_type;
|
||||
typedef typename IDT::Point_3 value_type;
|
||||
typedef typename IDT::Point_2 Point_2;
|
||||
typedef value_type reference;
|
||||
typedef boost::readable_property_map_tag category;
|
||||
/**
|
||||
* Default constructor for vertex/point property map
|
||||
*/
|
||||
IDT_vertex_point_property_map(const IDT& idt)
|
||||
: idt(idt)
|
||||
{}
|
||||
|
||||
|
||||
/**
|
||||
* friend function for Heat method to get vertex descriptor's coordinates in iDT's local coordinate system
|
||||
*/
|
||||
friend value_type get(const IDT_vertex_point_property_map<IDT>& pm,
|
||||
key_type vd)
|
||||
{
|
||||
const Point_2& p = get(pm.idt.hcmap(), vd.hd);
|
||||
return value_type(p.first, p.second, 0);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename IDT, typename PM>
|
||||
struct IDT_vertex_distance_property_map {
|
||||
const IDT& idt;
|
||||
PM pm;
|
||||
|
||||
typedef typename IDT::Triangle_mesh TM;
|
||||
typedef typename IDT::Vertex_descriptor key_type;
|
||||
typedef double value_type;
|
||||
typedef value_type reference;
|
||||
|
||||
IDT_vertex_distance_property_map(const IDT& idt,
|
||||
PM pm)
|
||||
: idt(idt), pm(pm)
|
||||
{}
|
||||
|
||||
|
||||
// no need for a get()
|
||||
|
||||
friend void put(IDT_vertex_distance_property_map<IDT,PM> idtpm,
|
||||
key_type vd,
|
||||
value_type v)
|
||||
{
|
||||
typename boost::graph_traits<TM>::vertex_descriptor tm_vd = target(vd.hd, idtpm.idt.triangle_mesh());
|
||||
|
||||
put(idtpm.pm, idtpm.idt.v2v.at(tm_vd), v);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace Heat_method_3
|
||||
} // namespace CGAL
|
||||
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
struct property_map<CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T>,
|
||||
CGAL::vertex_point_t > {
|
||||
typedef CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T> IDT;
|
||||
typedef CGAL::Heat_method_3::IDT_vertex_point_property_map<IDT> type;
|
||||
typedef type const_type;
|
||||
};
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
struct property_map<CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T>,
|
||||
CGAL::face_index_t > {
|
||||
typedef CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T> IDT;
|
||||
typedef typename property_map<TM, CGAL::face_index_t>::type type;
|
||||
typedef typename property_map<TM, CGAL::face_index_t>::const_type const_type;
|
||||
};
|
||||
|
||||
} // boost
|
||||
|
||||
|
||||
namespace CGAL {
|
||||
namespace Heat_method_3 {
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
typename boost::property_map<TM,CGAL::face_index_t>::type
|
||||
get(CGAL::face_index_t fi,
|
||||
const CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return get(fi, idt.triangle_mesh());
|
||||
}
|
||||
|
||||
template <typename TM,
|
||||
typename T>
|
||||
CGAL::Heat_method_3::IDT_vertex_point_property_map<CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T> >
|
||||
get(CGAL::vertex_point_t,
|
||||
const CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
return CGAL::Heat_method_3::IDT_vertex_point_property_map<CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T> >(idt);
|
||||
}
|
||||
|
||||
template <typename IDT, typename PM, typename K, typename V>
|
||||
class IDT_dynamic_vertex_property_map {
|
||||
const IDT& idt;
|
||||
PM pm;
|
||||
|
||||
public:
|
||||
typedef IDT_dynamic_vertex_property_map<IDT,PM,K,V> Self;
|
||||
typedef typename IDT::Triangle_mesh TM;
|
||||
typedef typename boost::graph_traits<TM>::vertex_descriptor TM_vertex_descriptor;
|
||||
|
||||
|
||||
IDT_dynamic_vertex_property_map(const IDT& idt, PM pm)
|
||||
: idt(idt), pm(pm)
|
||||
{}
|
||||
|
||||
|
||||
friend V get(const Self& idpm, const K& k)
|
||||
{
|
||||
return get(idpm.pm, target(k.hd, idpm.idt.triangle_mesh()));
|
||||
}
|
||||
|
||||
|
||||
friend void put(const Self& idpm, const K& k, const V& v)
|
||||
{
|
||||
put(idpm.pm, target(k.hd, idpm.idt.triangle_mesh()), v);
|
||||
}
|
||||
|
||||
|
||||
friend V get(const Self& idpm, const TM_vertex_descriptor& k)
|
||||
{
|
||||
return get(idpm.pm, k);
|
||||
}
|
||||
|
||||
|
||||
friend void put(const Self& idpm, const TM_vertex_descriptor& k, const V& v)
|
||||
{
|
||||
put(idpm.pm, k, v);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} } // CGAL::Heat_method_3
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename TM,
|
||||
typename T,
|
||||
typename dT>
|
||||
struct property_map<CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T>,
|
||||
CGAL::dynamic_vertex_property_t<dT> > {
|
||||
typedef CGAL::Heat_method_3::Intrinsic_Delaunay_triangulation_3<TM,T> IDT;
|
||||
typedef CGAL::Heat_method_3::IDT_dynamic_vertex_property_map<IDT,
|
||||
typename property_map<TM, CGAL::dynamic_vertex_property_t<dT> >::type,
|
||||
typename graph_traits<IDT>::vertex_descriptor,
|
||||
dT> type;
|
||||
typedef CGAL::Heat_method_3::IDT_dynamic_vertex_property_map<IDT,
|
||||
typename property_map<TM, CGAL::dynamic_vertex_property_t<dT> >::const_type,
|
||||
typename graph_traits<IDT>::vertex_descriptor,
|
||||
dT> const_type;
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
namespace CGAL {
|
||||
namespace Heat_method_3 {
|
||||
|
||||
template <typename TM,
|
||||
typename T,
|
||||
typename dT>
|
||||
typename boost::property_map<Intrinsic_Delaunay_triangulation_3<TM,T>, CGAL::dynamic_vertex_property_t<dT> >::const_type
|
||||
get(CGAL::dynamic_vertex_property_t<dT> dvp,
|
||||
const Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
typedef Intrinsic_Delaunay_triangulation_3<TM,T> IDT;
|
||||
typedef IDT_dynamic_vertex_property_map<IDT,
|
||||
typename boost::property_map<TM, CGAL::dynamic_vertex_property_t<dT> >::const_type,
|
||||
typename boost::graph_traits<IDT>::vertex_descriptor,
|
||||
dT> PM;
|
||||
return PM(idt,get(dvp,idt.triangle_mesh()));
|
||||
}
|
||||
|
||||
|
||||
template <typename TM,
|
||||
typename T,
|
||||
typename dT>
|
||||
typename boost::property_map<Intrinsic_Delaunay_triangulation_3<TM,T>, CGAL::dynamic_vertex_property_t<dT> >::type
|
||||
get(CGAL::dynamic_vertex_property_t<dT> dvp,
|
||||
Intrinsic_Delaunay_triangulation_3<TM,T>& idt)
|
||||
{
|
||||
typedef Intrinsic_Delaunay_triangulation_3<TM,T> IDT;
|
||||
typedef IDT_dynamic_vertex_property_map<IDT,
|
||||
typename boost::property_map<TM, CGAL::dynamic_vertex_property_t<dT> >::type,
|
||||
typename boost::graph_traits<IDT>::vertex_descriptor,
|
||||
dT> PM;
|
||||
|
||||
return PM(idt, get(dvp,idt.triangle_mesh()));
|
||||
}
|
||||
|
||||
} // namespace Heat_method_3
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // DOXYGEN_RUNNING
|
||||
|
||||
#include <CGAL/enable_warnings.h>
|
||||
#endif // CGAL_INTRINSIC_DELAUNAY_TRIANGULATION_3_H
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
// Copyright (c) 2018 Carnegie Mellon University (USA), 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
|
||||
// General Public License as published by the Free Software Foundation,
|
||||
// either version 3 of the License, or (at your option) any later version.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0+
|
||||
//
|
||||
//
|
||||
// Author(s) : Christina Vaz, Keenan Crane, Andreas Fabri
|
||||
|
||||
#ifndef CGAL_HEAT_METHOD_3_INTERNAL_V2V_H
|
||||
#define CGAL_HEAT_METHOD_3_INTERNAL_V2V_H
|
||||
|
||||
#include <CGAL/license/Heat_method_3.h>
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
|
||||
namespace CGAL {
|
||||
namespace Heat_method_3 {
|
||||
|
||||
template <typename TM>
|
||||
struct V2V {
|
||||
|
||||
V2V(const TM&)
|
||||
{}
|
||||
|
||||
template <typename T>
|
||||
const T& operator()(const T& t) const
|
||||
{
|
||||
return t;
|
||||
}
|
||||
};
|
||||
#endif
|
||||
} // namespace Heat_method_3
|
||||
} // namespace CGAL
|
||||
#endif //CGAL_HEAT_METHOD_3_INTERNAL_V2V_H
|
||||
|
|
@ -0,0 +1 @@
|
|||
Carnegie Mellon University, GeometryFactory 2018
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
Algebraic_foundations
|
||||
BGL
|
||||
Cartesian_kernel
|
||||
Circulator
|
||||
Distance_2
|
||||
Distance_3
|
||||
Filtered_kernel
|
||||
Heat_method_3
|
||||
Installation
|
||||
Interval_support
|
||||
Kernel_23
|
||||
Modular_arithmetic
|
||||
Number_types
|
||||
Polygon_mesh_processing
|
||||
Profiling_tools
|
||||
Property_map
|
||||
STL_Extension
|
||||
Solver_interface
|
||||
Stream_support
|
||||
|
|
@ -0,0 +1 @@
|
|||
See https://www.cs.cmu.edu/~kmcrane/Projects/HeatMethod/index.html
|
||||
|
|
@ -0,0 +1 @@
|
|||
GPL (v3 or later)
|
||||
|
|
@ -0,0 +1 @@
|
|||
See https://www.cs.cmu.edu/~kmcrane/Projects/HeatMethod/index.html
|
||||
|
|
@ -0,0 +1 @@
|
|||
Keenan Crane, Andreas Fabri
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
# Created by the script cgal_create_CMakeLists
|
||||
# This is the CMake script for compiling a set of CGAL applications.
|
||||
|
||||
project( Heat_method_3_Tests )
|
||||
|
||||
|
||||
cmake_minimum_required(VERSION 2.8.11)
|
||||
|
||||
# CGAL and its components
|
||||
find_package( CGAL QUIET COMPONENTS )
|
||||
|
||||
if ( NOT CGAL_FOUND )
|
||||
|
||||
message(STATUS "This project requires the CGAL library, and will not be compiled.")
|
||||
return()
|
||||
|
||||
endif()
|
||||
|
||||
# include helper file
|
||||
include( ${CGAL_USE_FILE} )
|
||||
|
||||
|
||||
# Boost and its components
|
||||
find_package( Boost REQUIRED )
|
||||
|
||||
if ( NOT Boost_FOUND )
|
||||
|
||||
message(STATUS "This project requires the Boost library, and will not be compiled.")
|
||||
|
||||
return()
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
find_package(Eigen3 3.3.0)
|
||||
|
||||
if (EIGEN3_FOUND)
|
||||
include( ${EIGEN3_USE_FILE} )
|
||||
else()
|
||||
message(STATUS "This project requires the Eigen library (3.3 or greater), and will not be compiled.")
|
||||
|
||||
return()
|
||||
endif()
|
||||
|
||||
# include for local directory
|
||||
include_directories( BEFORE include )
|
||||
|
||||
|
||||
# Creating entries for all C++ files with "main" routine
|
||||
# ##########################################################
|
||||
|
||||
include( CGAL_CreateSingleSourceCGALProgram )
|
||||
|
||||
create_single_source_cgal_program( "heat_method_concept.cpp" )
|
||||
create_single_source_cgal_program( "heat_method_surface_mesh_test.cpp" )
|
||||
create_single_source_cgal_program( "heat_method_surface_mesh_direct_test.cpp" )
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
|
||||
struct Heat_method_traits_3
|
||||
{
|
||||
typedef double FT;
|
||||
|
||||
struct Point_3 {
|
||||
Point_3()
|
||||
{}
|
||||
|
||||
Point_3(double, double,double)
|
||||
{}
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct Vector_3 {
|
||||
Vector_3()
|
||||
{}
|
||||
|
||||
Vector_3(double, double, double)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
struct Construct_vector_3{
|
||||
Vector_3 operator()(const Point_3&, const Point_3&) const
|
||||
{ return Vector_3();}
|
||||
};
|
||||
|
||||
struct Construct_scaled_vector_3{
|
||||
Vector_3 operator()(const Vector_3&, double) const
|
||||
{ return Vector_3();}
|
||||
};
|
||||
|
||||
struct Construct_cross_product_vector_3 {
|
||||
|
||||
Vector_3 operator()(const Vector_3&, const Vector_3&) const
|
||||
{ return Vector_3();}
|
||||
};
|
||||
|
||||
struct Construct_sum_of_vectors_3 {
|
||||
|
||||
Vector_3 operator()(const Vector_3&, const Vector_3&) const
|
||||
{ return Vector_3();}
|
||||
};
|
||||
struct Compute_scalar_product_3 {
|
||||
|
||||
double operator()(const Vector_3&, const Vector_3&) const
|
||||
{ return 0;}
|
||||
};
|
||||
|
||||
struct Compute_squared_distance_3 {
|
||||
|
||||
double operator()(const Point_3&, const Point_3&) const
|
||||
{ return 0;}
|
||||
};
|
||||
|
||||
|
||||
Construct_vector_3 construct_vector_3_object() const
|
||||
{
|
||||
return Construct_vector_3();
|
||||
}
|
||||
Construct_scaled_vector_3 construct_scaled_vector_3_object() const
|
||||
{
|
||||
return Construct_scaled_vector_3();
|
||||
}
|
||||
|
||||
Construct_cross_product_vector_3 construct_cross_product_vector_3_object() const
|
||||
{
|
||||
return Construct_cross_product_vector_3();
|
||||
}
|
||||
|
||||
Compute_squared_distance_3 compute_squared_distance_3_object() const
|
||||
{
|
||||
return Compute_squared_distance_3();
|
||||
}
|
||||
|
||||
Compute_scalar_product_3 compute_scalar_product_3_object() const
|
||||
{
|
||||
return Compute_scalar_product_3();
|
||||
}
|
||||
|
||||
Construct_sum_of_vectors_3 construct_sum_of_vectors_3_object() const
|
||||
{
|
||||
return Construct_sum_of_vectors_3();
|
||||
}
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,66 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h>
|
||||
|
||||
#include "Heat_method_traits_3.h"
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
typedef Heat_method_traits_3 Kernel;
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
typedef CGAL::Surface_mesh<Point_3> Surface_mesh;
|
||||
|
||||
typedef boost::graph_traits<Surface_mesh>::vertex_descriptor vertex_descriptor;
|
||||
typedef Surface_mesh::Property_map<vertex_descriptor,double> Vertex_distance_map;
|
||||
typedef CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3<Surface_mesh,
|
||||
CGAL::Heat_method_3::Intrinsic_Delaunay,
|
||||
boost::property_map< Surface_mesh, CGAL::vertex_point_t>::const_type,
|
||||
CGAL::Eigen_solver_traits<Eigen::SimplicialLDLT<CGAL::Eigen_sparse_matrix<double>::EigenType > >,
|
||||
Kernel> Heat_method;
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
//read in mesh
|
||||
Surface_mesh sm;
|
||||
|
||||
if(sm.is_empty()){
|
||||
return 0;
|
||||
}
|
||||
//the heat intensity will hold the distance values from the source set
|
||||
Vertex_distance_map heat_intensity = sm.add_property_map<vertex_descriptor, double>("v:heat_intensity", 0).first;
|
||||
|
||||
Heat_method hm(sm);
|
||||
|
||||
//add the first vertex as the source set
|
||||
vertex_descriptor source = *(vertices(sm).first);
|
||||
hm.add_source(source);
|
||||
hm.estimate_geodesic_distances(heat_intensity);
|
||||
|
||||
//Point_3 sp = sm.point(source);
|
||||
|
||||
vertex_descriptor far;
|
||||
// double sdistance = 0;
|
||||
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
std::cout << vd << " is at distance " << get(heat_intensity, vd) << " from " << source << std::endl;
|
||||
/*
|
||||
if(squared_distance(sp,sm.point(vd)) > sdistance){
|
||||
far = vd;
|
||||
sdistance = squared_distance(sp,sm.point(vd));
|
||||
}
|
||||
*/
|
||||
}
|
||||
hm.add_source(far);
|
||||
hm.estimate_geodesic_distances(heat_intensity);
|
||||
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
std::cout << vd << " is at distance " << get(heat_intensity, vd) << " " << std::endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
typedef CGAL::Surface_mesh<Point_3> Surface_mesh;
|
||||
|
||||
typedef boost::graph_traits<Surface_mesh>::vertex_descriptor vertex_descriptor;
|
||||
typedef Surface_mesh::Property_map<vertex_descriptor,double> Vertex_distance_map;
|
||||
typedef CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3<Surface_mesh, CGAL::Heat_method_3::Direct> Heat_method;
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
//read in mesh
|
||||
Surface_mesh sm;
|
||||
const char* filename = (argc > 1) ? argv[1] : "./data/sphere.off";
|
||||
std::ifstream in(filename);
|
||||
in >> sm;
|
||||
//property map for the distance values to the source set
|
||||
Vertex_distance_map vertex_distance = sm.add_property_map<vertex_descriptor, double>("v:distance", 0).first;
|
||||
|
||||
Heat_method hm(sm);
|
||||
|
||||
//add the first vertex as the source set
|
||||
vertex_descriptor source = *(vertices(sm).first);
|
||||
hm.add_source(source);
|
||||
assert(hm.sources().size() == 1);
|
||||
hm.estimate_geodesic_distances(vertex_distance);
|
||||
|
||||
Point_3 sp = sm.point(source);
|
||||
|
||||
std::cout << "source: " << sp << " " << source << std::endl;
|
||||
vertex_descriptor far;
|
||||
double sdistance = 0;
|
||||
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
if(get(vertex_distance,vd) > sdistance){
|
||||
far = vd;
|
||||
sdistance = get(vertex_distance,vd);
|
||||
}
|
||||
}
|
||||
assert(sdistance > 2.9);
|
||||
assert(sdistance < CGAL_PI);
|
||||
|
||||
hm.add_source(far);
|
||||
assert(hm.sources().size() == 2);
|
||||
hm.estimate_geodesic_distances(vertex_distance);
|
||||
|
||||
sdistance = 0;
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
if(get(vertex_distance,vd) > sdistance){
|
||||
sdistance = get(vertex_distance,vd);
|
||||
}
|
||||
}
|
||||
|
||||
assert(sdistance > 1.4);
|
||||
assert(sdistance < CGAL_PI/2.0);
|
||||
|
||||
hm.remove_source(far);
|
||||
assert(hm.sources().size() == 1);
|
||||
|
||||
hm.clear_sources();
|
||||
|
||||
// add range of sources
|
||||
std::vector<vertex_descriptor> vrange;
|
||||
vrange.push_back(source);
|
||||
vrange.push_back(far);
|
||||
hm.add_sources(vrange);
|
||||
assert(hm.sources().size() == 2);
|
||||
hm.estimate_geodesic_distances(vertex_distance);
|
||||
sdistance = 0;
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
if(get(vertex_distance,vd) > sdistance){
|
||||
sdistance = get(vertex_distance,vd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
assert(sdistance > 1.4);
|
||||
assert(sdistance < CGAL_PI/2.0);
|
||||
|
||||
// do it again for one source
|
||||
hm.clear_sources();
|
||||
assert(hm.sources().size() == 0);
|
||||
hm.add_source(source);
|
||||
hm.estimate_geodesic_distances(vertex_distance);
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
if(get(vertex_distance,vd) > sdistance){
|
||||
sdistance = get(vertex_distance,vd);
|
||||
}
|
||||
}
|
||||
assert(sdistance > 2.9);
|
||||
assert(sdistance < CGAL_PI);
|
||||
|
||||
|
||||
CGAL::Heat_method_3::estimate_geodesic_distances(sm, vertex_distance, source, CGAL::Heat_method_3::Direct());
|
||||
sdistance = 0;
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
if(get(vertex_distance,vd) > sdistance){
|
||||
sdistance = get(vertex_distance,vd);
|
||||
}
|
||||
}
|
||||
|
||||
assert(sdistance > 2.9);
|
||||
assert(sdistance < CGAL_PI);
|
||||
|
||||
|
||||
std::cout << "done" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Heat_method_3/Surface_mesh_geodesic_distances_3.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/foreach.hpp>
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
typedef CGAL::Surface_mesh<Point_3> Surface_mesh;
|
||||
|
||||
typedef boost::graph_traits<Surface_mesh>::vertex_descriptor vertex_descriptor;
|
||||
typedef Surface_mesh::Property_map<vertex_descriptor,double> Vertex_distance_map;
|
||||
typedef CGAL::Heat_method_3::Surface_mesh_geodesic_distances_3<Surface_mesh> Heat_method;
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
//read in mesh
|
||||
Surface_mesh sm;
|
||||
const char* filename = (argc > 1) ? argv[1] : "./data/sphere.off";
|
||||
std::ifstream in(filename);
|
||||
in >> sm;
|
||||
//property map for the distance values to the source set
|
||||
Vertex_distance_map vertex_distance = sm.add_property_map<vertex_descriptor, double>("v:distance", 0).first;
|
||||
|
||||
Heat_method hm(sm);
|
||||
|
||||
//add the first vertex as the source set
|
||||
vertex_descriptor source = *(vertices(sm).first);
|
||||
hm.add_source(source);
|
||||
assert(hm.sources().size() == 1);
|
||||
hm.estimate_geodesic_distances(vertex_distance);
|
||||
|
||||
Point_3 sp = sm.point(source);
|
||||
|
||||
std::cout << "source: " << sp << " " << source << std::endl;
|
||||
vertex_descriptor far;
|
||||
double sdistance = 0;
|
||||
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
if(get(vertex_distance,vd) > sdistance){
|
||||
far = vd;
|
||||
sdistance = get(vertex_distance,vd);
|
||||
}
|
||||
}
|
||||
assert(sdistance > 2.9);
|
||||
assert(sdistance < CGAL_PI);
|
||||
|
||||
hm.add_source(far);
|
||||
assert(hm.sources().size() == 2);
|
||||
hm.estimate_geodesic_distances(vertex_distance);
|
||||
|
||||
sdistance = 0;
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
if(get(vertex_distance,vd) > sdistance){
|
||||
sdistance = get(vertex_distance,vd);
|
||||
}
|
||||
}
|
||||
|
||||
assert(sdistance > 1.4);
|
||||
assert(sdistance < CGAL_PI/2.0);
|
||||
|
||||
hm.remove_source(far);
|
||||
assert(hm.sources().size() == 1);
|
||||
|
||||
hm.clear_sources();
|
||||
|
||||
// add range of sources
|
||||
std::vector<vertex_descriptor> vrange;
|
||||
vrange.push_back(source);
|
||||
vrange.push_back(far);
|
||||
hm.add_sources(vrange);
|
||||
assert(hm.sources().size() == 2);
|
||||
hm.estimate_geodesic_distances(vertex_distance);
|
||||
sdistance = 0;
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
if(get(vertex_distance,vd) > sdistance){
|
||||
sdistance = get(vertex_distance,vd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
assert(sdistance > 1.4);
|
||||
assert(sdistance < CGAL_PI/2.0);
|
||||
|
||||
// do it again for one source
|
||||
hm.clear_sources();
|
||||
assert(hm.sources().size() == 0);
|
||||
hm.add_source(source);
|
||||
hm.estimate_geodesic_distances(vertex_distance);
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
if(get(vertex_distance,vd) > sdistance){
|
||||
sdistance = get(vertex_distance,vd);
|
||||
}
|
||||
}
|
||||
assert(sdistance > 2.9);
|
||||
assert(sdistance < CGAL_PI);
|
||||
|
||||
|
||||
CGAL::Heat_method_3::estimate_geodesic_distances(sm, vertex_distance, source, CGAL::Heat_method_3::Direct());
|
||||
sdistance = 0;
|
||||
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
|
||||
if(get(vertex_distance,vd) > sdistance){
|
||||
sdistance = get(vertex_distance,vd);
|
||||
}
|
||||
}
|
||||
|
||||
assert(sdistance > 2.9);
|
||||
assert(sdistance < CGAL_PI);
|
||||
|
||||
|
||||
std::cout << "done" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -168,6 +168,18 @@ struct Extremal_polygon_perimeter_traits_2 {
|
|||
|
||||
Kgon_triangle_perimeter(const K& k_): k(k_) {}
|
||||
|
||||
// Added as workaround for VC2017 with /arch:AVX to fix
|
||||
// https://cgal.geometryfactory.com/CGAL/testsuite/CGAL-4.14-I-95/Inscribed_areas_Examples/TestReport_afabri_x64_Cygwin-Windows10_MSVC2017-Release-64bits.gz
|
||||
Kgon_triangle_perimeter(const Kgon_triangle_perimeter& other)
|
||||
: k(other.k)
|
||||
{}
|
||||
|
||||
Kgon_triangle_perimeter& operator=(const Kgon_triangle_perimeter& other)
|
||||
{
|
||||
k = other.k;
|
||||
return *this;
|
||||
}
|
||||
|
||||
result_type
|
||||
operator()(const Point_2& p, const Point_2& q, const Point_2& r) const
|
||||
{ return dist(p, r) + dist(p, q) - dist(q, r); }
|
||||
|
|
|
|||
|
|
@ -6,6 +6,17 @@ Release 4.14
|
|||
|
||||
Release date: March 2019
|
||||
|
||||
### The Heat Method (new package)
|
||||
- This package provides an algorithm that solves the single- or multiple-source
|
||||
shortest path problem by returning an approximation of the geodesic distance
|
||||
for all vertices of a triangle mesh to the closest vertex in a given set of
|
||||
source vertices.
|
||||
|
||||
### Triangulated Surface Mesh Approximation (new package)
|
||||
|
||||
- This package implements the Variational Shape Approximation method to approximate
|
||||
an input surface triangle mesh by a simpler surface triangle mesh.
|
||||
|
||||
### Polygon Mesh Processing package
|
||||
- Added the following new functions to detect and repair issues in polygon soups:
|
||||
- `CGAL::Polygon_mesh_processing::remove_isolated_points_in_polygon_soup()`, which detects and removes
|
||||
|
|
@ -68,6 +79,12 @@ Release date: March 2019
|
|||
- `CGAL::write_vtu()`, that writes a 2D mesh in a `.vtu` file,
|
||||
- `CGAL::output_to_vtu()`, that writes a 3D mesh in a `.vtu` file.
|
||||
|
||||
### 2D Minkowski Sums
|
||||
|
||||
- Fixed a bug in the function that computed the Minkowski sum using the
|
||||
reduced-convolution method. In particular, correctly handled the case where
|
||||
one of the summands does not have an outer boundaey.
|
||||
|
||||
### CGAL and the Boost Graph Library (BGL)
|
||||
|
||||
- Added function `write_wrl()` for writing into VRML 2.0 format.
|
||||
|
|
@ -75,6 +92,7 @@ Release date: March 2019
|
|||
face graph in a `.vtp` file (XML VTK format).
|
||||
|
||||
|
||||
|
||||
Release 4.13
|
||||
------------
|
||||
|
||||
|
|
|
|||
|
|
@ -364,10 +364,11 @@ endif()
|
|||
# CGAL-4.10 : 13.0.0 (Change the API/ABI in CGAL_ImageIO.)
|
||||
# CGAL-4.11 : 13.0.1 (Nothing different in CGAL compiled libraries.)
|
||||
# CGAL-4.12 : 13.0.2 (Nothing different in CGAL compiled libraries.)
|
||||
# CGAL-4.14 : 14.0.0 (ABI broken in CGAL::Image_3.)
|
||||
# ¹) According to http://upstream-tracker.org/versions/cgal.html
|
||||
|
||||
set( CGAL_SONAME_VERSION "13" )
|
||||
set( CGAL_SOVERSION "13.0.2" )
|
||||
set( CGAL_SONAME_VERSION "14" )
|
||||
set( CGAL_SOVERSION "14.0.0" )
|
||||
|
||||
message( STATUS "CGAL_SONAME_VERSION=${CGAL_SONAME_VERSION}" )
|
||||
message( STATUS "CGAL_SOVERSION =${CGAL_SOVERSION}" )
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ get_filename_component(CGAL_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
|||
set(CGAL_HEADER_ONLY "@CGAL_HEADER_ONLY@" )
|
||||
|
||||
# CGAL_DIR is the directory where this CGALConfig.cmake is installed
|
||||
string(REPLACE "@CGAL_INSTALL_CMAKE_DIR@" "" CGAL_INSTALL_PREFIX "${CGAL_CONFIG_DIR}")
|
||||
string(REPLACE "/@CGAL_INSTALL_CMAKE_DIR@" "" CGAL_INSTALL_PREFIX "${CGAL_CONFIG_DIR}")
|
||||
|
||||
if(NOT EXISTS "${CGAL_INSTALL_PREFIX}/@CGAL_INSTALL_CMAKE_DIR@/CGALConfig.cmake")
|
||||
# Cannot compute CGAL_INSTALL_PREFIX!
|
||||
|
|
|
|||
|
|
@ -0,0 +1,67 @@
|
|||
// Copyright (c) 2016 GeometryFactory SARL (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 3 of the License,
|
||||
// or (at your option) any later version.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0+
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
//
|
||||
// Warning: this file is generated, see include/CGAL/licence/README.md
|
||||
|
||||
|
||||
#ifndef CGAL_LICENSE_HEAT_METHOD_3_H
|
||||
#define CGAL_LICENSE_HEAT_METHOD_3_H
|
||||
|
||||
#include <CGAL/config.h>
|
||||
#include <CGAL/license.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef CGAL_HEAT_METHOD_3_COMMERCIAL_LICENSE
|
||||
|
||||
# if CGAL_HEAT_METHOD_3_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
|
||||
|
||||
# if defined(CGAL_LICENSE_WARNING)
|
||||
|
||||
CGAL_pragma_warning("Your commercial license for CGAL does not cover "
|
||||
"this release of the 3D Heat Method package.")
|
||||
# endif
|
||||
|
||||
# ifdef CGAL_LICENSE_ERROR
|
||||
# error "Your commercial license for CGAL does not cover this release \
|
||||
of the 3D Heat Method package. \
|
||||
You get this error, as you defined CGAL_LICENSE_ERROR."
|
||||
# endif // CGAL_LICENSE_ERROR
|
||||
|
||||
# endif // CGAL_HEAT_METHOD_3_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
|
||||
|
||||
#else // no CGAL_HEAT_METHOD_3_COMMERCIAL_LICENSE
|
||||
|
||||
# if defined(CGAL_LICENSE_WARNING)
|
||||
CGAL_pragma_warning("\nThe macro CGAL_HEAT_METHOD_3_COMMERCIAL_LICENSE is not defined."
|
||||
"\nYou use the CGAL 3D Heat Method package under "
|
||||
"the terms of the GPLv3+.")
|
||||
# endif // CGAL_LICENSE_WARNING
|
||||
|
||||
# ifdef CGAL_LICENSE_ERROR
|
||||
# error "The macro CGAL_HEAT_METHOD_3_COMMERCIAL_LICENSE is not defined.\
|
||||
You use the CGAL 3D Heat Method package under the terms of \
|
||||
the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR."
|
||||
# endif // CGAL_LICENSE_ERROR
|
||||
|
||||
#endif // no CGAL_HEAT_METHOD_3_COMMERCIAL_LICENSE
|
||||
|
||||
#endif // CGAL_LICENSE_CHECK_HEAT_METHOD_3_H
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
// Copyright (c) 2016 GeometryFactory SARL (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 3 of the License,
|
||||
// or (at your option) any later version.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0+
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
//
|
||||
// Warning: this file is generated, see include/CGAL/licence/README.md
|
||||
|
||||
|
||||
#ifndef CGAL_LICENSE_SURFACE_MESH_APPROXIMATION_H
|
||||
#define CGAL_LICENSE_SURFACE_MESH_APPROXIMATION_H
|
||||
|
||||
#include <CGAL/config.h>
|
||||
#include <CGAL/license.h>
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef CGAL_SURFACE_MESH_APPROXIMATION_COMMERCIAL_LICENSE
|
||||
|
||||
# if CGAL_SURFACE_MESH_APPROXIMATION_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
|
||||
|
||||
# if defined(CGAL_LICENSE_WARNING)
|
||||
|
||||
CGAL_pragma_warning("Your commercial license for CGAL does not cover "
|
||||
"this release of the Triangulated Surface Mesh Approximation package.")
|
||||
# endif
|
||||
|
||||
# ifdef CGAL_LICENSE_ERROR
|
||||
# error "Your commercial license for CGAL does not cover this release \
|
||||
of the Triangulated Surface Mesh Approximation package. \
|
||||
You get this error, as you defined CGAL_LICENSE_ERROR."
|
||||
# endif // CGAL_LICENSE_ERROR
|
||||
|
||||
# endif // CGAL_SURFACE_MESH_APPROXIMATION_COMMERCIAL_LICENSE < CGAL_RELEASE_DATE
|
||||
|
||||
#else // no CGAL_SURFACE_MESH_APPROXIMATION_COMMERCIAL_LICENSE
|
||||
|
||||
# if defined(CGAL_LICENSE_WARNING)
|
||||
CGAL_pragma_warning("\nThe macro CGAL_SURFACE_MESH_APPROXIMATION_COMMERCIAL_LICENSE is not defined."
|
||||
"\nYou use the CGAL Triangulated Surface Mesh Approximation package under "
|
||||
"the terms of the GPLv3+.")
|
||||
# endif // CGAL_LICENSE_WARNING
|
||||
|
||||
# ifdef CGAL_LICENSE_ERROR
|
||||
# error "The macro CGAL_SURFACE_MESH_APPROXIMATION_COMMERCIAL_LICENSE is not defined.\
|
||||
You use the CGAL Triangulated Surface Mesh Approximation package under the terms of \
|
||||
the GPLv3+. You get this error, as you defined CGAL_LICENSE_ERROR."
|
||||
# endif // CGAL_LICENSE_ERROR
|
||||
|
||||
#endif // no CGAL_SURFACE_MESH_APPROXIMATION_COMMERCIAL_LICENSE
|
||||
|
||||
#endif // CGAL_LICENSE_CHECK_SURFACE_MESH_APPROXIMATION_H
|
||||
|
|
@ -74,6 +74,7 @@ Stream_lines_2 2D Placement of Streamlines
|
|||
Surface_mesh_deformation Triangulated Surface Mesh Deformation
|
||||
Surface_mesher 3D Surface Mesh Generation
|
||||
Surface_mesh Surface Mesh
|
||||
Surface_mesh_approximation Triangulated Surface Mesh Approximation
|
||||
Surface_mesh_parameterization Triangulated Surface Mesh Parameterization
|
||||
Surface_mesh_segmentation Triangulated Surface Mesh Segmentation
|
||||
Surface_mesh_shortest_path Triangulated Surface Mesh Shortest Paths
|
||||
|
|
|
|||
|
|
@ -68,6 +68,8 @@
|
|||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define CGAL_INTERSECTION_FUNCTION(A, B, DIM) \
|
||||
template<typename K> \
|
||||
inline \
|
||||
|
|
@ -143,6 +145,8 @@ template<typename B>
|
|||
class IT<Bbox_3, B> : public Intersection_traits< typename Kernel_traits<B>::Kernel, CGAL::Bbox_3, B >
|
||||
{ };
|
||||
|
||||
|
||||
namespace Intersections {
|
||||
namespace internal {
|
||||
|
||||
// this function is used to call either make_object or a
|
||||
|
|
@ -246,7 +250,8 @@ do_intersect_impl(const A& a, const B& b, Dynamic_dimension_tag) {
|
|||
return Kernel().do_intersect_d_object()(a, b);
|
||||
}
|
||||
|
||||
} // internal
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
// See overloads in the respective header files
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,46 @@
|
|||
// Copyright (c) 2018 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$
|
||||
// SPDX-License-Identifier: LGPL-3.0+
|
||||
//
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
//
|
||||
|
||||
#ifndef CGAL_INTERSECTIONS_2_BBOX_2_CIRCLE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_BBOX_2_CIRCLE_2_H
|
||||
|
||||
#include <CGAL/Bbox_2.h>
|
||||
#include <CGAL/Circle_2.h>
|
||||
|
||||
#include <CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template<typename K>
|
||||
bool do_intersect(const CGAL::Bbox_2& a,
|
||||
const Circle_2<K>& b) {
|
||||
return K().do_intersect_2_object()(a, b);
|
||||
}
|
||||
|
||||
template<typename K>
|
||||
bool do_intersect(const Circle_2<K>& a,
|
||||
const CGAL::Bbox_2& b) {
|
||||
return K().do_intersect_2_object()(a, b);
|
||||
}
|
||||
|
||||
}
|
||||
#endif // CGAL_INTERSECTIONS_2_BBOX_2_CIRCLE_2_H
|
||||
|
|
@ -24,13 +24,11 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_BBOX_2_LINE_2_INTERSECTION_H
|
||||
#define CGAL_BBOX_2_LINE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_BBOX_2_LINE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_BBOX_2_LINE_2_H
|
||||
|
||||
#include <CGAL/Bbox_2.h>
|
||||
#include <CGAL/Line_2.h>
|
||||
//#include <CGAL/Segment_2.h>
|
||||
//#include <CGAL/Point_2.h>
|
||||
#include <CGAL/kernel_assertions.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
|
||||
|
|
@ -98,7 +96,7 @@ inline bool do_intersect(
|
|||
} //namespace CGAL
|
||||
|
||||
#ifdef CGAL_HEADER_ONLY
|
||||
#include <CGAL/Bbox_2_Line_2_intersection_impl.h>
|
||||
#include <CGAL/Intersections_2/internal/Bbox_2_Line_2_intersection_impl.h>
|
||||
#endif // CGAL_HEADER_ONLY
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,97 @@
|
|||
// Copyright (c) 2010 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$
|
||||
// SPDX-License-Identifier: LGPL-3.0+
|
||||
//
|
||||
//
|
||||
// Author(s) : Sebastien Loriot
|
||||
//
|
||||
|
||||
#ifndef CGAL_INTERSECTIONS_2_BBOX_2_POINT_2_H
|
||||
#define CGAL_INTERSECTIONS_2_BBOX_2_POINT_2_H
|
||||
|
||||
#include <CGAL/Bbox_2.h>
|
||||
#include <CGAL/Point_2.h>
|
||||
|
||||
#include <CGAL/Intersections_2/Iso_rectangle_2_Point_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template<typename K>
|
||||
bool do_intersect(const CGAL::Bbox_2& a,
|
||||
const Point_2<K>& b)
|
||||
{
|
||||
Point_2<K> bl(a.xmin(), a.ymin()), tr(a.xmax(), a.ymax());
|
||||
|
||||
Iso_rectangle_2<K> ic(bl,tr);
|
||||
return K().do_intersect_2_object()(ic, b);
|
||||
}
|
||||
|
||||
|
||||
template<typename K>
|
||||
bool do_intersect(const Point_2<K>& a,
|
||||
const CGAL::Bbox_2& b)
|
||||
{
|
||||
return do_intersect(b,a);
|
||||
}
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template<typename K>
|
||||
typename CGAL::Intersection_traits<K, typename K::Point_2, CGAL::Bbox_2>::result_type
|
||||
intersection(const Point_2<K>& a,
|
||||
const CGAL::Bbox_2& b)
|
||||
{
|
||||
if (do_intersect(a,b))
|
||||
return Intersections::internal::intersection_return<typename K::Intersect_2, typename K::Point_2, CGAL::Bbox_2>(a);
|
||||
return Intersections::internal::intersection_return<typename K::Intersect_2, typename K::Point_2, CGAL::Bbox_2>();
|
||||
}
|
||||
|
||||
|
||||
template<typename K>
|
||||
typename CGAL::Intersection_traits<K, CGAL::Bbox_2, typename K::Point_2>::result_type
|
||||
intersection(const CGAL::Bbox_2& b,
|
||||
const typename K::Point_2 & a,
|
||||
const K& /*k*/ )
|
||||
{
|
||||
if (do_intersect(a,b))
|
||||
return Intersections::internal::intersection_return<typename K::Intersect_2, CGAL::Bbox_2, typename K::Point_2>(a);
|
||||
return Intersections::internal::intersection_return<typename K::Intersect_2, CGAL::Bbox_2, typename K::Point_2>();
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
template<typename K>
|
||||
typename CGAL::Intersection_traits<K, Bbox_2, Point_2<K> >::result_type
|
||||
intersection(const Bbox_2& b,
|
||||
const Point_2<K> & a)
|
||||
{
|
||||
return Intersections::internal::intersection(b,a,K());
|
||||
}
|
||||
|
||||
template<typename K>
|
||||
typename CGAL::Intersection_traits<K, Bbox_2, Point_2<K> >::result_type
|
||||
intersection(const Point_2<K> & a,
|
||||
const Bbox_2& b)
|
||||
{
|
||||
return Intersections::internal::intersection(b,a,K());
|
||||
}
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_INTERSECTIONS_2_BBOX_2_POINT_2_H
|
||||
|
|
@ -24,8 +24,8 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_RAY_2_BBOX_2_INTERSECTION_H
|
||||
#define CGAL_RAY_2_BBOX_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_BBOX_2_RAY_2_H
|
||||
#define CGAL_INTERSECTIONS_BBOX_2_RAY_2_H
|
||||
|
||||
#include <CGAL/Bbox_2.h>
|
||||
#include <CGAL/Ray_2.h>
|
||||
|
|
@ -77,7 +77,7 @@ inline bool do_intersect_ray_2(
|
|||
} //namespace CGAL
|
||||
|
||||
#ifdef CGAL_HEADER_ONLY
|
||||
#include <CGAL/Ray_2_Bbox_2_intersection_impl.h>
|
||||
#include <CGAL/Intersections_2/internal/Ray_2_Bbox_2_intersection_impl.h>
|
||||
#endif // CGAL_HEADER_ONLY
|
||||
|
||||
#endif
|
||||
|
|
@ -24,14 +24,16 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_CIRCLE_2_CIRCLE_2_INTERSECTION_H
|
||||
#define CGAL_CIRCLE_2_CIRCLE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_CIRCLE_2_CIRCLE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_CIRCLE_2_CIRCLE_2_H
|
||||
|
||||
#include <CGAL/Circle_2.h>
|
||||
#include <CGAL/squared_distance_2_1.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -49,6 +51,7 @@ do_intersect(const typename K::Circle_2 & circ1,
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
template <class K>
|
||||
inline
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
// Copyright (c) 2018 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$
|
||||
// SPDX-License-Identifier: LGPL-3.0+
|
||||
//
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
//
|
||||
|
||||
#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_CIRCLE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_CIRCLE_2_H
|
||||
|
||||
#include <CGAL/Iso_rectangle_2.h>
|
||||
#include <CGAL/Circle_2.h>
|
||||
|
||||
#include <CGAL/Intersections_2/internal/Bbox_2_Circle_2_do_intersect.h>
|
||||
|
||||
namespace CGAL {
|
||||
CGAL_DO_INTERSECT_FUNCTION(Iso_rectangle_2, Circle_2, 2)
|
||||
}
|
||||
|
||||
#endif // CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_CIRCLE_2_H
|
||||
|
|
@ -24,15 +24,15 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_CIRCLE_2_LINE_2_INTERSECTION_H
|
||||
#define CGAL_CIRCLE_2_LINE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_CIRCLE_2_LINE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_CIRCLE_2_LINE_2_H
|
||||
|
||||
#include <CGAL/Circle_2.h>
|
||||
#include <CGAL/Line_2.h>
|
||||
#include <CGAL/squared_distance_2_1.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -54,6 +54,7 @@ do_intersect(const typename K::Line_2& l,
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
template <class K>
|
||||
inline
|
||||
|
|
@ -0,0 +1,86 @@
|
|||
// Copyright (c) 2018 INRIA Sophia-Antipolis (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 3 of the License,
|
||||
// or (at your option) any later version.
|
||||
//
|
||||
// Licensees holding a valid commercial license may use this file in
|
||||
// accordance with the commercial license agreement provided with the software.
|
||||
//
|
||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0+
|
||||
//
|
||||
//
|
||||
// Author(s) : Maxime Gimeno
|
||||
|
||||
#ifndef CGAL_INTERSECTIONS_2_POINT_2_CIRCLE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_POINT_2_CIRCLE_2_H
|
||||
|
||||
#include <CGAL/Circle_2.h>
|
||||
#include <CGAL/Point_2.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
inline
|
||||
bool
|
||||
do_intersect(const typename K::Point_2 &pt,
|
||||
const typename K::Circle_2 &circle,
|
||||
const K&)
|
||||
{
|
||||
return circle.has_on_boundary(pt);
|
||||
}
|
||||
|
||||
|
||||
template <class K>
|
||||
inline
|
||||
bool
|
||||
do_intersect(const typename K::Circle_2 &circle,
|
||||
const typename K::Point_2 &pt,
|
||||
const K&)
|
||||
{
|
||||
return circle.has_on_boundary(pt);
|
||||
}
|
||||
|
||||
|
||||
template <class K>
|
||||
typename CGAL::Intersection_traits
|
||||
<K, typename K::Point_2, typename K::Circle_2>::result_type
|
||||
intersection(const typename K::Point_2 &pt,
|
||||
const typename K::Circle_2 &circle,
|
||||
const K& k)
|
||||
{
|
||||
if (do_intersect(pt,circle, k))
|
||||
return intersection_return<typename K::Intersect_2, typename K::Point_2, typename K::Circle_2>(pt);
|
||||
return intersection_return<typename K::Intersect_2, typename K::Point_2, typename K::Circle_2>();
|
||||
}
|
||||
|
||||
template <class K>
|
||||
typename CGAL::Intersection_traits
|
||||
<K, typename K::Circle_2, typename K::Point_2>::result_type
|
||||
intersection(const typename K::Circle_2 &circle,
|
||||
const typename K::Point_2 &pt,
|
||||
const K& k)
|
||||
{
|
||||
return internal::intersection(pt, circle, k);
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION(Point_2, Circle_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION(Circle_2, Point_2, 2)
|
||||
|
||||
} //namespace CGAL
|
||||
#endif // CGAL_INTERSECTIONS_2_POINT_2_CIRCLE_2_H
|
||||
|
|
@ -24,14 +24,16 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_ISO_RECTANGLE_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#define CGAL_ISO_RECTANGLE_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_ISO_RECTANGLE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_ISO_RECTANGLE_2_H
|
||||
|
||||
#include <CGAL/Iso_rectangle_2.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -89,6 +91,7 @@ do_intersect(const typename K::Iso_rectangle_2 &irect1,
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION_SELF(Iso_rectangle_2, 2)
|
||||
|
|
@ -24,14 +24,13 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_LINE_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#define CGAL_LINE_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_LINE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_LINE_2_H
|
||||
|
||||
#include <CGAL/disable_warnings.h>
|
||||
|
||||
#include <CGAL/Line_2.h>
|
||||
#include <CGAL/Iso_rectangle_2.h>
|
||||
#include <CGAL/Line_2.h>
|
||||
#include <CGAL/kernel_assertions.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
|
|
@ -39,6 +38,8 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -219,6 +220,7 @@ intersection(const typename K::Iso_rectangle_2 &iso,
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION(Line_2, Iso_rectangle_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION(Line_2, Iso_rectangle_2, 2)
|
||||
|
|
@ -24,8 +24,8 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_POINT_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#define CGAL_POINT_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_POINT_2_ISO_RECTANGLE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_POINT_2_ISO_RECTANGLE_2_H
|
||||
|
||||
#include <CGAL/Iso_rectangle_2.h>
|
||||
#include <CGAL/Point_2.h>
|
||||
|
|
@ -33,6 +33,8 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -79,6 +81,7 @@ intersection(const typename K::Iso_rectangle_2 &iso,
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION(Point_2, Iso_rectangle_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION(Point_2, Iso_rectangle_2, 2)
|
||||
|
|
@ -24,21 +24,21 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_RAY_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#define CGAL_RAY_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_RAY_2_H
|
||||
#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_RAY_2_H
|
||||
|
||||
#include <CGAL/disable_warnings.h>
|
||||
|
||||
#include <CGAL/Iso_rectangle_2.h>
|
||||
#include <CGAL/Ray_2.h>
|
||||
#include <CGAL/Segment_2.h>
|
||||
#include <CGAL/Point_2.h>
|
||||
#include <CGAL/kernel_assertions.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -206,6 +206,7 @@ Ray_2_Iso_rectangle_2_pair<K>::intersection_point() const
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION(Ray_2, Iso_rectangle_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION(Ray_2, Iso_rectangle_2, 2)
|
||||
|
|
@ -24,20 +24,22 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_SEGMENT_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#define CGAL_SEGMENT_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_SEGMENT_2_H
|
||||
#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_SEGMENT_2_H
|
||||
|
||||
#include <CGAL/disable_warnings.h>
|
||||
|
||||
#include <CGAL/Iso_rectangle_2.h>
|
||||
#include <CGAL/Segment_2.h>
|
||||
#include <CGAL/Point_2.h>
|
||||
#include <CGAL/kernel_assertions.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -232,6 +234,7 @@ inline bool do_intersect(
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION(Segment_2, Iso_rectangle_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION(Segment_2, Iso_rectangle_2, 2)
|
||||
|
|
@ -19,22 +19,24 @@
|
|||
//
|
||||
// Author(s) : Radu Ursu
|
||||
|
||||
#ifndef CGAL_TRIANGLE_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#define CGAL_TRIANGLE_2_ISO_RECTANGLE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_TRIANGLE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_ISO_RECTANGLE_2_TRIANGLE_2_H
|
||||
|
||||
#include <CGAL/Point_2.h>
|
||||
#include <CGAL/Segment_2.h>
|
||||
#include <CGAL/Triangle_2.h>
|
||||
#include <CGAL/Iso_rectangle_2.h>
|
||||
#include <CGAL/Segment_2_Segment_2_intersection.h>
|
||||
#include <CGAL/Intersections_2/Segment_2_Segment_2.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
#include <CGAL/Segment_2_Iso_rectangle_2_intersection.h>
|
||||
#include <CGAL/Intersections_2/Iso_rectangle_2_Segment_2.h>
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
|
||||
namespace CGAL{ namespace internal {
|
||||
namespace CGAL{
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
typename Intersection_traits<K, typename K::Triangle_2, typename K::Iso_rectangle_2>::result_type
|
||||
|
|
@ -331,6 +333,7 @@ namespace CGAL{ namespace internal {
|
|||
}
|
||||
|
||||
} //namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION(Triangle_2, Iso_rectangle_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION(Triangle_2, Iso_rectangle_2, 2)
|
||||
|
|
@ -24,18 +24,22 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_LINE_2_LINE_2_INTERSECTION_H
|
||||
#define CGAL_LINE_2_LINE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_LINE_2_LINE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_LINE_2_LINE_2_H
|
||||
|
||||
#include <CGAL/config.h>
|
||||
#include <CGAL/Line_2.h>
|
||||
#include <CGAL/Point_2.h>
|
||||
#include <CGAL/kernel_assertions.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
class Cartesian_tag;
|
||||
class Homogeneous_tag;
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -202,6 +206,7 @@ Line_2_Line_2_pair<K>::intersection_line() const
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION_SELF(Line_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION_SELF(Line_2, 2)
|
||||
|
|
@ -24,8 +24,8 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_POINT_2_LINE_2_INTERSECTION_H
|
||||
#define CGAL_POINT_2_LINE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_POINT_2_LINE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_POINT_2_LINE_2_H
|
||||
|
||||
#include <CGAL/Line_2.h>
|
||||
#include <CGAL/Point_2.h>
|
||||
|
|
@ -33,6 +33,8 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -77,6 +79,8 @@ intersection(const typename K::Line_2 &line,
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION(Point_2, Line_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION(Point_2, Line_2, 2)
|
||||
|
|
@ -24,19 +24,21 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_RAY_2_LINE_2_INTERSECTION_H
|
||||
#define CGAL_RAY_2_LINE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_LINE_2_RAY_2_H
|
||||
#define CGAL_INTERSECTIONS_2_LINE_2_RAY_2_H
|
||||
|
||||
#include <CGAL/Line_2.h>
|
||||
#include <CGAL/Ray_2.h>
|
||||
#include <CGAL/Point_2.h>
|
||||
#include <CGAL/kernel_assertions.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
#include <CGAL/Line_2_Line_2_intersection.h>
|
||||
#include <CGAL/Intersections_2/Line_2_Line_2.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -166,6 +168,7 @@ Ray_2_Line_2_pair<K>::intersection_ray() const
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION(Ray_2, Line_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION(Ray_2, Line_2, 2)
|
||||
|
|
@ -24,19 +24,20 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_SEGMENT_2_LINE_2_INTERSECTION_H
|
||||
#define CGAL_SEGMENT_2_LINE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_SEGMENT_2_LINE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_SEGMENT_2_LINE_2_H
|
||||
|
||||
#include <CGAL/Line_2.h>
|
||||
#include <CGAL/Segment_2.h>
|
||||
#include <CGAL/Point_2.h>
|
||||
#include <CGAL/kernel_assertions.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
#include <CGAL/Line_2_Line_2_intersection.h>
|
||||
#include <CGAL/Intersections_2/Line_2_Line_2.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -159,6 +160,7 @@ Segment_2_Line_2_pair<K>::intersection_segment() const
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION(Segment_2, Line_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION(Segment_2, Line_2, 2)
|
||||
|
|
@ -24,20 +24,22 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_LINE_2_TRIANGLE_2_INTERSECTION_H
|
||||
#define CGAL_LINE_2_TRIANGLE_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_LINE_2_TRIANGLE_2_H
|
||||
#define CGAL_INTERSECTIONS_2_LINE_2_TRIANGLE_2_H
|
||||
|
||||
#include <CGAL/Line_2.h>
|
||||
#include <CGAL/Segment_2.h>
|
||||
#include <CGAL/Triangle_2.h>
|
||||
#include <CGAL/Point_2.h>
|
||||
#include <CGAL/Straight_2.h>
|
||||
#include <CGAL/Intersections_2/internal/Straight_2.h>
|
||||
#include <CGAL/kernel_assertions.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -194,6 +196,7 @@ intersection(const typename K::Triangle_2 &tr,
|
|||
}
|
||||
|
||||
} // namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION(Line_2, Triangle_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION(Line_2, Triangle_2, 2)
|
||||
|
|
@ -24,14 +24,16 @@
|
|||
// Author(s) : Geert-Jan Giezeman
|
||||
|
||||
|
||||
#ifndef CGAL_POINT_2_POINT_2_INTERSECTION_H
|
||||
#define CGAL_POINT_2_POINT_2_INTERSECTION_H
|
||||
#ifndef CGAL_INTERSECTIONS_2_POINT_2_POINT_2_H
|
||||
#define CGAL_INTERSECTIONS_2_POINT_2_POINT_2_H
|
||||
|
||||
#include <CGAL/Point_2.h>
|
||||
#include <CGAL/Intersection_traits_2.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace Intersections {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K>
|
||||
|
|
@ -55,6 +57,7 @@ intersection(const typename K::Point_2 &pt1,
|
|||
}
|
||||
|
||||
}// namespace internal
|
||||
} // namespace Intersections
|
||||
|
||||
CGAL_INTERSECTION_FUNCTION_SELF(Point_2, 2)
|
||||
CGAL_DO_INTERSECT_FUNCTION_SELF(Point_2, 2)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue