Wildmeshing Toolkit
PositionMapEvaluator.cpp
Go to the documentation of this file.
2 #include <wmtk/function/PerSimplexDifferentiableAutodiffFunction.hpp>
3 #include <wmtk/image/Image.hpp>
4 #include <wmtk/image/Sampling.hpp>
5 #include <wmtk/image/bicubic_interpolation.hpp>
6 
7 
8 namespace wmtk::function::utils {
9 
12 PositionMapEvaluator::PositionMapEvaluator(PositionMapEvaluator&&) =
13  default; // move assignment operator
14 PositionMapEvaluator& PositionMapEvaluator::operator=(PositionMapEvaluator&&) =
15  default; // move assignment operator
16 
24 {
25  m_sampling = std::make_unique<wmtk::image::SamplingBicubic>(image);
26 }
27 
29  const wmtk::image::SamplingAnalyticFunction::FunctionType type,
30  const double a,
31  const double b,
32  const double c)
33 {
34  m_sampling = std::make_unique<wmtk::image::SamplingAnalyticFunction>(type, a, b, c);
35 }
36 /*
37 template <typename T>
38 Vector3<T> PositionMapEvaluator::uv_to_pos(const Vector2<T>& uv) const
39 {
40  return Vector3<T>(uv.x(), uv.y(), m_sampling->sample(uv.x(), uv.y()));
41 }
42 
43 template <>
44 Vector3<double> PositionMapEvaluator::uv_to_pos(const Vector2<double>& uv) const;
45 
46 
47 template <>
48 auto PositionMapEvaluator::uv_to_pos(const
49 Vector2<wmtk::function::PerSimplexDifferentiableAutodiffFunction::DScalar>& uv) const ->
50 Vector3<wmtk::function::PerSimplexDifferentiableAutodiffFunction::DScalar>;
51  */
52 } // namespace wmtk::function::utils
std::unique_ptr< wmtk::image::Sampling > m_sampling
PositionMapEvaluator & operator=(PositionMapEvaluator &&)