mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0024157: Parallelization of assembly part of BO
New features class BOPAlgo_BuilderSolid -method: void BOPAlgo_BuilderSolid::SetSolid(const TopoDS_Solid& theSolid) has been added. Purpose: Sets the source solid <theSolid> class BOPAlgo_BuilderSolid -method: const TopoDS_Solid& BOPAlgo_BuilderSolid::Solid()const has been added. Purpose: Returns the source solid Auxiliary classes BOPAlgo_BuilderSolidFunctor BOPAlgo_BuilderSolidCnt have been added. Purpose: The classes provide the interface and implementation of the parallel computations. class BOPTools_AlgoTools -method: Standard_Boolean BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& theShell) has been added. Purpose: Returns true if the shell <theShell> is open class BOPTools_AlgoTools -method: Standard_Boolean BOPTools_AlgoTools::IsInvertedSolid(const TopoDS_Solid& theSolid) has been added. Purpose: Returns true if the solid <theSolid> is inverted class BOPDS_DS -protected method: void BOPDS_DS::BuildBndBoxSolid(const Standard_Integer theIndex, Bnd_Box& theBoxS) has been added. The method computes bouding box <theBoxS> for the solid with DS-index <theIndex> Changes class BOPDS_DS - method: void BOPDS_DS::Init() The block to compute bouding box for the solids has been added. class BOPAlgo_Builder - method: void BOPAlgo_Builder::FillIn3DParts (BOPCol_DataMapOfShapeListOfShape& theInParts, BOPCol_DataMapOfShapeShape& theDraftSolids, const BOPCol_BaseAllocator& theAllocator) The order of treatment of the unbalanced binary tree of overlapped bounding boxes has been changed class BOPAlgo_Builder - method: void BOPAlgo_Builder::BuildSplitSolids (BOPCol_DataMapOfShapeListOfShape& theInParts, BOPCol_DataMapOfShapeShape& theDraftSolids, const BOPCol_BaseAllocator& theAllocator) The algorithm has been adapted to provide the parallel computations
This commit is contained in:
@@ -30,7 +30,8 @@ uses
|
||||
Vertex from TopoDS,
|
||||
Edge from TopoDS,
|
||||
Face from TopoDS,
|
||||
Wire from TopoDS,
|
||||
Wire from TopoDS,
|
||||
Shell from TopoDS,
|
||||
Solid from TopoDS,
|
||||
--
|
||||
BaseAllocator from BOPCol,
|
||||
@@ -446,5 +447,15 @@ is
|
||||
returns Integer from Standard;
|
||||
---Purpose:
|
||||
--- Retutns dimension of the shape <theS>.
|
||||
|
||||
|
||||
IsOpenShell(myclass;
|
||||
theShell:Shell from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns true if the shell <theShell> is open
|
||||
|
||||
IsInvertedSolid(myclass;
|
||||
theSolid:Solid from TopoDS)
|
||||
returns Boolean from Standard;
|
||||
---Purpose: Returns true if the solid <theSolid> is inverted
|
||||
|
||||
end AlgoTools;
|
||||
|
@@ -1880,3 +1880,63 @@ Standard_Boolean FindPointInFace(const TopoDS_Edge& aE,
|
||||
bRet = aDist < Precision::Angular();
|
||||
return bRet;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsOpenShell
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean
|
||||
BOPTools_AlgoTools::IsOpenShell(const TopoDS_Shell& aSh)
|
||||
{
|
||||
Standard_Boolean bRet;
|
||||
Standard_Integer i, aNbE, aNbF;
|
||||
TopAbs_Orientation aOrF;
|
||||
BOPCol_IndexedDataMapOfShapeListOfShape aMEF;
|
||||
BOPCol_ListIteratorOfListOfShape aItLS;
|
||||
//
|
||||
bRet=Standard_False;
|
||||
//
|
||||
BOPTools::MapShapesAndAncestors(aSh, TopAbs_EDGE, TopAbs_FACE, aMEF);
|
||||
//
|
||||
aNbE=aMEF.Extent();
|
||||
for (i=1; i<=aNbE; ++i) {
|
||||
const TopoDS_Edge& aE=*((TopoDS_Edge*)&aMEF.FindKey(i));
|
||||
if (BRep_Tool::Degenerated(aE)) {
|
||||
continue;
|
||||
}
|
||||
//
|
||||
aNbF=0;
|
||||
const BOPCol_ListOfShape& aLF=aMEF(i);
|
||||
aItLS.Initialize(aLF);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Shape& aF=aItLS.Value();
|
||||
aOrF=aF.Orientation();
|
||||
if (aOrF==TopAbs_INTERNAL || aOrF==TopAbs_EXTERNAL) {
|
||||
continue;
|
||||
}
|
||||
++aNbF;
|
||||
}
|
||||
//
|
||||
if (aNbF==1) {
|
||||
bRet=!bRet; // True
|
||||
break;
|
||||
}
|
||||
}
|
||||
//
|
||||
return bRet;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsInvertedSolid
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
Standard_Boolean
|
||||
BOPTools_AlgoTools::IsInvertedSolid(const TopoDS_Solid& aSolid)
|
||||
{
|
||||
Standard_Real aTolS;
|
||||
TopAbs_State aState;
|
||||
BRepClass3d_SolidClassifier aSC(aSolid);
|
||||
//
|
||||
aTolS=1.e-7;
|
||||
aSC.PerformInfinitePoint(aTolS);
|
||||
aState=aSC.State();
|
||||
return (aState==TopAbs_IN);
|
||||
}
|
||||
|
Reference in New Issue
Block a user