SFCGAL  1.3.0
Public Member Functions | Static Public Member Functions | List of all members
SFCGAL::Envelope Class Reference

Represents a bounding box. More...

#include <Envelope.h>

Public Member Functions

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

Static Public Member Functions

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

Detailed Description

Represents a bounding box.

Todo:

add asText instead of "print"?

add basic operations (especialy intersects/intersects3D)

Constructor & Destructor Documentation

SFCGAL::Envelope::Envelope ( )

default constructor (empty bounding box)

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

2D box constructor with min,max values

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

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

default constructor (empty bounding box)

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

default constructor (empty bounding box)

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

copy constructor

SFCGAL::Envelope::~Envelope ( )

destructor

Member Function Documentation

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

returns the n-th bound

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

returns the n-th bound

bool 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

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

expand the box to include coordinate

bool SFCGAL::Envelope::is3D ( ) const

indicates if the bounding box has a 3D component

bool SFCGAL::Envelope::isEmpty ( ) const

indicates if the bounding box is empty

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

assign operator

bool SFCGAL::Envelope::overlaps ( const Envelope a,
const Envelope b 
)
static

Global binary operator on Envelopes.

Test if A's bounding box overlaps B's

std::ostream & SFCGAL::Envelope::print ( std::ostream &  ostr) const
CGAL::Bbox_2 SFCGAL::Envelope::toBbox_2 ( ) const
inline

Convenience function.

Convert to CGAL::BBox_2

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

Convenience function.

Convert to CGAL::BBox_3

std::auto_ptr< Polygon > SFCGAL::Envelope::toPolygon ( ) const

convenience method to convert to 2D Polygon

Warning
empty Polygon for empty Envelope, may be X or Y collapsed
std::auto_ptr< LineString > SFCGAL::Envelope::toRing ( ) const

convenience method to convert to 2D Polygon ring

Warning
empty LineString for empty Envelope, may be X or Y collapsed
std::auto_ptr< PolyhedralSurface > 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
std::auto_ptr< Solid > 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
const double& SFCGAL::Envelope::xMax ( ) const
inline
const double& SFCGAL::Envelope::xMin ( ) const
inline
const double& SFCGAL::Envelope::yMax ( ) const
inline
const double& SFCGAL::Envelope::yMin ( ) const
inline
const double& SFCGAL::Envelope::zMax ( ) const
inline
const double& SFCGAL::Envelope::zMin ( ) const
inline