Template class for 2D bounding box. This is a base template that is instantiated for double and float.
More...
|
| 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.
|
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.