geirs2Panic  Richard J. Mathar
Fits header keyword batch editor
 All Classes Files Functions Variables Macros Pages
Public Member Functions | Public Attributes | List of all members
Bbox2D Class Reference

A 2-dimensional rectangular boundary box parallel to the two Cartesian axes. More...

#include <Bbox2D.h>

Collaboration diagram for Bbox2D:
Collaboration graph

Public Member Functions

 Bbox2D (const Point2D &ptll, const Point2D &ptur)
 Create a boundary box given two corner points. More...
 
 Bbox2D ()
 
Bbox2D apply (const RotTrans2D &rt) const
 Compute the bounding box of the quadrangle that is rotated-translated. More...
 
void include (const Point2D &pt)
 
bool isInside (const Point2D &pt) const
 
Point2D lowerRight () const
 
Point2D upperLeft () const
 

Public Attributes

Point2D limits [2]
 The two points at the lower left and upper right corner. More...
 

Detailed Description

A 2-dimensional rectangular boundary box parallel to the two Cartesian axes.

Since
2013-07-04
Author
Richard J. Mathar

Constructor & Destructor Documentation

Bbox2D::Bbox2D ( const Point2D pt1,
const Point2D pt2 
)

Create a boundary box given two corner points.


Parameters
pt1The first corner.
pt2The second corner.
Bbox2D::Bbox2D ( )

Create an invalid bounding box. Default ctor.

Member Function Documentation

Bbox2D Bbox2D::apply ( const RotTrans2D rt) const

Compute the bounding box of the quadrangle that is rotated-translated.


Parameters
[in]rtThe rotation-translation to be applied
Returns
The bounding box which includes all 4 rotated corner points of this bounding box.
void Bbox2D::include ( const Point2D pt)

Extend the bounding box such that a point is inside.

Parameters
[in]ptThe point that may expand the bounding box.
bool Bbox2D::isInside ( const Point2D pt) const

Decide whether a point is inside (or on the rim) of the bounding box.

Parameters
[in]ptThe point to be tested for insidedness.
Returns
True if the point is inside.
Point2D Bbox2D::lowerRight ( ) const

Compute the lower right corner of the bounding box.

Returns
The point in the bounding box with maximum x and minimum y coordinate.
Point2D Bbox2D::upperLeft ( ) const

Compute the upper left corner of the bounding box.

Returns
The point in the bounding box with minimum x and maximum y coordinate.

Member Data Documentation

Point2D Bbox2D::limits[2]

The two points at the lower left and upper right corner.