FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
marenv::terrain::GridTerrain Class Reference

#include <GridTerrain.h>

+ Inheritance diagram for marenv::terrain::GridTerrain:
+ Collaboration diagram for marenv::terrain::GridTerrain:

Classes

struct  Grid
 The grid. More...
 

Public Member Functions

 GridTerrain (Grid grid)
 
Status GetElevation (const double pos[2], double &zOut) const override
 TerrainField.
 
double Spacing () const override
 TerrainField: the smaller spacing.
 
bool Covers (const double pos[2]) const override
 TerrainField: inside the grid, in a cell with data at a corner at least.
 
const Grid & GetGrid () const
 The grid.
 
- Public Member Functions inherited from marenv::terrain::TerrainField
virtual Status ComputeSurfaceUnitNormal (const double pos[2], double nOut[3]) const
 

Detailed Description

A regular grid of ground heights, interpolated bilinearly (D-F): the form a site's elevation grid comes in.

Sample (i, j) is at x = x0 + i dx (north), y = y0 + j dy (east), with height heights[j * nx + i] [m] above the sea level (positive up). A height at or below 0 is the sea (or the seabed of a grid that holds both): the ground there is at the sea level, so a coast slopes down into the sea, and a point whose interpolated height is not above 0 has no ground. A NaN height is no data: a cell with no data at its four corners is not covered (Covers(): a hole, which a coarser field fills), and missing corners of a cell with data count as the sea level. Outside the grid there is no ground and no data.

Constructor & Destructor Documentation

◆ GridTerrain()

marenv::terrain::GridTerrain::GridTerrain ( Grid  grid)
explicit
Parameters
[in]gridThe grid.
Exceptions
std::invalid_argumentfor a spacing <= 0, fewer than 2 samples along an axis, or a wrong number of heights.

Member Function Documentation

◆ Covers()

bool marenv::terrain::GridTerrain::Covers ( const double  pos[2]) const
overridevirtual

Reimplemented from marenv::terrain::TerrainField.

◆ GetElevation()

Status marenv::terrain::GridTerrain::GetElevation ( const double  pos[2],
double &  zOut 
) const
overridevirtual

◆ Spacing()

double marenv::terrain::GridTerrain::Spacing ( ) const
overridevirtual

The documentation for this class was generated from the following file: