Bbox2 is an axis aligned 2D bounding box.
More...
#include <Bbox2.h>
|
void | treatPointForInvalidBox (const Point2 &p) |
|
void | treatPointForValidBox (const Point2 &p) |
|
bool | updateMaxAbs () |
|
|
bool | bValid |
|
double | maxAbsCoord |
|
double | maxX |
|
double | maxY |
|
double | minX |
|
double | minY |
|
GeomTest * | pGeomTest |
|
Bbox2 is an axis aligned 2D bounding box.
◆ Bbox2()
GEOM_FADE25D::Bbox2::Bbox2 |
( |
GeomTest * |
pGeomTest_ = NULL | ) |
|
|
inlineexplicit |
Constructor.
Minimum bounds are initialized to DBL_MAX. Maximum bounds are initialized to -DBL_MAX. Box is not valid yet
◆ add() [1/5]
bool GEOM_FADE25D::Bbox2::add |
( |
const Bbox2 & |
other | ) |
|
|
inline |
Add another bounding box.
Extends the 2D bounding box if required.
- Returns
- true if the bounding box changes, false otherwise
◆ add() [2/5]
bool GEOM_FADE25D::Bbox2::add |
( |
const Point2 & |
p | ) |
|
|
inline |
Add a point.
Extends the 2D bounding box if required.
- Returns
- true if the bounding box changes, false otherwise
◆ add() [3/5]
bool GEOM_FADE25D::Bbox2::add |
( |
size_t |
numPoints, |
|
|
double * |
coordinates |
|
) |
| |
|
inline |
Add points.
Extends the 2D bounding box if required.
- Returns
- true if the bounding box changes, false otherwise
◆ add() [4/5]
bool GEOM_FADE25D::Bbox2::add |
( |
std::vector< Point2 * >::const_iterator |
start_it, |
|
|
std::vector< Point2 * >::const_iterator |
end_it |
|
) |
| |
|
inline |
Add points.
Extends the 2D bounding box if required.
- Returns
- true if the bounding box changes, false otherwise
◆ add() [5/5]
bool GEOM_FADE25D::Bbox2::add |
( |
std::vector< Point2 >::const_iterator |
start_it, |
|
|
std::vector< Point2 >::const_iterator |
end_it |
|
) |
| |
|
inline |
Add points.
Extends the 2D bounding box if required.
- Returns
- true if the bounding box changes, false otherwise
◆ doIntersect()
bool GEOM_FADE25D::Bbox2::doIntersect |
( |
const Bbox2 & |
other | ) |
const |
Check intersection.
Two valid bounding boxes intersect if they share at least one point in the XY plane.
◆ doubleTheBox()
void GEOM_FADE25D::Bbox2::doubleTheBox |
( |
| ) |
|
Double the box.
Changes the bounds such that the box grows in each direction by half the previous range
◆ enlargeRanges()
void GEOM_FADE25D::Bbox2::enlargeRanges |
( |
double |
factor, |
|
|
bool |
bUseMaxRange, |
|
|
double |
minRange |
|
) |
| |
Enlarge the x|y-ranges of a bounding box.
This function updates minX
, minY
, maxX
and maxY
symmetrically to enlarge the x-
and y-ranges
of the bounding box.
- Parameters
-
factor | is the factor by which the existing ranges rangeX and rangeY shall grow. |
bUseMaxRange | specifies if a square bounding box with side length shall be made. |
minRange | is a lower bound on the new ranges and it can be used to avoid a degenerate box when the pre-existing box was degenerate. |
◆ get_maxX()
double GEOM_FADE25D::Bbox2::get_maxX |
( |
| ) |
const |
|
inline |
◆ get_maxY()
double GEOM_FADE25D::Bbox2::get_maxY |
( |
| ) |
const |
|
inline |
◆ get_minX()
double GEOM_FADE25D::Bbox2::get_minX |
( |
| ) |
const |
|
inline |
◆ get_minY()
double GEOM_FADE25D::Bbox2::get_minY |
( |
| ) |
const |
|
inline |
◆ getBoundary()
void GEOM_FADE25D::Bbox2::getBoundary |
( |
std::vector< Segment2 > & |
vBoundary | ) |
const |
Get boundary.
Convenience function: Returns 4 border segments
◆ getCorners()
void GEOM_FADE25D::Bbox2::getCorners |
( |
std::vector< Point2 > & |
vBoxCorners | ) |
const |
Get corners.
Convenience function: Returns the 4 corners of the box
◆ getMaxCoord()
double GEOM_FADE25D::Bbox2::getMaxCoord |
( |
| ) |
const |
|
inline |
Get maximum coordinate.
- Returns
- the largest coordinate value, i.e. max(maxX,maxY)
◆ getMaxPoint()
Point2 GEOM_FADE25D::Bbox2::getMaxPoint |
( |
| ) |
const |
|
inline |
Get the max point.
- Returns
- the 2D corner point with the maximum coordinates, the z-coordinate is set to 0
◆ getMaxRange()
double GEOM_FADE25D::Bbox2::getMaxRange |
( |
| ) |
const |
|
inline |
◆ getMinCoord()
double GEOM_FADE25D::Bbox2::getMinCoord |
( |
| ) |
const |
|
inline |
Get minimum coordinate.
- Returns
- the smallest coordinate value, i.e. min(minX,minY)
◆ getMinPoint()
Point2 GEOM_FADE25D::Bbox2::getMinPoint |
( |
| ) |
const |
|
inline |
Get the min point.
- Returns
- the corner point with the minimum coordinates, the z-coordinate is set to 0
◆ getOffsetCorners()
void GEOM_FADE25D::Bbox2::getOffsetCorners |
( |
double |
offset, |
|
|
std::vector< Point2 > & |
vBoxCorners |
|
) |
| const |
Get offset corners.
Convenience function: Returns the 4 corners of an enlarged box. The box es enlarged by offset
in each direction
◆ getRangeX()
double GEOM_FADE25D::Bbox2::getRangeX |
( |
| ) |
const |
|
inline |
Get x-range.
- Returns
- maxX-minX
◆ getRangeY()
double GEOM_FADE25D::Bbox2::getRangeY |
( |
| ) |
const |
|
inline |
Get y-range.
- Returns
- maxY-minY
◆ inflateIfDegenerate()
void GEOM_FADE25D::Bbox2::inflateIfDegenerate |
( |
double |
val | ) |
|
|
inline |
Inflate if Degenerate.
When only one point has been added to Bbox2 or when all points have the same x- and/or y- coordinates then Bbox2 is degenerate. This is a valid state but sometimes undesireable. The present method inflates the Bbox2 by adding /p val to maxX and/or maxY.
◆ isInBox()
bool GEOM_FADE25D::Bbox2::isInBox |
( |
const Point2 & |
p | ) |
const |
Point-in-Box Test.
- Returns
- true if minX <= p.x() <=maxX and minY <= p.y() <=maxY or false otherwise.
◆ isValid()
bool GEOM_FADE25D::Bbox2::isValid |
( |
| ) |
const |
|
inline |
Check if the bounds are valid.
The bounds are valid when at least one point has been added or when set-methods have been used to set minX<=maxX and minY<=maxY
◆ operator+()
Bbox2 GEOM_FADE25D::Bbox2::operator+ |
( |
const Bbox2 & |
b | ) |
|
Add a bounding box.
Extends the 2D bounding box if required.
- Returns
- the resulting bounding box
◆ reset()
void GEOM_FADE25D::Bbox2::reset |
( |
| ) |
|
|
inline |
Reset the bounds.
Resets the bounding box to default values
◆ intersection
Print the box.
Prints the box coordinates to stream
The documentation for this class was generated from the following file: