1#if TATOOINE_CGAL_AVAILABLE
2#ifndef TATOOINE_DETAIL_POINTSET_NATURAL_NEIGHBOR_COORDINATES_SAMPLER_H
3#define TATOOINE_DETAIL_POINTSET_NATURAL_NEIGHBOR_COORDINATES_SAMPLER_H
5#include <CGAL/natural_neighbor_coordinates_2.h>
6#include <CGAL/natural_neighbor_coordinates_3.h>
12template <
floating_po
int Real, std::
size_t NumDimensions,
typename T>
14 :
field<natural_neighbor_coordinates_sampler<Real, NumDimensions, T>, Real,
25 typename pointset_type::template typed_vertex_property_type<T>;
27 using cgal_kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
38 using cgal_point =
typename cgal_triangulation_type::Point;
49 auto points = std::vector<std::pair<cgal_point, vertex_handle>>{};
50 points.reserve(ps.
vertices().size());
51 [&]<std::size_t... Is>(std::index_sequence<Is...> ) {
53 auto const &p = ps[v];
59 (std::make_index_sequence<NumDimensions>{});
78 template <std::
size_t... Is>
80 std::index_sequence<Is...> ) const
84 NumDimensions,
typename cgal_triangulation_type::Geom_traits,
85 typename cgal_triangulation_type::Triangulation_data_structure>(
90 auto const norm = 1 / result.second;
92 for (
auto const &[
handle, coeff] : coords) {
101 return evaluate(x, std::make_index_sequence<NumDimensions>{});
delaunay_triangulation< NumDimensions, Traits, triangulation_data_structure< NumDimensions, Traits, triangulation_vertex_base_with_info< NumDimensions, Info, Traits >, SimplexBase > > delaunay_triangulation_with_info
Definition: delaunay_triangulation.h:50
CGAL::Delaunay_triangulation_cell_base_with_circumcenter_3< Traits, SimplexBase > delaunay_triangulation_simplex_base_with_circumcenter
Definition: triangulation_simplex_base.h:44
auto natural_neighbor_coordinates(delaunay_triangulation< NumDimensions, Traits, TriangulationDataStructure > const &triangulation, typename delaunay_triangulation< NumDimensions, Traits, TriangulationDataStructure >::Point const &query)
Definition: natural_neighbor_coordinates.h:19
Definition: inverse_distance_weighting_sampler.h:4
auto begin(Range &&range)
Definition: iterator_facade.h:318
auto end(Range &&range)
Definition: iterator_facade.h:322
constexpr auto norm(base_tensor< Tensor, T, N > const &t, unsigned p=2) -> T
Definition: norm.h:23
Definition: natural_neighbor_coordinates_sampler.h:15
typename cgal_triangulation_type::Point cgal_point
Definition: natural_neighbor_coordinates_sampler.h:38
auto evaluate(pos_type const &x, real_type const) const -> tensor_type
Definition: natural_neighbor_coordinates_sampler.h:99
std::conditional_t< NumDimensions==2, cgal::delaunay_triangulation_with_info< 2, vertex_handle, cgal_kernel >, std::conditional_t< NumDimensions==3, cgal::delaunay_triangulation_with_info< 3, vertex_handle, cgal_kernel, cgal::delaunay_triangulation_simplex_base_with_circumcenter< 3, cgal_kernel > >, void > > cgal_triangulation_type
Definition: natural_neighbor_coordinates_sampler.h:37
typename pointset_type::template typed_vertex_property_type< T > vertex_property_type
Definition: natural_neighbor_coordinates_sampler.h:25
CGAL::Exact_predicates_inexact_constructions_kernel cgal_kernel
Definition: natural_neighbor_coordinates_sampler.h:27
natural_neighbor_coordinates_sampler(pointset_type const &ps, vertex_property_type const &property)
Definition: natural_neighbor_coordinates_sampler.h:46
pointset_type const & m_pointset
Definition: natural_neighbor_coordinates_sampler.h:41
natural_neighbor_coordinates_sampler(natural_neighbor_coordinates_sampler &&) noexcept=default
vertex_property_type const & m_property
Definition: natural_neighbor_coordinates_sampler.h:42
cgal_triangulation_type m_triangulation
Definition: natural_neighbor_coordinates_sampler.h:43
typename pointset_type::vertex_handle vertex_handle
Definition: natural_neighbor_coordinates_sampler.h:23
auto evaluate(pos_type const &x, std::index_sequence< Is... >) const -> tensor_type
Definition: natural_neighbor_coordinates_sampler.h:79
natural_neighbor_coordinates_sampler(natural_neighbor_coordinates_sampler const &)=default
Real real_type
Definition: field.h:17
vec< real_type, NumDimensions > pos_type
Definition: field.h:20
Tensor tensor_type
Definition: field.h:18
Definition: pointset.h:83
Definition: pointset.h:69
auto vertices() const
Definition: pointset.h:226
static auto constexpr ood_tensor()
Definition: field.h:21