diff --git a/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h b/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h index 6512717f475..79c817fd066 100644 --- a/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h +++ b/Jet_fitting_3/doc/Jet_fitting_3/CGAL/Monge_via_jet_fitting.h @@ -13,7 +13,7 @@ the particular information returned depending on the degrees specified for the polynomial fitting and for the Monge form. If `CGAL_EIGEN3_ENABLED` is defined, `LocalKernel` and `SvdTraits` -template parameters have defaults, `Cartesian` and `Eigen_svd` respectively. +template parameters have defaults, `Simple_cartesian` and `Eigen_svd` respectively. \tparam DataKernel provides the geometric classes and tools corresponding to the input points, and also members of the diff --git a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h index ba9d085b37a..9fcccc371c7 100644 --- a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h @@ -51,6 +51,7 @@ namespace internal { /// /// @return Computed normal. Orientation is random. template < typename Kernel, + typename SvdTraits, typename Tree > typename Kernel::Vector_3 @@ -68,7 +69,9 @@ jet_estimate_normal(const typename Kernel::Point_3& query, ///< point to compute typedef typename Neighbor_search::iterator Search_iterator; // types for jet fitting - typedef typename CGAL::Monge_via_jet_fitting Monge_jet_fitting; + typedef Monge_via_jet_fitting< Kernel, + Simple_cartesian, + SvdTraits> Monge_jet_fitting; typedef typename Monge_jet_fitting::Monge_form Monge_form; // Gather set of (k+1) neighboring points. @@ -114,19 +117,22 @@ jet_estimate_normal(const typename Kernel::Point_3& query, ///< point to compute /// /// \pre `k >= 2` /// - +/// /// @tparam ForwardIterator iterator model of the concept of the same name over input points and able to store output normals. /// @tparam PointPMap is a model of `ReadablePropertyMap` with a value_type = Point_3. /// It can be omitted if ForwardIterator value_type is convertible to Point_3. /// @tparam NormalPMap is a model of `WritablePropertyMap` with a value_type = Vector_3. /// @tparam Kernel Geometric traits class. /// It can be omitted and deduced automatically from PointPMap value_type. +/// @tparam SvdTraits template parameter for the class `Monge_via_jet_fitting` that +/// can be ommited in conditions described in the documentation of `Monge_via_jet_fitting`. // This variant requires all parameters. template void jet_estimate_normals( @@ -185,7 +191,7 @@ jet_estimate_normals( // vectors (already normalized) for(it = first; it != beyond; it++) { - Vector normal = internal::jet_estimate_normal( + Vector normal = internal::jet_estimate_normal( #ifdef CGAL_USE_PROPERTY_MAPS_API_V1 get(point_pmap,it), #else @@ -205,6 +211,32 @@ jet_estimate_normals( CGAL_TRACE("End of jet_estimate_normals()\n"); } +#if defined(CGAL_EIGEN3_ENABLED) || defined(CGAL_LAPACK_ENABLED) +/// @cond SKIP_IN_MANUAL +template +void +jet_estimate_normals( + ForwardIterator first, + ForwardIterator beyond, + PointPMap point_pmap, + NormalPMap normal_pmap, + unsigned int k, + const Kernel& kernel, + unsigned int degree_fitting = 2) +{ + #ifdef CGAL_EIGEN3_ENABLED + typedef Eigen_svd SvdTraits; + #else + typedef Lapack_svd SvdTraits; + #endif + jet_estimate_normals( + first, beyond, point_pmap, normal_pmap, k, kernel, degree_fitting); +} + /// @cond SKIP_IN_MANUAL // This variant deduces the kernel from the point property map. template + typename SvdTraits, + typename Tree + > typename Kernel::Point_3 jet_smooth_point( const typename Kernel::Point_3& query, ///< 3D point to project @@ -68,7 +70,9 @@ jet_smooth_point( typedef typename Neighbor_search::iterator Search_iterator; // types for jet fitting - typedef typename CGAL::Monge_via_jet_fitting Monge_jet_fitting; + typedef Monge_via_jet_fitting< Kernel, + Simple_cartesian, + SvdTraits> Monge_jet_fitting; typedef typename Monge_jet_fitting::Monge_form Monge_form; // Gather set of (k+1) neighboring points. @@ -119,11 +123,14 @@ jet_smooth_point( /// It can be omitted if InputIterator value_type is convertible to Point_3. /// @tparam Kernel Geometric traits class. /// It can be omitted and deduced automatically from PointPMap value_type. +/// @tparam SvdTraits template parameter for the class `Monge_via_jet_fitting` that +/// can be ommited in conditions described in the documentation of `Monge_via_jet_fitting`. // This variant requires all parameters. template void jet_smooth_point_set( @@ -174,15 +181,43 @@ jet_smooth_point_set( #ifdef CGAL_USE_PROPERTY_MAPS_API_V1 const Point& p = get(point_pmap, it); put(point_pmap, it , - internal::jet_smooth_point(p,tree,k,degree_fitting,degree_monge) ); + internal::jet_smooth_point( + p,tree,k,degree_fitting,degree_monge) ); #else const Point& p = get(point_pmap, *it); put(point_pmap, *it , - internal::jet_smooth_point(p,tree,k,degree_fitting,degree_monge) ); + internal::jet_smooth_point( + p,tree,k,degree_fitting,degree_monge) ); #endif } } + +#if defined(CGAL_EIGEN3_ENABLED) || defined(CGAL_LAPACK_ENABLED) +/// @cond SKIP_IN_MANUAL +template +void +jet_smooth_point_set( + InputIterator first, ///< iterator over the first input point. + InputIterator beyond, ///< past-the-end iterator over the input points. + PointPMap point_pmap, ///< property map: value_type of InputIterator -> Point_3. + unsigned int k, ///< number of neighbors. + const Kernel& kernel, ///< geometric traits. + unsigned int degree_fitting = 2, ///< fitting degree + unsigned int degree_monge = 2) ///< Monge degree +{ + #ifdef CGAL_EIGEN3_ENABLED + typedef Eigen_svd SvdTraits; + #else + typedef Lapack_svd SvdTraits; + #endif + jet_smooth_point_set( + first, beyond, point_pmap, k, kernel, degree_fitting, degree_monge); +} + /// @cond SKIP_IN_MANUAL // This variant deduces the kernel from the point property map. template +#include + +int main() +{}