From 36f4947b8dd4992b406b0cde90d28bb4af2dd023 Mon Sep 17 00:00:00 2001 From: pkv Date: Mon, 2 Jun 2014 12:09:10 +0400 Subject: [PATCH] 0024952: Possibility to break Boolean operations algorithm by user request class: BOPAlgo_Algo method: void BOPAlgo_Algo::SetProgressIndicator (const Handle(Message_ProgressIndicator)& theObj) Purpose: Set the Progress Indicator object . method: void BOPAlgo_Algo::UserBreak() const Purpose: Breaks the execution if the break signal is indicated. --- src/BOPAlgo/BOPAlgo.cdl | 5 +- src/BOPAlgo/BOPAlgo_Algo.cdl | 51 ++++++---- src/BOPAlgo/BOPAlgo_Algo.cxx | 27 +++++ src/BOPAlgo/BOPAlgo_BOP.cdl | 4 +- src/BOPAlgo/BOPAlgo_BOP.cxx | 4 +- src/BOPAlgo/BOPAlgo_Builder.cdl | 6 +- src/BOPAlgo/BOPAlgo_Builder.cxx | 19 +++- src/BOPAlgo/BOPAlgo_BuilderFace.cxx | 38 ++++--- src/BOPAlgo/BOPAlgo_BuilderSolid.cxx | 9 ++ src/BOPAlgo/BOPAlgo_Builder_2.cxx | 126 ++++++++++------------- src/BOPAlgo/BOPAlgo_Builder_3.cxx | 4 + src/BOPAlgo/BOPAlgo_PaveFiller.cdl | 5 +- src/BOPAlgo/BOPAlgo_PaveFiller.cxx | 143 ++++++++++++++------------- src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx | 18 ++-- src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx | 21 +++- src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx | 15 ++- src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx | 21 +++- src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx | 25 +++-- src/BOPAlgo/BOPAlgo_PaveFiller_7.cxx | 32 ++++-- src/BOPCol/BOPCol_TBB.hxx | 32 +++++- 20 files changed, 387 insertions(+), 218 deletions(-) diff --git a/src/BOPAlgo/BOPAlgo.cdl b/src/BOPAlgo/BOPAlgo.cdl index 44c49cf852..bc42d9bbf5 100644 --- a/src/BOPAlgo/BOPAlgo.cdl +++ b/src/BOPAlgo/BOPAlgo.cdl @@ -17,7 +17,8 @@ package BOPAlgo uses gp, - Bnd, + Bnd, + Message, TopAbs, Geom, GeomAPI, @@ -73,7 +74,7 @@ is class SectionAttribute; class CheckerSI; class ArgumentAnalyzer; - class CheckResult; + class CheckResult; -- -- pointers -- diff --git a/src/BOPAlgo/BOPAlgo_Algo.cdl b/src/BOPAlgo/BOPAlgo_Algo.cdl index 6b78ed69e7..03b144872b 100644 --- a/src/BOPAlgo/BOPAlgo_Algo.cdl +++ b/src/BOPAlgo/BOPAlgo_Algo.cdl @@ -16,53 +16,66 @@ -- commercial license or contractual agreement. deferred class Algo from BOPAlgo - ---Purpose: provides the root interface for algorithms + ---Purpose: provides the root interface for algorithms uses - BaseAllocator from BOPCol - + BaseAllocator from BOPCol, + ProgressIndicator from Message + --raises is Initialize - returns Algo from BOPAlgo; + returns Algo from BOPAlgo; ---C++: alias "Standard_EXPORT virtual ~BOPAlgo_Algo();" Initialize (theAllocator: BaseAllocator from BOPCol) - returns Algo from BOPAlgo; + returns Algo from BOPAlgo; Perform(me:out) - is deferred; + is deferred; ErrorStatus (me) - returns Integer from Standard; + returns Integer from Standard; WarningStatus (me) - returns Integer from Standard; + returns Integer from Standard; CheckData(me:out) - is virtual protected; - + is virtual protected; + CheckResult(me:out) - is virtual protected; + is virtual protected; Allocator(me) - returns BaseAllocator from BOPCol; - ---C++: return const & + returns BaseAllocator from BOPCol; + ---C++: return const & SetRunParallel(me:out; - theFlag:Boolean from Standard); + theFlag:Boolean from Standard); ---Purpose: Set the flag of parallel processing -- if is true the parallel processing is switched on -- if is false the parallel processing is switched off -- RunParallel(me) - returns Boolean from Standard; - ---Purpose: Returns the flag of parallel processing + returns Boolean from Standard; + ---Purpose: Returns the flag of parallel processing + + SetProgressIndicator(me:out; + theObj: ProgressIndicator from Message); + ---Purpose: Set the Progress Indicator object. + + UserBreak(me) + is protected; + ---Purpose: Breaks the execution if the break signal + -- is indicated by myProgressIndicator. + fields myAllocator : BaseAllocator from BOPCol is protected; - myErrorStatus : Integer from Standard is protected; - myWarningStatus : Integer from Standard is protected; - myRunParallel : Boolean from Standard is protected; + myErrorStatus : Integer from Standard is protected; + myWarningStatus : Integer from Standard is protected; + myRunParallel : Boolean from Standard is protected; + myProgressIndicator : ProgressIndicator from Message is protected; + end Algo; diff --git a/src/BOPAlgo/BOPAlgo_Algo.cxx b/src/BOPAlgo/BOPAlgo_Algo.cxx index 9eddbb1f7a..4d1b4412aa 100644 --- a/src/BOPAlgo/BOPAlgo_Algo.cxx +++ b/src/BOPAlgo/BOPAlgo_Algo.cxx @@ -19,6 +19,9 @@ #include +#include +#include + //======================================================================= // function: // purpose: @@ -106,6 +109,30 @@ Standard_Boolean BOPAlgo_Algo::RunParallel()const { return myRunParallel; } +//======================================================================= +//function : SetProgressIndicator +//purpose : +//======================================================================= +void BOPAlgo_Algo::SetProgressIndicator + (const Handle(Message_ProgressIndicator)& theObj) +{ + if (!theObj.IsNull()) { + myProgressIndicator=theObj; + } +} +//======================================================================= +//function : UserBreak +//purpose : +//======================================================================= +void BOPAlgo_Algo::UserBreak() const +{ + if (myProgressIndicator.IsNull()) { + return; + } + if (myProgressIndicator->UserBreak()) { + Standard_NotImplemented::Raise(""); + } +} // myErrorStatus // // 1 - object is just initialized diff --git a/src/BOPAlgo/BOPAlgo_BOP.cdl b/src/BOPAlgo/BOPAlgo_BOP.cdl index 4a8daa7eff..1fe7207199 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.cdl +++ b/src/BOPAlgo/BOPAlgo_BOP.cdl @@ -70,11 +70,11 @@ is is redefined protected; ---Purpose: Provides preparing actions - PerformInternal(me:out; + PerformInternal1(me:out; thePF:PaveFiller from BOPAlgo) is redefined protected; ---Purpose: Performs calculations using prepared Filler - -- object theDSF + -- object BuildResult(me:out; theType: ShapeEnum from TopAbs) diff --git a/src/BOPAlgo/BOPAlgo_BOP.cxx b/src/BOPAlgo/BOPAlgo_BOP.cxx index 6630c0e7f4..b616d2c8aa 100644 --- a/src/BOPAlgo/BOPAlgo_BOP.cxx +++ b/src/BOPAlgo/BOPAlgo_BOP.cxx @@ -333,10 +333,10 @@ void BOPAlgo_BOP::Perform() PerformInternal(*pPF); } //======================================================================= -//function : PerformInternal +//function : PerformInternal1 //purpose : //======================================================================= -void BOPAlgo_BOP::PerformInternal(const BOPAlgo_PaveFiller& theFiller) +void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) { myErrorStatus=0; myWarningStatus=0; diff --git a/src/BOPAlgo/BOPAlgo_Builder.cdl b/src/BOPAlgo/BOPAlgo_Builder.cdl index b67b272a01..a5b46bf607 100644 --- a/src/BOPAlgo/BOPAlgo_Builder.cdl +++ b/src/BOPAlgo/BOPAlgo_Builder.cdl @@ -116,7 +116,11 @@ is PerformInternal(me:out; thePF: PaveFiller from BOPAlgo) is virtual protected; - + + PerformInternal1(me:out; + thePF: PaveFiller from BOPAlgo) + is virtual protected; + CheckData(me:out) is redefined protected; diff --git a/src/BOPAlgo/BOPAlgo_Builder.cxx b/src/BOPAlgo/BOPAlgo_Builder.cxx index 4dd493d073..d587c7d41c 100644 --- a/src/BOPAlgo/BOPAlgo_Builder.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder.cxx @@ -17,12 +17,14 @@ #include +#include +#include + #include #include #include - #include //======================================================================= @@ -239,6 +241,21 @@ void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller) //purpose : //======================================================================= void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller) +{ + try { + OCC_CATCH_SIGNALS + PerformInternal1(theFiller); + } + // + catch (Standard_Failure) { + myErrorStatus=191; + } +} +//======================================================================= +//function : PerformInternal1 +//purpose : +//======================================================================= +void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller) { myErrorStatus=0; // diff --git a/src/BOPAlgo/BOPAlgo_BuilderFace.cxx b/src/BOPAlgo/BOPAlgo_BuilderFace.cxx index 620885c5fb..ba45b05687 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderFace.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderFace.cxx @@ -17,35 +17,39 @@ // 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 - +// #include #include #include #include - // #include #include @@ -54,11 +58,13 @@ #include #include #include -#include +// #include #include #include - +#include +// +#include static Standard_Boolean IsGrowthWire(const TopoDS_Shape& , @@ -75,11 +81,7 @@ static void GetWire(const TopoDS_Shape& , TopoDS_Shape& ); // -#include -#include -#include -#include -#include + // //======================================================================= //class : BOPAlgo_ShapeBox2D @@ -215,21 +217,29 @@ void BOPAlgo_BuilderFace::Perform() return; } // + UserBreak(); + // PerformShapesToAvoid(); if (myErrorStatus) { return; } // + UserBreak(); + // PerformLoops(); if (myErrorStatus) { return; } // + UserBreak(); + // PerformAreas(); if (myErrorStatus) { return; } // + UserBreak(); + // PerformInternalShapes(); if (myErrorStatus) { return; diff --git a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx index 216d5f1d8e..c087235d11 100644 --- a/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx +++ b/src/BOPAlgo/BOPAlgo_BuilderSolid.cxx @@ -199,20 +199,29 @@ void BOPAlgo_BuilderSolid::Perform() aBB.Add(aC, aF); } // + UserBreak(); // PerformShapesToAvoid(); if (myErrorStatus) { return; } // + UserBreak(); + // PerformLoops(); if (myErrorStatus) { return; } + // + UserBreak(); + // PerformAreas(); if (myErrorStatus) { return; } + // + UserBreak(); + // PerformInternalShapes(); if (myErrorStatus) { return; diff --git a/src/BOPAlgo/BOPAlgo_Builder_2.cxx b/src/BOPAlgo/BOPAlgo_Builder_2.cxx index 4e41f7a5b2..eb24e6b96d 100644 --- a/src/BOPAlgo/BOPAlgo_Builder_2.cxx +++ b/src/BOPAlgo/BOPAlgo_Builder_2.cxx @@ -87,10 +87,17 @@ typedef NCollection_IndexedDataMap\ //class : BOPAlgo_PairOfShapeBoolean //purpose : //======================================================================= -class BOPAlgo_PairOfShapeBoolean { +class BOPAlgo_PairOfShapeBoolean : public BOPAlgo_Algo { + public: - BOPAlgo_PairOfShapeBoolean() - : myFlag(Standard_False) { + DEFINE_STANDARD_ALLOC + + BOPAlgo_PairOfShapeBoolean() : + BOPAlgo_Algo(), + myFlag(Standard_False) { + } + // + virtual ~BOPAlgo_PairOfShapeBoolean() { } // TopoDS_Shape& Shape1() { @@ -105,78 +112,43 @@ class BOPAlgo_PairOfShapeBoolean { return myFlag; } // + void SetContext(const Handle(IntTools_Context)& aContext) { + myContext=aContext; + } + // + const Handle(IntTools_Context)& Context()const { + return myContext; + } + // + virtual void Perform() { + BOPAlgo_Algo::UserBreak(); + // + const TopoDS_Face& aFj=*((TopoDS_Face*)&myShape1); + const TopoDS_Face& aFk=*((TopoDS_Face*)&myShape2); + myFlag=BOPTools_AlgoTools::AreFacesSameDomain(aFj, aFk, myContext); + } + // protected: Standard_Boolean myFlag; TopoDS_Shape myShape1; TopoDS_Shape myShape2; + Handle(IntTools_Context) myContext; }; // 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(IntTools_Context) aContext; - // - aContext=new IntTools_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; - } - } - } -}; +typedef BOPCol_TBBContextFunctor + BOPCol_BuilderSDFaceFunctor; +// +typedef BOPCol_TBBContextCnt + BOPAlgo_BuilderSDFaceCnt; // -//======================================================================= -//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 // @@ -194,13 +166,17 @@ typedef BOPCol_TBBCnt //class : BOPAlgo_VFI //purpose : //======================================================================= -class BOPAlgo_VFI { +class BOPAlgo_VFI : public BOPAlgo_Algo { + public: - BOPAlgo_VFI() - : myFlag(-1) { + DEFINE_STANDARD_ALLOC + + BOPAlgo_VFI() : + BOPAlgo_Algo(), + myFlag(-1) { } // - ~BOPAlgo_VFI(){ + virtual ~BOPAlgo_VFI(){ } // void SetVertex(const TopoDS_Vertex& aV) { @@ -231,9 +207,10 @@ class BOPAlgo_VFI { return myContext; } // - void Perform() { + virtual void Perform() { Standard_Real aT1, aT2; // + BOPAlgo_Algo::UserBreak(); myFlag=myContext->ComputeVF(myV, myF, aT1, aT2); } // @@ -435,6 +412,7 @@ void BOPAlgo_Builder::BuildSplitFaces() aBF.SetFace(aF); aBF.SetShapes(aLE); aBF.SetRunParallel(myRunParallel); + aBF.SetProgressIndicator(myProgressIndicator); // }// for (i=0; iUpdatePaveBlocks(); - // 11 - PerformEE(); - if (myErrorStatus) { - return; - } - // 02 - PerformVF(); - if (myErrorStatus) { - return; - } - // 12 - PerformEF(); - if (myErrorStatus) { - return; - } - // - MakeSplitEdges(); - if (myErrorStatus) { - return; - } - // - // 22 - PerformFF(); - if (myErrorStatus) { - return; - } - // - MakeBlocks(); - if (myErrorStatus) { - return; - } - // - RefineFaceInfoOn(); - // - MakePCurves(); - if (myErrorStatus) { - return; - } - // - ProcessDE(); - if (myErrorStatus) { - return; - } - } // try { + PerformInternal(); + } + // catch (Standard_Failure) { myErrorStatus=11; - } + } } +//======================================================================= +// function: PerformInternal +// purpose: +//======================================================================= +void BOPAlgo_PaveFiller::PerformInternal() +{ + myErrorStatus=0; + // + Init(); + if (myErrorStatus) { + return; + } + // + Prepare(); + if (myErrorStatus) { + return; + } + // 00 + PerformVV(); + if (myErrorStatus) { + return; + } + // 01 + PerformVE(); + if (myErrorStatus) { + return; + } + // + myDS->UpdatePaveBlocks(); + // 11 + PerformEE(); + if (myErrorStatus) { + return; + } + // 02 + PerformVF(); + if (myErrorStatus) { + return; + } + // 12 + PerformEF(); + if (myErrorStatus) { + return; + } + // + MakeSplitEdges(); + if (myErrorStatus) { + return; + } + // + // 22 + PerformFF(); + if (myErrorStatus) { + return; + } + // + MakeBlocks(); + if (myErrorStatus) { + return; + } + // + RefineFaceInfoOn(); + // + MakePCurves(); + if (myErrorStatus) { + return; + } + // + ProcessDE(); + if (myErrorStatus) { + return; + } +} diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx index a85a07064c..51c3ace97c 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_2.cxx @@ -38,13 +38,17 @@ //class : BOPAlgo_VertexEdgeEdge //purpose : //======================================================================= -class BOPAlgo_VertexEdge { +class BOPAlgo_VertexEdge : public BOPAlgo_Algo { + public: - BOPAlgo_VertexEdge() - : myIV(-1), myIE(-1), myIVx(-1), myFlag(-1), myT(-1.) { + DEFINE_STANDARD_ALLOC + + BOPAlgo_VertexEdge() : + BOPAlgo_Algo(), + myIV(-1), myIE(-1), myIVx(-1), myFlag(-1), myT(-1.) { }; // - ~BOPAlgo_VertexEdge(){ + virtual ~BOPAlgo_VertexEdge(){ }; // void SetIndices(const Standard_Integer nV, @@ -95,7 +99,8 @@ class BOPAlgo_VertexEdge { return myContext; } // - void Perform() { + virtual void Perform() { + BOPAlgo_Algo::UserBreak(); myFlag=myContext->ComputeVE (myV, myE, myT); }; // @@ -190,8 +195,9 @@ void BOPAlgo_PaveFiller::PerformVE() aVESolver.SetIndices(nV, nE, nVx); aVESolver.SetVertex(aV); aVESolver.SetEdge(aE); + aVESolver.SetProgressIndicator(myProgressIndicator); // - }// myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE); + }// for (; myIterator->More(); myIterator->Next()) { // aNbVE=aVVE.Extent(); //============================================================= diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx index f7f48a00d6..d45b9367e8 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_3.cxx @@ -70,13 +70,20 @@ //class : BOPAlgo_EdgeEdge //purpose : //======================================================================= -class BOPAlgo_EdgeEdge : public IntTools_EdgeEdge { +class BOPAlgo_EdgeEdge : + public IntTools_EdgeEdge, + public BOPAlgo_Algo { + public: - BOPAlgo_EdgeEdge() - : IntTools_EdgeEdge() { + + DEFINE_STANDARD_ALLOC + // + BOPAlgo_EdgeEdge(): + IntTools_EdgeEdge(), + BOPAlgo_Algo() { }; // - ~BOPAlgo_EdgeEdge(){ + virtual ~BOPAlgo_EdgeEdge(){ }; // void SetPaveBlock1(const Handle(BOPDS_PaveBlock)& aPB) { @@ -94,6 +101,11 @@ class BOPAlgo_EdgeEdge : public IntTools_EdgeEdge { Handle(BOPDS_PaveBlock)& PaveBlock2() { return myPB2; } + // + virtual void Perform() { + BOPAlgo_Algo::UserBreak(); + IntTools_EdgeEdge::Perform(); + } // protected: Handle(BOPDS_PaveBlock) myPB1; @@ -345,6 +357,7 @@ void BOPAlgo_PaveFiller::PerformEE() // anEdgeEdge.SetEdge1(aE1, aT11, aT12); anEdgeEdge.SetEdge2(aE2, aT21, aT22); + anEdgeEdge.SetProgressIndicator(myProgressIndicator); }//for (; aIt2.More(); aIt2.Next()) { }//for (; aIt1.More(); aIt1.Next()) { }//for (; myIterator->More(); myIterator->Next()) { diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx index ae274ba3cd..0cb860bfcc 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_4.cxx @@ -42,14 +42,17 @@ //class : BOPAlgo_VertexFace //purpose : //======================================================================= -class BOPAlgo_VertexFace { +class BOPAlgo_VertexFace : public BOPAlgo_Algo { public: - BOPAlgo_VertexFace() - : myIV(-1), myIF(-1), myIVx(-1), + DEFINE_STANDARD_ALLOC + + BOPAlgo_VertexFace() : + BOPAlgo_Algo(), + myIV(-1), myIF(-1), myIVx(-1), myFlag(-1), myT1(-1.), myT2(-1.) { } // - ~BOPAlgo_VertexFace(){ + virtual ~BOPAlgo_VertexFace(){ } // void SetIndices(const Standard_Integer nV, @@ -102,7 +105,8 @@ class BOPAlgo_VertexFace { return myContext; } // - void Perform() { + virtual void Perform() { + BOPAlgo_Algo::UserBreak(); myFlag=myContext->ComputeVF(myV, myF, myT1, myT2); } // @@ -189,6 +193,7 @@ void BOPAlgo_PaveFiller::PerformVF() aVertexFace.SetIndices(nV, nF, nVx); aVertexFace.SetVertex(aV); aVertexFace.SetFace(aF); + aVertexFace.SetProgressIndicator(myProgressIndicator); }//for (; myIterator->More(); myIterator->Next()) { // aNbVF=aVVF.Extent(); diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx index 294917726f..79dd5ec38f 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_5.cxx @@ -60,13 +60,20 @@ //class : BOPAlgo_EdgeFace //purpose : //======================================================================= -class BOPAlgo_EdgeFace : public IntTools_EdgeFace { +class BOPAlgo_EdgeFace : + public IntTools_EdgeFace, + public BOPAlgo_Algo { + public: - BOPAlgo_EdgeFace() - : IntTools_EdgeFace(), myIE(-1), myIF(-1) { + DEFINE_STANDARD_ALLOC + + BOPAlgo_EdgeFace() : + IntTools_EdgeFace(), + BOPAlgo_Algo(), + myIE(-1), myIF(-1) { }; // - ~BOPAlgo_EdgeFace(){ + virtual ~BOPAlgo_EdgeFace(){ }; // void SetIndices(const Standard_Integer nE, @@ -97,6 +104,11 @@ class BOPAlgo_EdgeFace : public IntTools_EdgeFace { return myPB; } // + virtual void Perform() { + BOPAlgo_Algo::UserBreak(); + IntTools_EdgeFace::Perform(); + } + // protected: Standard_Integer myIE; Standard_Integer myIF; @@ -225,6 +237,7 @@ void BOPAlgo_PaveFiller::PerformEF() aSR = aPBRange; BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange); aEdgeFace.SetRange (aPBRange); + aEdgeFace.SetProgressIndicator(myProgressIndicator); // }//for (; aIt.More(); aIt.Next()) { }//for (; myIterator->More(); myIterator->Next()) { diff --git a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx index ca7c7b27b2..2489e5ca5a 100644 --- a/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx +++ b/src/BOPAlgo/BOPAlgo_PaveFiller_6.cxx @@ -101,13 +101,20 @@ static void ToleranceFF(const BRepAdaptor_Surface& aBAS1, //class : BOPAlgo_FaceFace //purpose : //======================================================================= -class BOPAlgo_FaceFace : public IntTools_FaceFace { +class BOPAlgo_FaceFace : + public IntTools_FaceFace, + public BOPAlgo_Algo { + public: - BOPAlgo_FaceFace() - : IntTools_FaceFace(), myIF1(-1), myIF2(-1), myTolFF(1.e-7) { + DEFINE_STANDARD_ALLOC + + BOPAlgo_FaceFace() : + IntTools_FaceFace(), + BOPAlgo_Algo(), + myIF1(-1), myIF2(-1), myTolFF(1.e-7) { } // - ~BOPAlgo_FaceFace() { + virtual ~BOPAlgo_FaceFace() { } // void SetIndices(const Standard_Integer nF1, @@ -144,7 +151,8 @@ class BOPAlgo_FaceFace : public IntTools_FaceFace { return myTolFF; } // - void Perform() { + virtual void Perform() { + BOPAlgo_Algo::UserBreak(); IntTools_FaceFace::Perform(myF1, myF2); } // @@ -257,8 +265,7 @@ void BOPAlgo_PaveFiller::PerformFF() } // aFaceFace.SetParameters(bApp, bCompC2D1, bCompC2D2, aApproxTol); - // - //aFaceFace.Perform(aF1, aF2); + aFaceFace.SetProgressIndicator(myProgressIndicator); }//for (; myIterator->More(); myIterator->Next()) { // aNbFaceFace=aVFaceFace.Extent(); @@ -387,6 +394,9 @@ void BOPAlgo_PaveFiller::MakeBlocks() BOPCol_DataMapOfIntegerInteger aDMI(100, aAllocator); // for (i=0; i +#include +#ifdef HAVE_TBB // On Windows, function TryEnterCriticalSection has appeared in Windows NT // and is surrounded by #ifdef in MS VC++ 7.1 headers. // Thus to use it we need to define appropriate macro saying that we wil @@ -126,7 +128,20 @@ template (0,aNb), aFunctor); + } + // + catch( captured_exception& ) { + Standard_NotImplemented::Raise(""); + } + catch( ... ) { + Standard_NotImplemented::Raise(""); + } +#else // not HAVE_TBB flexible_for(flexible_range(0,aNb), aFunctor); +#endif } else { aFunctor.operator()(flexible_range(0,aNb)); @@ -136,7 +151,6 @@ template //======================================================================= //class : BOPCol_TBBContextFunctor @@ -208,7 +222,21 @@ template (0,aNb), aFunctor); + } + // + catch(captured_exception& ) { + //cout<<" captured_exception: " << ex.what() << endl; + Standard_NotImplemented::Raise(""); + } + catch( ... ) { + Standard_NotImplemented::Raise(""); + } +#else // not HAVE_TBB flexible_for(flexible_range(0,aNb), aFunctor); +#endif } else { aFunctor.SetContext(aCtx);