MeshKernel
Loading...
Searching...
No Matches
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
59} // namespace meshkernelapi
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.
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:58