# FoundationClasses
TKMath
Bnd

# Bnd_Box2d Class Reference

Describes a bounding box in 2D space.
A bounding box is parallel to the axes of the coordinates
system. If it is finite, it is defined by the two intervals:
- [ Xmin,Xmax ], and
- [ Ymin,Ymax ].
A bounding box may be infinite (i.e. open) in one or more
directions. It is said to be:
- OpenXmin if it is infinite on the negative side of the "X Direction";
- OpenXmax if it is infinite on the positive side of the "X Direction";
- OpenYmin if it is infinite on the negative side of the "Y Direction";
- OpenYmax if it is infinite on the positive side of the "Y Direction";
- WholeSpace if it is infinite in all four directions. In
this case, any point of the space is inside the box;
- Void if it is empty. In this case, there is no point included in the box.
A bounding box is defined by four bounds (Xmin, Xmax, Ymin and Ymax) which
limit the bounding box if it is finite, six flags (OpenXmin, OpenXmax, OpenYmin,
OpenYmax, WholeSpace and Void) which describe the bounding box if it is infinite or empty, and
- a gap, which is included on both sides in any direction when consulting the finite bounds of the box.
.

`#include <Bnd_Box2d.hxx>`

## Public Member Functions

void * | operator new (size_t, void *anAddress)
void * | operator new (size_t size)
void | operator delete (void *anAddress)
| Bnd_Box2d ()
| Creates an empty 2D bounding box. The constructed box is qualified Void. Its gap is null. .
void | SetWhole ()
| Sets this bounding box so that it covers the whole 2D space, i.e. it is infinite in all directions. .
void | SetVoid ()
| Sets this 2D bounding box so that it is empty. All points are outside a void box. .
void | Set (const gp_Pnt2d &P)
| Sets this 2D bounding box so that it bounds the point P. This involves first setting this bounding box to be void and then adding the point PThe rectangle bounds the point . .
void | Set (const gp_Pnt2d &P, const gp_Dir2d &D)
| Sets this 2D bounding box so that it bounds the half-line defined by point P and direction D, i.e. all points M defined by M=P+u*D, where u is greater than or equal to 0, are inside the bounding area. This involves first setting this 2D box to be void and then adding the half-line. .
Standard_EXPORT void | Update (const Standard_Real aXmin, const Standard_Real aYmin, const Standard_Real aXmax, const Standard_Real aYmax)
| Enlarges this 2D bounding box, if required, so that it contains at least: - interval [ aXmin,aXmax ] in the "X Direction", - interval [ aYmin,aYmax ] in the "Y Direction" .
Standard_EXPORT void | Update (const Standard_Real X, const Standard_Real Y)
| Adds a point of coordinates (X,Y) to this bounding box. .
Standard_Real | GetGap () const
| Returns the gap of this 2D bounding box. .
void | SetGap (const Standard_Real Tol)
| Set the gap of this 2D bounding box to abs(Tol). .
void | Enlarge (const Standard_Real Tol)
| Enlarges the box with a tolerance value. This means that the minimum values of its X and Y intervals of definition, when they are finite, are reduced by the absolute value of Tol, while the maximum values are increased by the same amount. .
Standard_EXPORT void | Get (Standard_Real &aXmin, Standard_Real &aYmin, Standard_Real &aXmax, Standard_Real &aYmax) const
| Returns the bounds of this 2D bounding box. The gap is included. If this bounding box is infinite (i.e. "open"), returned values may be equal to +/- Precision::Infinite(). if IsVoid() .
void | OpenXmin ()
| The Box will be infinitely long in the Xmin direction. .
void | OpenXmax ()
| The Box will be infinitely long in the Xmax direction. .
void | OpenYmin ()
| The Box will be infinitely long in the Ymin direction. .
void | OpenYmax ()
| The Box will be infinitely long in the Ymax direction. .
Standard_Boolean | IsOpenXmin () const
| Returns true if this bounding box is open in the Xmin direction. .
Standard_Boolean | IsOpenXmax () const
| Returns true if this bounding box is open in the Xmax direction. .
Standard_Boolean | IsOpenYmin () const
| Returns true if this bounding box is open in the Ymin direction. .
Standard_Boolean | IsOpenYmax () const
| Returns true if this bounding box is open in the Ymax direction. .
Standard_Boolean | IsWhole () const
| Returns true if this bounding box is infinite in all 4 directions (Whole Space flag). .
Standard_Boolean | IsVoid () const
| Returns true if this 2D bounding box is empty (Void flag). .
Standard_EXPORT Bnd_Box2d | Transformed (const gp_Trsf2d &T) const
| Returns a bounding box which is the result of applying the transformation T to this bounding box. Warning Applying a geometric transformation (for example, a rotation) to a bounding box generally increases its dimensions. This is not optimal for algorithms which use it. .
Standard_EXPORT void | Add (const Bnd_Box2d &Other)
| Adds the 2d box <other> to <me>. .
void | Add (const gp_Pnt2d &P)
| Adds the 2d pnt to <me>. .
void | Add (const gp_Pnt2d &P, const gp_Dir2d &D)
| Extends <me> from the Pnt in the direction <d>. .
Standard_EXPORT void | Add (const gp_Dir2d &D)
| Extends the Box in the given Direction, i.e. adds a half-line. The box may become infinite in 1 or 2 directions. .
Standard_EXPORT Standard_Boolean | IsOut (const gp_Pnt2d &P) const
| Returns True if the 2d pnt is out <me>. .
Standard_EXPORT Standard_Boolean | IsOut (const Bnd_Box2d &Other) const
| Returns True if <box2d> is out <me>. .
Standard_Boolean | IsOut (const Bnd_Box2d &Other, const gp_Trsf2d &T) const
| Returns True if transformed <box2d> is out <me>. .
Standard_Boolean | IsOut (const gp_Trsf2d &T1, const Bnd_Box2d &Other, const gp_Trsf2d &T2) const
| Compares a transformed bounding with a transformed bounding. The default implementation is to make a copy of <me> and <other>, to transform them and to test. .
Standard_EXPORT void | Dump () const

## Private Attributes

Standard_Real | Xmin
Standard_Real | Xmax
Standard_Real | Ymin
Standard_Real | Ymax
Standard_Real | Gap
Standard_Integer | Flags

## Constructor & Destructor Documentation

Bnd_Box2d::Bnd_Box2d | ( |  | ) | `[inline]`

## Member Function Documentation

Standard_EXPORT void Bnd_Box2d::Add | ( | const gp_Dir2d & | D | ) |

void Bnd_Box2d::Add | ( | const gp_Pnt2d & | P,
|  | const gp_Dir2d & | D
| ) | `[inline]`

void Bnd_Box2d::Add | ( | const gp_Pnt2d & | P | ) | `[inline]`

Standard_EXPORT void Bnd_Box2d::Add | ( | const Bnd_Box2d & | Other | ) |

Standard_EXPORT void Bnd_Box2d::Dump | ( |  | ) | const

void Bnd_Box2d::Enlarge | ( | const Standard_Real | Tol | ) | `[inline]`

Standard_EXPORT void Bnd_Box2d::Get | ( | Standard_Real & | aXmin,
|  | Standard_Real & | aYmin,
|  | Standard_Real & | aXmax,
|  | Standard_Real & | aYmax
| ) | const

Standard_Real Bnd_Box2d::GetGap | ( |  | ) | const`[inline]`

Standard_Boolean Bnd_Box2d::IsOpenXmax | ( |  | ) | const`[inline]`

Standard_Boolean Bnd_Box2d::IsOpenXmin | ( |  | ) | const`[inline]`

Standard_Boolean Bnd_Box2d::IsOpenYmax | ( |  | ) | const`[inline]`

Standard_Boolean Bnd_Box2d::IsOpenYmin | ( |  | ) | const`[inline]`

Standard_Boolean Bnd_Box2d::IsOut | ( | const gp_Trsf2d & | T1,
|  | const Bnd_Box2d & | Other,
|  | const gp_Trsf2d & | T2
| ) | const`[inline]`

Standard_Boolean Bnd_Box2d::IsOut | ( | const Bnd_Box2d & | Other,
|  | const gp_Trsf2d & | T
| ) | const`[inline]`

Standard_EXPORT Standard_Boolean Bnd_Box2d::IsOut | ( | const Bnd_Box2d & | Other | ) | const

Standard_EXPORT Standard_Boolean Bnd_Box2d::IsOut | ( | const gp_Pnt2d & | P | ) | const

Standard_Boolean Bnd_Box2d::IsVoid | ( |  | ) | const`[inline]`

Standard_Boolean Bnd_Box2d::IsWhole | ( |  | ) | const`[inline]`

void Bnd_Box2d::OpenXmax | ( |  | ) | `[inline]`

void Bnd_Box2d::OpenXmin | ( |  | ) | `[inline]`

void Bnd_Box2d::OpenYmax | ( |  | ) | `[inline]`

void Bnd_Box2d::OpenYmin | ( |  | ) | `[inline]`

void Bnd_Box2d::operator delete | ( | void * | anAddress | ) | `[inline]`

void* Bnd_Box2d::operator new | ( | size_t | size | ) | `[inline]`

void* Bnd_Box2d::operator new | ( | size_t | ,
|  | void * | anAddress
| ) | `[inline]`

void Bnd_Box2d::Set | ( | const gp_Pnt2d & | P,
|  | const gp_Dir2d & | D
| ) | `[inline]`

void Bnd_Box2d::Set | ( | const gp_Pnt2d & | P | ) | `[inline]`

void Bnd_Box2d::SetGap | ( | const Standard_Real | Tol | ) | `[inline]`

void Bnd_Box2d::SetVoid | ( |  | ) | `[inline]`

void Bnd_Box2d::SetWhole | ( |  | ) | `[inline]`

Standard_EXPORT Bnd_Box2d Bnd_Box2d::Transformed | ( | const gp_Trsf2d & | T | ) | const

Standard_EXPORT void Bnd_Box2d::Update | ( | const Standard_Real | X,
|  | const Standard_Real | Y
| ) |

Standard_EXPORT void Bnd_Box2d::Update | ( | const Standard_Real | aXmin,
|  | const Standard_Real | aYmin,
|  | const Standard_Real | aXmax,
|  | const Standard_Real | aYmax
| ) |

## Field Documentation

Standard_Integer Bnd_Box2d::Flags `[private]`

Standard_Real Bnd_Box2d::Gap `[private]`

Standard_Real Bnd_Box2d::Xmax `[private]`

Standard_Real Bnd_Box2d::Xmin `[private]`

Standard_Real Bnd_Box2d::Ymax `[private]`

Standard_Real Bnd_Box2d::Ymin `[private]`

The documentation for this class was generated from the following files:

- Bnd_Box2d.hxx
- Bnd_Box2d.lxx