mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-16 10:08:36 +03:00
0026701: BOPAlgo_Builder::Perform crash.
Data race eliminated (PCurves are stored in edges after paralleled calculation) Add comments and make minor cosmetic changes.
This commit is contained in:
parent
b9f21bee94
commit
575e33ceba
@ -304,13 +304,28 @@ class BOPAlgo_BPC {
|
|||||||
myE=aE;
|
myE=aE;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
const TopoDS_Edge& GetEdge() const {
|
||||||
|
return myE;
|
||||||
|
}
|
||||||
|
const TopoDS_Face& GetFace() const {
|
||||||
|
return myF;
|
||||||
|
}
|
||||||
|
const Handle_Geom2d_Curve& GetCurve2d() const {
|
||||||
|
return myCurve;
|
||||||
|
}
|
||||||
|
Standard_Boolean IsToUpdate() const {
|
||||||
|
return myToUpdate;
|
||||||
|
}
|
||||||
|
//
|
||||||
void Perform() {
|
void Perform() {
|
||||||
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnPlane (myE, myF);
|
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnPlane (myE, myF, myCurve, myToUpdate);
|
||||||
};
|
};
|
||||||
//
|
//
|
||||||
protected:
|
protected:
|
||||||
TopoDS_Edge myE;
|
TopoDS_Edge myE;
|
||||||
TopoDS_Face myF;
|
TopoDS_Face myF;
|
||||||
|
Handle_Geom2d_Curve myCurve;
|
||||||
|
Standard_Boolean myToUpdate;
|
||||||
};
|
};
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
typedef BOPCol_NCVector
|
typedef BOPCol_NCVector
|
||||||
@ -748,6 +763,7 @@ void BOPAlgo_PaveFiller::Prepare()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
// Build pcurves of edges on planes; first collect pairs edge-face.
|
||||||
BOPAlgo_VectorOfBPC aVBPC;
|
BOPAlgo_VectorOfBPC aVBPC;
|
||||||
//
|
//
|
||||||
for (i = 1; i <= aNbF; ++i) {
|
for (i = 1; i <= aNbF; ++i) {
|
||||||
@ -764,6 +780,17 @@ void BOPAlgo_PaveFiller::Prepare()
|
|||||||
//======================================================
|
//======================================================
|
||||||
BOPAlgo_BPCCnt::Perform(myRunParallel, aVBPC);
|
BOPAlgo_BPCCnt::Perform(myRunParallel, aVBPC);
|
||||||
//======================================================
|
//======================================================
|
||||||
|
|
||||||
|
// pcurves are built, and now update edges
|
||||||
|
BRep_Builder aBB;
|
||||||
|
TopoDS_Edge E;
|
||||||
|
for (i = 0; i < aVBPC.Extent(); i++) {
|
||||||
|
const BOPAlgo_BPC& aBPC=aVBPC(i);
|
||||||
|
if (aBPC.IsToUpdate()) {
|
||||||
|
Standard_Real aTolE = BRep_Tool::Tolerance(aBPC.GetEdge());
|
||||||
|
aBB.UpdateEdge(aBPC.GetEdge(), aBPC.GetCurve2d(), aBPC.GetFace(), aTolE);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsBasedOnPlane
|
//function : IsBasedOnPlane
|
||||||
|
@ -158,6 +158,12 @@ is
|
|||||||
theE : Edge from TopoDS;
|
theE : Edge from TopoDS;
|
||||||
theF : Face from TopoDS);
|
theF : Face from TopoDS);
|
||||||
|
|
||||||
|
BuildPCurveForEdgeOnPlane(myclass;
|
||||||
|
theE : Edge from TopoDS;
|
||||||
|
theF : Face from TopoDS;
|
||||||
|
theC2D: out Curve from Geom2d;
|
||||||
|
bToUpdate: out Boolean);
|
||||||
|
|
||||||
BuildPCurveForEdgesOnPlane(myclass;
|
BuildPCurveForEdgesOnPlane(myclass;
|
||||||
theLE : ListOfShape from BOPCol;
|
theLE : ListOfShape from BOPCol;
|
||||||
theF : Face from TopoDS);
|
theF : Face from TopoDS);
|
||||||
|
@ -505,6 +505,21 @@ void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnPlane
|
|||||||
aBB.UpdateEdge(aE, aC2D, aF, aTolE);
|
aBB.UpdateEdge(aE, aC2D, aF, aTolE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : BuildPCurveForEdgeOnPlane
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void BOPTools_AlgoTools2D::BuildPCurveForEdgeOnPlane
|
||||||
|
(const TopoDS_Edge& aE,
|
||||||
|
const TopoDS_Face& aF,
|
||||||
|
Handle(Geom2d_Curve)& aC2D,
|
||||||
|
Standard_Boolean& bToUpdate)
|
||||||
|
{
|
||||||
|
Standard_Real aT1, aT2;
|
||||||
|
aC2D=BRep_Tool_CurveOnSurface(aE, aF, aT1, aT2, bToUpdate);
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// function: BuildPCurveForEdgesOnPlane
|
// function: BuildPCurveForEdgesOnPlane
|
||||||
// purpose:
|
// purpose:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user