FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
NetCdfSeafloorBathymetry.h
1#pragma once
2
3#include "util/NetCDFParser.h"
4
5#include <marenv/seafloor/BathymetryField.h>
6#include <cstdint>
7#include <memory>
8#include <string>
9#include <vector>
10
11namespace environmentmodels
12{
13
22{
23public:
28 explicit NetCdfSeafloorBathymetry(const std::string& filename);
29
32
42 [[nodiscard]] std::unique_ptr<NetCdfSeafloorBathymetry> MakeVisualTerrain(std::uint32_t seed) const;
43
52 [[nodiscard]] marenv::Status GetDepth(const double pos[2], double& depthOut) override;
53
63 [[nodiscard]] marenv::Status ComputeSurfaceUnitNormal(const double pos[2], double unitNormalOut[3]) override;
64
71 [[nodiscard]] marenv::Status GetSoilState(const double pos[3], marenv::seafloor::SoilState& soilOut) override;
72
77 const netcdf_sinmod::Grid& GetGrid() const { return m_grid; }
78
83 const double* GetDepthMap() const { return m_depthMap.data(); }
84
89 double GetLengthX() const { return m_length_x; }
90
95 double GetLengthY() const { return m_length_y; }
96
97private:
103 NetCdfSeafloorBathymetry(const netcdf_sinmod::Grid& grid, std::vector<double> depthMap);
104
110 double GetDepthInternal(const double pos[2]) const;
111
118 double DepthSlope(const double pos[2], int axis) const;
119
120 netcdf_sinmod::Grid m_grid {};
121 std::vector<double> m_depthMap;
122 double m_length_x = 0.0;
123 double m_length_y = 0.0;
124};
125
126} // namespace environmentmodels
Definition NetCdfSeafloorBathymetry.h:22
marenv::Status GetSoilState(const double pos[3], marenv::seafloor::SoilState &soilOut) override
NetCdfSeafloorBathymetry(const NetCdfSeafloorBathymetry &)=delete
Nothing copies it: MakeVisualTerrain builds a new one.
const netcdf_sinmod::Grid & GetGrid() const
Definition NetCdfSeafloorBathymetry.h:77
const double * GetDepthMap() const
Definition NetCdfSeafloorBathymetry.h:83
std::unique_ptr< NetCdfSeafloorBathymetry > MakeVisualTerrain(std::uint32_t seed) const
marenv::Status ComputeSurfaceUnitNormal(const double pos[2], double unitNormalOut[3]) override
NetCdfSeafloorBathymetry(const std::string &filename)
double GetLengthX() const
Definition NetCdfSeafloorBathymetry.h:89
marenv::Status GetDepth(const double pos[2], double &depthOut) override
double GetLengthY() const
Definition NetCdfSeafloorBathymetry.h:95
NetCdfSeafloorBathymetry & operator=(const NetCdfSeafloorBathymetry &)=delete
See the copy constructor.
Definition BathymetryField.h:25
Status
Definition marenv.h:44
Environment SimObjects.
Definition Environment.h:30
Definition SoilState.h:14
Grid dimensions structure.
Definition NetCDFParser.h:23