Loading [MathJax]/extensions/tex2jax.js
MeshKernel
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages Concepts
PropertyCalculator.hpp
1//---- GPL ---------------------------------------------------------------------
2//
3// Copyright (C) Stichting Deltares, 2011-2024.
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/SampleInterpolator.hpp"
32
33#include "MeshKernelApi/GeometryList.hpp"
34#include "MeshKernelApi/State.hpp"
35
36namespace meshkernelapi
37{
38
41 {
42 public:
44 virtual ~PropertyCalculator() = default;
45
47 virtual bool IsValid(const MeshKernelState& state, const meshkernel::Location location) const = 0;
48
50 virtual void Calculate(const MeshKernelState& state, const meshkernel::Location location, const GeometryList& geometryList) const = 0;
51
53 virtual int Size(const MeshKernelState& state, const meshkernel::Location location) const = 0;
54 };
55
58 {
59 public:
63 virtual bool IsValid(const MeshKernelState& state, const meshkernel::Location location) const override;
64
66 void Calculate(const MeshKernelState& state, const meshkernel::Location location, const GeometryList& geometryList) const override;
67
69 int Size(const MeshKernelState& state, const meshkernel::Location location) const override;
70 };
71
74 {
75 public:
79 virtual bool IsValid(const MeshKernelState& state, const meshkernel::Location location) const override;
80
84 void Calculate(const MeshKernelState& state, const meshkernel::Location location, const GeometryList& geometryList) const override;
85
87 int Size(const MeshKernelState& state, const meshkernel::Location location) const override;
88 };
89
92 {
93 public:
96 const meshkernel::Projection projection,
97 const int interpolationType,
98 const int propertyId);
99
101 bool IsValid(const MeshKernelState& state, const meshkernel::Location location) const override;
102
106 void Calculate(const MeshKernelState& state, const meshkernel::Location location, const GeometryList& geometryList) const override;
107
109 int Size(const MeshKernelState& state, const meshkernel::Location location) const override;
110
111 private:
113 std::unique_ptr<meshkernel::SampleInterpolator> m_sampleInterpolator;
114
116 meshkernel::Projection m_projection;
117
119 int m_propertyId = -1;
120 };
121
122} // namespace meshkernelapi
Calculator for the edge lengths for a mesh.
Definition PropertyCalculator.hpp:74
virtual bool IsValid(const MeshKernelState &state, const meshkernel::Location location) const override
Determine is the calculator can compute the desired results correctly.
int Size(const MeshKernelState &state, const meshkernel::Location location) const override
Determine the size of the edge-length vector required.
void Calculate(const MeshKernelState &state, const meshkernel::Location location, const GeometryList &geometryList) const override
Calculate the edge-length for a mesh.
Interpolate the depths at the mesh node points.
Definition PropertyCalculator.hpp:92
InterpolatedSamplePropertyCalculator(const GeometryList &sampleData, const meshkernel::Projection projection, const int interpolationType, const int propertyId)
Constructor.
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.
int Size(const MeshKernelState &state, const meshkernel::Location location) const override
Determine the size of the edge-length vector required.
Calculator for orthogonality of a mesh.
Definition PropertyCalculator.hpp:58
void Calculate(const MeshKernelState &state, const meshkernel::Location location, const GeometryList &geometryList) const override
Calculate the orthogonality for a mesh.
virtual bool IsValid(const MeshKernelState &state, const meshkernel::Location location) const override
Determine is the calculator can compute the desired results correctly.
int Size(const MeshKernelState &state, const meshkernel::Location location) const override
Determine the size of the orthogonality vector required.
Base class for calculating properties for a mesh.
Definition PropertyCalculator.hpp:41
virtual bool IsValid(const MeshKernelState &state, const meshkernel::Location location) const =0
Determine is the calculator can compute the desired results correctly.
virtual int Size(const MeshKernelState &state, const meshkernel::Location location) const =0
Determine the size of the vector required to store the calculated properties.
virtual ~PropertyCalculator()=default
Destructor.
virtual void Calculate(const MeshKernelState &state, const meshkernel::Location location, const GeometryList &geometryList) const =0
Calculate the property.
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
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:56