diff --git a/src/BOPAlgo/BOPAlgo_Builder.cdl b/src/BOPAlgo/BOPAlgo_Builder.cdl index dcf982efc8..f28ffd7129 100644 --- a/src/BOPAlgo/BOPAlgo_Builder.cdl +++ b/src/BOPAlgo/BOPAlgo_Builder.cdl @@ -166,11 +166,6 @@ is FillImagesFaces1 (me:out) is protected; - - FillInternalVertices(me:out; - theLF:out ListOfShape from BOPCol; - theLIV:out ListOfInteger from BOPCol) - is protected; -- -- solids -- diff --git a/src/BOPAlgo/BOPAlgo_Builder_2.cxx b/src/BOPAlgo/BOPAlgo_Builder_2.cxx index 778c693cb4..0754b5b629 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_2.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_2.cxx @@ -16,28 +16,30 @@ // commercial license or contractual agreement. #include - +// #include - +// #include #include #include #include #include - +// #include #include - +// #include - +// #include #include #include #include #include - +#include +#include +// #include - +// #include #include #include @@ -47,7 +49,7 @@ #include #include #include - +// #include #include #include @@ -57,7 +59,7 @@ #include #include #include -#include + static Standard_Boolean HasPaveBlocksOnIn(const BOPDS_FaceInfo& aFI1, @@ -71,8 +73,190 @@ static void MakeBlocksCnx(const BOPCol_IndexedDataMapOfShapeListOfShape& aMILI, BOPCol_DataMapOfIntegerListOfShape& aMBlocks, Handle(NCollection_IncAllocator)& aAllocator); - - +// +typedef BOPCol_NCVector BOPAlgo_VectorOfShape; +// +typedef BOPCol_NCVector \ + BOPAlgo_VectorOfVectorOfShape; +// +typedef NCollection_IndexedDataMap\ + \ + BOPAlgo_IndexedDataMapOfSetInteger; +// +//======================================================================= +//class : BOPAlgo_PairOfShapeBoolean +//purpose : +//======================================================================= +class BOPAlgo_PairOfShapeBoolean { + public: + BOPAlgo_PairOfShapeBoolean() + : myFlag(Standard_False) { + } + // + TopoDS_Shape& Shape1() { + return myShape1; + } + // + TopoDS_Shape& Shape2() { + return myShape2; + } + // + Standard_Boolean& Flag() { + return myFlag; + } + // + protected: + Standard_Boolean myFlag; + TopoDS_Shape myShape1; + TopoDS_Shape myShape2; +}; +// +typedef BOPCol_NCVector \ + BOPAlgo_VectorOfPairOfShapeBoolean; +// +//======================================================================= +//function : BOPAlgo_BuilderSDFaceFunctor +//purpose : The class provides the interface and implementation +// of the parallel computations +//======================================================================= +class BOPAlgo_BuilderSDFaceFunctor { + protected: + BOPAlgo_VectorOfPairOfShapeBoolean* myPVPSB; + + public: + // + BOPAlgo_BuilderSDFaceFunctor(BOPAlgo_VectorOfPairOfShapeBoolean& aVPSB) + : myPVPSB(&aVPSB){ + } + // + void operator()( const flexible_range& aBR ) const { + Standard_Boolean bFlag; + Standard_Integer i, iBeg, iEnd; + Handle(BOPInt_Context) aContext; + // + aContext=new BOPInt_Context; + // + BOPAlgo_VectorOfPairOfShapeBoolean& aVPSB=*myPVPSB; + // + iBeg=aBR.begin(); + iEnd=aBR.end(); + for(i=iBeg; i!=iEnd; ++i) { + BOPAlgo_PairOfShapeBoolean& aPSB=aVPSB(i); + const TopoDS_Face& aFj=(*(TopoDS_Face*)(&aPSB.Shape1())); + const TopoDS_Face& aFk=(*(TopoDS_Face*)(&aPSB.Shape2())); + bFlag=BOPTools_AlgoTools::AreFacesSameDomain(aFj, aFk, aContext); + if (bFlag) { + aPSB.Flag()=bFlag; + } + } + } +}; +// +//======================================================================= +//function : BOPAlgo_BuilderSDFaceCnt +//purpose : The class provides the interface and implementation +// of the parallel computations +//======================================================================= +class BOPAlgo_BuilderSDFaceCnt { + public: + //------------------------------- + // Perform + Standard_EXPORT static + void Perform(const Standard_Boolean bRunParallel, + BOPAlgo_VectorOfPairOfShapeBoolean& aVPSB) { + Standard_Integer aNbVPSB; + // + aNbVPSB=aVPSB.Extent(); + BOPAlgo_BuilderSDFaceFunctor aBFF(aVPSB); + // + if (bRunParallel) { + flexible_for(flexible_range(0,aNbVPSB), aBFF); + } + else { + aBFF.operator()(flexible_range(0,aNbVPSB)); + } + } +}; +//======================================================================= +// BuilderFace +// +typedef BOPCol_NCVector BOPAlgo_VectorOfBuilderFace; +// +typedef BOPCol_TBBFunctor + BOPAlgo_BuilderFaceFunctor; +// +typedef BOPCol_TBBCnt + BOPAlgo_BuilderFaceCnt; +// +//======================================================================= +//class : BOPAlgo_VFI +//purpose : +//======================================================================= +class BOPAlgo_VFI { + public: + BOPAlgo_VFI() + : myFlag(-1) { + } + // + ~BOPAlgo_VFI(){ + } + // + void SetVertex(const TopoDS_Vertex& aV) { + myV=aV; + } + // + TopoDS_Vertex& Vertex() { + return myV; + } + // + void SetFace(const TopoDS_Face& aF) { + myF=aF; + } + // + TopoDS_Face& Face() { + return myF; + } + // + Standard_Integer Flag()const { + return myFlag; + } + // + void SetContext(const Handle(BOPInt_Context)& aContext) { + myContext=aContext; + } + // + const Handle(BOPInt_Context)& Context()const { + return myContext; + } + // + void Perform() { + Standard_Real aT1, aT2; + // + myFlag=myContext->ComputeVF(myV, myF, aT1, aT2); + } + // + protected: + Standard_Integer myFlag; + TopoDS_Vertex myV; + TopoDS_Face myF; + Handle(BOPInt_Context) myContext; +}; +// +typedef BOPCol_NCVector BOPAlgo_VectorOfVFI; +// +typedef BOPCol_TBBContextFunctor + BOPAlgo_VFIFunctor; +// +typedef BOPCol_TBBContextCnt + BOPAlgo_VFICnt; +// //======================================================================= //function : FillImagesFaces //purpose : @@ -493,11 +677,15 @@ void BOPAlgo_Builder::FillSameDomainFaces() //======================================================================= void BOPAlgo_Builder::FillImagesFaces1() { - Standard_Integer i, aNbS, iSense; + Standard_Integer i, aNbS, iSense, nVx, aNbVFI, iFlag; TopoDS_Face aFSD; + TopoDS_Vertex aVx; + BRep_Builder aBB; BOPCol_ListOfInteger aLIAV; BOPCol_ListOfShape aLFIm; - BOPCol_ListIteratorOfListOfShape aItLS; + BOPCol_ListIteratorOfListOfInteger aItV; + BOPCol_ListIteratorOfListOfShape aItLS, aItF; + BOPAlgo_VectorOfVFI aVVFI; // aNbS=myDS->NbSourceShapes(); for (i=0; iAloneVertices(i, aLIAV); aLFIm.Clear(); @@ -533,47 +722,50 @@ void BOPAlgo_Builder::FillImagesFaces1() } } // - FillInternalVertices(aLFIm, aLIAV); + //FillInternalVertices(aLFIm, aLIAV); // myImages.Bind(aF, aLFIm); // - //fill myOrigins + // 2. fill myOrigins aItLS.Initialize(aLFIm); for (; aItLS.More(); aItLS.Next()) { const TopoDS_Face& aFSp=(*(TopoDS_Face*)(&aItLS.Value())); myOrigins.Bind(aFSp, aF); } - }// for (i=0; iShape(nV))); - aV.Orientation(TopAbs_INTERNAL); // - aItF.Initialize(aLFIm); - for (; aItF.More(); aItF.Next()) { - TopoDS_Face& aF=(*(TopoDS_Face*)(&aItF.Value())); - iFlag=myContext->ComputeVF(aV, aF, aU1, aU2); - if (!iFlag) { - aBB.Add(aF, aV); - break; + // 3. + aItV.Initialize(aLIAV); + for (; aItV.More(); aItV.Next()) { + nVx=aItV.Value(); + aVx=(*(TopoDS_Vertex*)(&myDS->Shape(nVx))); + aVx.Orientation(TopAbs_INTERNAL); + // + aItF.Initialize(aLFIm); + for (; aItF.More(); aItF.Next()) { + TopoDS_Face& aFy=(*(TopoDS_Face*)(&aItF.Value())); + // + BOPAlgo_VFI& aVFI=aVVFI.Append1(); + aVFI.SetVertex(aVx); + aVFI.SetFace(aFy); } } + }// for (i=0; i - -#include -#include - -#include -#include - -#include -#include -#include - -#include - -#include -#include - -typedef BOPCol_NCVector BOPAlgo_VectorOfBuilderFace; -// -//======================================================================= -//class : BOPAlgo_BuilderFaceFunctor -//purpose : The class provides the interface and implementation -// of the parallel computations -//======================================================================= -class BOPAlgo_BuilderFaceFunctor { - protected: - BOPAlgo_VectorOfBuilderFace* myPVBF; - // - public: - // - BOPAlgo_BuilderFaceFunctor(BOPAlgo_VectorOfBuilderFace& aVBF) - : myPVBF(&aVBF) { - } - // - void operator()( const flexible_range& aBR ) const{ - Standard_Integer i, iBeg, iEnd; - // - BOPAlgo_VectorOfBuilderFace& aVBF=*myPVBF; - // - iBeg=aBR.begin(); - iEnd=aBR.end(); - for(i=iBeg; i!=iEnd; ++i) { - BOPAlgo_BuilderFace& aBF=aVBF(i); - // - aBF.Perform(); - } - } -}; -//======================================================================= -//class : BOPAlgo_BuilderFaceCnt -//purpose : The class provides the interface and implementation -// of the parallel computations -//======================================================================= -class BOPAlgo_BuilderFaceCnt { - public: - //------------------------------- - // Perform - Standard_EXPORT static void Perform(const Standard_Boolean bRunParallel, - BOPAlgo_VectorOfBuilderFace& aVBF) { - // - BOPAlgo_BuilderFaceFunctor aBFF(aVBF); - Standard_Integer aNbBF=aVBF.Extent(); - // - if (bRunParallel) { - flexible_for(flexible_range(0,aNbBF), aBFF); - } - else { - aBFF.operator()(flexible_range(0,aNbBF)); - } - } - // -}; -// -typedef BOPCol_NCVector BOPAlgo_VectorOfShape; -// -typedef BOPCol_NCVector \ - BOPAlgo_VectorOfVectorOfShape; -// -typedef NCollection_IndexedDataMap\ - \ - BOPAlgo_IndexedDataMapOfSetInteger; -// -//======================================================================= -//class : BOPAlgo_PairOfShapeBoolean -//purpose : -//======================================================================= -class BOPAlgo_PairOfShapeBoolean { - public: - BOPAlgo_PairOfShapeBoolean() - : myFlag(Standard_False) { - } - // - TopoDS_Shape& Shape1() { - return myShape1; - } - // - TopoDS_Shape& Shape2() { - return myShape2; - } - // - Standard_Boolean& Flag() { - return myFlag; - } - // - protected: - Standard_Boolean myFlag; - TopoDS_Shape myShape1; - TopoDS_Shape myShape2; -}; -// -typedef BOPCol_NCVector \ - BOPAlgo_VectorOfPairOfShapeBoolean; -// -//======================================================================= -//function : BOPAlgo_BuilderSDFaceFunctor -//purpose : The class provides the interface and implementation -// of the parallel computations -//======================================================================= -class BOPAlgo_BuilderSDFaceFunctor { - protected: - BOPAlgo_VectorOfPairOfShapeBoolean* myPVPSB; - - public: - // - BOPAlgo_BuilderSDFaceFunctor(BOPAlgo_VectorOfPairOfShapeBoolean& aVPSB) - : myPVPSB(&aVPSB){ - } - // - void operator()( const flexible_range& aBR ) const { - Standard_Boolean bFlag; - Standard_Integer i, iBeg, iEnd; - Handle(BOPInt_Context) aContext; - // - aContext=new BOPInt_Context; - // - BOPAlgo_VectorOfPairOfShapeBoolean& aVPSB=*myPVPSB; - // - iBeg=aBR.begin(); - iEnd=aBR.end(); - for(i=iBeg; i!=iEnd; ++i) { - BOPAlgo_PairOfShapeBoolean& aPSB=aVPSB(i); - const TopoDS_Face& aFj=(*(TopoDS_Face*)(&aPSB.Shape1())); - const TopoDS_Face& aFk=(*(TopoDS_Face*)(&aPSB.Shape2())); - bFlag=BOPTools_AlgoTools::AreFacesSameDomain(aFj, aFk, aContext); - if (bFlag) { - aPSB.Flag()=bFlag; - } - } - } -}; -// -//======================================================================= -//function : BOPAlgo_BuilderSDFaceCnt -//purpose : The class provides the interface and implementation -// of the parallel computations -//======================================================================= -class BOPAlgo_BuilderSDFaceCnt { - public: - //------------------------------- - // Perform - Standard_EXPORT static - void Perform(const Standard_Boolean bRunParallel, - BOPAlgo_VectorOfPairOfShapeBoolean& aVPSB) { - Standard_Integer aNbVPSB; - // - aNbVPSB=aVPSB.Extent(); - BOPAlgo_BuilderSDFaceFunctor aBFF(aVPSB); - // - if (bRunParallel) { - flexible_for(flexible_range(0,aNbVPSB), aBFF); - } - else { - aBFF.operator()(flexible_range(0,aNbVPSB)); - } - } - // -}; -// -typedef BOPCol_NCVector BOPAlgo_VectorOfBuilderSolid; -// -//======================================================================= -//class : BOPAlgo_BuilderSolidFunctor -//purpose : The class provides the interface and implementation -// of the parallel computations -//======================================================================= -class BOPAlgo_BuilderSolidFunctor { - protected: - BOPAlgo_VectorOfBuilderSolid* myPVBS; - // - public: - // - BOPAlgo_BuilderSolidFunctor(BOPAlgo_VectorOfBuilderSolid& aVBS) - : myPVBS(&aVBS) { - } - // - void operator()( const flexible_range& aBR ) const{ - Standard_Integer i, iBeg, iEnd; - // - BOPAlgo_VectorOfBuilderSolid& aVBS=*myPVBS; - // - iBeg=aBR.begin(); - iEnd=aBR.end(); - for(i=iBeg; i!=iEnd; ++i) { - BOPAlgo_BuilderSolid& aBS=aVBS(i); - // - aBS.Perform(); - } - } -}; -//======================================================================= -//class : BOPAlgo_BuilderSolidCnt -//purpose : The class provides the interface and implementation -// of the parallel computations -//======================================================================= -class BOPAlgo_BuilderSolidCnt { - public: - //------------------------------- - // Perform - Standard_EXPORT static void Perform(const Standard_Boolean bRunParallel, - BOPAlgo_VectorOfBuilderSolid& aVBS) { - - Standard_Integer aNbBS=aVBS.Extent(); - BOPAlgo_BuilderSolidFunctor aBSF(aVBS); - // - if (bRunParallel) { - flexible_for(flexible_range(0,aNbBS), aBSF); - } - else { - aBSF.operator()(flexible_range(0,aNbBS)); - } - } - // -}; - -#endif diff --git a/src/BOPAlgo/BOPAlgo_Builder_3.cxx b/src/BOPAlgo/BOPAlgo_Builder_3.cxx index 0a5075a26f..1cd38ed87d 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_3.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_3.cxx @@ -16,13 +16,13 @@ // commercial license or contractual agreement. #include - +// #include #include - +// #include #include - +// #include #include #include @@ -33,10 +33,10 @@ #include #include #include - +// #include #include - +// #include #include #include @@ -49,6 +49,8 @@ #include #include #include +#include +#include // #include // @@ -61,7 +63,6 @@ #include // #include -#include static @@ -73,6 +74,20 @@ static BOPCol_MapOfShape& aMFence, BOPCol_ListOfShape& theLS); +//======================================================================= +// BOPAlgo_BuilderSolid +// +typedef BOPCol_NCVector + BOPAlgo_VectorOfBuilderSolid; +// +typedef BOPCol_TBBFunctor + BOPAlgo_BuilderSolidFunctor; +// +typedef BOPCol_TBBCnt + BOPAlgo_BuilderSolidCnt; +// //======================================================================= //class : BOPAlgo_ShapeBox //purpose : Auxiliary class @@ -156,9 +171,10 @@ void BOPAlgo_Builder::FillImagesSolids() //function : FillIn3DParts //purpose : //======================================================================= -void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts, - BOPCol_DataMapOfShapeShape& theDraftSolids, - const BOPCol_BaseAllocator& ) +void BOPAlgo_Builder::FillIn3DParts + (BOPCol_DataMapOfShapeListOfShape& theInParts, + BOPCol_DataMapOfShapeShape& theDraftSolids, + const BOPCol_BaseAllocator& ) { Standard_Boolean bHasImage; Standard_Integer i, k, aNbS, aNbLIF, nFP, aNbFP, aNbFIN, iIsIN; @@ -192,16 +208,16 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts const BOPCol_ListOfShape& aLS=myImages.Find(aS); aItLS.Initialize(aLS); for (; aItLS.More(); aItLS.Next()) { - const TopoDS_Shape& aSx=aItLS.Value(); - // - Bnd_Box aBox; - BRepBndLib::Add(aSx, aBox); - // - aSB.SetShape(aSx); - aSB.SetBox(aBox); - // - aDMISB.Bind(k, aSB); - ++k; + const TopoDS_Shape& aSx=aItLS.Value(); + // + Bnd_Box aBox; + BRepBndLib::Add(aSx, aBox); + // + aSB.SetShape(aSx); + aSB.SetBox(aBox); + // + aDMISB.Bind(k, aSB); + ++k; } } else { @@ -261,7 +277,7 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts const TopoDS_Shape& aShell=aIt.Value(); bHasImage=myImages.IsBound(aShell); if (bHasImage){ - break; + break; } } // @@ -308,10 +324,10 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts const BOPAlgo_ShapeBox& aSBF=aDMISB.Find(nFP); const TopoDS_Face& aFP=(*(TopoDS_Face*)&aSBF.Shape()); if (aMF.Contains(aFP)) { - continue; + continue; } if (aMFDone.Contains(aFP)) { - continue; + continue; } // aMFDone.Add(aFP); @@ -323,19 +339,19 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts // aItLI1.Initialize(aLIFP); for (; aItLI1.More(); aItLI1.Next()) { - const TopoDS_Shape& aFx=aDMISB.Find(aItLI1.Value()).Shape(); - if (!aMFDone.Contains(aFx)) { - aLFP.Append(aFx); - } + const TopoDS_Shape& aFx=aDMISB.Find(aItLI1.Value()).Shape(); + if (!aMFDone.Contains(aFx)) { + aLFP.Append(aFx); + } } // aLCBF.Clear(); //---------------------------------------- { - Handle(NCollection_IncAllocator) aAlr2; - aAlr2=new NCollection_IncAllocator(); - // - BOPTools_AlgoTools::MakeConnexityBlock(aLFP, aME, aLCBF, aAlr2); + Handle(NCollection_IncAllocator) aAlr2; + aAlr2=new NCollection_IncAllocator(); + // + BOPTools_AlgoTools::MakeConnexityBlock(aLFP, aME, aLCBF, aAlr2); } //---------------------------------------- aItLS.Initialize(aLCBF); @@ -353,8 +369,8 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts if (aNbFIN || aNbLIF) { aItLS.Initialize(aLIF); for (; aItLS.More(); aItLS.Next()) { - const TopoDS_Shape& aFI=aItLS.Value(); - aLFIN.Append(aFI); + const TopoDS_Shape& aFI=aItLS.Value(); + aLFIN.Append(aFI); } theInParts.Bind(aSolid, aLFIN); } @@ -365,14 +381,13 @@ void BOPAlgo_Builder::FillIn3DParts(BOPCol_DataMapOfShapeListOfShape& theInParts //--------------------------------------------- }// for (i=0; i - +// #include - +// #include #include #include #include #include - +// #include - +#include +#include +// #include - +// #include #include #include #include #include #include -#include +//======================================================================= +//class : BOPAlgo_VertexFace +//purpose : +//======================================================================= +class BOPAlgo_VertexFace { + public: + BOPAlgo_VertexFace() + : myIV(-1), myIF(-1), myIVx(-1), + myFlag(-1), myT1(-1.), myT2(-1.) { + } + // + ~BOPAlgo_VertexFace(){ + } + // + void SetIndices(const Standard_Integer nV, + const Standard_Integer nF, + const Standard_Integer nVx) { + myIV=nV; + myIF=nF; + myIVx=nVx; + } + // + void Indices(Standard_Integer& nV, + Standard_Integer& nF, + Standard_Integer& nVx) const { + nV=myIV; + nF=myIF; + nVx=myIVx; + } + // + void SetVertex(const TopoDS_Vertex& aV) { + myV=aV; + } + // + const TopoDS_Vertex& Vertex()const { + return myV; + } + // + void SetFace(const TopoDS_Face& aF) { + myF=aF; + } + // + const TopoDS_Face& Face()const { + return myF; + } + // + Standard_Integer Flag()const { + return myFlag; + } + // + void Parameters(Standard_Real& aT1, + Standard_Real& aT2)const { + aT1=myT1; + aT2=myT2; + } + // + void SetContext(const Handle(BOPInt_Context)& aContext) { + myContext=aContext; + } + // + const Handle(BOPInt_Context)& Context()const { + return myContext; + } + // + void Perform() { + myFlag=myContext->ComputeVF(myV, myF, myT1, myT2); + } + // + protected: + Standard_Integer myIV; + Standard_Integer myIF; + Standard_Integer myIVx; + Standard_Integer myFlag; + Standard_Real myT1; + Standard_Real myT2; + TopoDS_Vertex myV; + TopoDS_Face myF; + Handle(BOPInt_Context) myContext; +}; +//======================================================================= +typedef BOPCol_NCVector + BOPAlgo_VectorOfVertexFace; +// +typedef BOPCol_TBBContextFunctor + BOPAlgo_VertexFaceFunctor; +// +typedef BOPCol_TBBContextCnt + BOPAlgo_VertexFaceCnt; +// //======================================================================= // function: PerformVF // purpose: //======================================================================= - void BOPAlgo_PaveFiller::PerformVF() +void BOPAlgo_PaveFiller::PerformVF() { Standard_Boolean bJustAdd; - Standard_Integer iSize, nV, nF, nVSD, iFlag, nVx, i; + Standard_Integer iSize, nV, nF, nVSD, iFlag, nVx, i, aNbVF, k; Standard_Real aT1, aT2, aTolF, aTolV; BRep_Builder aBB; + BOPAlgo_VectorOfVertexFace aVVF; // myErrorStatus=0; // @@ -83,34 +179,56 @@ continue; } // + myDS->ChangeFaceInfo(nF);// ! + // const TopoDS_Vertex& aV=(*(TopoDS_Vertex *)(&myDS->Shape(nVx))); const TopoDS_Face& aF=(*(TopoDS_Face *)(&myDS->Shape(nF))); // + BOPAlgo_VertexFace& aVertexFace=aVVF.Append1(); + // + aVertexFace.SetIndices(nV, nF, nVx); + aVertexFace.SetVertex(aV); + aVertexFace.SetFace(aF); + }//for (; myIterator->More(); myIterator->Next()) { + // + aNbVF=aVVF.Extent(); + //================================================================ + BOPAlgo_VertexFaceCnt::Perform(myRunParallel, aVVF, myContext); + //================================================================ + // + for (k=0; k < aNbVF; ++k) { + const BOPAlgo_VertexFace& aVertexFace=aVVF(k); + // + iFlag=aVertexFace.Flag(); + if (iFlag) { + continue; + } + // + aVertexFace.Indices(nV, nF, nVx); + aVertexFace.Parameters(aT1, aT2); + const TopoDS_Vertex& aV=aVertexFace.Vertex(); + const TopoDS_Face& aF=aVertexFace.Face(); + // 1 + i=aVFs.Append()-1; + BOPDS_InterfVF& aVF=aVFs(i); + aVF.SetIndices(nVx, nF); + aVF.SetUV(aT1, aT2); + // 2 + myDS->AddInterf(nVx, nF); + // 3 + BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF); + BOPCol_MapOfInteger& aMVIn=aFI.ChangeVerticesIn(); + aMVIn.Add(nVx); + // 4 aTolV = BRep_Tool::Tolerance(aV); aTolF = BRep_Tool::Tolerance(aF); - // - iFlag=myContext->ComputeVF(aV, aF, aT1, aT2); - if (!iFlag) { - // 1 - i=aVFs.Append()-1; - BOPDS_InterfVF& aVF=aVFs(i); - aVF.SetIndices(nVx, nF); - aVF.SetUV(aT1, aT2); - // 2 - myDS->AddInterf(nVx, nF); - // - BOPDS_FaceInfo& aFI=myDS->ChangeFaceInfo(nF); - BOPCol_MapOfInteger& aMVIn=aFI.ChangeVerticesIn(); - aMVIn.Add(nVx); - // - if (aTolV < aTolF) { - aBB.UpdateVertex(aV, aTolF); - BOPDS_ShapeInfo& aSIV = myDS->ChangeShapeInfo(nVx); - Bnd_Box& aBoxV = aSIV.ChangeBox(); - BRepBndLib::Add(aV, aBoxV); - } + if (aTolV < aTolF) { + aBB.UpdateVertex(aV, aTolF); + BOPDS_ShapeInfo& aSIV = myDS->ChangeShapeInfo(nVx); + Bnd_Box& aBoxV = aSIV.ChangeBox(); + BRepBndLib::Add(aV, aBoxV); } - }// for (; myIterator->More(); myIterator->Next()) { + }//for (k=0; k < aNbVF; ++k) { }// if (iSize) { else { iSize=10; @@ -121,21 +239,18 @@ } // TreatVerticesEE(); -} - - +} //======================================================================= //function : TreatVerticesEE //purpose : //======================================================================= - void BOPAlgo_PaveFiller::TreatVerticesEE() +void BOPAlgo_PaveFiller::TreatVerticesEE() { Standard_Integer i, aNbS, aNbEEs, nF, nV, iFlag; Standard_Real aT1, aT2; BOPCol_ListIteratorOfListOfInteger aItLI; Handle(NCollection_IncAllocator) aAllocator; // - //-----------------------------------------------------scope_1 f aAllocator=new NCollection_IncAllocator(); BOPCol_ListOfInteger aLIV(aAllocator), aLIF(aAllocator); BOPCol_MapOfInteger aMI(100, aAllocator); @@ -209,5 +324,4 @@ } // aAllocator.Nullify(); - //-----------------------------------------------------scope_1 t } diff --git a/src/BOPAlgo/FILES b/src/BOPAlgo/FILES index 1efa7024b0..02e84d51f7 100644 --- a/src/BOPAlgo/FILES +++ b/src/BOPAlgo/FILES @@ -13,7 +13,5 @@ BOPAlgo_Builder_4.cxx BOPAlgo_BOP_1.cxx BOPAlgo_WireSplitter_1.cxx BOPAlgo_ListOfCheckResult.hxx -BOPAlgo_Builder_2Cnt.hxx BOPAlgo_CheckerSI_1.cxx - BOPAlgo_PaveFiller_9.cxx