SFCGAL
SFCGAL::Envelope Class Reference

Represents a bounding box. More...

#include <Envelope.h>

Public Member Functions

 Envelope ()
 default constructor (empty bounding box)
 
 Envelope (const double &xmin, const double &xmax, const double &ymin, const double &ymax)
 2D box constructor with min,max values
 
 Envelope (const double &xmin, const double &xmax, const double &ymin, const double &ymax, const double &zmin, const double &zmax)
 3D box constructor with min,max values
 
 Envelope (const Coordinate &p)
 default constructor (empty bounding box)
 
 Envelope (const Coordinate &p1, const Coordinate &p2)
 default constructor (empty bounding box)
 
 Envelope (const Envelope &other)
 copy constructor
 
Envelopeoperator= (const Envelope &other)
 assign operator
 
 ~Envelope ()
 destructor
 
bool isEmpty () const
 indicates if the bounding box is empty
 
bool is3D () const
 indicates if the bounding box has a 3D component
 
void expandToInclude (const Coordinate &coordinate)
 expand the box to include coordinate
 
const double & xMin () const
 
const double & yMin () const
 
const double & zMin () const
 
const double & xMax () const
 
const double & yMax () const
 
const double & zMax () const
 
detail::IntervalboundsN (const size_t &n)
 returns the n-th bound
 
const detail::IntervalboundsN (const size_t &n) const
 returns the n-th bound
 
CGAL::Bbox_2 toBbox_2 () const
 Convenience function.
 
CGAL::Bbox_3 toBbox_3 () const
 Convenience function.
 
std::unique_ptr< LineStringtoRing () const
 convenience method to convert to 2D Polygon ring
 
std::unique_ptr< PolygontoPolygon () const
 convenience method to convert to 2D Polygon
 
std::unique_ptr< PolyhedralSurfacetoShell () const
 convenience method to convert to 3D Shell
 
std::unique_ptr< SolidtoSolid () const
 convenience method to convert to 3D Solid
 
std::ostream & print (std::ostream &) const
 

Static Public Member Functions

static bool contains (const Envelope &a, const Envelope &b)
 Global binary operator on Envelopes.
 
static bool overlaps (const Envelope &a, const Envelope &b)
 Global binary operator on Envelopes.
 

Detailed Description

Represents a bounding box.

Todo

add asText instead of "print"?

add basic operations (especialy intersects/intersects3D)

Constructor & Destructor Documentation

◆ Envelope() [1/6]

SFCGAL::Envelope::Envelope ( )

default constructor (empty bounding box)

◆ Envelope() [2/6]

SFCGAL::Envelope::Envelope ( const double & xmin,
const double & xmax,
const double & ymin,
const double & ymax )

2D box constructor with min,max values

◆ Envelope() [3/6]

SFCGAL::Envelope::Envelope ( const double & xmin,
const double & xmax,
const double & ymin,
const double & ymax,
const double & zmin,
const double & zmax )

3D box constructor with min,max values

◆ Envelope() [4/6]

SFCGAL::Envelope::Envelope ( const Coordinate & p)

default constructor (empty bounding box)

◆ Envelope() [5/6]

SFCGAL::Envelope::Envelope ( const Coordinate & p1,
const Coordinate & p2 )

default constructor (empty bounding box)

◆ Envelope() [6/6]

SFCGAL::Envelope::Envelope ( const Envelope & other)

copy constructor

◆ ~Envelope()

SFCGAL::Envelope::~Envelope ( )
default

destructor

Member Function Documentation

◆ boundsN() [1/2]

detail::Interval & SFCGAL::Envelope::boundsN ( const size_t & n)
inline

returns the n-th bound

◆ boundsN() [2/2]

const detail::Interval & SFCGAL::Envelope::boundsN ( const size_t & n) const
inline

returns the n-th bound

◆ contains()

auto SFCGAL::Envelope::contains ( const Envelope & a,
const Envelope & b )
static

Global binary operator on Envelopes.

Test if A's bounding box contains B's FIXME: consider moving that outside of the class

◆ expandToInclude()

void SFCGAL::Envelope::expandToInclude ( const Coordinate & coordinate)

expand the box to include coordinate

◆ is3D()

auto SFCGAL::Envelope::is3D ( ) const

indicates if the bounding box has a 3D component

◆ isEmpty()

auto SFCGAL::Envelope::isEmpty ( ) const

indicates if the bounding box is empty

◆ operator=()

auto SFCGAL::Envelope::operator= ( const Envelope & other)

assign operator

◆ overlaps()

auto SFCGAL::Envelope::overlaps ( const Envelope & a,
const Envelope & b )
static

Global binary operator on Envelopes.

Test if A's bounding box overlaps B's

◆ print()

auto SFCGAL::Envelope::print ( std::ostream & ostr) const

◆ toBbox_2()

CGAL::Bbox_2 SFCGAL::Envelope::toBbox_2 ( ) const
inline

Convenience function.

Convert to CGAL::BBox_2

◆ toBbox_3()

CGAL::Bbox_3 SFCGAL::Envelope::toBbox_3 ( ) const
inline

Convenience function.

Convert to CGAL::BBox_3

◆ toPolygon()

auto SFCGAL::Envelope::toPolygon ( ) const

convenience method to convert to 2D Polygon

Warning
empty Polygon for empty Envelope, may be X or Y collapsed

◆ toRing()

auto SFCGAL::Envelope::toRing ( ) const

convenience method to convert to 2D Polygon ring

Warning
empty LineString for empty Envelope, may be X or Y collapsed

◆ toShell()

auto SFCGAL::Envelope::toShell ( ) const

convenience method to convert to 3D Shell

Warning
empty Solid for empty or non 3D Envelope, may be X, Y or Z collapsed

◆ toSolid()

auto SFCGAL::Envelope::toSolid ( ) const

convenience method to convert to 3D Solid

Warning
empty Solid for empty or non 3D Envelope, may be X, Y or Z collapsed

◆ xMax()

const double & SFCGAL::Envelope::xMax ( ) const
inline

◆ xMin()

const double & SFCGAL::Envelope::xMin ( ) const
inline

◆ yMax()

const double & SFCGAL::Envelope::yMax ( ) const
inline

◆ yMin()

const double & SFCGAL::Envelope::yMin ( ) const
inline

◆ zMax()

const double & SFCGAL::Envelope::zMax ( ) const
inline

◆ zMin()

const double & SFCGAL::Envelope::zMin ( ) const
inline