LuciadCPillar 2024.0.08
luciad::Bounds Class Referencefinal

Represents a bounds. More...

#include <luciad/geometries/Bounds.h>

Inheritance diagram for luciad::Bounds:
luciad::Geometry

Public Member Functions

 Bounds (Bounds &&other) noexcept
 
 Bounds (const Bounds &other)
 
 Bounds (std::shared_ptr< CoordinateReference > reference, Coordinate location, double width, double height, double depth)
 Creates a new bounds instance based on a point, and the width, height and depth with respect to that point. More...
 
 Bounds (std::shared_ptr< CoordinateReference > reference, Coordinate lowerLeft, Coordinate upperRight)
 Creates a new bounds instance based on lower left and upper right corners. More...
 
 ~Bounds () override
 
Bounds getBounds () const override
 Returns the bounds for the geometry object. More...
 
Coordinate getCenter () const
 Returns the center of this bounds instance. More...
 
double getDepth () const
 Returns the depth of this bounds instance. More...
 
double getHeight () const
 Returns the height of this bounds instance. More...
 
Coordinate getLocation () const
 Returns the lower left corner of this bounds instance. More...
 
Coordinate getLowerLeftCorner () const
 Returns the lower left corner of this bounds instance. More...
 
Coordinate getLowerRightCorner () const
 Returns the lower right corner of this bounds instance. More...
 
std::shared_ptr< luciad::CoordinateReferencegetReference () const override
 Returns the coordinate reference of the geometry. More...
 
Coordinate getUpperLeftCorner () const
 Returns the upper left corner of this bounds instance. More...
 
Coordinate getUpperRightCorner () const
 Returns the upper right corner of this bounds instance. More...
 
double getWidth () const
 Returns the width of this bounds instance. More...
 
bool operator!= (const Bounds &other) const
 
Boundsoperator= (Bounds other)
 
bool operator== (const Bounds &other) const
 
- Public Member Functions inherited from luciad::Geometry
virtual ~Geometry ()=default
 
virtual Bounds getBounds () const =0
 Returns the bounds for the geometry object. More...
 
virtual std::shared_ptr< CoordinateReferencegetReference () const =0
 Returns the coordinate reference of the geometry. More...
 

Static Public Member Functions

static Bounds boundsUnion (const Bounds &bounds1, const Bounds &bounds2)
 Returns the union of the two bounds objects, provided they are defined in the same coordinate reference. More...
 
static bool contains2D (const Bounds &bounds, Coordinate coordinate, double eps=0)
 Checks if this bounds contains the specified coordinate, considering only the x and y values. More...
 
static bool contains2D (const Bounds &bounds1, const Bounds &bounds2, double eps=0)
 Checks if the first bounds contains the second bounds, only considering x and y values. More...
 
static bool contains3D (const Bounds &bounds, Coordinate coordinate, double eps=0)
 Checks if the first bounds contains the second bounds. More...
 
static bool interacts2D (const Bounds &bounds1, const Bounds &bounds2, double eps=0)
 Checks of two given bounds geometries have an interaction, only considering x and y values. More...
 
static std::optional< Boundsintersection2D (const Bounds &bounds1, const Bounds &bounds2)
 Returns the intersection of the two given bounds geometries. More...
 

Protected Member Functions

size_t getHash () const override
 Returns the hash value for this geometry. More...
 
virtual size_t getHash () const =0
 Returns the hash value for this geometry. More...
 

Detailed Description

Represents a bounds.

See also
GeometryFactory::createBounds
Bounds::Bounds

Constructor & Destructor Documentation

◆ ~Bounds()

luciad::Bounds::~Bounds ( )
override

◆ Bounds() [1/4]

luciad::Bounds::Bounds ( const Bounds other)

◆ Bounds() [2/4]

luciad::Bounds::Bounds ( Bounds &&  other)
noexcept

◆ Bounds() [3/4]

luciad::Bounds::Bounds ( std::shared_ptr< CoordinateReference reference,
Coordinate  location,
double  width,
double  height,
double  depth 
)

Creates a new bounds instance based on a point, and the width, height and depth with respect to that point.

Parameters
referencethe coordinate reference
locationthe lower left location of the bounds
widththe width
heightthe height
depththe depth

◆ Bounds() [4/4]

luciad::Bounds::Bounds ( std::shared_ptr< CoordinateReference reference,
Coordinate  lowerLeft,
Coordinate  upperRight 
)

Creates a new bounds instance based on lower left and upper right corners.

This method takes wrap-around the 180° meridian into account when the coordinate reference is geodetic.

Parameters
referencethe coordinate reference
lowerLeftthe lower left corner of the bounds
upperRightthe upper right corner of the bounds

Member Function Documentation

◆ boundsUnion()

static Bounds luciad::Bounds::boundsUnion ( const Bounds bounds1,
const Bounds bounds2 
)
static

Returns the union of the two bounds objects, provided they are defined in the same coordinate reference.

Parameters
bounds1the first bounds.
bounds2the second bounds.
Returns
the union of the two bounds objects.
Exceptions
luciad::InvalidArgumentExceptionif the bounds are not defined in the same coordinate reference.

◆ contains2D() [1/2]

static bool luciad::Bounds::contains2D ( const Bounds bounds,
Coordinate  coordinate,
double  eps = 0 
)
static

Checks if this bounds contains the specified coordinate, considering only the x and y values.

Returns
true if this bounds contains the specified coordinate, considering only the x and y values.

◆ contains2D() [2/2]

static bool luciad::Bounds::contains2D ( const Bounds bounds1,
const Bounds bounds2,
double  eps = 0 
)
static

Checks if the first bounds contains the second bounds, only considering x and y values.

Parameters
bounds1a bounds instance.
bounds2an other bounds instance.
epsa tolerance for the contains check.
Returns
if the first bounds contains the second bounds.
Exceptions
luciad::InvalidArgumentExceptionif the bounds are not defined in the same coordinate reference.

◆ contains3D()

static bool luciad::Bounds::contains3D ( const Bounds bounds,
Coordinate  coordinate,
double  eps = 0 
)
static

Checks if the first bounds contains the second bounds.

Parameters
boundsa bounds instance.
coordinatea coordinate.
epsa tolerance for the contains check.
Returns
true if this bounds contains the specified coordinate.

◆ getBounds()

Bounds luciad::Bounds::getBounds ( ) const
overridevirtual

Returns the bounds for the geometry object.

Returns
the bounds for the geometry object.
Exceptions
luciad::InvalidArgumentExceptionif the bounds could not be computed. For example, when the geometry is defined by invalid points.

Implements luciad::Geometry.

◆ getCenter()

Coordinate luciad::Bounds::getCenter ( ) const

Returns the center of this bounds instance.

When this bounds uses a geodetic reference, this method normalizes the result.

Returns
the center of this bounds instance.

◆ getDepth()

double luciad::Bounds::getDepth ( ) const

Returns the depth of this bounds instance.

Returns
the depth of this bounds instance.

◆ getHash()

size_t luciad::Bounds::getHash ( ) const
overrideprotectedvirtual

Returns the hash value for this geometry.

Returns
the hash value for this geometry.

Implements luciad::Geometry.

◆ getHeight()

double luciad::Bounds::getHeight ( ) const

Returns the height of this bounds instance.

Returns
the height of this bounds instance.

◆ getLocation()

Coordinate luciad::Bounds::getLocation ( ) const

Returns the lower left corner of this bounds instance.

Returns
the lower left corner of this bounds instance.

◆ getLowerLeftCorner()

Coordinate luciad::Bounds::getLowerLeftCorner ( ) const

Returns the lower left corner of this bounds instance.

When this bounds uses a geodetic reference, this method normalizes the result.

Returns
the lower left corner of this bounds instance.

◆ getLowerRightCorner()

Coordinate luciad::Bounds::getLowerRightCorner ( ) const

Returns the lower right corner of this bounds instance.

When this bounds uses a geodetic reference, this method normalizes the result.

Returns
the lower right corner of this bounds instance.

◆ getReference()

std::shared_ptr< luciad::CoordinateReference > luciad::Bounds::getReference ( ) const
overridevirtual

Returns the coordinate reference of the geometry.

Returns
the coordinate reference of the geometry.

Implements luciad::Geometry.

◆ getUpperLeftCorner()

Coordinate luciad::Bounds::getUpperLeftCorner ( ) const

Returns the upper left corner of this bounds instance.

When this bounds uses a geodetic reference, this method normalizes the result.

Returns
the upper left corner of this bounds instance.

◆ getUpperRightCorner()

Coordinate luciad::Bounds::getUpperRightCorner ( ) const

Returns the upper right corner of this bounds instance.

When this bounds uses a geodetic reference, this method normalizes the result.

Returns
the upper right corner of this bounds instance.

◆ getWidth()

double luciad::Bounds::getWidth ( ) const

Returns the width of this bounds instance.

Returns
the width of this bounds instance.

◆ interacts2D()

static bool luciad::Bounds::interacts2D ( const Bounds bounds1,
const Bounds bounds2,
double  eps = 0 
)
static

Checks of two given bounds geometries have an interaction, only considering x and y values.

Parameters
bounds1the first bounds.
bounds2the second bounds.
epsa tolerance for the interaction check.
Returns
true if the two bounds interact in 2D.
Exceptions
luciad::InvalidArgumentExceptionif the bounds are not defined in the same coordinate reference.

◆ intersection2D()

static std::optional< Bounds > luciad::Bounds::intersection2D ( const Bounds bounds1,
const Bounds bounds2 
)
static

Returns the intersection of the two given bounds geometries.

Parameters
bounds1a bounds instance
bounds2an other bounds instance
Returns
the intersection of the given bounds geometries. If geodetic bounds, the result is normalized.

◆ operator!=()

bool luciad::Bounds::operator!= ( const Bounds other) const

◆ operator=()

Bounds & luciad::Bounds::operator= ( Bounds  other)

◆ operator==()

bool luciad::Bounds::operator== ( const Bounds other) const