#include "hausdorff.h" #include "../../hausdorff.h" #include template < typename DerivedV, typename Kernel, typename Scalar> IGL_INLINE void igl::copyleft::cgal::hausdorff( const Eigen::MatrixBase& V, const CGAL::AABB_tree< CGAL::AABB_traits >::iterator > > > & treeB, const std::vector > & /*TB*/, Scalar & l, Scalar & u) { // Not sure why using `auto` here doesn't work with the `hausdorff` function // parameter but explicitly naming the type does... const std::function dist_to_B = [&treeB]( const double & x, const double & y, const double & z)->double { CGAL::Point_3 query(x,y,z); typename CGAL::AABB_tree< CGAL::AABB_traits >::iterator > > >::Point_and_primitive_id pp = treeB.closest_point_and_primitive(query); return std::sqrt((query-pp.first).squared_length()); }; return igl::hausdorff(V,dist_to_B,l,u); }