Heightfield 1.0
Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
AnalyticHeightField Class Reference

A base two-dimensional analytic field of real values. More...

#include <analyticfield.h>

Inheritance diagram for AnalyticHeightField:
AnalyticScalarField2 AnalyticFieldDune AnalyticMusgrave AnalyticRidged

Public Member Functions

 AnalyticHeightField ()
 Empty.
 
virtual double Height (const Vector2 &) const
 Compute elevation at a given point. More...
 
virtual Vector Normal (const Vector2 &) const
 Compute the normal to the field. More...
 
HeightField CreateHeightField (const Box2 &, int, int) const
 Create a HeightField given an input domain. More...
 
double Slope (const Vector2 &) const
 Compute the slope at a given point. More...
 
double AverageSlope (const Vector2 &, int=8) const
 Compute the average slope at a given point. More...
 
double Slope (const Vector2 &, const Vector2 &) const
 Compute the slope in a given direction and at a given point. More...
 
QVector< double > Cross (const Vector2 &, const Vector2 &, int) const
 Compute the elevation along a segment. More...
 

Static Public Member Functions

static double Ridge (const double &, const double &=0.0)
 Ridge function. More...
 

Static Protected Attributes

static double Epsilon = 1e-6
 Epsilon value used for gradient computation. More...
 

Detailed Description

A base two-dimensional analytic field of real values.

Member Function Documentation

◆ AverageSlope()

double AnalyticHeightField::AverageSlope ( const Vector2 p,
int  n = 8 
) const

Compute the average slope at a given point.

Parameters
pThe point.
nNumber of sampling directions.

◆ CreateHeightField()

HeightField AnalyticHeightField::CreateHeightField ( const Box2 box,
int  nx,
int  ny 
) const

Create a HeightField given an input domain.

Parameters
boxThe box.
nx,nyResolution.

◆ Cross()

QVector< double > AnalyticHeightField::Cross ( const Vector2 a,
const Vector2 b,
int  n 
) const

Compute the elevation along a segment.

Parameters
a,bSegment.
nNumber of samples.

◆ Height()

double AnalyticHeightField::Height ( const Vector2 p) const
inlinevirtual

Compute elevation at a given point.

Parameters
pPoint.

Reimplemented in AnalyticFieldDune.

◆ Normal()

Vector AnalyticHeightField::Normal ( const Vector2 p) const
virtual

Compute the normal to the field.

Parameters
pPoint.

◆ Ridge()

double AnalyticHeightField::Ridge ( const double &  z,
const double &  r = 0.0 
)
inlinestatic

Ridge function.

Parameters
zElevation.
rRidge elevation.

◆ Slope() [1/2]

double AnalyticHeightField::Slope ( const Vector2 p) const

Compute the slope at a given point.

This is the maximum slope, which is the norm of the gradient.

See also
AnalyticHeightField::Gradient()
Parameters
pThe point.

◆ Slope() [2/2]

double AnalyticHeightField::Slope ( const Vector2 p,
const Vector2 d 
) const

Compute the slope in a given direction and at a given point.

Parameters
pThe point.
dDirection (should be normalized).

Member Data Documentation

◆ Epsilon

double AnalyticHeightField::Epsilon = 1e-6
staticprotected

Epsilon value used for gradient computation.

Epsilon value used for all fields.