Open CASCADE Technology  7.4.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 theType , class theTypeHasher >
static void MakeBlocks (const NCollection_IndexedDataMap< theType, NCollection_List< theType >, theTypeHasher > &theMILI, NCollection_List< NCollection_List< theType >> &theMBlocks, const Handle< NCollection_BaseAllocator > &theAllocator)
 Makes the chains of the connected elements from the given connexity map. More...
 
template<class theType , class theTypeHasher >
static void FillMap (const theType &n1, const theType &n2, NCollection_IndexedDataMap< theType, NCollection_List< theType >, theTypeHasher > &theMILI, const Handle< NCollection_BaseAllocator > &theAllocator)
 Fills the map with the connected entities. More...
 
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. More...
 
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>. More...
 
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.
More...
 
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.
More...
 
static void IntersectVertices (const TopTools_IndexedDataMapOfShapeReal &theVertices, const Standard_Real theFuzzyValue, TopTools_ListOfListOfShape &theChains)
 Finds chains of intersecting vertices. More...
 
static void TreatCompound (const TopoDS_Shape &theS, TopTools_MapOfShape &theMFence, TopTools_ListOfShape &theLS)
 Collect in the output list recursively all non-compound subshapes of the first level of the given shape theS. If a shape presents in the map theMFence it is skipped. All shapes put in the output are also added into theMFence. More...
 
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())
 Classifies the faces <theFaces> relatively solids <theSolids>. The IN faces for solids are stored into output data map <theInParts>. More...
 
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. More...
 

Detailed Description

Provides tools used in the intersection part of Boolean operations.

Member Function Documentation

◆ ClassifyFaces()

static void BOPAlgo_Tools::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() 
)
static

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- Cashed geometrical tools to speed-up classifications

◆ FillMap() [1/2]

template<class theType , class theTypeHasher >
static void BOPAlgo_Tools::FillMap ( const theType &  n1,
const theType &  n2,
NCollection_IndexedDataMap< theType, NCollection_List< theType >, theTypeHasher > &  theMILI,
const Handle< NCollection_BaseAllocator > &  theAllocator 
)
inlinestatic

Fills the map with the connected entities.

◆ FillMap() [2/2]

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

◆ 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 theType , class theTypeHasher >
static void BOPAlgo_Tools::MakeBlocks ( const NCollection_IndexedDataMap< theType, NCollection_List< theType >, theTypeHasher > &  theMILI,
NCollection_List< NCollection_List< theType >> &  theMBlocks,
const Handle< NCollection_BaseAllocator > &  theAllocator 
)
inlinestatic

Makes the chains of the connected elements from the given connexity 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>.

◆ TreatCompound()

static void BOPAlgo_Tools::TreatCompound ( const TopoDS_Shape theS,
TopTools_MapOfShape theMFence,
TopTools_ListOfShape theLS 
)
static

Collect in the output list recursively all non-compound subshapes of the first level of the given shape theS. If a shape presents in the map theMFence it is skipped. All shapes put in the output are also added into theMFence.

◆ 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: