30#include "MeshKernel/AveragingStrategies/AveragingStrategy.hpp"
31#include "MeshKernel/Definitions.hpp"
32#include "MeshKernel/Mesh2D.hpp"
33#include "MeshKernel/MeshInterpolation.hpp"
34#include "MeshKernel/Utilities/RTreeBase.hpp"
99 std::vector<Sample>& samples,
102 double relativeSearchRadius,
103 bool useClosestSampleIfNoneAvailable,
104 bool subtractSampleValues,
112 static constexpr UInt DefaultMaximumCacheSize = 100;
118 double ComputeOnPolygon(
const std::vector<Point>& polygon,
119 const Point& interpolationPoint);
122 void DecreaseValueOfSamples();
128 [[nodiscard]] std::vector<Point> GetSearchPolygon(std::vector<Point>
const& polygon,
Point const& interpolationPoint)
const;
134 [[nodiscard]]
double ComputeInterpolationResultFromNeighbors(
const Point& interpolationPoint, std::vector<Point>
const& searchPolygon);
139 [[nodiscard]]
double GetSampleValueFromRTree(
UInt index);
145 [[nodiscard]]
double GetSearchRadiusSquared(std::vector<Point>
const& searchPolygon,
146 Point const& interpolationPoint)
const;
149 std::vector<Sample>& m_samples;
151 double m_relativeSearchRadius;
152 bool m_useClosestSampleIfNoneAvailable =
false;
153 bool m_transformSamples =
false;
154 std::vector<Sample> m_interpolationSampleCache;
156 std::unique_ptr<RTreeBase> m_samplesRtree;
157 std::unique_ptr<averaging::AveragingStrategy> m_strategy;
The class used to interpolate based on averaging.
Definition AveragingInterpolation.hpp:76
Method
Averaging methods.
Definition AveragingInterpolation.hpp:80
@ Closest
Takes the value of the closest sample to the interpolation location.
@ Max
Takes the maximum sample value.
@ MinAbsValue
Computes the minimum absolute value.
@ SimpleAveraging
Computes a simple mean.
@ Min
Takes the minimum sample value.
@ InverseWeightedDistance
Computes the inverse weighted sample mean.
void Compute() override
Compute interpolation.
AveragingInterpolation(Mesh2D &mesh, std::vector< Sample > &samples, Method method, Location locationType, double relativeSearchRadius, bool useClosestSampleIfNoneAvailable, bool subtractSampleValues, UInt minNumSamples)
Interpolation based on averaging.
A class derived from Mesh, which describes unstructures 2d meshes.
Definition Mesh2D.hpp:58
A class describing an unstructured mesh. This class contains the shared functionality between 1d or 2...
Definition Mesh.hpp:99
Interface for interpolation methods.
Definition MeshInterpolation.hpp:43
A struct describing a point in a two-dimensional space.
Definition Point.hpp:41
A struct describing a sample with two coordinates and a value.
Definition Entities.hpp:102
Contains the logic of the C++ static library.
Definition AveragingInterpolation.hpp:37
Location
Mesh locations enumeration.
Definition Definitions.hpp:76
std::uint32_t UInt
Integer type used when indexing mesh graph entities.
Definition Definitions.hpp:39