Open CASCADE Technology  7.3.0
Public Member Functions | Protected Attributes

Bnd_B2f Class Reference

#include <Bnd_B2f.hxx>

Public Member Functions

 Bnd_B2f ()
 Empty constructor. More...
 
 Bnd_B2f (const gp_XY &theCenter, const gp_XY &theHSize)
 Constructor. More...
 
Standard_Boolean IsVoid () const
 Returns True if the box is void (non-initialized). More...
 
void Clear ()
 Reset the box data. More...
 
void Add (const gp_XY &thePnt)
 Update the box by a point. More...
 
void Add (const gp_Pnt2d &thePnt)
 Update the box by a point. More...
 
void Add (const Bnd_B2f &theBox)
 Update the box by another box. More...
 
gp_XY CornerMin () const
 Query a box corner: (Center - HSize). You must make sure that the box is NOT VOID (see IsVoid()), otherwise the method returns irrelevant result. More...
 
gp_XY CornerMax () const
 Query a box corner: (Center + HSize). You must make sure that the box is NOT VOID (see IsVoid()), otherwise the method returns irrelevant result. More...
 
Standard_Real SquareExtent () const
 Query the square diagonal. If the box is VOID (see method IsVoid()) then a very big real value is returned. More...
 
void Enlarge (const Standard_Real theDiff)
 Extend the Box by the absolute value of theDiff. More...
 
Standard_Boolean Limit (const Bnd_B2f &theOtherBox)
 Limit the Box by the internals of theOtherBox. Returns True if the limitation takes place, otherwise False indicating that the boxes do not intersect. More...
 
Bnd_B2f Transformed (const gp_Trsf2d &theTrsf) const
 Transform the bounding box with the given transformation. The resulting box will be larger if theTrsf contains rotation. More...
 
Standard_Boolean IsOut (const gp_XY &thePnt) const
 Check the given point for the inclusion in the Box. Returns True if the point is outside. More...
 
Standard_Boolean IsOut (const gp_XY &theCenter, const Standard_Real theRadius, const Standard_Boolean isCircleHollow=Standard_False) const
 Check a circle for the intersection with the current box. Returns True if there is no intersection between boxes. More...
 
Standard_Boolean IsOut (const Bnd_B2f &theOtherBox) const
 Check the given box for the intersection with the current box. Returns True if there is no intersection between boxes. More...
 
Standard_Boolean IsOut (const Bnd_B2f &theOtherBox, const gp_Trsf2d &theTrsf) const
 Check the given box oriented by the given transformation for the intersection with the current box. Returns True if there is no intersection between boxes. More...
 
Standard_Boolean IsOut (const gp_Ax2d &theLine) const
 Check the given Line for the intersection with the current box. Returns True if there is no intersection. More...
 
Standard_Boolean IsOut (const gp_XY &theP0, const gp_XY &theP1) const
 Check the Segment defined by the couple of input points for the intersection with the current box. Returns True if there is no intersection. More...
 
Standard_Boolean IsIn (const Bnd_B2f &theBox) const
 Check that the box 'this' is inside the given box 'theBox'. Returns True if 'this' box is fully inside 'theBox'. More...
 
Standard_Boolean IsIn (const Bnd_B2f &theBox, const gp_Trsf2d &theTrsf) const
 Check that the box 'this' is inside the given box 'theBox' transformed by 'theTrsf'. Returns True if 'this' box is fully inside the transformed 'theBox'. More...
 
void SetCenter (const gp_XY &theCenter)
 Set the Center coordinates. More...
 
void SetHSize (const gp_XY &theHSize)
 Set the HSize (half-diagonal) coordinates. All components of theHSize must be non-negative. More...
 

Protected Attributes

Standard_ShortReal myCenter [2]
 
Standard_ShortReal myHSize [2]
 

Constructor & Destructor Documentation

◆ Bnd_B2f() [1/2]

Bnd_B2f::Bnd_B2f ( )

Empty constructor.

◆ Bnd_B2f() [2/2]

Bnd_B2f::Bnd_B2f ( const gp_XY theCenter,
const gp_XY theHSize 
)

Constructor.

Member Function Documentation

◆ Add() [1/3]

void Bnd_B2f::Add ( const gp_XY thePnt)

Update the box by a point.

◆ Add() [2/3]

void Bnd_B2f::Add ( const gp_Pnt2d thePnt)

Update the box by a point.

◆ Add() [3/3]

void Bnd_B2f::Add ( const Bnd_B2f theBox)

Update the box by another box.

◆ Clear()

void Bnd_B2f::Clear ( )

Reset the box data.

◆ CornerMax()

gp_XY Bnd_B2f::CornerMax ( ) const

Query a box corner: (Center + HSize). You must make sure that the box is NOT VOID (see IsVoid()), otherwise the method returns irrelevant result.

◆ CornerMin()

gp_XY Bnd_B2f::CornerMin ( ) const

Query a box corner: (Center - HSize). You must make sure that the box is NOT VOID (see IsVoid()), otherwise the method returns irrelevant result.

◆ Enlarge()

void Bnd_B2f::Enlarge ( const Standard_Real  theDiff)

Extend the Box by the absolute value of theDiff.

◆ IsIn() [1/2]

Standard_Boolean Bnd_B2f::IsIn ( const Bnd_B2f theBox) const

Check that the box 'this' is inside the given box 'theBox'. Returns True if 'this' box is fully inside 'theBox'.

◆ IsIn() [2/2]

Standard_Boolean Bnd_B2f::IsIn ( const Bnd_B2f theBox,
const gp_Trsf2d theTrsf 
) const

Check that the box 'this' is inside the given box 'theBox' transformed by 'theTrsf'. Returns True if 'this' box is fully inside the transformed 'theBox'.

◆ IsOut() [1/6]

Standard_Boolean Bnd_B2f::IsOut ( const gp_XY thePnt) const

Check the given point for the inclusion in the Box. Returns True if the point is outside.

◆ IsOut() [2/6]

Standard_Boolean Bnd_B2f::IsOut ( const gp_XY theCenter,
const Standard_Real  theRadius,
const Standard_Boolean  isCircleHollow = Standard_False 
) const

Check a circle for the intersection with the current box. Returns True if there is no intersection between boxes.

◆ IsOut() [3/6]

Standard_Boolean Bnd_B2f::IsOut ( const Bnd_B2f theOtherBox) const

Check the given box for the intersection with the current box. Returns True if there is no intersection between boxes.

◆ IsOut() [4/6]

Standard_Boolean Bnd_B2f::IsOut ( const Bnd_B2f theOtherBox,
const gp_Trsf2d theTrsf 
) const

Check the given box oriented by the given transformation for the intersection with the current box. Returns True if there is no intersection between boxes.

◆ IsOut() [5/6]

Standard_Boolean Bnd_B2f::IsOut ( const gp_Ax2d theLine) const

Check the given Line for the intersection with the current box. Returns True if there is no intersection.

◆ IsOut() [6/6]

Standard_Boolean Bnd_B2f::IsOut ( const gp_XY theP0,
const gp_XY theP1 
) const

Check the Segment defined by the couple of input points for the intersection with the current box. Returns True if there is no intersection.

◆ IsVoid()

Standard_Boolean Bnd_B2f::IsVoid ( ) const

Returns True if the box is void (non-initialized).

◆ Limit()

Standard_Boolean Bnd_B2f::Limit ( const Bnd_B2f theOtherBox)

Limit the Box by the internals of theOtherBox. Returns True if the limitation takes place, otherwise False indicating that the boxes do not intersect.

◆ SetCenter()

void Bnd_B2f::SetCenter ( const gp_XY theCenter)

Set the Center coordinates.

◆ SetHSize()

void Bnd_B2f::SetHSize ( const gp_XY theHSize)

Set the HSize (half-diagonal) coordinates. All components of theHSize must be non-negative.

◆ SquareExtent()

Standard_Real Bnd_B2f::SquareExtent ( ) const

Query the square diagonal. If the box is VOID (see method IsVoid()) then a very big real value is returned.

◆ Transformed()

Bnd_B2f Bnd_B2f::Transformed ( const gp_Trsf2d theTrsf) const

Transform the bounding box with the given transformation. The resulting box will be larger if theTrsf contains rotation.

Field Documentation

◆ myCenter

Standard_ShortReal Bnd_B2f::myCenter[2]
protected

◆ myHSize

Standard_ShortReal Bnd_B2f::myHSize[2]
protected

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