mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
0028776: Extend the field BOPAlgo_Builder::myOrigins so that the shape could have multiple origins
Change the type of the field BOPAlgo_Builder::myOrigins so that the new shape could have multiple origins in case of overlapping.
This commit is contained in:
@@ -148,7 +148,7 @@ const BOPCol_DataMapOfShapeListOfShape& BOPAlgo_Builder::Images()const
|
||||
//function : Origins
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
const BOPCol_DataMapOfShapeShape& BOPAlgo_Builder::Origins()const
|
||||
const BOPCol_DataMapOfShapeListOfShape& BOPAlgo_Builder::Origins()const
|
||||
{
|
||||
return myOrigins;
|
||||
}
|
||||
|
@@ -86,7 +86,7 @@ Standard_EXPORT virtual ~BOPAlgo_Builder();
|
||||
Standard_EXPORT Standard_Boolean IsInterferred (const TopoDS_Shape& theS) const;
|
||||
|
||||
//! Returns myOrigins.
|
||||
Standard_EXPORT const BOPCol_DataMapOfShapeShape& Origins() const;
|
||||
Standard_EXPORT const BOPCol_DataMapOfShapeListOfShape& Origins() const;
|
||||
|
||||
//! Returns myShapesSD.
|
||||
Standard_EXPORT const BOPCol_DataMapOfShapeShape& ShapesSD() const;
|
||||
@@ -171,7 +171,7 @@ protected:
|
||||
BOPCol_DataMapOfShapeListOfShape myImages;
|
||||
BOPCol_DataMapOfShapeShape myShapesSD;
|
||||
BOPCol_DataMapOfShapeListOfShape mySplits;
|
||||
BOPCol_DataMapOfShapeShape myOrigins;
|
||||
BOPCol_DataMapOfShapeListOfShape myOrigins;
|
||||
Standard_Boolean myNonDestructive;
|
||||
BOPAlgo_GlueEnum myGlue;
|
||||
|
||||
|
@@ -38,7 +38,7 @@
|
||||
//function : FillImagesVertices
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
void BOPAlgo_Builder::FillImagesVertices()
|
||||
void BOPAlgo_Builder::FillImagesVertices()
|
||||
{
|
||||
myErrorStatus=0;
|
||||
//
|
||||
@@ -59,6 +59,12 @@
|
||||
myImages.Bind(aV, aLVSD);
|
||||
//
|
||||
myShapesSD.Bind(aV, aVSD);
|
||||
//
|
||||
BOPCol_ListOfShape* pLOr = myOrigins.ChangeSeek(aVSD);
|
||||
if (!pLOr) {
|
||||
pLOr = myOrigins.Bound(aVSD, BOPCol_ListOfShape());
|
||||
}
|
||||
pLOr->Append(aV);
|
||||
}
|
||||
}
|
||||
//=======================================================================
|
||||
@@ -97,7 +103,12 @@
|
||||
Standard_Integer nSpR = aPBR->Edge();
|
||||
const TopoDS_Shape& aSpR = myDS->Shape(nSpR);
|
||||
pLS->Append(aSpR);
|
||||
myOrigins.Bind(aSpR, aE);
|
||||
//
|
||||
BOPCol_ListOfShape* pLOr = myOrigins.ChangeSeek(aSpR);
|
||||
if (!pLOr) {
|
||||
pLOr = myOrigins.Bound(aSpR, BOPCol_ListOfShape());
|
||||
}
|
||||
pLOr->Append(aE);
|
||||
//
|
||||
if (myDS->IsCommonBlockOnEdge(aPB)) {
|
||||
Standard_Integer nSp = aPB->Edge();
|
||||
|
@@ -707,7 +707,12 @@ void BOPAlgo_Builder::FillImagesFaces1()
|
||||
aItLS.Initialize(aLFIm);
|
||||
for (; aItLS.More(); aItLS.Next()) {
|
||||
const TopoDS_Face& aFSp=(*(TopoDS_Face*)(&aItLS.Value()));
|
||||
myOrigins.Bind(aFSp, aF);
|
||||
//
|
||||
BOPCol_ListOfShape* pLOr = myOrigins.ChangeSeek(aFSp);
|
||||
if (!pLOr) {
|
||||
pLOr = myOrigins.Bound(aFSp, BOPCol_ListOfShape());
|
||||
}
|
||||
pLOr->Append(aF);
|
||||
}
|
||||
//
|
||||
// 3.
|
||||
|
@@ -894,10 +894,7 @@ void BOPAlgo_Builder::BuildSplitSolids
|
||||
const BOPCol_ListOfShape& aLSR=aBS.Areas();
|
||||
//
|
||||
if (!myImages.IsBound(aS)) {
|
||||
BOPCol_ListOfShape aLSx;
|
||||
//
|
||||
myImages.Bind(aS, aLSx);
|
||||
BOPCol_ListOfShape& aLSIm=myImages.ChangeFind(aS);
|
||||
BOPCol_ListOfShape* pLSx = myImages.Bound(aS, BOPCol_ListOfShape());
|
||||
//
|
||||
aIt.Initialize(aLSR);
|
||||
for (; aIt.More(); aIt.Next()) {
|
||||
@@ -910,7 +907,13 @@ void BOPAlgo_Builder::BuildSplitSolids
|
||||
//
|
||||
const BOPTools_Set& aSTx=aMST.Added(aST);
|
||||
const TopoDS_Shape& aSx=aSTx.Shape();
|
||||
aLSIm.Append(aSx);
|
||||
pLSx->Append(aSx);
|
||||
//
|
||||
BOPCol_ListOfShape* pLOr = myOrigins.ChangeSeek(aSx);
|
||||
if (!pLOr) {
|
||||
pLOr = myOrigins.Bound(aSx, BOPCol_ListOfShape());
|
||||
}
|
||||
pLOr->Append(aS);
|
||||
//
|
||||
if (bFlagSD) {
|
||||
myShapesSD.Bind(aSR, aSx);
|
||||
@@ -1105,8 +1108,8 @@ void BOPAlgo_Builder::FillInternalShapes()
|
||||
continue;
|
||||
}
|
||||
//
|
||||
if(aMSOr.Contains(aSd)) {
|
||||
//
|
||||
if (aMSOr.Contains(aSd)) {
|
||||
// make new solid
|
||||
TopoDS_Solid aSdx;
|
||||
//
|
||||
aBB.MakeSolid(aSdx);
|
||||
@@ -1118,15 +1121,12 @@ void BOPAlgo_Builder::FillInternalShapes()
|
||||
//
|
||||
aBB.Add(aSdx, aSI);
|
||||
//
|
||||
if (myImages.IsBound(aSdx)) {
|
||||
BOPCol_ListOfShape& aLS=myImages.ChangeFind(aSdx);
|
||||
aLS.Append(aSdx);
|
||||
}
|
||||
else {
|
||||
BOPCol_ListOfShape aLS;
|
||||
aLS.Append(aSdx);
|
||||
myImages.Bind(aSd, aLS);
|
||||
}
|
||||
// no need to check for images of aSd as aMSOr contains only original solids
|
||||
BOPCol_ListOfShape* pLS = myImages.Bound(aSd, BOPCol_ListOfShape());
|
||||
pLS->Append(aSdx);
|
||||
//
|
||||
BOPCol_ListOfShape* pLOr = myOrigins.Bound(aSdx, BOPCol_ListOfShape());
|
||||
pLOr->Append(aSd);
|
||||
//
|
||||
aMSOr.Remove(aSd);
|
||||
aSd=aSdx;
|
||||
|
Reference in New Issue
Block a user