PAL9151. Restore some code from V2_2_2 revision

This commit is contained in:
eap 2005-06-15 12:43:07 +00:00
parent 8039f8cb66
commit 987a247e12

View File

@ -566,10 +566,9 @@ static
// //
if (aCBAPI.IsCommonBlock(aPB)) { if (aCBAPI.IsCommonBlock(aPB)) {
// it can be Common Block // it can be Common Block
Standard_Boolean bHasPCOnF, bFound; Standard_Real aTolEx;
Standard_Integer nF, k, nEOrx, nF1x, nF2x; Handle(Geom2d_Curve) aC2D1, aC2D2;
Standard_Real aTolEx, aT1x, aT2x; TopoDS_Face aF1FWD, aF2FWD;
BOPTools_ListIteratorOfListOfPaveBlock aItPBx;
// //
NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB); NMTTools_CommonBlock& aCB=aCBAPI.CommonBlock(aPB);
const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks(); const BOPTools_ListOfPaveBlock& aLPBx=aCB.PaveBlocks();
@ -578,50 +577,67 @@ static
mE=aPB.Edge(); // index of edge in tDS mE=aPB.Edge(); // index of edge in tDS
const TopoDS_Edge& aEx=TopoDS::Edge(tDS.Shape(mE)); const TopoDS_Edge& aEx=TopoDS::Edge(tDS.Shape(mE));
aTolEx=BRep_Tool::Tolerance(aEx); aTolEx=BRep_Tool::Tolerance(aEx);
//
// Commented out by EAP in the frame of PAL9151
//
// Standard_Boolean bHasPCOnF, bFound;
// Standard_Integer nF, k, nEOrx, nF1x, nF2x;
// Standard_Real aTolEx, aT1x, aT2x;
// BOPTools_ListIteratorOfListOfPaveBlock aItPBx;
// //
for (k=0; k<2; ++k) { // for (k=0; k<2; ++k) {
nF=(!k) ? nF1 : nF2; // nF=(!k) ? nF1 : nF2;
const TopoDS_Face& aF=TopoDS::Face(myDS->Shape(nF)); // const TopoDS_Face& aF=TopoDS::Face(myDS->Shape(nF));
// // //
bHasPCOnF=BOPTools_Tools2D::HasCurveOnSurface(aEx, aF); // bHasPCOnF=BOPTools_Tools2D::HasCurveOnSurface(aEx, aF);
if (bHasPCOnF) { // if (bHasPCOnF) {
continue; // continue;
} // }
// // //
bFound=Standard_False; // bFound=Standard_False;
aItPBx.Initialize(aLPBx); // aItPBx.Initialize(aLPBx);
for (; aItPBx.More(); aItPBx.Next()) { // for (; aItPBx.More(); aItPBx.Next()) {
BOPTools_PaveBlock& aPBx=aIt.Value(); // BOPTools_PaveBlock& aPBx=aIt.Value();
nEOrx=aPBx.OriginalEdge(); // nEOrx=aPBx.OriginalEdge();
const TopoDS_Shape& aEOrx=tDS.Shape(nEOrx); // const TopoDS_Shape& aEOrx=tDS.Shape(nEOrx);
BOPTools_PaveBlock& aPBSEx=aMEPB.ChangeFromKey(aEOrx); // BOPTools_PaveBlock& aPBSEx=aMEPB.ChangeFromKey(aEOrx);
aT1x=aPBSEx.Pave1().Param(); // aT1x=aPBSEx.Pave1().Param();
aT2x=aPBSEx.Pave2().Param(); // aT2x=aPBSEx.Pave2().Param();
const IntTools_Curve& aICx=aPBSEx.Curve(); // const IntTools_Curve& aICx=aPBSEx.Curve();
// // //
nF1x=aPBSEx.Face1(); // nF1x=aPBSEx.Face1();
nF2x=aPBSEx.Face2(); // nF2x=aPBSEx.Face2();
// // //
if (nF1x==nF) { // if (nF1x==nF) {
Handle(Geom2d_Curve) aC2D1x=aICx.FirstCurve2d(); // Handle(Geom2d_Curve) aC2D1x=aICx.FirstCurve2d();
Handle(Geom2d_TrimmedCurve)aC2D1xT =new Geom2d_TrimmedCurve(aC2D1x, aT1x, aT2x); // Handle(Geom2d_TrimmedCurve)aC2D1xT =new Geom2d_TrimmedCurve(aC2D1x, aT1x, aT2x);
aBB.UpdateEdge(aEx, aC2D1xT, aF, aTolEx); // aBB.UpdateEdge(aEx, aC2D1xT, aF, aTolEx);
bFound=!bFound; // bFound=!bFound;
break; // break;
} // }
// // //
if (nF2x==nF) { // if (nF2x==nF) {
Handle(Geom2d_Curve) aC2D2x=aICx.SecondCurve2d(); // Handle(Geom2d_Curve) aC2D2x=aICx.SecondCurve2d();
Handle(Geom2d_TrimmedCurve)aC2D2xT =new Geom2d_TrimmedCurve(aC2D2x, aT1x, aT2x); // Handle(Geom2d_TrimmedCurve)aC2D2xT =new Geom2d_TrimmedCurve(aC2D2x, aT1x, aT2x);
aBB.UpdateEdge(aEx, aC2D2xT, aF, aTolEx); // aBB.UpdateEdge(aEx, aC2D2xT, aF, aTolEx);
bFound=!bFound; // bFound=!bFound;
break; // break;
} // }
} // }
if (bFound){ // if (bFound){
BRepLib::SameParameter(aEx, aTolEx, Standard_True); // BRepLib::SameParameter(aEx, aTolEx, Standard_True);
} // }
} // }
//
// The code till the if block end is restored from V2_2_2 revision
//
aF1FWD=aF1;
aF1FWD.Orientation(TopAbs_FORWARD);
NMTTools_Tools::MakePCurve(aEx, aF1FWD, aC2D1, aTolEx);
//
aF2FWD=aF2;
aF2FWD.Orientation(TopAbs_FORWARD);
NMTTools_Tools::MakePCurve(aEx, aF2FWD, aC2D2, aTolEx);
} //if (aCBAPI.IsCommonBlock(aPB)) } //if (aCBAPI.IsCommonBlock(aPB))
// //
// new SE // new SE