Ocean
Ocean::Geometry::SpatialDistribution::Array Class Reference

This class implements a base class for data arrays. More...

Inheritance diagram for Ocean::Geometry::SpatialDistribution::Array:

Public Member Functions

Scalar left () const
 Returns the left position of the distribution area. More...
 
Scalar top () const
 Returns the top position of the distribution area. More...
 
Scalar width () const
 Returns the width of the distribution area. More...
 
Scalar height () const
 Returns the height of the distribution area. More...
 
unsigned int horizontalBins () const
 Returns the number of horizontal distribution bins. More...
 
unsigned int verticalBins () const
 Returns the number of vertical distribution bins. More...
 
unsigned int bins () const
 Returns the number of bins this distribution holds. More...
 
unsigned int index (const Scalar x, const Scalar y) const
 Returns the bin index for a given position. More...
 
int horizontalBin (const Scalar x) const
 Returns the horizontal bin of a given horizontal position. More...
 
int verticalBin (const Scalar y) const
 Returns the vertical bin of a given vertical position. More...
 
int clampedHorizontalBin (const Scalar x) const
 Returns the horizontal bin of a given horizontal position. More...
 
int clampedVerticalBin (const Scalar y) const
 Returns the vertical bin of a given vertical position. More...
 
bool isValid () const
 Returns whether this object holds a valid distribution. More...
 
bool operator== (const Array &right) const
 Returns whether two Array objects are identical. More...
 
bool operator!= (const Array &right) const
 Returns whether two Array objects are not identical. More...
 
 operator bool () const
 Returns whether this object holds a valid distribution. More...
 

Protected Member Functions

 Array ()=default
 Creates an empty array object. More...
 
 Array (const Array &object)=default
 Copy constructor. More...
 
 Array (Array &&object) noexcept
 Move constructor. More...
 
 Array (const Scalar left, const Scalar top, const Scalar width, const Scalar height, const unsigned int horizontalBins, const unsigned int verticalBins)
 Creates a new array object. More...
 
Arrayoperator= (const Array &object)
 Assign operator. More...
 
Arrayoperator= (Array &&object) noexcept
 Move operator. More...
 

Protected Attributes

Scalar areaLeft_ = Scalar(0)
 Left position of the distribution area. More...
 
Scalar areaTop_ = Scalar(0)
 Top position of the distribution area. More...
 
Scalar areaWidth_ = Scalar(0)
 Width of the distribution area. More...
 
Scalar areaHeight_ = Scalar(0)
 Height of the distribution area. More...
 
unsigned int horizontalBins_ = 0u
 Number of horizontal distribution bins. More...
 
unsigned int verticalBins_ = 0u
 Number of vertical distribution bins. More...
 
Scalar horizontalPoint2Bin_ = Scalar(0)
 Horizontal position to bin factor. More...
 
Scalar verticalPoint2Bin_ = Scalar(0)
 Vertical position to bin factor. More...
 

Detailed Description

This class implements a base class for data arrays.

Constructor & Destructor Documentation

◆ Array() [1/4]

Ocean::Geometry::SpatialDistribution::Array::Array ( )
protecteddefault

Creates an empty array object.

◆ Array() [2/4]

Ocean::Geometry::SpatialDistribution::Array::Array ( const Array object)
protecteddefault

Copy constructor.

Parameters
objectThe array object to be copied

◆ Array() [3/4]

Ocean::Geometry::SpatialDistribution::Array::Array ( Array &&  object)
inlineprotectednoexcept

Move constructor.

Parameters
objectThe array object to be moved

◆ Array() [4/4]

Ocean::Geometry::SpatialDistribution::Array::Array ( const Scalar  left,
const Scalar  top,
const Scalar  width,
const Scalar  height,
const unsigned int  horizontalBins,
const unsigned int  verticalBins 
)
inlineprotected

Creates a new array object.

Parameters
leftThe left area position, with range (-infinity, infinity)
topThe top area position, with range (-infinity, infinity)
widthThe width of the distribution area, with range (0, infinity)
heightThe height of the distribution area, with range (0, infinity)
horizontalBinsNumber of horizontal distribution bins, with range [1, infinity)
verticalBinsNumber of vertical distribution bins, with range [1, infinity)

Member Function Documentation

◆ bins()

unsigned int Ocean::Geometry::SpatialDistribution::Array::bins ( ) const
inline

Returns the number of bins this distribution holds.

Returns
Bin number

◆ clampedHorizontalBin()

int Ocean::Geometry::SpatialDistribution::Array::clampedHorizontalBin ( const Scalar  x) const
inline

Returns the horizontal bin of a given horizontal position.

Beware: The resulting bin is clamped into the range [0, number of bins - 1).

Parameters
xHorizontal position, with range (-infinity, infinity)
Returns
Horizontal bin, with range [0, horizontalBins() - 1]
See also
horizontalBin().

◆ clampedVerticalBin()

int Ocean::Geometry::SpatialDistribution::Array::clampedVerticalBin ( const Scalar  y) const
inline

Returns the vertical bin of a given vertical position.

Beware: The resulting bin is clamped into the range [0, number of bins - 1).

Parameters
yVertical position, with range (-infinity, infinity)
Returns
Vertical bin, with range [0, verticalBins() - 1]
See also
clampedVerticalBin().

◆ height()

Scalar Ocean::Geometry::SpatialDistribution::Array::height ( ) const
inline

Returns the height of the distribution area.

Returns
Area height

◆ horizontalBin()

int Ocean::Geometry::SpatialDistribution::Array::horizontalBin ( const Scalar  x) const
inline

Returns the horizontal bin of a given horizontal position.

Beware: The resulting bin can exceed the bin-ranges of the array.

Parameters
xHorizontal position, with range (-infinity, infinity)
Returns
Horizontal bin, with range (-infinity, infinity)
See also
clampedHorizontalBin().

◆ horizontalBins()

unsigned int Ocean::Geometry::SpatialDistribution::Array::horizontalBins ( ) const
inline

Returns the number of horizontal distribution bins.

Returns
Number of bins

◆ index()

unsigned int Ocean::Geometry::SpatialDistribution::Array::index ( const Scalar  x,
const Scalar  y 
) const
inline

Returns the bin index for a given position.

Beware: Make sure that the given position is inside the specified range!

Parameters
xHorizontal position, with range [0, width())
yVertical position, with range [0, height())
Returns
Resulting bin index

◆ isValid()

bool Ocean::Geometry::SpatialDistribution::Array::isValid ( ) const
inline

Returns whether this object holds a valid distribution.

Returns
True, if so

◆ left()

Scalar Ocean::Geometry::SpatialDistribution::Array::left ( ) const
inline

Returns the left position of the distribution area.

Returns
Left position

◆ operator bool()

Ocean::Geometry::SpatialDistribution::Array::operator bool ( ) const
inlineexplicit

Returns whether this object holds a valid distribution.

Returns
True, if so

◆ operator!=()

bool Ocean::Geometry::SpatialDistribution::Array::operator!= ( const Array right) const
inline

Returns whether two Array objects are not identical.

Parameters
rightThe second array object to compare
Returns
True, if so

◆ operator=() [1/2]

SpatialDistribution::Array & Ocean::Geometry::SpatialDistribution::Array::operator= ( Array &&  object)
inlineprotectednoexcept

Move operator.

Parameters
objectThe object to be moved
Returns
Reference to this object

◆ operator=() [2/2]

SpatialDistribution::Array & Ocean::Geometry::SpatialDistribution::Array::operator= ( const Array object)
inlineprotected

Assign operator.

Parameters
objectThe object to be assigned
Returns
Reference to this object

◆ operator==()

bool Ocean::Geometry::SpatialDistribution::Array::operator== ( const Array right) const
inline

Returns whether two Array objects are identical.

Parameters
rightThe second array object to compare
Returns
True, if so

◆ top()

Scalar Ocean::Geometry::SpatialDistribution::Array::top ( ) const
inline

Returns the top position of the distribution area.

Returns
Top position

◆ verticalBin()

int Ocean::Geometry::SpatialDistribution::Array::verticalBin ( const Scalar  y) const
inline

Returns the vertical bin of a given vertical position.

Beware: The resulting bin can exceed the bin-ranges of the array.

Parameters
yVertical position, with range (-infinity, infinity)
Returns
Vertical bin, with range (-infinity, infinity)
See also
clampedVerticalBin().

◆ verticalBins()

unsigned int Ocean::Geometry::SpatialDistribution::Array::verticalBins ( ) const
inline

Returns the number of vertical distribution bins.

Returns
Number of bins

◆ width()

Scalar Ocean::Geometry::SpatialDistribution::Array::width ( ) const
inline

Returns the width of the distribution area.

Returns
Area width

Field Documentation

◆ areaHeight_

Scalar Ocean::Geometry::SpatialDistribution::Array::areaHeight_ = Scalar(0)
protected

Height of the distribution area.

◆ areaLeft_

Scalar Ocean::Geometry::SpatialDistribution::Array::areaLeft_ = Scalar(0)
protected

Left position of the distribution area.

◆ areaTop_

Scalar Ocean::Geometry::SpatialDistribution::Array::areaTop_ = Scalar(0)
protected

Top position of the distribution area.

◆ areaWidth_

Scalar Ocean::Geometry::SpatialDistribution::Array::areaWidth_ = Scalar(0)
protected

Width of the distribution area.

◆ horizontalBins_

unsigned int Ocean::Geometry::SpatialDistribution::Array::horizontalBins_ = 0u
protected

Number of horizontal distribution bins.

◆ horizontalPoint2Bin_

Scalar Ocean::Geometry::SpatialDistribution::Array::horizontalPoint2Bin_ = Scalar(0)
protected

Horizontal position to bin factor.

◆ verticalBins_

unsigned int Ocean::Geometry::SpatialDistribution::Array::verticalBins_ = 0u
protected

Number of vertical distribution bins.

◆ verticalPoint2Bin_

Scalar Ocean::Geometry::SpatialDistribution::Array::verticalPoint2Bin_ = Scalar(0)
protected

Vertical position to bin factor.


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