MeshKernel
Loading...
Searching...
No Matches
InterpolatedSamplePropertyCalculator.hpp
1//---- GPL ---------------------------------------------------------------------
2//
3// Copyright (C) Stichting Deltares, 2011-2025.
4//
5// This program is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation version 3.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16//
17// contact: delft3d.support@deltares.nl
18// Stichting Deltares
19// P.O. Box 177
20// 2600 MH Delft, The Netherlands
21//
22// All indications and logos of, and references to, "Delft3D" and "Deltares"
23// are registered trademarks of Stichting Deltares, and remain the property of
24// Stichting Deltares. All rights reserved.
25//
26//------------------------------------------------------------------------------
27
28#pragma once
29
30#include "MeshKernel/Definitions.hpp"
31#include "MeshKernel/Parameters.hpp"
32#include "MeshKernel/SampleInterpolator.hpp"
33
34#include "MeshKernelApi/GeometryList.hpp"
35#include "MeshKernelApi/PropertyCalculator.hpp"
36
37namespace meshkernelapi
38{
39
42 {
43 public:
46 const meshkernel::Projection projection,
47 const meshkernel::InterpolationParameters& interpolationParameters,
48 const int propertyId);
49
51 bool IsValid(const MeshKernelState& state, const meshkernel::Location location) const override;
52
56 void Calculate(const MeshKernelState& state, const meshkernel::Location location, const GeometryList& geometryList) const override;
57
59 int Size(const MeshKernelState& state, const meshkernel::Location location) const override;
60
61 private:
63 std::unique_ptr<meshkernel::SampleInterpolator> m_sampleInterpolator;
64
66 meshkernel::Projection m_projection;
67
69 int m_propertyId = -1;
70 };
71
72} // namespace meshkernelapi
Interpolate the depths at the mesh node points.
Definition InterpolatedSamplePropertyCalculator.hpp:42
void Calculate(const MeshKernelState &state, const meshkernel::Location location, const GeometryList &geometryList) const override
Calculate the edge-length for a mesh.
bool IsValid(const MeshKernelState &state, const meshkernel::Location location) const override
Determine is the calculator can interpolate depth values correctly.
InterpolatedSamplePropertyCalculator(const GeometryList &sampleData, const meshkernel::Projection projection, const meshkernel::InterpolationParameters &interpolationParameters, const int propertyId)
Constructor.
int Size(const MeshKernelState &state, const meshkernel::Location location) const override
Determine the size of the edge-length vector required.
Base class for calculating properties for a mesh.
Definition PropertyCalculator.hpp:44
Projection
Enumerator describing the supported projections.
Definition Definitions.hpp:43
Location
Mesh locations enumeration.
Definition Definitions.hpp:76
Contains all structs and functions exposed at the API level.
Definition BoundingBox.hpp:33
Parameters used by the sample interpolation.
Definition Parameters.hpp:270
A struct used to describe a list of geometries in a C-compatible manner.
Definition GeometryList.hpp:34
The class holding the state of the C API library.
Definition State.hpp:58