Open CASCADE Technology
7.3.0
|
The class describes the Oriented Bounding Box (OBB), much tighter enclosing volume for the shape than the Axis Aligned Bounding Box (AABB). The OBB is defined by a center of the box, the axes and the halves of its three dimensions. The OBB can be used more effectively than AABB as a rejection mechanism for non-interfering objects. More...
#include <Bnd_OBB.hxx>
Public Member Functions | |
Bnd_OBB () | |
Empty constructor. More... | |
Bnd_OBB (const gp_Pnt &theCenter, const gp_Dir &theXDirection, const gp_Dir &theYDirection, const gp_Dir &theZDirection, const Standard_Real theHXSize, const Standard_Real theHYSize, const Standard_Real theHZSize) | |
Constructor taking all defining parameters. More... | |
Bnd_OBB (const Bnd_Box &theBox) | |
Constructor to create OBB from AABB. More... | |
void | ReBuild (const TColgp_Array1OfPnt &theListOfPoints, const TColStd_Array1OfReal *theListOfTolerances=0) |
Created new OBB covering every point in theListOfPoints. Tolerance of every such point is set by *theListOfTolerances array. If this array is not void (not null-pointer) then the resulted Bnd_OBB will be enlarged using tolerances of points lying on the box surface. More... | |
void | SetCenter (const gp_Pnt &theCenter) |
Sets the center of OBB. More... | |
void | SetXComponent (const gp_Dir &theXDirection, const Standard_Real theHXSize) |
Sets the X component of OBB - direction and size. More... | |
void | SetYComponent (const gp_Dir &theYDirection, const Standard_Real theHYSize) |
Sets the Y component of OBB - direction and size. More... | |
void | SetZComponent (const gp_Dir &theZDirection, const Standard_Real theHZSize) |
Sets the Z component of OBB - direction and size. More... | |
const gp_XYZ & | Center () const |
Returns the center of OBB. More... | |
const gp_XYZ & | XDirection () const |
Returns the X Direction of OBB. More... | |
const gp_XYZ & | YDirection () const |
Returns the Y Direction of OBB. More... | |
const gp_XYZ & | ZDirection () const |
Returns the Z Direction of OBB. More... | |
Standard_Real | XHSize () const |
Returns the X Dimension of OBB. More... | |
Standard_Real | YHSize () const |
Returns the Y Dimension of OBB. More... | |
Standard_Real | ZHSize () const |
Returns the Z Dimension of OBB. More... | |
Standard_Boolean | IsVoid () const |
Checks if the box is empty. More... | |
void | SetVoid () |
Clears this box. More... | |
void | SetAABox (const Standard_Boolean &theFlag) |
Sets the flag for axes aligned box. More... | |
Standard_Boolean | IsAABox () const |
Returns TRUE if the box is axes aligned. More... | |
void | Enlarge (const Standard_Real theGapAdd) |
Enlarges the box with the given value. More... | |
Standard_Boolean | GetVertex (gp_Pnt theP[8]) const |
Returns the array of vertices in <this>. The local coordinate of the vertex depending on the index of the array are follow: Index == 0: (-XHSize(), -YHSize(), -ZHSize()) Index == 1: ( XHSize(), -YHSize(), -ZHSize()) Index == 2: (-XHSize(), YHSize(), -ZHSize()) Index == 3: ( XHSize(), YHSize(), -ZHSize()) Index == 4: (-XHSize(), -YHSize(), ZHSize()) Index == 5: ( XHSize(), -YHSize(), ZHSize()) Index == 6: (-XHSize(), YHSize(), ZHSize()) Index == 7: ( XHSize(), YHSize(), ZHSize()). More... | |
Standard_Real | SquareExtent () const |
Returns square diagonal of this box. More... | |
Standard_Boolean | IsOut (const Bnd_OBB &theOther) const |
Check if the box do not interfere the other box. More... | |
Standard_Boolean | IsOut (const gp_Pnt &theP) const |
Check if the point is inside of <this>. More... | |
Standard_Boolean | IsCompletelyInside (const Bnd_OBB &theOther) const |
Check if the theOther is completely inside *this. More... | |
void | Add (const Bnd_OBB &theOther) |
Rebuilds this in order to include all previous objects (which it was created from) and theOther. More... | |
void | Add (const gp_Pnt &theP) |
Rebuilds this in order to include all previous objects (which it was created from) and theP. More... | |
Protected Member Functions | |
void | ProcessOnePoint (const gp_Pnt &theP) |
The class describes the Oriented Bounding Box (OBB), much tighter enclosing volume for the shape than the Axis Aligned Bounding Box (AABB). The OBB is defined by a center of the box, the axes and the halves of its three dimensions. The OBB can be used more effectively than AABB as a rejection mechanism for non-interfering objects.
|
inline |
Empty constructor.
|
inline |
Constructor taking all defining parameters.
|
inline |
Constructor to create OBB from AABB.
void Bnd_OBB::Add | ( | const Bnd_OBB & | theOther | ) |
Rebuilds this in order to include all previous objects (which it was created from) and theOther.
void Bnd_OBB::Add | ( | const gp_Pnt & | theP | ) |
Rebuilds this in order to include all previous objects (which it was created from) and theP.
|
inline |
Returns the center of OBB.
|
inline |
Enlarges the box with the given value.
|
inline |
Returns the array of vertices in <this>. The local coordinate of the vertex depending on the index of the array are follow: Index == 0: (-XHSize(), -YHSize(), -ZHSize()) Index == 1: ( XHSize(), -YHSize(), -ZHSize()) Index == 2: (-XHSize(), YHSize(), -ZHSize()) Index == 3: ( XHSize(), YHSize(), -ZHSize()) Index == 4: (-XHSize(), -YHSize(), ZHSize()) Index == 5: ( XHSize(), -YHSize(), ZHSize()) Index == 6: (-XHSize(), YHSize(), ZHSize()) Index == 7: ( XHSize(), YHSize(), ZHSize()).
|
inline |
Returns TRUE if the box is axes aligned.
Standard_Boolean Bnd_OBB::IsCompletelyInside | ( | const Bnd_OBB & | theOther | ) | const |
Check if the theOther is completely inside *this.
Standard_Boolean Bnd_OBB::IsOut | ( | const Bnd_OBB & | theOther | ) | const |
Check if the box do not interfere the other box.
Standard_Boolean Bnd_OBB::IsOut | ( | const gp_Pnt & | theP | ) | const |
Check if the point is inside of <this>.
|
inline |
Checks if the box is empty.
|
inlineprotected |
void Bnd_OBB::ReBuild | ( | const TColgp_Array1OfPnt & | theListOfPoints, |
const TColStd_Array1OfReal * | theListOfTolerances = 0 |
||
) |
Created new OBB covering every point in theListOfPoints. Tolerance of every such point is set by *theListOfTolerances array. If this array is not void (not null-pointer) then the resulted Bnd_OBB will be enlarged using tolerances of points lying on the box surface.
|
inline |
Sets the flag for axes aligned box.
|
inline |
Sets the center of OBB.
|
inline |
Clears this box.
|
inline |
Sets the X component of OBB - direction and size.
|
inline |
Sets the Y component of OBB - direction and size.
|
inline |
Sets the Z component of OBB - direction and size.
|
inline |
Returns square diagonal of this box.
|
inline |
Returns the X Direction of OBB.
|
inline |
Returns the X Dimension of OBB.
|
inline |
Returns the Y Direction of OBB.
|
inline |
Returns the Y Dimension of OBB.
|
inline |
Returns the Z Direction of OBB.
|
inline |
Returns the Z Dimension of OBB.