Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions
Bnd_BoundSortBox Class Reference

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>

Public Member Functions

 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.
 

Detailed Description

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:

Constructor & Destructor Documentation

◆ Bnd_BoundSortBox()

Bnd_BoundSortBox::Bnd_BoundSortBox ( )

Constructs an empty comparison algorithm for bounding boxes. The bounding boxes are then defined using the Initialize function.

Member Function Documentation

◆ 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
    theBoxThe bounding box to be added.
    theIndexThe index of the bounding box in the internal array where the box will be added. The index is 1-based.

◆ Compare() [1/2]

const NCollection_List< int > & Bnd_BoundSortBox::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.

Parameters
theBoxThe 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]

const NCollection_List< int > & Bnd_BoundSortBox::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.

Parameters
thePlaneThe 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
theEnclosingBoxThe bounding box that contains all the boxes to be sorted.
theNbComponentsThe number of components to be added.

◆ Initialize() [2/3]

void Bnd_BoundSortBox::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.

Parameters
theEnclosingBoxThe bounding box that contains all the boxes in theSetOfBoxes.
theSetOfBoxesThe set of bounding boxes to be used by this algorithm.

◆ Initialize() [3/3]

void Bnd_BoundSortBox::Initialize ( const occ::handle< NCollection_HArray1< Bnd_Box > > & theSetOfBoxes)

Initializes this comparison algorithm with the set of boxes.

Parameters
theSetOfBoxesThe set of bounding boxes to be used by this algorithm.

The documentation for this class was generated from the following file: