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

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

#include <Bnd_B3.hxx>

Public Member Functions

constexpr Bnd_B3 () noexcept
 Empty constructor.
 
constexpr Bnd_B3 (const gp_XYZ &theCenter, const gp_XYZ &theHSize) noexcept
 Constructor.
 
constexpr Bnd_B3 (const std::array< RealType, 3 > &theCenter, const std::array< RealType, 3 > &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_XYZ &thePnt)
 Update the box by a point.
 
void Add (const gp_Pnt &thePnt)
 Update the box by a point.
 
void Add (const Bnd_B3< RealType > &theBox)
 Update the box by another box.
 
gp_XYZ CornerMin () const noexcept
 Query the lower corner: (Center - HSize). You must make sure that the box is NOT VOID (see IsVoid()), otherwise the method returns irrelevant result.
 
gp_XYZ CornerMax () const noexcept
 Query the upper 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_B3< 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_B3< RealTypeTransformed (const gp_Trsf &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_XYZ &thePnt) const noexcept
 Check the given point for the inclusion in the Box. Returns True if the point is outside.
 
bool IsOut (const gp_XYZ &theCenter, const double theRadius, const bool isSphereHollow=false) const
 Check a sphere for the intersection with the current box. Returns True if there is no intersection between boxes. If the parameter 'IsSphereHollow' is True, then the intersection is not reported for a box that is completely inside the sphere (otherwise this method would report an intersection).
 
constexpr bool IsOut (const Bnd_B3< 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_B3< RealType > &theOtherBox, const gp_Trsf &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_Ax1 &theLine, const bool isRay=false, const double theOverthickness=0.0) const
 Check the given Line for the intersection with the current box. Returns True if there is no intersection. isRay==True means intersection check with the positive half-line theOverthickness is the addition to the size of the current box (may be negative). If positive, it can be treated as the thickness of the line 'theLine' or the radius of the cylinder along 'theLine'.
 
bool IsOut (const gp_Ax3 &thePlane) const
 Check the given Plane for the intersection with the current box. Returns True if there is no intersection.
 
constexpr bool IsIn (const Bnd_B3< 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_B3< RealType > &theBox, const gp_Trsf &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_XYZ &theCenter) noexcept
 Set the Center coordinates.
 
void SetCenter (const std::array< RealType, 3 > &theCenter) noexcept
 Set the Center coordinates.
 
void SetHSize (const gp_XYZ &theHSize) noexcept
 Set the HSize (half-diagonal) coordinates. All components of theHSize must be non-negative.
 
void SetHSize (const std::array< RealType, 3 > &theHSize) noexcept
 Set the HSize (half-diagonal) coordinates. All components of theHSize must be non-negative.
 
constexpr const std::array< RealType, 3 > & Center () const noexcept
 Get the Center coordinates.
 
constexpr const std::array< RealType, 3 > & HSize () const noexcept
 Get the HSize (half-diagonal) coordinates.
 

Static Protected Member Functions

static constexpr bool compareDist (const RealType aHSize[3], const RealType aDist[3]) noexcept
 
static bool compareDistD (const gp_XYZ &aHSize, const gp_XYZ &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_B3< RealType >

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

Constructor & Destructor Documentation

◆ Bnd_B3() [1/3]

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

Empty constructor.

◆ Bnd_B3() [2/3]

template<typename RealType >
constexpr Bnd_B3< RealType >::Bnd_B3 ( const gp_XYZ & theCenter,
const gp_XYZ & theHSize )
inlineconstexprnoexcept

Constructor.

◆ Bnd_B3() [3/3]

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

Constructor.

Member Function Documentation

◆ Add() [1/3]

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

Update the box by another box.

◆ Add() [2/3]

template<typename RealType >
void Bnd_B3< RealType >::Add ( const gp_Pnt & thePnt)
inline

Update the box by a point.

◆ Add() [3/3]

template<typename RealType >
void Bnd_B3< RealType >::Add ( const gp_XYZ & thePnt)

Update the box by a point.

◆ Center()

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

Get the Center coordinates.

◆ Clear()

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

Reset the box data.

◆ compareDist()

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

◆ compareDistD()

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

◆ CornerMax()

template<typename RealType >
gp_XYZ Bnd_B3< RealType >::CornerMax ( ) const
inlinenoexcept

Query the upper 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_XYZ Bnd_B3< RealType >::CornerMin ( ) const
inlinenoexcept

Query the lower 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_B3< RealType >::Enlarge ( const double theDiff)
inlinenoexcept

Extend the Box by the absolute value of theDiff.

◆ HSize()

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

Get the HSize (half-diagonal) coordinates.

◆ IsIn() [1/2]

template<typename RealType >
constexpr bool Bnd_B3< RealType >::IsIn ( const Bnd_B3< 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_B3< RealType >::IsIn ( const Bnd_B3< RealType > & theBox,
const gp_Trsf & 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_B3< RealType >::IsOut ( const Bnd_B3< 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_B3< RealType >::IsOut ( const Bnd_B3< RealType > & theOtherBox,
const gp_Trsf & 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_B3< RealType >::IsOut ( const gp_Ax1 & theLine,
const bool isRay = false,
const double theOverthickness = 0.0 ) const

Check the given Line for the intersection with the current box. Returns True if there is no intersection. isRay==True means intersection check with the positive half-line theOverthickness is the addition to the size of the current box (may be negative). If positive, it can be treated as the thickness of the line 'theLine' or the radius of the cylinder along 'theLine'.

◆ IsOut() [4/6]

template<typename RealType >
bool Bnd_B3< RealType >::IsOut ( const gp_Ax3 & thePlane) const

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

◆ IsOut() [5/6]

template<typename RealType >
bool Bnd_B3< RealType >::IsOut ( const gp_XYZ & theCenter,
const double theRadius,
const bool isSphereHollow = false ) const

Check a sphere for the intersection with the current box. Returns True if there is no intersection between boxes. If the parameter 'IsSphereHollow' is True, then the intersection is not reported for a box that is completely inside the sphere (otherwise this method would report an intersection).

◆ IsOut() [6/6]

template<typename RealType >
constexpr bool Bnd_B3< RealType >::IsOut ( const gp_XYZ & 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_B3< RealType >::IsVoid ( ) const
inlineconstexprnoexcept

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

◆ Limit()

template<typename RealType >
bool Bnd_B3< RealType >::Limit ( const Bnd_B3< 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_B3< RealType >::SetCenter ( const gp_XYZ & theCenter)
inlinenoexcept

Set the Center coordinates.

◆ SetCenter() [2/2]

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

Set the Center coordinates.

◆ SetHSize() [1/2]

template<typename RealType >
void Bnd_B3< RealType >::SetHSize ( const gp_XYZ & theHSize)
inlinenoexcept

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

◆ SetHSize() [2/2]

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

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

◆ SquareExtent()

template<typename RealType >
constexpr double Bnd_B3< 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_B3< RealType > Bnd_B3< RealType >::Transformed ( const gp_Trsf & 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_B3< 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: