Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | Static Protected Attributes
Bnd_B2< RealType > Class Template Reference

Template class for 2D bounding box. This is a base template that is instantiated for double and float. More...

#include <Bnd_B2.hxx>

Public Member Functions

constexpr Bnd_B2 () noexcept
 Empty constructor.
 
constexpr Bnd_B2 (const gp_XY &theCenter, const gp_XY &theHSize) noexcept
 Constructor.
 
constexpr Bnd_B2 (const std::array< RealType, 2 > &theCenter, const std::array< RealType, 2 > &theHSize) noexcept
 Constructor.
 
constexpr bool IsVoid () const noexcept
 Returns True if the box is void (non-initialized).
 
void Clear () noexcept
 Reset the box data.
 
void Add (const gp_XY &thePnt)
 Update the box by a point.
 
void Add (const gp_Pnt2d &thePnt)
 Update the box by a point.
 
void Add (const Bnd_B2< RealType > &theBox)
 Update the box by another box.
 
gp_XY CornerMin () const noexcept
 Query a box corner: (Center - HSize). You must make sure that the box is NOT VOID (see IsVoid()), otherwise the method returns irrelevant result.
 
gp_XY CornerMax () const noexcept
 Query a box corner: (Center + HSize). You must make sure that the box is NOT VOID (see IsVoid()), otherwise the method returns irrelevant result.
 
constexpr double SquareExtent () const noexcept
 Query the square diagonal. If the box is VOID (see method IsVoid()) then a very big real value is returned.
 
void Enlarge (const double theDiff) noexcept
 Extend the Box by the absolute value of theDiff.
 
bool Limit (const Bnd_B2< RealType > &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.
 
Bnd_B2< RealTypeTransformed (const gp_Trsf2d &theTrsf) const
 Transform the bounding box with the given transformation. The resulting box will be larger if theTrsf contains rotation.
 
constexpr bool IsOut (const gp_XY &thePnt) const noexcept
 Check the given point for the inclusion in the Box. Returns True if the point is outside.
 
bool IsOut (const gp_XY &theCenter, const double theRadius, const bool isCircleHollow=false) const
 Check a circle for the intersection with the current box. Returns True if there is no intersection between boxes.
 
constexpr bool IsOut (const Bnd_B2< RealType > &theOtherBox) const noexcept
 Check the given box for the intersection with the current box. Returns True if there is no intersection between boxes.
 
bool IsOut (const Bnd_B2< RealType > &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.
 
bool IsOut (const gp_Ax2d &theLine) const
 Check the given Line for the intersection with the current box. Returns True if there is no intersection.
 
bool 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.
 
constexpr bool IsIn (const Bnd_B2< RealType > &theBox) const noexcept
 Check that the box 'this' is inside the given box 'theBox'. Returns True if 'this' box is fully inside 'theBox'.
 
bool IsIn (const Bnd_B2< RealType > &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'.
 
void SetCenter (const gp_XY &theCenter) noexcept
 Set the Center coordinates.
 
void SetCenter (const std::array< RealType, 2 > &theCenter) noexcept
 Set the Center coordinates.
 
void SetHSize (const gp_XY &theHSize) noexcept
 Set the HSize (half-diagonal) coordinates. All components of theHSize must be non-negative.
 
void SetHSize (const std::array< RealType, 2 > &theHSize) noexcept
 Set the HSize (half-diagonal) coordinates. All components of theHSize must be non-negative.
 
constexpr const std::array< RealType, 2 > & Center () const noexcept
 Get the Center coordinates.
 
constexpr const std::array< RealType, 2 > & HSize () const noexcept
 Get the HSize (half-diagonal) coordinates.
 

Static Protected Member Functions

static constexpr bool compareDist (const RealType aHSize[2], const RealType aDist[2]) noexcept
 
static bool compareDistD (const gp_XY &aHSize, const gp_XY &aDist) noexcept
 

Static Protected Attributes

static constexpr RealType THE_RealLast = RealType(1e30)
 Constant representing a very large value for void box initialization.
 

Detailed Description

template<typename RealType>
class Bnd_B2< RealType >

Template class for 2D bounding box. This is a base template that is instantiated for double and float.

Constructor & Destructor Documentation

◆ Bnd_B2() [1/3]

template<typename RealType >
constexpr Bnd_B2< RealType >::Bnd_B2 ( )
inlineconstexprnoexcept

Empty constructor.

◆ Bnd_B2() [2/3]

template<typename RealType >
constexpr Bnd_B2< RealType >::Bnd_B2 ( const gp_XY & theCenter,
const gp_XY & theHSize )
inlineconstexprnoexcept

Constructor.

◆ Bnd_B2() [3/3]

template<typename RealType >
constexpr Bnd_B2< RealType >::Bnd_B2 ( const std::array< RealType, 2 > & theCenter,
const std::array< RealType, 2 > & theHSize )
inlineconstexprnoexcept

Constructor.

Member Function Documentation

◆ Add() [1/3]

template<typename RealType >
void Bnd_B2< RealType >::Add ( const Bnd_B2< RealType > & theBox)
inline

Update the box by another box.

◆ Add() [2/3]

template<typename RealType >
void Bnd_B2< RealType >::Add ( const gp_Pnt2d & thePnt)
inline

Update the box by a point.

◆ Add() [3/3]

template<typename RealType >
void Bnd_B2< RealType >::Add ( const gp_XY & thePnt)

Update the box by a point.

◆ Center()

template<typename RealType >
constexpr const std::array< RealType, 2 > & Bnd_B2< RealType >::Center ( ) const
inlineconstexprnoexcept

Get the Center coordinates.

◆ Clear()

template<typename RealType >
void Bnd_B2< RealType >::Clear ( )
inlinenoexcept

Reset the box data.

◆ compareDist()

template<typename RealType >
static constexpr bool Bnd_B2< RealType >::compareDist ( const RealType aHSize[2],
const RealType aDist[2] )
inlinestaticconstexprprotectednoexcept

◆ compareDistD()

template<typename RealType >
static bool Bnd_B2< RealType >::compareDistD ( const gp_XY & aHSize,
const gp_XY & aDist )
inlinestaticprotectednoexcept

◆ CornerMax()

template<typename RealType >
gp_XY Bnd_B2< RealType >::CornerMax ( ) const
inlinenoexcept

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()

template<typename RealType >
gp_XY Bnd_B2< RealType >::CornerMin ( ) const
inlinenoexcept

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()

template<typename RealType >
void Bnd_B2< RealType >::Enlarge ( const double theDiff)
inlinenoexcept

Extend the Box by the absolute value of theDiff.

◆ HSize()

template<typename RealType >
constexpr const std::array< RealType, 2 > & Bnd_B2< RealType >::HSize ( ) const
inlineconstexprnoexcept

Get the HSize (half-diagonal) coordinates.

◆ IsIn() [1/2]

template<typename RealType >
constexpr bool Bnd_B2< RealType >::IsIn ( const Bnd_B2< RealType > & theBox) const
inlineconstexprnoexcept

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

◆ IsIn() [2/2]

template<typename RealType >
bool Bnd_B2< RealType >::IsIn ( const Bnd_B2< RealType > & 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]

template<typename RealType >
constexpr bool Bnd_B2< RealType >::IsOut ( const Bnd_B2< RealType > & theOtherBox) const
inlineconstexprnoexcept

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

◆ IsOut() [2/6]

template<typename RealType >
bool Bnd_B2< RealType >::IsOut ( const Bnd_B2< RealType > & 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() [3/6]

template<typename RealType >
bool Bnd_B2< RealType >::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() [4/6]

template<typename RealType >
bool Bnd_B2< RealType >::IsOut ( const gp_XY & theCenter,
const double theRadius,
const bool isCircleHollow = false ) const

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

◆ IsOut() [5/6]

template<typename RealType >
bool Bnd_B2< RealType >::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.

◆ IsOut() [6/6]

template<typename RealType >
constexpr bool Bnd_B2< RealType >::IsOut ( const gp_XY & thePnt) const
inlineconstexprnoexcept

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

◆ IsVoid()

template<typename RealType >
constexpr bool Bnd_B2< RealType >::IsVoid ( ) const
inlineconstexprnoexcept

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

◆ Limit()

template<typename RealType >
bool Bnd_B2< RealType >::Limit ( const Bnd_B2< RealType > & 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() [1/2]

template<typename RealType >
void Bnd_B2< RealType >::SetCenter ( const gp_XY & theCenter)
inlinenoexcept

Set the Center coordinates.

◆ SetCenter() [2/2]

template<typename RealType >
void Bnd_B2< RealType >::SetCenter ( const std::array< RealType, 2 > & theCenter)
inlinenoexcept

Set the Center coordinates.

◆ SetHSize() [1/2]

template<typename RealType >
void Bnd_B2< RealType >::SetHSize ( const gp_XY & theHSize)
inlinenoexcept

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

◆ SetHSize() [2/2]

template<typename RealType >
void Bnd_B2< RealType >::SetHSize ( const std::array< RealType, 2 > & theHSize)
inlinenoexcept

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

◆ SquareExtent()

template<typename RealType >
constexpr double Bnd_B2< RealType >::SquareExtent ( ) const
inlineconstexprnoexcept

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

◆ Transformed()

template<typename RealType >
Bnd_B2< RealType > Bnd_B2< RealType >::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

◆ THE_RealLast

template<typename RealType >
constexpr RealType Bnd_B2< RealType >::THE_RealLast = RealType(1e30)
staticconstexprprotected

Constant representing a very large value for void box initialization.


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