Open CASCADE Technology 7.8.0
Static Public Member Functions
BOPAlgo_Tools Class Reference

Provides tools used in the intersection part of Boolean operations. More...

#include <BOPAlgo_Tools.hxx>

Static Public Member Functions

template<class TheMap , class TheList >
static void MakeBlocks (const TheMap &theMILI, TheList &theMBlocks, const Handle< NCollection_BaseAllocator > &theAllocator)
 Makes the chains of the connected elements from the given convexity map.
 
template<class TheType , class TheMap >
static void FillMap (const TheType &n1, const TheType &n2, TheMap &theMILI, const Handle< NCollection_BaseAllocator > &theAllocator)
 Fills the map with the connected entities.
 
static void FillMap (const Handle< BOPDS_PaveBlock > &thePB1, const Standard_Integer theF, BOPDS_IndexedDataMapOfPaveBlockListOfInteger &theMILI, const Handle< NCollection_BaseAllocator > &theAllocator)
 
static void PerformCommonBlocks (BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock &theMBlocks, const Handle< NCollection_BaseAllocator > &theAllocator, BOPDS_PDS &theDS, const Handle< IntTools_Context > &theContext=Handle< IntTools_Context >())
 Create Common Blocks from the groups of pave blocks of <theMBlocks> connection map.
 
static void PerformCommonBlocks (const BOPDS_IndexedDataMapOfPaveBlockListOfInteger &theMBlocks, const Handle< NCollection_BaseAllocator > &theAllocator, BOPDS_PDS &pDS, const Handle< IntTools_Context > &theContext=Handle< IntTools_Context >())
 Create Common Blocks on faces using the PB->Faces connection map <theMBlocks>.
 
static Standard_Real ComputeToleranceOfCB (const Handle< BOPDS_CommonBlock > &theCB, const BOPDS_PDS theDS, const Handle< IntTools_Context > &theContext)
 
static Standard_Integer EdgesToWires (const TopoDS_Shape &theEdges, TopoDS_Shape &theWires, const Standard_Boolean theShared=Standard_False, const Standard_Real theAngTol=1.e-8)
 Creates planar wires from the given edges.
The input edges are expected to be planar. And for the performance sake the method does not check if the edges are really planar.
Thus, the result wires will also be not planar if the input edges are not planar.
The edges may be not shared, but the resulting wires will be sharing the coinciding parts and intersecting parts.
The output wires may be non-manifold and contain free and multi-connected vertices.
Parameters: <theEdges> - input edges;
<theWires> - output wires;
<theShared> - boolean flag which defines whether the input edges are already shared or have to be intersected;
<theAngTol> - the angular tolerance which will be used for distinguishing the planes in which the edges are located. Default value is 1.e-8 which is used for intersection of planes in IntTools_FaceFace.
Method returns the following error statuses:
0 - in case of success (at least one wire has been built);
1 - in case there are no edges in the given shape;
2 - sharing of the edges has failed.

 
static Standard_Boolean WiresToFaces (const TopoDS_Shape &theWires, TopoDS_Shape &theFaces, const Standard_Real theAngTol=1.e-8)
 Creates planar faces from given planar wires.
The method does not check if the wires are really planar.
The input wires may be non-manifold but should be shared.
The wires located in the same planes and included into other wires will create holes in the faces built from outer wires.
The tolerance values of the input shapes may be modified during the operation due to projection of the edges on the planes for creation of 2D curves.
Parameters: <theWires> - the given wires;
<theFaces> - the output faces;
<theAngTol> - the angular tolerance for distinguishing the planes in which the wires are located. Default value is 1.e-8 which is used for intersection of planes in IntTools_FaceFace.
Method returns TRUE in case of success, i.e. at least one face has been built.

 
static void IntersectVertices (const TopTools_IndexedDataMapOfShapeReal &theVertices, const Standard_Real theFuzzyValue, TopTools_ListOfListOfShape &theChains)
 Finds chains of intersecting vertices.
 
static void ClassifyFaces (const TopTools_ListOfShape &theFaces, const TopTools_ListOfShape &theSolids, const Standard_Boolean theRunParallel, Handle< IntTools_Context > &theContext, TopTools_IndexedDataMapOfShapeListOfShape &theInParts, const TopTools_DataMapOfShapeBox &theShapeBoxMap=TopTools_DataMapOfShapeBox(), const TopTools_DataMapOfShapeListOfShape &theSolidsIF=TopTools_DataMapOfShapeListOfShape(), const Message_ProgressRange &theRange=Message_ProgressRange())
 Classifies the faces <theFaces> relatively solids <theSolids>. The IN faces for solids are stored into output data map <theInParts>.
 
static void FillInternals (const TopTools_ListOfShape &theSolids, const TopTools_ListOfShape &theParts, const TopTools_DataMapOfShapeListOfShape &theImages, const Handle< IntTools_Context > &theContext)
 Classifies the given parts relatively the given solids and fills the solids with the parts classified as INTERNAL.
 
static Standard_Boolean TrsfToPoint (const Bnd_Box &theBox1, const Bnd_Box &theBox2, gp_Trsf &theTrsf, const gp_Pnt &thePoint=gp_Pnt(0.0, 0.0, 0.0), const Standard_Real theCriteria=1.e+5)
 Computes the transformation needed to move the objects to the given point to increase the quality of computations. Returns true if the objects are located far from the given point (relatively given criteria), false otherwise.
 

Detailed Description

Provides tools used in the intersection part of Boolean operations.

Member Function Documentation

◆ ClassifyFaces()

Classifies the faces <theFaces> relatively solids <theSolids>. The IN faces for solids are stored into output data map <theInParts>.

The map <theSolidsIF> contains INTERNAL faces of the solids, to avoid their additional classification.

Firstly, it checks the intersection of bounding boxes of the shapes. If the Box is not stored in the <theShapeBoxMap> map, it builds the box. If the bounding boxes of solid and face are interfering the classification is performed.

It is assumed that all faces and solids are already intersected and do not have any geometrically coinciding parts without topological sharing of these parts

◆ ComputeToleranceOfCB()

static Standard_Real BOPAlgo_Tools::ComputeToleranceOfCB ( const Handle< BOPDS_CommonBlock > &  theCB,
const BOPDS_PDS  theDS,
const Handle< IntTools_Context > &  theContext 
)
static

◆ EdgesToWires()

static Standard_Integer BOPAlgo_Tools::EdgesToWires ( const TopoDS_Shape theEdges,
TopoDS_Shape theWires,
const Standard_Boolean  theShared = Standard_False,
const Standard_Real  theAngTol = 1.e-8 
)
static

Creates planar wires from the given edges.
The input edges are expected to be planar. And for the performance sake the method does not check if the edges are really planar.
Thus, the result wires will also be not planar if the input edges are not planar.
The edges may be not shared, but the resulting wires will be sharing the coinciding parts and intersecting parts.
The output wires may be non-manifold and contain free and multi-connected vertices.
Parameters: <theEdges> - input edges;
<theWires> - output wires;
<theShared> - boolean flag which defines whether the input edges are already shared or have to be intersected;
<theAngTol> - the angular tolerance which will be used for distinguishing the planes in which the edges are located. Default value is 1.e-8 which is used for intersection of planes in IntTools_FaceFace.
Method returns the following error statuses:
0 - in case of success (at least one wire has been built);
1 - in case there are no edges in the given shape;
2 - sharing of the edges has failed.

◆ FillInternals()

static void BOPAlgo_Tools::FillInternals ( const TopTools_ListOfShape theSolids,
const TopTools_ListOfShape theParts,
const TopTools_DataMapOfShapeListOfShape theImages,
const Handle< IntTools_Context > &  theContext 
)
static

Classifies the given parts relatively the given solids and fills the solids with the parts classified as INTERNAL.

Parameters
theSolids- The solids to put internals to
theParts- The parts to classify relatively solids
theImages- Possible images of the parts that has to be classified
theContext- cached geometrical tools to speed-up classifications

◆ FillMap() [1/2]

static void BOPAlgo_Tools::FillMap ( const Handle< BOPDS_PaveBlock > &  thePB1,
const Standard_Integer  theF,
BOPDS_IndexedDataMapOfPaveBlockListOfInteger theMILI,
const Handle< NCollection_BaseAllocator > &  theAllocator 
)
static

◆ FillMap() [2/2]

template<class TheType , class TheMap >
static void BOPAlgo_Tools::FillMap ( const TheType &  n1,
const TheType &  n2,
TheMap &  theMILI,
const Handle< NCollection_BaseAllocator > &  theAllocator 
)
inlinestatic

Fills the map with the connected entities.

◆ IntersectVertices()

static void BOPAlgo_Tools::IntersectVertices ( const TopTools_IndexedDataMapOfShapeReal theVertices,
const Standard_Real  theFuzzyValue,
TopTools_ListOfListOfShape theChains 
)
static

Finds chains of intersecting vertices.

◆ MakeBlocks()

template<class TheMap , class TheList >
static void BOPAlgo_Tools::MakeBlocks ( const TheMap &  theMILI,
TheList theMBlocks,
const Handle< NCollection_BaseAllocator > &  theAllocator 
)
inlinestatic

Makes the chains of the connected elements from the given convexity map.

◆ PerformCommonBlocks() [1/2]

static void BOPAlgo_Tools::PerformCommonBlocks ( BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock theMBlocks,
const Handle< NCollection_BaseAllocator > &  theAllocator,
BOPDS_PDS theDS,
const Handle< IntTools_Context > &  theContext = HandleIntTools_Context >() 
)
static

Create Common Blocks from the groups of pave blocks of <theMBlocks> connection map.

◆ PerformCommonBlocks() [2/2]

static void BOPAlgo_Tools::PerformCommonBlocks ( const BOPDS_IndexedDataMapOfPaveBlockListOfInteger theMBlocks,
const Handle< NCollection_BaseAllocator > &  theAllocator,
BOPDS_PDS pDS,
const Handle< IntTools_Context > &  theContext = HandleIntTools_Context >() 
)
static

Create Common Blocks on faces using the PB->Faces connection map <theMBlocks>.

◆ TrsfToPoint()

static Standard_Boolean BOPAlgo_Tools::TrsfToPoint ( const Bnd_Box theBox1,
const Bnd_Box theBox2,
gp_Trsf theTrsf,
const gp_Pnt thePoint = gp_Pnt(0.0, 0.0, 0.0),
const Standard_Real  theCriteria = 1.e+5 
)
static

Computes the transformation needed to move the objects to the given point to increase the quality of computations. Returns true if the objects are located far from the given point (relatively given criteria), false otherwise.

Parameters
theBox1the AABB of the first object
theBox2the AABB of the second object
theTrsfthe computed transformation
thePointthe Point to compute transformation to
theCriteriathe Criteria to check whether thranformation is required

◆ WiresToFaces()

static Standard_Boolean BOPAlgo_Tools::WiresToFaces ( const TopoDS_Shape theWires,
TopoDS_Shape theFaces,
const Standard_Real  theAngTol = 1.e-8 
)
static

Creates planar faces from given planar wires.
The method does not check if the wires are really planar.
The input wires may be non-manifold but should be shared.
The wires located in the same planes and included into other wires will create holes in the faces built from outer wires.
The tolerance values of the input shapes may be modified during the operation due to projection of the edges on the planes for creation of 2D curves.
Parameters: <theWires> - the given wires;
<theFaces> - the output faces;
<theAngTol> - the angular tolerance for distinguishing the planes in which the wires are located. Default value is 1.e-8 which is used for intersection of planes in IntTools_FaceFace.
Method returns TRUE in case of success, i.e. at least one face has been built.


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