A tool to compare a bounding box or a plane with a set of bounding boxes. It sorts the set of bounding boxes to give the list of boxes which intersect the element being compared. The boxes being sorted generally bound a set of shapes, while the box being compared bounds a shape to be compared. The resulting list of intersecting boxes therefore gives the list of items which potentially intersect the shape to be compared. How to use this class:
More...
#include <Bnd_BoundSortBox.hxx>
|
| | Bnd_BoundSortBox () |
| | Constructs an empty comparison algorithm for bounding boxes. The bounding boxes are then defined using the Initialize function.
|
| |
| void | Initialize (const occ::handle< NCollection_HArray1< Bnd_Box > > &theSetOfBoxes) |
| | Initializes this comparison algorithm with the set of boxes.
|
| |
| void | Initialize (const Bnd_Box &theEnclosingBox, const occ::handle< NCollection_HArray1< Bnd_Box > > &theSetOfBoxes) |
| | Initializes this comparison algorithm with the set of boxes and the bounding box that encloses all those boxes. This version of initialization can be used if complete box is known in advance to avoid calculating it again inside the algorithm.
|
| |
| void | Initialize (const Bnd_Box &theEnclosingBox, const int theNbBoxes) |
| | Initializes this comparison algorithm with the bounding box that encloses all the boxes that will be used by this algorithm. and the expected number of those boxes. Boxes to be considered can then be added using the Add() method.
|
| |
| void | Add (const Bnd_Box &theBox, const int theIndex) |
| | Adds the bounding box theBox at position boxIndex in the internal array of boxes to be sorted by this comparison algorithm. This function is used only in conjunction with the Initialize(const Bnd_Box&, const int) method. Exceptions:
|
| |
| const NCollection_List< int > & | Compare (const Bnd_Box &theBox) |
| | Compares the bounding box theBox, with the set of bounding boxes provided to this algorithm at initialization, and returns the list of indices of bounding boxes that intersect the theBox or are inside it. The indices correspond to the indices of the bounding boxes in the array provided to this algorithm at initialization.
|
| |
| const NCollection_List< int > & | Compare (const gp_Pln &thePlane) |
| | Compares the plane thePlane with the set of bounding boxes provided to this algorithm at initialization, and returns the list of indices of bounding boxes that intersect the thePlane. The indices correspond to the indices of the bounding boxes in the array provided to this algorithm at initialization.
|
| |
A tool to compare a bounding box or a plane with a set of bounding boxes. It sorts the set of bounding boxes to give the list of boxes which intersect the element being compared. The boxes being sorted generally bound a set of shapes, while the box being compared bounds a shape to be compared. The resulting list of intersecting boxes therefore gives the list of items which potentially intersect the shape to be compared. How to use this class:
- Create an instance of this class.
- Initialize it with the set of boxes to be sorted using one of the Initialize() methods.
- Call the Compare() method with the box or plane to be compared. Compare() will return the list of indices of the boxes which intersect the box or plane passed as argument.
◆ Bnd_BoundSortBox()
| Bnd_BoundSortBox::Bnd_BoundSortBox |
( |
| ) |
|
Constructs an empty comparison algorithm for bounding boxes. The bounding boxes are then defined using the Initialize function.
◆ Add()
| void Bnd_BoundSortBox::Add |
( |
const Bnd_Box & | theBox, |
|
|
const int | theIndex ) |
Adds the bounding box theBox at position boxIndex in the internal array of boxes to be sorted by this comparison algorithm. This function is used only in conjunction with the Initialize(const Bnd_Box&, const int) method. Exceptions:
- Standard_OutOfRange if boxIndex is not in the range [ 1,nbComponents ] where nbComponents is the maximum number of bounding boxes declared for this algorithm at initialization.
- Standard_MultiplyDefined if a box already exists at position
theIndex in the internal array of boxes. - Parameters
-
| theBox | The bounding box to be added. |
| theIndex | The index of the bounding box in the internal array where the box will be added. The index is 1-based. |
◆ Compare() [1/2]
Compares the bounding box theBox, with the set of bounding boxes provided to this algorithm at initialization, and returns the list of indices of bounding boxes that intersect the theBox or are inside it. The indices correspond to the indices of the bounding boxes in the array provided to this algorithm at initialization.
- Parameters
-
| theBox | The bounding box to be compared. |
- Returns
- The list of indices of bounding boxes that intersect the bounding box theBox or are inside it.
◆ Compare() [2/2]
Compares the plane thePlane with the set of bounding boxes provided to this algorithm at initialization, and returns the list of indices of bounding boxes that intersect the thePlane. The indices correspond to the indices of the bounding boxes in the array provided to this algorithm at initialization.
- Parameters
-
| thePlane | The plane to be compared. |
- Returns
- The list of indices of bounding boxes that intersect the plane thePlane.
◆ Initialize() [1/3]
| void Bnd_BoundSortBox::Initialize |
( |
const Bnd_Box & | theEnclosingBox, |
|
|
const int | theNbBoxes ) |
Initializes this comparison algorithm with the bounding box that encloses all the boxes that will be used by this algorithm. and the expected number of those boxes. Boxes to be considered can then be added using the Add() method.
- Parameters
-
| theEnclosingBox | The bounding box that contains all the boxes to be sorted. |
| theNbComponents | The number of components to be added. |
◆ Initialize() [2/3]
Initializes this comparison algorithm with the set of boxes and the bounding box that encloses all those boxes. This version of initialization can be used if complete box is known in advance to avoid calculating it again inside the algorithm.
- Parameters
-
| theEnclosingBox | The bounding box that contains all the boxes in theSetOfBoxes. |
| theSetOfBoxes | The set of bounding boxes to be used by this algorithm. |
◆ Initialize() [3/3]
Initializes this comparison algorithm with the set of boxes.
- Parameters
-
| theSetOfBoxes | The set of bounding boxes to be used by this algorithm. |
The documentation for this class was generated from the following file: