#include <TopoDS_AlertWithShape.hxx>
-//! Boolean operation was stoped by user
+//! Boolean operation was stopped by user
DEFINE_SIMPLE_ALERT(BOPAlgo_AlertUserBreak)
//! Boolean operation of given type is not allowed on the given inputs
//! The main method to implement the operation
//! Providing the range allows to enable Progress indicator User break functionalities.
- Standard_EXPORT virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) = 0;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) = 0;
protected:
//! step1 = number_of_input_vertices;
//! step2 = 2 * number_of_input_edges;
//! step3 = 10 * number_of_input_faces.
- //! Normalization of this values will be done automatically in analyzeProgress() method.
+ //! Normalization of these values will be done automatically in analyzeProgress() method.
Standard_EXPORT virtual void fillPISteps(BOPAlgo_PISteps& theSteps) const;
};
//! Additional root class to provide interface to be launched from parallel vector.
-//! It already has the range as a field, and has to be used with cautious to create
+//! It already has the range as a field, and has to be used with caution to create
//! scope from the range only once.
class BOPAlgo_ParallelAlgo : public BOPAlgo_Algo
{
BOPAlgo_PISteps(const Standard_Integer theNbOp)
: mySteps(0, theNbOp - 1)
{
- for (Standard_Integer i = 0; i < theNbOp; ++i)
- {
- mySteps(i) = 0.;
- }
+ mySteps.Init(0);
}
//! Returns the steps
//! Returns modifiable steps
TColStd_Array1OfReal& ChangeSteps() { return mySteps; }
- //! Returns the step assigned to the operation
+ //! Assign the value theSteps to theOperation
void SetStep(const Standard_Integer theOperation, const Standard_Real theStep)
{
if (theOperation >= mySteps.Lower() && theOperation <= mySteps.Upper())
void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller,
const Message_ProgressRange& theRange)
{
- Message_ProgressScope aPS (theRange, "Building the result of Boolean operation", 100);
-
myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
myDS=myPaveFiller->PDS();
myContext=myPaveFiller->Context();
return;
}
}
+ Message_ProgressScope aPS(theRange, "Building the result of Boolean operation", 100);
//
BOPAlgo_PISteps aSteps (PIOperation_Last);
analyzeProgress (100, aSteps);
if (hasNotClosedSolids)
{
Handle(Message_Report) aReport = new Message_Report();
- BuildBOP(myArguments, myTools, myOperation, aReport);
+ BuildBOP(myArguments, myTools, myOperation, Message_ProgressRange(), aReport);
if (aReport->GetAlerts(Message_Fail).IsEmpty())
{
// Success. Merge the report into the main report.
if (myFillHistory)
{
// for FillHistroty, which takes about 5% of the whole operation
- theSteps.SetStep(PIOperation_FillHistory, 5. * theWhole / 100.);
+ theSteps.SetStep(PIOperation_FillHistory, 0.05 * theWhole);
}
// and for PostTreat, which takes about 3% of the whole operation
- theSteps.SetStep(PIOperation_PostTreat, 3. * theWhole / 100.);
+ theSteps.SetStep(PIOperation_PostTreat, 0.03 * theWhole);
}
//=======================================================================
//
Message_ProgressScope aPS(theRange, "Post treatment of result shape", 2);
BOPTools_AlgoTools::CorrectTolerances(myShape, aMA, 0.05, myRunParallel);
- aPS.Next().Close();
+ aPS.Next();
BOPTools_AlgoTools::CorrectShapeTolerances(myShape, aMA, myRunParallel);
}
//function : BuildBOP
//purpose :
//=======================================================================
-void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
- const TopAbs_State theObjState,
- const TopTools_ListOfShape& theTools,
- const TopAbs_State theToolsState,
- Handle(Message_Report) theReport)
+void BOPAlgo_Builder::BuildBOP(const TopTools_ListOfShape& theObjects,
+ const TopAbs_State theObjState,
+ const TopTools_ListOfShape& theTools,
+ const TopAbs_State theToolsState,
+ const Message_ProgressRange& theRange,
+ Handle(Message_Report) theReport)
{
if (HasErrors())
return;
aReport->AddAlert(Message_Fail, new BOPAlgo_AlertBuilderFailed());
return;
}
-
// Check the input data
if ((theObjState != TopAbs_IN && theObjState != TopAbs_OUT) ||
(theToolsState != TopAbs_IN && theToolsState != TopAbs_OUT))
if (!aMFToAvoid.Contains(aRF))
aResFaces.Append(aRF);
}
-
+ Message_ProgressScope aPS(theRange, NULL, 2);
BRep_Builder aBB;
// Try to build closed solids from the faces
aBS.SetRunParallel(myRunParallel);
aBS.SetContext(myContext);
aBS.SetFuzzyValue(myFuzzyValue);
- aBS.Perform();
+ aBS.Perform(aPS.Next());
// Resulting solids
TopTools_ListOfShape aResSolids;
}
}
}
+ else
+ {
+ return;
+ }
// Collect unused faces
TopoDS_Compound anUnUsedFaces;
aBB.Add(aResult, itLS.Value());
myShape = aResult;
- PrepareHistory(Message_ProgressRange());
+ PrepareHistory(aPS.Next());
}
//! @param theTools - The group of Tools for BOP;
//! @param theObjState - State for tools faces to pass into result;
//! @param theReport - The alternative report to avoid pollution of the main one.
- Standard_EXPORT virtual void BuildBOP(const TopTools_ListOfShape& theObjects,
- const TopAbs_State theObjState,
- const TopTools_ListOfShape& theTools,
- const TopAbs_State theToolsState,
- Handle(Message_Report) theReport = NULL);
+ Standard_EXPORT virtual void BuildBOP(const TopTools_ListOfShape& theObjects,
+ const TopAbs_State theObjState,
+ const TopTools_ListOfShape& theTools,
+ const TopAbs_State theToolsState,
+ const Message_ProgressRange& theRange,
+ Handle(Message_Report) theReport = NULL);
//! Builds the result of Boolean operation of given type
//! basing on the result of Builder operation (GF or any other).
//! @param theObjects - The group of Objects for BOP;
//! @param theTools - The group of Tools for BOP;
//! @param theOperation - The BOP type;
+ //! @param theRange - The parameter to progressIndicator
//! @param theReport - The alternative report to avoid pollution of the global one.
- void BuildBOP(const TopTools_ListOfShape& theObjects,
- const TopTools_ListOfShape& theTools,
- const BOPAlgo_Operation theOperation,
- Handle(Message_Report) theReport = NULL)
+ void BuildBOP(const TopTools_ListOfShape& theObjects,
+ const TopTools_ListOfShape& theTools,
+ const BOPAlgo_Operation theOperation,
+ const Message_ProgressRange& theRange,
+ Handle(Message_Report) theReport = NULL)
{
TopAbs_State anObjState, aToolsState;
switch (theOperation)
break;
}
}
- BuildBOP(theObjects, anObjState, theTools, aToolsState, theReport);
+ BuildBOP(theObjects, anObjState, theTools, aToolsState, theRange, theReport);
}
protected: //! @name History methods
// Build BVH
aBoxTree.Build();
- aMainScope.Next().Close();
+ aMainScope.Next();
// Fence map
TColStd_MapOfInteger aMEDone;
Standard_Integer i, aNbS = myDS->NbSourceShapes();
Message_ProgressScope aPS(theRange, "Filling splits of edges", aNbS);
for (i = 0; i < aNbS; ++i, aPS.Next()) {
- if (UserBreak(aPS))
- {
- return;
- }
const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
if (aSI.ShapeType() != TopAbs_EDGE) {
continue;
const TopoDS_Shape& aSp = myDS->Shape(nSp);
myShapesSD.Bind(aSp, aSpR);
}
+ if (UserBreak(aPS))
+ {
+ return;
+ }
}
}
}
aNbS=myDS->NbSourceShapes();
Message_ProgressScope aPS(theRange, "Building splits of containers", 1);
for (i=0; i<aNbS; ++i) {
- if (UserBreak(aPS))
- {
- return;
- }
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
if (aSI.ShapeType()==theType) {
const TopoDS_Shape& aC=aSI.Shape();
FillImagesContainer(aC, theType);
}
+ if (UserBreak(aPS))
+ {
+ return;
+ }
}// for (; aItS.More(); aItS.Next()) {
}
//=======================================================================
aNbS=myDS->NbSourceShapes();
Message_ProgressScope aPS(theRange, "Building splits of compounds", aNbS);
for (i=0; i<aNbS; ++i, aPS.Next()) {
- if (UserBreak(aPS))
- {
- return;
- }
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
if (aSI.ShapeType()==TopAbs_COMPOUND) {
const TopoDS_Shape& aC=aSI.Shape();
FillImagesCompound(aC, aMFP);
}
+ if (UserBreak(aPS))
+ {
+ return;
+ }
}// for (; aItS.More(); aItS.Next()) {
}
//=======================================================================
virtual void Perform(const Message_ProgressRange& /*theRange*/) {};
private:
- TopoDS_Solid mySolid; //!< Solid to split
Message_ProgressRange myRange;
};
typedef NCollection_Vector<BOPAlgo_SplitFace> BOPAlgo_VectorOfBuilderFace;
}// for (i=0; i<aNbS; ++i) {
// close preparation task
- aPSOuter.Next().Close();
+ aPSOuter.Next();
//
Standard_Integer aNbBF = aVBF.Length();
// Set progress range for each task to be run in parallel
}
}
- aPSOuter.Next().Close();
+ aPSOuter.Next();
// Set progress range for each task to be run in parallel
Message_ProgressScope aPSParallel(aPSOuter.Next(6), "Checking SD faces", aVPSB.Size());
return;
}
- aPS.Next().Close();
+ aPS.Next();
//
// 5 Settle internal vertices and edges into solids
aMx.Clear();
Message_ProgressScope aPS(theRange, "Preparing history information", aNbS);
for (Standard_Integer i = 0; i < aNbS; ++i, aPS.Next())
{
- if (UserBreak(aPS))
- {
- return;
- }
const TopoDS_Shape& aS = myDS->Shape(i);
// Check if History information is available for this kind of shape.
if (!BRepTools_History::IsSupportedType(aS))
continue;
+ if (UserBreak(aPS))
+ {
+ return;
+ }
+
Standard_Boolean isModified = Standard_False;
// Check if the shape has any splits
Standard_Integer aNbFace = aVFace.Length();
Message_ProgressScope aPSParallel(aPSOuter.Next(), "Checking surface on self-intersection", aNbFace);
- for (Standard_Integer iF = 0; iF < aVFace.Size(); ++iF)
+ for (Standard_Integer iF = 0; iF < aNbFace; ++iF)
{
aVFace.ChangeValue(iF).SetProgressRange(aPSParallel.Next());
}
//class : BOPAlgo_VertexSolid
//purpose :
//=======================================================================
-class BOPAlgo_VertexSolid : public BOPAlgo_ParallelAlgo {
+class BOPAlgo_VertexSolid {
public:
DEFINE_STANDARD_ALLOC
BOPAlgo_VertexSolid() :
- BOPAlgo_ParallelAlgo(),
myIV(-1), myIZ(-1), myState(TopAbs_UNKNOWN) {
};
//
return myState;
};
//
+ void SetProgressRange(const Message_ProgressRange& theRange)
+ {
+ myProgressRange = theRange;
+ }
+ //
virtual void Perform() {
Message_ProgressScope aPS(myProgressRange, NULL, 1);
- if (UserBreak(aPS))
+ if (!aPS.More())
{
return;
}
TopoDS_Vertex myV;
TopoDS_Solid myZ;
Handle(IntTools_Context) myContext;
+ Message_ProgressRange myProgressRange;
};
//=======================================================================
typedef NCollection_Vector<BOPAlgo_VertexSolid> BOPAlgo_VectorOfVertexSolid;
//class : BOPAlgo_ShapeSolid
//purpose :
//=======================================================================
-class BOPAlgo_ShapeSolid: public BOPAlgo_ParallelAlgo {
+class BOPAlgo_ShapeSolid {
public:
DEFINE_STANDARD_ALLOC
BOPAlgo_ShapeSolid() :
- BOPAlgo_ParallelAlgo(),
myIE(-1),
myIZ(-1),
myHasInterf(Standard_False),
return myHasInterf;
};
//
+ void SetProgressRange(const Message_ProgressRange& theRange)
+ {
+ myProgressRange = theRange;
+ }
+ //
virtual void Perform() {
Message_ProgressScope aPS(myProgressRange, NULL, 1);
- if (UserBreak(aPS))
+ if (!aPS.More())
{
return;
}
Standard_Integer myIZ;
Standard_Boolean myHasInterf;
BOPDS_DS* myDS;
+ Message_ProgressRange myProgressRange;
};
//=======================================================================
typedef NCollection_Vector<BOPAlgo_ShapeSolid> BOPAlgo_VectorOfShapeSolid;
//
virtual void Perform() {
Message_ProgressScope aPS(myProgressRange, NULL, 1);
- if (UserBreak(aPS))
+ if (!aPS.More())
{
return;
}
myHasInterf=myDS->HasInterfShapeSubShapes(myIE, myIZ, bFlag);
}
};
+protected:
+ Message_ProgressRange myProgressRange;
};
//=======================================================================
typedef NCollection_Vector<BOPAlgo_SolidSolid> BOPAlgo_VectorOfSolidSolid;
BOPAlgo_VectorOfShapeSolid aVShapeSolid;
//
for (; myIterator->More(); myIterator->Next()) {
- if (UserBreak(aPSOuter))
- {
- return;
- }
myIterator->Value(nS, nZ);
//
BOPAlgo_ShapeSolid& aShapeSolid=aVShapeSolid.Appended();
pPF->SetGlue(myGlue);
pPF->SetUseOBB(myUseOBB);
pPF->Perform(aPS.Next(anInterPart));
- if (HasErrors())
+ if (pPF->HasErrors())
{
+ AddError(new BOPAlgo_AlertUserBreak);
return;
}
//
Message_ProgressScope aPS (theRange, "Repeat intersection", 3);
for (Standard_Integer i = 0; i < aNbS; ++i)
{
- if (UserBreak (aPS))
- {
- return;
- }
const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo (i);
if (aSI.ShapeType() != TopAbs_VERTEX)
continue;
}
//=======================================================================
-// function: PerformVV
+// function: MakeSDVertices
// purpose:
//=======================================================================
Standard_Integer BOPAlgo_PaveFiller::MakeSDVertices
aNbVE = aVVE.Length();
Message_ProgressScope aPS(aPSOuter.Next(9), "Performing Vertex-Edge intersection", aNbVE);
- for (i = 0; i < aVVE.Length(); i++)
+ for (i = 0; i < aNbVE; i++)
{
BOPAlgo_VertexEdge& aVESolver = aVVE.ChangeValue(i);
aVESolver.SetProgressRange(aPS.Next());
//=============================================================
BOPTools_Parallel::Perform (myRunParallel, aVVE, myContext);
//=============================================================
- if (HasErrors())
+ if (UserBreak(aPSOuter))
{
return;
}
BOPDS_ListOfPaveBlock::Iterator itPB (aLPB);
for (; itPB.More(); itPB.Next())
{
- if (UserBreak(aPSOuter))
- {
- return;
- }
aPB = itPB.Value();
Standard_Real aT1, aT2;
aPB->Range (aT1, aT2);
const TColStd_ListOfInteger& aLI = aDMVSD.Find(aPair);
TColStd_ListIteratorOfListOfInteger aItLI(aLI);
for (; aItLI.More(); aItLI.Next()) {
- if (UserBreak(aPSOuter))
- {
- return;
- }
const Standard_Integer nVOld = aItLI.Value();
// 3. Create interference V/E
BOPDS_InterfVE& aVE = aVEs.Appended();
//
aIt2.Initialize(aLPB2);
for (; aIt2.More(); aIt2.Next()) {
- if (UserBreak(aPSOuter))
- {
- return;
- }
Bnd_Box aBB2;
//
Handle(BOPDS_PaveBlock)& aPB2=aIt2.ChangeValue();
//======================================================
BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
//======================================================
- if (HasErrors())
+ if (UserBreak(aPSOuter))
{
return;
}
//
TopTools_ListIteratorOfListOfShape aItLS(aLVSD);
for (; aItLS.More(); aItLS.Next()) {
- if (UserBreak(aPS))
- {
- return;
- }
const TopoDS_Shape& aVx = aItLS.Value();
BOPDS_CoupleOfPaveBlocks &aCPB = theMVCPB.ChangeFromKey(aVx);
aCPB.SetIndex(iV);
const Standard_Integer aNbS = myDS->NbSourceShapes();
for (Standard_Integer i = 0; i < aNbS; ++i)
{
- if (UserBreak(aPSOuter))
- {
- return;
- }
const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
if (aSI.ShapeType() == TopAbs_VERTEX)
{
if (myDS->HasInterf(i))
myDS->InitPaveBlocksForVertex(i);
}
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
}
// Fill the connection map from bounding vertices to pave blocks
// having those bounding vertices
for (Standard_Integer i = 0; i < aNbS; ++i)
{
- if (UserBreak(aPSOuter))
- {
- return;
- }
const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
if (aSI.ShapeType() != TopAbs_EDGE)
// Not an edge
if (aSI.HasFlag())
// Degenerated edge
continue;
-
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
const BOPDS_ListOfPaveBlock& aLPB = myDS->PaveBlocks(i);
BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPB);
for (; aItLPB.More(); aItLPB.Next())
return;
// close preparation step
- aPSOuter.Next(0.7).Close();
+ aPSOuter.Next(0.7);
aPBMap.Clear();
aMPBFence.Clear();
// Perform intersection of the found pairs
BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
- if (HasErrors())
+ if (UserBreak(aPSOuter))
{
return;
}
//================================================================
BOPTools_Parallel::Perform (myRunParallel, aVVF, myContext);
//================================================================
- if (HasErrors())
+ if (UserBreak(aPSOuter))
{
return;
}
//=================================================================
BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
//=================================================================
- if (HasErrors())
+ if (UserBreak(aPSOuter))
{
return;
}
const Standard_Integer aNbS = myDS->NbSourceShapes();
for (Standard_Integer nE = 0; nE < aNbS; ++nE)
{
- if (UserBreak(aPS))
- {
- return;
- }
const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(nE);
if (aSI.ShapeType() != TopAbs_EDGE)
// Not an edge
// Degenerated edge
continue;
+ if (UserBreak(aPS))
+ {
+ return;
+ }
const BOPDS_ListOfPaveBlock& aLPB = myDS->PaveBlocks(nE);
BOPDS_ListIteratorOfListOfPaveBlock aItLPB(aLPB);
for (; aItLPB.More(); aItLPB.Next())
Standard_Integer aNbPB = theMPB.Extent();
for (Standard_Integer iPB = 1; iPB <= aNbPB; ++iPB)
{
- if (UserBreak(aPSOuter))
- {
- return;
- }
Handle(BOPDS_PaveBlock) aPB = theMPB(iPB);
if (!aPB->HasShrunkData() || !myDS->IsValidShrunkData(aPB))
{
if (!aPB->HasShrunkData())
continue;
}
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
Standard_Real f, l;
Bnd_Box aPBBox;
const Standard_Integer aNbS = myDS->NbSourceShapes();
for (Standard_Integer nF = 0; nF < aNbS; ++nF)
{
- if (UserBreak(aPSOuter))
- {
- return;
- }
const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(nF);
if (aSI.ShapeType() != TopAbs_FACE)
// Not a face
// Face has no face info
continue;
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
+
const Bnd_Box& aBoxF = aSI.Box();
BOPTools_BoxTreeSelector aSelector;
aSelector.SetBox(Bnd_Tools::Bnd2BVH(aBoxF));
}
// close preparation step
- aPSOuter.Next(0.7).Close();
+ aPSOuter.Next(0.7);
aPBMap.Clear();
anAlloc->Reset();
}
// Perform intersection of the found pairs
BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
- if (HasErrors())
+ if (UserBreak(aPSOuter))
{
return;
}
//
Standard_Integer k, aNbFaceFace = aVFaceFace.Length();;
Message_ProgressScope aPS(aPSOuter.Next(), "Performing Face-Face intersection", aNbFaceFace);
- for (k = 0; k < aVFaceFace.Size(); k++)
+ for (k = 0; k < aNbFaceFace; k++)
{
BOPAlgo_FaceFace& aFaceFace = aVFaceFace.ChangeValue(k);
aFaceFace.SetProgressRange(aPS.Next());
//======================================================
// Perform intersection
BOPTools_Parallel::Perform (myRunParallel, aVFaceFace);
- if (HasErrors())
+ if (UserBreak(aPSOuter))
{
return;
}
Message_ProgressScope aPS(theRange, NULL, 1);
for (Standard_Integer i = 0; i < aNbFF; ++i)
{
- if (UserBreak(aPS))
- {
- return;
- }
const BOPDS_VectorOfCurve& aVNC = aFFs(i).Curves();
const Standard_Integer aNbC = aVNC.Length();
for (Standard_Integer j = 0; j < aNbC; ++j)
//
aNb=myDS->NbSourceShapes();
for (nE=0; nE<aNb; ++nE) {
- if (UserBreak(aPSOuter))
- {
- return;
- }
const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
if (aSIE.ShapeType()==TopAbs_EDGE) {
if (aSIE.HasFlag(nF)) {
aPBD->SetEdge(nEn);
}
}
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
}
}
}
// 1. aRC1
aNb=myDS->NbSourceShapes();
for (i=0; i<aNb; ++i) {
- if (UserBreak(aPS))
- {
- return;
- }
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
if (aSI.ShapeType()!=TopAbs_FACE) {
continue;
}
+ if (UserBreak(aPS))
+ {
+ return;
+ }
//
const BOPDS_FaceInfo& aFI=myDS->FaceInfo(i);
//
//
aNb=aPBP.Size();
for (i=0; i<aNb; ++i) {
- if (UserBreak(aPS))
- {
- return;
- }
const BOPDS_ListOfPaveBlock& aLPB=aPBP(i);
aItPB.Initialize(aLPB);
for (; aItPB.More(); aItPB.Next()) {
//
aNbMS=aMSI.Extent();
for (i=1; i<=aNbMS; ++i) {
- if (UserBreak(aPS))
- {
- return;
- }
const TopoDS_Shape& aV=aMSI.FindKey(i);
const Standard_Integer& iCnt=aMSI.FindFromIndex(i);
if (iCnt>1) {
//
Message_ProgressScope aPS(theRange, "Performing Split operation", 10);
pPF->Perform(aPS.Next(9));
- if (HasErrors())
+ if (pPF->HasErrors())
{
+ AddError(new BOPAlgo_AlertUserBreak);
return;
}
//
MapEdgesAndFaces(aVShapeBox(aIVec(k)).Shape(), aMEFP, anAlloc);
}
- aPSOuter.Next().Close();
+ aPSOuter.Next();
// Map of Edge-Face connection, necessary for solid classification.
// It will be filled when first classification is performed.
}
// Close preparation task
- aPSOuter.Next().Close();
+ aPSOuter.Next();
// Set progress range for each task to be run in parallel
Standard_Integer aNbS = aVFIP.Length();
Message_ProgressScope aPSParallel(aPSOuter.Next(9), "Classification of faces relatively solids", aNbS);
// Create new report for the operation
Handle(Message_Report) aReport = new Message_Report;
-
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
// Build specific operation
- pBuilder->BuildBOP(aLObjects, aLTools, anOp, aReport);
+ pBuilder->BuildBOP(aLObjects, aLTools, anOp, aProgress->Start(), aReport);
// Report alerts of the operation
BOPTest::ReportAlerts(aReport);
//=======================================================================
void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArgs, const Message_ProgressRange& theRange)
{
- Message_ProgressScope aPS(theRange, NULL, 1);
if (!myIsIntersectionNeeded)
return;
// Set Face/Face intersection options to the intersection algorithm
SetAttributes();
// Perform intersection
- myDSFiller->Perform(aPS.Next());
+ myDSFiller->Perform(theRange);
// Check for the errors during intersection
GetReport()->Merge(myDSFiller->GetReport());
}
TopTools_ListOfShape aLO, aLT;
aLO.Append(Sol1);
aLT.Append(Sol2);
- aBuilder.BuildBOP(aLO, aLT, BOPAlgo_CUT);
+ aBuilder.BuildBOP(aLO, aLT, BOPAlgo_CUT, Message_ProgressRange());
if (!aBuilder.HasErrors())
{
TopoDS_Solid aCutMin;
aLO.Clear();
aLO.Append(aCutMin);
- aGluer.BuildBOP(aLO, State1, aLT, State2);
+ aGluer.BuildBOP(aLO, State1, aLT, State2, Message_ProgressRange());
if (!aGluer.HasErrors())
{
aLO.Append(Sol1);
aLT.Append(Sol2);
- aBuilder.BuildBOP(aLO, State1, aLT, State2);
+ aBuilder.BuildBOP(aLO, State1, aLT, State2, Message_ProgressRange());
if (aBuilder.HasErrors())
return Standard_False;