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;
void Compute() override
Compute interpolation.
@ MinAbsValue
Computes the minimum absolute value.
AveragingInterpolation(Mesh2D &mesh, std::vector< Sample > &samples, Method method, Location locationType, double relativeSearchRadius, bool useClosestSampleIfNoneAvailable, bool subtractSampleValues, UInt minNumSamples)
Interpolation based on averaging.
Interface for interpolation methods.
Definition: MeshInterpolation.hpp:42
A class derived from Mesh, which describes unstructures 2d meshes.
Definition: Mesh2D.hpp:55
@ Min
Takes the minimum sample value.
A struct describing a point in a two-dimensional space.
Definition: Point.hpp:40
Location
Mesh locations enumeration.
Definition: Definitions.hpp:74
The class used to interpolate based on averaging.
Definition: AveragingInterpolation.hpp:75
Contains the logic of the C++ static library.
Definition: AveragingInterpolation.hpp:36
A struct describing a sample with two coordinates and a value.
Definition: Entities.hpp:109
std::uint32_t UInt
Integer type used when indexing mesh graph entities.
Definition: Definitions.hpp:38
@ Max
Takes the maximum sample value.
@ InverseWeightedDistance
Computes the inverse weighted sample mean.
Method
Averaging methods.
Definition: AveragingInterpolation.hpp:79
@ Closest
Takes the value of the closest sample to the interpolation location.
A class describing an unstructured mesh. This class contains the shared functionality between 1d or 2...
Definition: Mesh.hpp:98
@ SimpleAveraging
Computes a simple mean.