FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
WaterMap.h
1#pragma once
2
3#include <memory>
4#include <string>
5#include <vector>
6
7namespace environment
8{
9
32{
33public:
35 static constexpr int kChannels = 3;
36
38 struct Sample
39 {
40 double shelter = 1.0;
41 double flowNorth = 0.0;
42 double flowEast = 0.0;
43 };
44
50 WaterMap(int rows, int cols, double northMin, double eastMin, double spacing, std::vector<float> cells);
51
58 static std::shared_ptr<const WaterMap> Load(const std::string& jsonPath);
59
62 Sample At(double north, double east) const;
63
64 int Rows() const { return m_rows; }
65 int Cols() const { return m_cols; }
66 double NorthMin() const { return m_northMin; }
67 double EastMin() const { return m_eastMin; }
68 double Spacing() const { return m_spacing; }
70 bool HasFlow() const { return m_hasFlow; }
72 const std::vector<float>& Cells() const { return m_cells; }
73
74private:
75 int m_rows;
76 int m_cols;
77 double m_northMin;
78 double m_eastMin;
79 double m_spacing;
80 bool m_hasFlow = false;
81 std::vector<float> m_cells;
82};
83
84} // namespace environment
Definition WaterMap.h:32
static constexpr int kChannels
Channels kept per cell.
Definition WaterMap.h:35
Sample At(double north, double east) const
const std::vector< float > & Cells() const
The cells, rows * cols * kChannels, row 0 south.
Definition WaterMap.h:72
WaterMap(int rows, int cols, double northMin, double eastMin, double spacing, std::vector< float > cells)
static std::shared_ptr< const WaterMap > Load(const std::string &jsonPath)
bool HasFlow() const
True when some cell has a flow.
Definition WaterMap.h:70
Definition FlukeAnchor.h:124
The state at a point.
Definition WaterMap.h:39
double flowNorth
Surface flow [m/s].
Definition WaterMap.h:41
double shelter
0: fully sheltered, 1: open sea.
Definition WaterMap.h:40