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/Parameters.hpp"
32#include "MeshKernel/SampleInterpolator.hpp"
33
34#include "MeshKernelApi/GeometryList.hpp"
35
36namespace meshkernelapi
37{
38
40 struct MeshKernelState;
41
44 {
45 public:
47 virtual ~PropertyCalculator() = default;
48
50 virtual bool IsValid(const MeshKernelState& state, const meshkernel::Location location) const = 0;
51
53 virtual void Calculate(const MeshKernelState& state, const meshkernel::Location location, const GeometryList& geometryList) const = 0;
54
56 virtual int Size(const MeshKernelState& state, const meshkernel::Location location) const = 0;
57 };
58
61 {
62 public:
66 virtual bool IsValid(const MeshKernelState& state, const meshkernel::Location location) const override;
67
69 void Calculate(const MeshKernelState& state, const meshkernel::Location location, const GeometryList& geometryList) const override;
70
72 int Size(const MeshKernelState& state, const meshkernel::Location location) const override;
73 };
74
77 {
78 public:
82 virtual bool IsValid(const MeshKernelState& state, const meshkernel::Location location) const override;
83
87 void Calculate(const MeshKernelState& state, const meshkernel::Location location, const GeometryList& geometryList) const override;
88
90 int Size(const MeshKernelState& state, const meshkernel::Location location) const override;
91 };
92
95 {
96 public:
99 const meshkernel::Projection projection,
100 const meshkernel::InterpolationParameters& interpolationParameters,
101 const int propertyId);
102
104 bool IsValid(const MeshKernelState& state, const meshkernel::Location location) const override;
105
109 void Calculate(const MeshKernelState& state, const meshkernel::Location location, const GeometryList& geometryList) const override;
110
112 int Size(const MeshKernelState& state, const meshkernel::Location location) const override;
113
114 private:
116 std::unique_ptr<meshkernel::SampleInterpolator> m_sampleInterpolator;
117
119 meshkernel::Projection m_projection;
120
122 int m_propertyId = -1;
123 };
124
125} // namespace meshkernelapi
Calculator for the edge lengths for a mesh.
Definition PropertyCalculator.hpp:77
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:95
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.
Calculator for orthogonality of a mesh.
Definition PropertyCalculator.hpp:61
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:44
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
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