![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
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< 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. | |
| 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. | |
Template class for 2D bounding box. This is a base template that is instantiated for double and float.
Empty constructor.
|
inlineconstexprnoexcept |
Constructor.
|
inlineconstexprnoexcept |
Constructor.
Update the box by another box.
Update the box by a point.
Update the box by a point.
|
inlineconstexprnoexcept |
Get the Center coordinates.
|
inlinestaticconstexprprotectednoexcept |
|
inlinestaticprotectednoexcept |
Query a box corner: (Center + HSize). You must make sure that the box is NOT VOID (see IsVoid()), otherwise the method returns irrelevant result.
Query a box corner: (Center - HSize). You must make sure that the box is NOT VOID (see IsVoid()), otherwise the method returns irrelevant result.
Extend the Box by the absolute value of theDiff.
|
inlineconstexprnoexcept |
Get the HSize (half-diagonal) coordinates.
|
inlineconstexprnoexcept |
Check that the box 'this' is inside the given box 'theBox'. Returns True if 'this' box is fully inside 'theBox'.
| 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'.
|
inlineconstexprnoexcept |
Check the given box for the intersection with the current box. Returns True if there is no intersection between boxes.
| 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.
Check the given Line for the intersection with the current box. Returns True if there is no intersection.
| 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.
Check the Segment defined by the couple of input points for the intersection with the current box. Returns True if there is no intersection.
Check the given point for the inclusion in the Box. Returns True if the point is outside.
Returns True if the box is void (non-initialized).
Limit the Box by the internals of theOtherBox. Returns True if the limitation takes place, otherwise False indicating that the boxes do not intersect.
Set the Center coordinates.
Set the Center coordinates.
Set the HSize (half-diagonal) coordinates. All components of theHSize must be non-negative.
Set the HSize (half-diagonal) coordinates. All components of theHSize must be non-negative.
Query the square diagonal. If the box is VOID (see method IsVoid()) then a very big real value is returned.
Transform the bounding box with the given transformation. The resulting box will be larger if theTrsf contains rotation.
Constant representing a very large value for void box initialization.