Wildmeshing Toolkit
Loading...
Searching...
No Matches
PositionMapEvaluator.hpp
Go to the documentation of this file.
1#pragma once
2#include <memory>
3#include <wmtk/Types.hpp>
4#include <wmtk/image/Sampling.hpp>
5
6namespace wmtk::image {
7class Image;
8class SamplingAnalyticFunction;
9} // namespace wmtk::image
10
11namespace wmtk::function::utils {
13{
14protected:
15 std::unique_ptr<wmtk::image::Sampling> m_sampling;
16
17public:
20 PositionMapEvaluator(PositionMapEvaluator&&); // move assignment operator
21 PositionMapEvaluator& operator=(PositionMapEvaluator&&); // move assignment operator
22
29 PositionMapEvaluator(const image::Image& image);
30
32 const wmtk::image::SamplingAnalyticFunction::FunctionType type,
33 const double a,
34 const double b,
35 const double c);
36
37
38 // Dont forget to update this if we change autodiff tyeps (add declarations in the cpp)
39 template <typename T>
41{
42 return Vector3<T>(uv.x(), uv.y(), m_sampling->sample(uv.x(), uv.y()));
43}
44};
45
46} // namespace wmtk::function::utils
std::unique_ptr< wmtk::image::Sampling > m_sampling
PositionMapEvaluator & operator=(PositionMapEvaluator &&)
Vector3< T > uv_to_pos(const Vector2< T > &uv) const
PositionMapEvaluator(PositionMapEvaluator &&)
Vector< T, 3 > Vector3
Definition Types.hpp:24
Vector< T, 2 > Vector2
Definition Types.hpp:22