uses
gp,
- Bnd,
+ Bnd,
+ Message,
TopAbs,
Geom,
GeomAPI,
class SectionAttribute;
class CheckerSI;
class ArgumentAnalyzer;
- class CheckResult;
+ class CheckResult;
--
-- pointers
--
-- 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 <theFlag> is true the parallel processing is switched on
-- if <theFlag> 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;
#include <NCollection_BaseAllocator.hxx>
+#include <Standard_ProgramError.hxx>
+#include <Standard_NotImplemented.hxx>
+
//=======================================================================
// function:
// purpose:
{
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
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 <thePF>
BuildResult(me:out;
theType: ShapeEnum from TopAbs)
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;
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;
#include <BOPAlgo_Builder.ixx>
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_Failure.hxx>
+
#include <NCollection_IncAllocator.hxx>
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
-
#include <BOPTools_AlgoTools.hxx>
//=======================================================================
//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;
//
// commercial license or contractual agreement.
#include <BOPAlgo_BuilderFace.ixx>
-
+//
+#include <NCollection_UBTreeFiller.hxx>
+#include <NCollection_DataMap.hxx>
+//
+#include <TColStd_MapIntegerHasher.hxx>
+//
#include <gp_Pnt2d.hxx>
#include <gp_Pln.hxx>
#include <gp_Vec.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
-
+//
#include <Geom_Surface.hxx>
-
+//
#include <TopAbs.hxx>
#include <TopLoc_Location.hxx>
-
+//
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Face.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#include <TopoDS_Edge.hxx>
#include <TopoDS_Vertex.hxx>
-
+//
#include <BRep_Builder.hxx>
#include <BRep_Tool.hxx>
#include <BRepTools.hxx>
-
+//
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <IntTools_FClass2d.hxx>
#include <IntTools_Context.hxx>
-
//
#include <BOPTools_AlgoTools.hxx>
#include <BOPTools_AlgoTools2D.hxx>
#include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
#include <BOPTools.hxx>
#include <BOPCol_ListOfShape.hxx>
-#include <BOPAlgo_WireSplitter.hxx>
+//
#include <BOPCol_DataMapOfShapeShape.hxx>
#include <BOPCol_DataMapOfShapeListOfShape.hxx>
#include <BOPCol_MapOfShape.hxx>
-
+#include <BOPCol_Box2DBndTree.hxx>
+//
+#include <BOPAlgo_WireSplitter.hxx>
static
Standard_Boolean IsGrowthWire(const TopoDS_Shape& ,
void GetWire(const TopoDS_Shape& ,
TopoDS_Shape& );
//
-#include <NCollection_UBTreeFiller.hxx>
-#include <BOPCol_Box2DBndTree.hxx>
-#include <BRepTools.hxx>
-#include <TColStd_MapIntegerHasher.hxx>
-#include <NCollection_DataMap.hxx>
+
//
//=======================================================================
//class : BOPAlgo_ShapeBox2D
return;
}
//
+ UserBreak();
+ //
PerformShapesToAvoid();
if (myErrorStatus) {
return;
}
//
+ UserBreak();
+ //
PerformLoops();
if (myErrorStatus) {
return;
}
//
+ UserBreak();
+ //
PerformAreas();
if (myErrorStatus) {
return;
}
//
+ UserBreak();
+ //
PerformInternalShapes();
if (myErrorStatus) {
return;
aBB.Add(aC, aF);
}
//
+ UserBreak();
//
PerformShapesToAvoid();
if (myErrorStatus) {
return;
}
//
+ UserBreak();
+ //
PerformLoops();
if (myErrorStatus) {
return;
}
+ //
+ UserBreak();
+ //
PerformAreas();
if (myErrorStatus) {
return;
}
+ //
+ UserBreak();
+ //
PerformInternalShapes();
if (myErrorStatus) {
return;
//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() {
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_PairOfShapeBoolean> \
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<Standard_Integer>& 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
+ <BOPAlgo_PairOfShapeBoolean,
+ BOPAlgo_VectorOfPairOfShapeBoolean,
+ Handle(IntTools_Context),
+ IntTools_Context> BOPCol_BuilderSDFaceFunctor;
+//
+typedef BOPCol_TBBContextCnt
+ <BOPCol_BuilderSDFaceFunctor,
+ BOPAlgo_VectorOfPairOfShapeBoolean,
+ Handle(IntTools_Context)> 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<Standard_Integer>(0,aNbVPSB), aBFF);
- }
- else {
- aBFF.operator()(flexible_range<Standard_Integer>(0,aNbVPSB));
- }
- }
-};
//=======================================================================
// BuilderFace
//
//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) {
return myContext;
}
//
- void Perform() {
+ virtual void Perform() {
Standard_Real aT1, aT2;
//
+ BOPAlgo_Algo::UserBreak();
myFlag=myContext->ComputeVF(myV, myF, aT1, aT2);
}
//
aBF.SetFace(aF);
aBF.SetShapes(aLE);
aBF.SetRunParallel(myRunParallel);
+ aBF.SetProgressIndicator(myProgressIndicator);
//
}// for (i=0; i<aNbS; ++i) {
//
BOPAlgo_PairOfShapeBoolean& aPSB=aVPSB.Append1();
aPSB.Shape1()=aFj;
aPSB.Shape2()=aFk;
+ aPSB.SetProgressIndicator(myProgressIndicator);
}
}
}
- //====================================================
- BOPAlgo_BuilderSDFaceCnt::Perform(myRunParallel, aVPSB);
- //====================================================
+ //================================================================
+ BOPAlgo_BuilderSDFaceCnt::Perform(myRunParallel, aVPSB, myContext);
+ //================================================================
aAllocator=new NCollection_IncAllocator();
BOPCol_IndexedDataMapOfShapeListOfShape aDMSLS(100, aAllocator);
BOPCol_DataMapOfIntegerListOfShape aMBlocks(100, aAllocator);
BOPAlgo_VFI& aVFI=aVVFI.Append1();
aVFI.SetVertex(aVx);
aVFI.SetFace(aFy);
+ aVFI.SetProgressIndicator(myProgressIndicator);
}
}
}// for (i=0; i<aNbS; ++i) {
continue;
}
//
+ UserBreak();
//---------------------------------------------
Handle(NCollection_IncAllocator) aAlr1;
//
BOPAlgo_BuilderSolid& aBS=aVBS.Append1();
aBS.SetSolid(aSolid);
aBS.SetShapes(aSFS);
+ aBS.SetProgressIndicator(myProgressIndicator);
}//for (i=0; i<aNbS; ++i) {
//
Standard_Integer k, aNbBS;
continue;
}
//
+ UserBreak();
+ //
const TopoDS_Shape& aS=aSI.Shape();
//
aMx.Clear();
is redefined;
--
-- protected methods
- --
+ --
+ PerformInternal (me:out)
+ is virtual protected;
+
Clear(me:out)
is virtual protected;
try {
OCC_CATCH_SIGNALS
//
- 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;
- }
- } // 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;
+ }
+}
//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,
return myContext;
}
//
- void Perform() {
+ virtual void Perform() {
+ BOPAlgo_Algo::UserBreak();
myFlag=myContext->ComputeVE (myV, myE, myT);
};
//
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();
//=============================================================
//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) {
Handle(BOPDS_PaveBlock)& PaveBlock2() {
return myPB2;
}
+ //
+ virtual void Perform() {
+ BOPAlgo_Algo::UserBreak();
+ IntTools_EdgeEdge::Perform();
+ }
//
protected:
Handle(BOPDS_PaveBlock) myPB1;
//
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()) {
//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,
return myContext;
}
//
- void Perform() {
+ virtual void Perform() {
+ BOPAlgo_Algo::UserBreak();
myFlag=myContext->ComputeVF(myV, myF, myT1, myT2);
}
//
aVertexFace.SetIndices(nV, nF, nVx);
aVertexFace.SetVertex(aV);
aVertexFace.SetFace(aF);
+ aVertexFace.SetProgressIndicator(myProgressIndicator);
}//for (; myIterator->More(); myIterator->Next()) {
//
aNbVF=aVVF.Extent();
//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,
return myPB;
}
//
+ virtual void Perform() {
+ BOPAlgo_Algo::UserBreak();
+ IntTools_EdgeFace::Perform();
+ }
+ //
protected:
Standard_Integer myIE;
Standard_Integer myIF;
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()) {
//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,
return myTolFF;
}
//
- void Perform() {
+ virtual void Perform() {
+ BOPAlgo_Algo::UserBreak();
IntTools_FaceFace::Perform(myF1, myF2);
}
//
}
//
aFaceFace.SetParameters(bApp, bCompC2D1, bCompC2D2, aApproxTol);
- //
- //aFaceFace.Perform(aF1, aF2);
+ aFaceFace.SetProgressIndicator(myProgressIndicator);
}//for (; myIterator->More(); myIterator->Next()) {
//
aNbFaceFace=aVFaceFace.Extent();
BOPCol_DataMapOfIntegerInteger aDMI(100, aAllocator);
//
for (i=0; i<aNbFF; ++i) {
+ //
+ UserBreak();
+ //
BOPDS_InterfFF& aFF=aFFs(i);
aFF.Indices(nF1, nF2);
//
}
//
// 2 Fuse shapes
+ aPF.SetProgressIndicator(myProgressIndicator);
aPF.SetRunParallel(myRunParallel);
aPF.SetArguments(aLS);
aPF.Perform();
//class : BOPAlgo_SplitEdge
//purpose :
//=======================================================================
-class BOPAlgo_SplitEdge {
+class BOPAlgo_SplitEdge : public BOPAlgo_Algo {
+
public:
- BOPAlgo_SplitEdge() {
+ DEFINE_STANDARD_ALLOC
+
+ BOPAlgo_SplitEdge() :
+ BOPAlgo_Algo() {
myT1=0.;
myT2=0.;
}
//
- ~BOPAlgo_SplitEdge() {
+ virtual ~BOPAlgo_SplitEdge() {
}
//
void SetData(const TopoDS_Edge& aE,
return myBox;
}
//
- void Perform () {
+ virtual void Perform () {
+ BOPAlgo_Algo::UserBreak();
BOPTools_AlgoTools::MakeSplitEdge(myE,
myV1, myT1,
myV2, myT2,
//class : BOPAlgo_MPC
//purpose :
//=======================================================================
-class BOPAlgo_MPC {
+class BOPAlgo_MPC : public BOPAlgo_Algo {
+
public:
- BOPAlgo_MPC()
- : myFlag(Standard_False) {
+ DEFINE_STANDARD_ALLOC
+
+ BOPAlgo_MPC() :
+ BOPAlgo_Algo(),
+ myFlag(Standard_False) {
};
//
- ~BOPAlgo_MPC(){
+ virtual ~BOPAlgo_MPC(){
};
//
void SetEdge(const TopoDS_Edge& aE) {
return myFlag;
}
//
- void Perform() {
+ virtual void Perform() {
+ BOPAlgo_Algo::UserBreak();
BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(myE, myF);
if (myFlag) {
UpdateVertices(myE, myF);
if (bCB) {
aBSE.SetCommonBlock(aCB);
}
+ aBSE.SetProgressIndicator(myProgressIndicator);
}
} // for (; aItPB.More(); aItPB.Next()) {
} // for (i=0; i<aNbPBP; ++i) {
BOPAlgo_MPC& aMPC=aVMPC.Append1();
aMPC.SetEdge(aE);
aMPC.SetFace(aF1F);
+ aMPC.SetProgressIndicator(myProgressIndicator);
}
//
// On
BOPAlgo_MPC& aMPC=aVMPC.Append1();
aMPC.SetEdge(aE);
aMPC.SetFace(aF1F);
+ aMPC.SetProgressIndicator(myProgressIndicator);
}
}
}// for (i=0; i<aNbFI; ++i) {
aMPC.SetEdge(aE);
aMPC.SetFace(aFf[m]);
aMPC.SetFlag(bPCurveOnS[m]);
+ aMPC.SetProgressIndicator(myProgressIndicator);
}
}
}
#ifndef _BOPDS_Col_HeaderFile
#define _BOPDS_Col_HeaderFile
-#ifdef HAVE_TBB
+#include <Standard_Macro.hxx>
+#include <Standard_NotImplemented.hxx>
+#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
Standard_Integer aNb=aV.Extent();
//
if (bRunParallel) {
+#ifdef HAVE_TBB
+ try {
+ flexible_for(flexible_range<Standard_Integer>(0,aNb), aFunctor);
+ }
+ //
+ catch( captured_exception& ) {
+ Standard_NotImplemented::Raise("");
+ }
+ catch( ... ) {
+ Standard_NotImplemented::Raise("");
+ }
+#else // not HAVE_TBB
flexible_for(flexible_range<Standard_Integer>(0,aNb), aFunctor);
+#endif
}
else {
aFunctor.operator()(flexible_range<Standard_Integer>(0,aNb));
//
// 2.2. Context dependent version
//
-#include <Standard_Macro.hxx>
//=======================================================================
//class : BOPCol_TBBContextFunctor
Standard_Integer aNb=aV.Extent();
//
if (bRunParallel) {
+#ifdef HAVE_TBB
+ try {
+ flexible_for(flexible_range<Standard_Integer>(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<Standard_Integer>(0,aNb), aFunctor);
+#endif
}
else {
aFunctor.SetContext(aCtx);