FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
marenv::terrain::TerrainField Class Referenceabstract

#include <TerrainField.h>

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

Public Member Functions

virtual Status GetElevation (const double pos[2], double &zOut) const =0
 
virtual Status ComputeSurfaceUnitNormal (const double pos[2], double nOut[3]) const
 
virtual double Spacing () const =0
 The horizontal size of the field's detail [m], > 0: of several fields covering a point, the finest is used.
 
virtual bool Covers (const double pos[2]) const
 

Detailed Description

The ground above the sea: the land's elevation at a horizontal position (owner decision D-F of fhsim_environment's doc/plans/volumetric-fog-and-media.md), for whoever cares (fog that pools in hollows, a vessel's grounding check above the sea level, a line of sight), at the modest fidelity of a marine simulator.

Elevations are NED: z is negative above the mean sea level (a hill 120 m high is z = -120). A field that has no ground at a position (the sea, outside its extent, a hole in its data) returns Status::NOT_APPLICABLE_NOT_SET and z = +infinity, so z < pos[2] never holds there. The seabed is the bathymetry's (seafloor::BathymetryField), not this.

Queries are const and thread-safe; a field is set up before the simulation starts (EnvironmentFacade::AddTerrainField).

Member Function Documentation

◆ ComputeSurfaceUnitNormal()

virtual Status marenv::terrain::TerrainField::ComputeSurfaceUnitNormal ( const double  pos[2],
double  nOut[3] 
) const
virtual

The ground's upward unit normal, NED (pointing up: its z component is negative).

Parameters
[in]posHorizontal position [m].
[out]nOutThe unit normal; (0, 0, -1) where there is no ground.
Returns
As GetElevation(). The default takes central differences of GetElevation() half a Spacing() apart.

◆ Covers()

virtual bool marenv::terrain::TerrainField::Covers ( const double  pos[2]) const
inlinevirtual

Whether the field has data at a position (ground or sea): of several fields, the finest that covers a point decides it, its sea included. The default: wherever GetElevation() returns Status::OK.

Reimplemented in marenv::terrain::GridTerrain.

◆ GetElevation()

virtual Status marenv::terrain::TerrainField::GetElevation ( const double  pos[2],
double &  zOut 
) const
pure virtual

The ground's elevation at a horizontal position.

Parameters
[in]posHorizontal position (x north, y east) [m].
[out]zOutThe ground's z [m], NED (negative above the sea level); +infinity where there is none.
Returns
Status::OK, or Status::NOT_APPLICABLE_NOT_SET where the field has no ground (zOut = +infinity).

Implemented in marenv::terrain::GridTerrain.

◆ Spacing()

virtual double marenv::terrain::TerrainField::Spacing ( ) const
pure virtual

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