#include <TopoDS_AlertWithShape.hxx>
+//! Boolean operation was stoped by user
+DEFINE_SIMPLE_ALERT(BOPAlgo_AlertUserBreak)
+
//! Boolean operation of given type is not allowed on the given inputs
DEFINE_SIMPLE_ALERT(BOPAlgo_AlertBOPNotAllowed)
#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Handle.hxx>
+#include <Message_ProgressRange.hxx>
+#include <NCollection_Array1.hxx>
#include <BOPAlgo_Options.hxx>
DEFINE_STANDARD_ALLOC
- Standard_EXPORT virtual void Perform() = 0;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& /*theRange*/ = Message_ProgressRange()) {};
+
+ Standard_EXPORT virtual void Perform() {};
protected:
//! Checks the obtained result
Standard_EXPORT virtual void CheckResult();
+ //! Analyze progress steps
+ virtual NCollection_Array1<Standard_Real> AnalyzeProgress()
+ {
+ return NCollection_Array1<Standard_Real>();
+ };
+
};
#endif // _BOPAlgo_Algo_HeaderFile
// function: Perform
// purpose:
// ================================================================================
-void BOPAlgo_ArgumentAnalyzer::Perform()
+void BOPAlgo_ArgumentAnalyzer::Perform(const Message_ProgressRange& theRange)
{
+ Message_ProgressScope aPS(theRange, "Analyze", 1);
try {
OCC_CATCH_SIGNALS
myResult.Clear();
- //
- UserBreak();
- //
+ if (UserBreak(aPS))
+ {
+ return;
+ }
// 1. Prepare
Prepare();
//
- UserBreak();
- //
// 2. Test types
if(myArgumentTypeMode) {
TestTypes();
+ if (UserBreak(aPS))
+ {
+ return;
+ }
}
//
- UserBreak();
- //
// 3. Test self-interference
if(mySelfInterMode) {
TestSelfInterferences();
+ if (UserBreak(aPS))
+ {
+ return;
+ }
}
//
- UserBreak();
- //
// 4. Test small edges
if(mySmallEdgeMode) {
if(!(!myResult.IsEmpty() && myStopOnFirst))
TestSmallEdge();
+ if (UserBreak(aPS))
+ {
+ return;
+ }
}
//
- UserBreak();
- //
// 5. Test possibility to rebuild faces
if(myRebuildFaceMode) {
if(!(!myResult.IsEmpty() && myStopOnFirst))
TestRebuildFace();
+ if (UserBreak(aPS))
+ {
+ return;
+ }
}
//
- UserBreak();
- //
// 6. Test tangent
if(myTangentMode) {
- if(!(!myResult.IsEmpty() && myStopOnFirst))
+ if (!(!myResult.IsEmpty() && myStopOnFirst))
+ {
TestTangent();
+ if (UserBreak(aPS))
+ {
+ return;
+ }
+ }
}
//
- UserBreak();
- //
// 7. Test merge vertices
if(myMergeVertexMode) {
if(!(!myResult.IsEmpty() && myStopOnFirst))
TestMergeVertex();
+ if (UserBreak(aPS))
+ {
+ return;
+ }
}
//
- UserBreak();
- //
// 8. Test merge edges
if(myMergeEdgeMode) {
if(!(!myResult.IsEmpty() && myStopOnFirst))
TestMergeEdge();
+ if (UserBreak(aPS))
+ {
+ return;
+ }
}
//
- UserBreak();
- //
// 9. Test shapes continuity
if(myContinuityMode) {
if(!(!myResult.IsEmpty() && myStopOnFirst))
TestContinuity();
+ if (UserBreak(aPS))
+ {
+ return;
+ }
}
//
- UserBreak();
- //
// 10. Test validity of the curves on the surfaces
if(myCurveOnSurfaceMode) {
if(!(!myResult.IsEmpty() && myStopOnFirst))
aChecker.SetNonDestructive(Standard_True);
aChecker.SetRunParallel(myRunParallel);
aChecker.SetFuzzyValue(myFuzzyValue);
- aChecker.SetProgressIndicator(*myProgressScope);
//
aChecker.Perform();
Standard_Boolean hasError = aChecker.HasErrors();
Standard_Boolean& CurveOnSurfaceMode();
//! performs analysis
- Standard_EXPORT void Perform();
+ Standard_EXPORT void Perform(const Message_ProgressRange& theRange = Message_ProgressRange());
//! result of test
Standard_EXPORT Standard_Boolean HasFaulty() const;
//function : Perform
//purpose :
//=======================================================================
-void BOPAlgo_BOP::Perform()
+void BOPAlgo_BOP::Perform(const Message_ProgressRange& theRange)
{
Handle(NCollection_BaseAllocator) aAllocator;
BOPAlgo_PaveFiller* pPF;
pPF=new BOPAlgo_PaveFiller(aAllocator);
pPF->SetArguments(aLS);
pPF->SetRunParallel(myRunParallel);
- if (myProgressScope != NULL)
- {
- pPF->SetProgressIndicator(*myProgressScope);
- }
+ Message_ProgressScope aPS(theRange, "Performing result of BOP operation", 10);
+
pPF->SetFuzzyValue(myFuzzyValue);
pPF->SetNonDestructive(myNonDestructive);
pPF->SetGlue(myGlue);
pPF->SetUseOBB(myUseOBB);
//
- pPF->Perform();
+ pPF->Perform(aPS.Next(9));
//
+ if (!aPS.More())
+ {
+ return;
+ }
myEntryPoint=1;
- PerformInternal(*pPF);
+ PerformInternal(*pPF, aPS.Next(1));
}
+
//=======================================================================
//function : PerformInternal1
//purpose :
//=======================================================================
-void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_BOP::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
{
myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
myDS=myPaveFiller->PDS();
}
}
//
+ Message_ProgressScope aPS(theRange, "PerformInternal", 100);
+ NCollection_Array1<Standard_Real> aSteps = BOPAlgo_Builder::AnalyzeProgress();
// 3. Fill Images
// 3.1 Vertices
- FillImagesVertices();
+ FillImagesVertices(aPS.Next(aSteps(0)));
if (HasErrors()) {
return;
}
return;
}
// 3.2 Edges
- FillImagesEdges();
+ FillImagesEdges(aPS.Next(aSteps(1)));
if (HasErrors()) {
return;
}
}
//
// 3.3 Wires
- FillImagesContainers(TopAbs_WIRE);
+ FillImagesContainers(TopAbs_WIRE, aPS.Next(aSteps(2)));
if (HasErrors()) {
return;
}
}
//
// 3.4 Faces
- FillImagesFaces();
+ FillImagesFaces(aPS.Next(aSteps(3)));
if (HasErrors()) {
return;
}
-
+
BuildResult(TopAbs_FACE);
if (HasErrors()) {
return;
}
//
// 3.5 Shells
- FillImagesContainers(TopAbs_SHELL);
+ FillImagesContainers(TopAbs_SHELL, aPS.Next(aSteps(4)));
if (HasErrors()) {
return;
}
}
//
// 3.6 Solids
- FillImagesSolids();
+ FillImagesSolids(aPS.Next(aSteps(5)));
if (HasErrors()) {
return;
}
}
//
// 3.7 CompSolids
- FillImagesContainers(TopAbs_COMPSOLID);
+ FillImagesContainers(TopAbs_COMPSOLID, aPS.Next(aSteps(6)));
if (HasErrors()) {
return;
}
}
//
// 3.8 Compounds
- FillImagesCompounds();
+ FillImagesCompounds(aPS.Next(aSteps(7)));
if (HasErrors()) {
return;
}
Standard_EXPORT BOPAlgo_Operation Operation() const;
- Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
protected:
//! Performs calculations using prepared Filler
//! object <thePF>
- Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE;
-
+ Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange) Standard_OVERRIDE;
+
Standard_EXPORT virtual void BuildResult (const TopAbs_ShapeEnum theType) Standard_OVERRIDE;
Standard_EXPORT void BuildShape();
//function : Perform
//purpose :
//=======================================================================
-void BOPAlgo_Builder::Perform()
+void BOPAlgo_Builder::Perform(const Message_ProgressRange& theRange)
{
GetReport()->Clear();
//
//
pPF->SetArguments(myArguments);
pPF->SetRunParallel(myRunParallel);
- if (myProgressScope != NULL)
- {
- pPF->SetProgressIndicator(*myProgressScope);
- }
+ Message_ProgressScope aPS(theRange, "BOPAlgo_Builder::Perform()", 10);
pPF->SetFuzzyValue(myFuzzyValue);
pPF->SetNonDestructive(myNonDestructive);
pPF->SetGlue(myGlue);
pPF->SetUseOBB(myUseOBB);
//
- pPF->Perform();
+ pPF->Perform(aPS.Next(9));
//
+ if (HasErrors())
+ {
+ return;
+ }
myEntryPoint=1;
- PerformInternal(*pPF);
+ PerformInternal(*pPF, aPS.Next(1));
}
//=======================================================================
//function : PerformWithFiller
//purpose :
//=======================================================================
-void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_Builder::PerformWithFiller(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
{
GetReport()->Clear();
myEntryPoint=0;
myFuzzyValue = theFiller.FuzzyValue();
myGlue = theFiller.Glue();
myUseOBB = theFiller.UseOBB();
- PerformInternal(theFiller);
+ Message_ProgressScope aPS(theRange, NULL, 1);
+ PerformInternal(theFiller, aPS.Next());
}
//=======================================================================
//function : PerformInternal
//purpose :
//=======================================================================
-void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_Builder::PerformInternal(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
{
GetReport()->Clear();
//
try {
OCC_CATCH_SIGNALS
- PerformInternal1(theFiller);
+ PerformInternal1(theFiller, theRange);
}
//
catch (Standard_Failure const&) {
AddError (new BOPAlgo_AlertBuilderFailed);
}
}
+
+//=======================================================================
+//function : AnalyzeProgress
+//purpose :
+//=======================================================================
+NCollection_Array1<Standard_Real> BOPAlgo_Builder::AnalyzeProgress()
+{
+ Standard_Integer aSize = 8;
+ NCollection_Array1<Standard_Real> aSteps(0, aSize - 1);
+ for (Standard_Integer i = 0; i < aSize; i++)
+ {
+ aSteps(i) = 0;
+ }
+
+ Standard_Real aPart = 100.;
+ Standard_Integer aNbV = myDS->ShapesSD().Size();
+ Standard_Integer aNbE = 0;
+ Standard_Integer aNbW = 0;
+ Standard_Integer aNbF = 0;
+ Standard_Integer aNbSh = 0;
+ Standard_Integer aNbS = 0;
+ Standard_Integer aNbCS = 0;
+ Standard_Integer aNbC = 0;
+ for (Standard_Integer i = 0; i < myDS->NbSourceShapes(); i++)
+ {
+ const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
+ switch (aSI.ShapeType())
+ {
+ case TopAbs_EDGE:
+ aNbE++;
+ break;
+ case TopAbs_WIRE:
+ aNbW++;
+ break;
+ case TopAbs_FACE:
+ aNbF++;
+ break;
+ case TopAbs_SHELL:
+ aNbSh++;
+ break;
+ case TopAbs_SOLID:
+ aNbS++;
+ break;
+ case TopAbs_COMPSOLID:
+ aNbCS++;
+ break;
+ case TopAbs_COMPOUND:
+ aNbC++;
+ break;
+ default:
+ break;
+ }
+ }
+
+ aNbE = 5 * aNbE;
+ aNbW = 10 * aNbW;
+ aNbF = 20 * aNbF;
+ aNbSh = 10 * aNbSh;
+ aNbS = 10 * aNbS;
+ aNbCS = 5 * aNbCS;
+ aNbC = 5 * aNbC;
+ Standard_Real aSum = aNbV + aNbE + aNbW + aNbF + aNbSh + aNbS + aNbCS + aNbC;
+ if (aSum == 0)
+ {
+ return aSteps;
+ }
+
+ aSteps(0) = aPart * aNbV / aSum;
+ aSteps(1) = aPart * aNbE / aSum;
+ aSteps(2) = aPart * aNbW / aSum;
+ aSteps(3) = aPart * aNbF / aSum;
+ aSteps(4) = aPart * aNbSh / aSum;
+ aSteps(5) = aPart * aNbS / aSum;
+ aSteps(6) = aPart * aNbCS / aSum;
+ aSteps(7) = aPart * aNbC / aSum;
+
+ return aSteps;
+}
+
//=======================================================================
//function : PerformInternal1
//purpose :
//=======================================================================
-void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_Builder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
{
myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
myDS=myPaveFiller->PDS();
myFuzzyValue = myPaveFiller->FuzzyValue();
myNonDestructive = myPaveFiller->NonDestructive();
//
+ Message_ProgressScope aPS(theRange, "PerformInternal", 100);
// 1. CheckData
CheckData();
if (HasErrors()) {
return;
}
//
+ NCollection_Array1<Standard_Real> aSteps = AnalyzeProgress();
// 3. Fill Images
// 3.1 Vertice
- FillImagesVertices();
+ FillImagesVertices(aPS.Next(aSteps(0)));
if (HasErrors()) {
return;
}
return;
}
// 3.2 Edges
- FillImagesEdges();
+ FillImagesEdges(aPS.Next(aSteps(1)));
if (HasErrors()) {
return;
}
}
//
// 3.3 Wires
- FillImagesContainers(TopAbs_WIRE);
+ FillImagesContainers(TopAbs_WIRE, aPS.Next(aSteps(2)));
if (HasErrors()) {
return;
}
}
// 3.4 Faces
- FillImagesFaces();
+ FillImagesFaces(aPS.Next(aSteps(3)));
if (HasErrors()) {
return;
}
return;
}
// 3.5 Shells
- FillImagesContainers(TopAbs_SHELL);
+ FillImagesContainers(TopAbs_SHELL, aPS.Next(aSteps(4)));
if (HasErrors()) {
return;
}
return;
}
// 3.6 Solids
- FillImagesSolids();
+ FillImagesSolids(aPS.Next(aSteps(5)));
if (HasErrors()) {
return;
}
return;
}
// 3.7 CompSolids
- FillImagesContainers(TopAbs_COMPSOLID);
+ FillImagesContainers(TopAbs_COMPSOLID, aPS.Next(aSteps(6)));
if (HasErrors()) {
return;
}
}
// 3.8 Compounds
- FillImagesCompounds();
+ FillImagesCompounds(aPS.Next(aSteps(7)));
if (HasErrors()) {
return;
}
aBS.SetRunParallel(myRunParallel);
aBS.SetContext(myContext);
aBS.SetFuzzyValue(myFuzzyValue);
- if (myProgressScope != NULL)
- {
- aBS.SetProgressIndicator(*myProgressScope);
- }
aBS.Perform();
// Resulting solids
//! Performs the operation.
//! The intersection will be performed also.
- Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Performs the operation with the prepared filler.
//! The intersection will not be performed in this case.
- Standard_EXPORT virtual void PerformWithFiller (const BOPAlgo_PaveFiller& theFiller);
+ Standard_EXPORT virtual void PerformWithFiller (const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange = Message_ProgressRange());
public: //! @name BOPs on open solids
//! obtaining Generated elements differently.
Standard_EXPORT virtual const TopTools_ListOfShape& LocGenerated(const TopoDS_Shape& theS);
+ //! AnalyzeProgress
+ Standard_EXPORT NCollection_Array1<Standard_Real> AnalyzeProgress() Standard_OVERRIDE;
+
public: //! @name Images/Origins
//! Returns the map of images.
//! Performs the building of the result.
//! The method calls the PerformInternal1() method surrounded by a try-catch block.
- Standard_EXPORT virtual void PerformInternal (const BOPAlgo_PaveFiller& thePF);
+ Standard_EXPORT virtual void PerformInternal (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange);
//! Performs the building of the result.
//! To build the result of any other operation
//! it will be necessary to override this method.
- Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF);
+ Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange);
//! Builds the result of operation.
//! The method is called for each of the arguments type and
protected: //! @name Fill Images of VERTICES
//! Fills the images of vertices.
- Standard_EXPORT void FillImagesVertices();
+ Standard_EXPORT void FillImagesVertices(const Message_ProgressRange& theRange);
protected: //! @name Fill Images of EDGES
//! Fills the images of edges.
- Standard_EXPORT void FillImagesEdges();
+ Standard_EXPORT void FillImagesEdges(const Message_ProgressRange& theRange);
protected: //! @name Fill Images of CONTAINERS
//! Fills the images of containers (WIRES/SHELLS/COMPSOLID).
- Standard_EXPORT void FillImagesContainers (const TopAbs_ShapeEnum theType);
+ Standard_EXPORT void FillImagesContainers (const TopAbs_ShapeEnum theType, const Message_ProgressRange& theRange);
//! Builds the image of the given container using the splits
//! of its sub-shapes.
//! 1. Build the splits of faces;
//! 2. Find SD faces;
//! 3. Add internal vertices (if any) to faces.
- Standard_EXPORT void FillImagesFaces();
+ Standard_EXPORT void FillImagesFaces(const Message_ProgressRange& theRange);
//! Builds the splits of faces using the information from the
//! intersection stage stored in Data Structure.
//! 2. Find faces from other arguments located inside the solids;
//! 3. Build splits of solid using the inside faces;
//! 4. Fill internal shapes for the splits (Wires and vertices).
- Standard_EXPORT void FillImagesSolids();
+ Standard_EXPORT void FillImagesSolids(const Message_ProgressRange& theRange);
//! Builds the draft solid by rebuilding the shells of the solid
//! with the splits of faces.
protected: //! @name Fill Images of COMPOUNDS
//! Fills the images of compounds.
- Standard_EXPORT void FillImagesCompounds();
+ Standard_EXPORT void FillImagesCompounds(const Message_ProgressRange& theRange);
//! Builds the image of the given compound.
Standard_EXPORT void FillImagesCompound (const TopoDS_Shape& theS,
//function : Perform
//purpose :
//=======================================================================
-void BOPAlgo_BuilderFace::Perform()
+void BOPAlgo_BuilderFace::Perform(const Message_ProgressRange& /*theRange*/)
{
GetReport()->Clear();
//
return;
}
//
- UserBreak();
- //
PerformShapesToAvoid();
if (HasErrors()) {
return;
}
//
- UserBreak();
- //
PerformLoops();
if (HasErrors()) {
return;
}
//
- UserBreak();
- //
PerformAreas();
if (HasErrors()) {
return;
}
//
- UserBreak();
- //
PerformInternalShapes();
if (HasErrors()) {
return;
Standard_EXPORT const TopoDS_Face& Face() const;
//! Performs the algorithm
- Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
Standard_EXPORT TopAbs_Orientation Orientation() const;
//function : Perform
//purpose :
//=======================================================================
-void BOPAlgo_BuilderSolid::Perform()
+void BOPAlgo_BuilderSolid::Perform(const Message_ProgressRange& /*theRange*/)
{
GetReport()->Clear();
//
aBB.Add(aC, aF);
}
//
- UserBreak();
- //
PerformShapesToAvoid();
if (HasErrors()) {
return;
}
//
- UserBreak();
- //
PerformLoops();
if (HasErrors()) {
return;
}
//
- UserBreak();
- //
PerformAreas();
if (HasErrors()) {
return;
}
//
- UserBreak();
- //
PerformInternalShapes();
if (HasErrors()) {
return;
public: //! @name Performing the operation
//! Performs the construction of the solids from the given faces
- Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
public: //! @name Getting the bounding boxes of the created solids
//function : FillImagesVertices
//purpose :
//=======================================================================
-void BOPAlgo_Builder::FillImagesVertices()
+void BOPAlgo_Builder::FillImagesVertices(const Message_ProgressRange& theRange)
{
+ Message_ProgressScope aPS(theRange, "Filling splits of vertices", 1);
TColStd_DataMapIteratorOfDataMapOfIntegerInteger aIt(myDS->ShapesSD());
for (; aIt.More(); aIt.Next())
{
+ if (UserBreak(aPS))
+ {
+ return;
+ }
Standard_Integer nV = aIt.Key();
Standard_Integer nVSD = aIt.Value();
//function : FillImagesEdges
//purpose :
//=======================================================================
- void BOPAlgo_Builder::FillImagesEdges()
+ void BOPAlgo_Builder::FillImagesEdges(const Message_ProgressRange& theRange)
{
Standard_Integer i, aNbS = myDS->NbSourceShapes();
+ Message_ProgressScope aPS(theRange, "Filling splits of edges", 1);
for (i = 0; i < aNbS; ++i) {
+ if (UserBreak(aPS))
+ {
+ return;
+ }
const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
if (aSI.ShapeType() != TopAbs_EDGE) {
continue;
// function: FillImagesContainers
// purpose:
//=======================================================================
- void BOPAlgo_Builder::FillImagesContainers(const TopAbs_ShapeEnum theType)
+ void BOPAlgo_Builder::FillImagesContainers(const TopAbs_ShapeEnum theType, const Message_ProgressRange& theRange)
{
Standard_Integer i, aNbS;
TopTools_MapOfShape aMFP(100, myAllocator);
//
aNbS=myDS->NbSourceShapes();
+ Message_ProgressScope aPS(theRange, "Filling images 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();
// function: FillImagesCompounds
// purpose:
//=======================================================================
- void BOPAlgo_Builder::FillImagesCompounds()
+ void BOPAlgo_Builder::FillImagesCompounds(const Message_ProgressRange& theRange)
{
Standard_Integer i, aNbS;
TopTools_MapOfShape aMFP(100, myAllocator);
//
aNbS=myDS->NbSourceShapes();
- for (i=0; i<aNbS; ++i) {
+ Message_ProgressScope aPS(theRange, "Filling images 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();
}
//
virtual void Perform() {
- BOPAlgo_Algo::UserBreak();
//
const TopoDS_Face& aFj=*((TopoDS_Face*)&myShape1);
const TopoDS_Face& aFk=*((TopoDS_Face*)&myShape2);
virtual void Perform() {
Standard_Real aT1, aT2, dummy;
//
- BOPAlgo_Algo::UserBreak();
Standard_Integer iFlag =
myContext->ComputeVF(myV, myF, aT1, aT2, dummy, myFuzzyValue);
myIsInternal = (iFlag == 0);
//function : FillImagesFaces
//purpose :
//=======================================================================
-void BOPAlgo_Builder::FillImagesFaces()
+void BOPAlgo_Builder::FillImagesFaces(const Message_ProgressRange& theRange)
{
+ Message_ProgressScope aPS(theRange, "Building splits of faces", 1);
BuildSplitFaces();
FillSameDomainFaces();
FillInternalVertices();
aBF.SetFace(aF);
aBF.SetShapes(aLE);
aBF.SetRunParallel(myRunParallel);
- if (myProgressScope != NULL)
- {
- aBF.SetProgressIndicator(*myProgressScope);
- }
//
}// for (i=0; i<aNbS; ++i) {
//
aPSB.Shape1() = aF1;
aPSB.Shape2() = aF2;
aPSB.SetFuzzyValue(myFuzzyValue);
- if (myProgressScope != NULL)
- {
- aPSB.SetProgressIndicator(*myProgressScope);
- }
}
}
}
aVFI.SetVertex(aV);
aVFI.SetFace(aFIm);
aVFI.SetFuzzyValue(myFuzzyValue);
- if (myProgressScope != NULL)
- {
- aVFI.SetProgressIndicator(*myProgressScope);
- }
}
}
}
//function : FillImagesSolids
//purpose :
//=======================================================================
-void BOPAlgo_Builder::FillImagesSolids()
+void BOPAlgo_Builder::FillImagesSolids(const Message_ProgressRange& theRange)
{
+ Message_ProgressScope aPS(theRange, "Filling images solids", 1);
Standard_Boolean bHasSolids;
Standard_Integer i, aNbS;
//
bHasSolids=Standard_False;
aNbS=myDS->NbSourceShapes();
for (i=0; i<aNbS; ++i) {
+ if (UserBreak(aPS))
+ {
+ return;
+ }
const BOPDS_ShapeInfo& aSI=myDS->ShapeInfo(i);
if (aSI.ShapeType()==TopAbs_SOLID) {
bHasSolids=!bHasSolids;
aBS.SetSolid(aSolid);
aBS.SetShapes(aSFS);
aBS.SetRunParallel(myRunParallel);
- if (myProgressScope != NULL)
- {
- aBS.SetProgressIndicator(*myProgressScope);
- }
}//for (i=0; i<aNbS; ++i) {
//
Standard_Integer k, aNbBS;
continue;
}
//
- UserBreak();
- //
const TopoDS_Shape& aS=aSI.Shape();
//
aMx.Clear();
//function : PerformInternal1
//purpose :
//=======================================================================
-void BOPAlgo_CellsBuilder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller)
+void BOPAlgo_CellsBuilder::PerformInternal1(const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
{
// Avoid filling history after GF operation as later
// in this method the result shape will be nullified
Standard_Boolean isHistory = HasHistory();
SetToFillHistory(Standard_False);
// Perform splitting of the arguments
- BOPAlgo_Builder::PerformInternal1(theFiller);
+ Message_ProgressScope aPS(theRange, "Performing cells operation", 1);
+ BOPAlgo_Builder::PerformInternal1(theFiller, aPS.Next());
if (HasErrors()) {
return;
}
//! Redefined method PerformInternal1 - makes all split parts,
//! nullifies the result <myShape>, and index all parts.
- Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE;
+ Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange) Standard_OVERRIDE;
//! Indexes the parts for quick access to the arguments.
Standard_EXPORT void IndexParts();
return myTolF;
}
//
- virtual void Perform() {
- BOPAlgo_Algo::UserBreak();
+ virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) {
+ Message_ProgressScope aPS(theRange, NULL, 1);
+ if (UserBreak(aPS))
+ {
+ return;
+ }
IntTools_FaceFace::Perform(myF, myF);
}
//
//function : Init
//purpose :
//=======================================================================
-void BOPAlgo_CheckerSI::Init()
+void BOPAlgo_CheckerSI::Init(const Message_ProgressRange& /*theRange*/)
{
Clear();
//
//function : Perform
//purpose :
//=======================================================================
-void BOPAlgo_CheckerSI::Perform()
+void BOPAlgo_CheckerSI::Perform(const Message_ProgressRange& theRange)
{
try {
OCC_CATCH_SIGNALS
return;
}
//
+ Message_ProgressScope aPS(theRange, NULL, 1);
// Perform intersection of sub shapes
- BOPAlgo_PaveFiller::Perform();
+ BOPAlgo_PaveFiller::Perform(aPS.Next());
+ if (UserBreak(aPS))
+ {
+ return;
+ }
//
CheckFaceSelfIntersection();
aFaceSelfIntersect.SetIndex(i);
aFaceSelfIntersect.SetFace(aF);
aFaceSelfIntersect.SetTolF(aTolF);
- //
- if (myProgressScope != NULL)
- {
- aFaceSelfIntersect.SetProgressIndicator(*myProgressScope);
- }
}
Standard_Integer aNbFace = aVFace.Length();
Standard_EXPORT BOPAlgo_CheckerSI();
Standard_EXPORT virtual ~BOPAlgo_CheckerSI();
- Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Sets the level of checking shape on self-interference.<br>
//! It defines which interferences will be checked:<br>
protected:
- Standard_EXPORT virtual void Init() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Init(const Message_ProgressRange& theRange) Standard_OVERRIDE;
//! Treats the intersection results
Standard_EXPORT void PostTreat();
//function : Perform
//purpose :
//=======================================================================
-void BOPAlgo_MakerVolume::Perform()
+void BOPAlgo_MakerVolume::Perform(const Message_ProgressRange& theRange)
{
GetReport()->Clear();
//
}
//
pPF->SetRunParallel(myRunParallel);
- if (myProgressScope != NULL)
- {
- pPF->SetProgressIndicator(*myProgressScope);
- }
pPF->SetFuzzyValue(myFuzzyValue);
pPF->SetNonDestructive(myNonDestructive);
pPF->SetGlue(myGlue);
pPF->SetUseOBB(myUseOBB);
- pPF->Perform();
+ Message_ProgressScope aPS(theRange, "MakerVolume", 10);
+ pPF->Perform(aPS.Next(9));
+ if (HasErrors())
+ {
+ return;
+ }
//
myEntryPoint = 1;
- PerformInternal(*pPF);
+ PerformInternal(*pPF, aPS.Next(1));
}
//=======================================================================
//purpose :
//=======================================================================
void BOPAlgo_MakerVolume::PerformInternal1
- (const BOPAlgo_PaveFiller& theFiller)
+ (const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
{
myPaveFiller = (BOPAlgo_PaveFiller*)&theFiller;
myDS = myPaveFiller->PDS();
// 3. Fill Images
// 3.1. Vertice
if (myIntersect) {
- FillImagesVertices();
+ Message_ProgressScope aPS(theRange, "PerformInternal", 100);
+ NCollection_Array1<Standard_Real> aSteps = AnalyzeProgress();
+
+ FillImagesVertices(aPS.Next(aSteps(0)));
if (HasErrors()) {
return;
}
// 3.2. Edges
- FillImagesEdges();
+ FillImagesEdges(aPS.Next(aSteps(1)));
if (HasErrors()) {
return;
}
// 3.3. Wires
- FillImagesContainers(TopAbs_WIRE);
+ FillImagesContainers(TopAbs_WIRE, aPS.Next(aSteps(2)));
if (HasErrors()) {
return;
}
// 3.4. Faces
- FillImagesFaces();
+ FillImagesFaces(aPS.Next(aSteps(3)));
if (HasErrors()) {
return;
}
PostTreat();
}
+//=======================================================================
+//function : AnalyzeProgress
+//purpose :
+//=======================================================================
+NCollection_Array1<Standard_Real> BOPAlgo_MakerVolume::AnalyzeProgress()
+{
+ Standard_Integer aSize = 4;
+ NCollection_Array1<Standard_Real> aSteps(0, aSize - 1);
+ for (Standard_Integer i = 0; i < aSize; i++)
+ {
+ aSteps(i) = 0;
+ }
+
+ Standard_Real aPart = 100.;
+ Standard_Integer aNbV = myDS->ShapesSD().Size();
+ Standard_Integer aNbE = 0;
+ Standard_Integer aNbW = 0;
+ Standard_Integer aNbF = 0;
+
+ for (Standard_Integer i = 0; i < myDS->NbSourceShapes(); i++)
+ {
+ const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
+ switch (aSI.ShapeType())
+ {
+ case TopAbs_EDGE:
+ aNbE++;
+ break;
+ case TopAbs_WIRE:
+ aNbW++;
+ break;
+ case TopAbs_FACE:
+ aNbF++;
+ break;
+ default:
+ break;
+ }
+ }
+
+ aNbE = 5 * aNbE;
+ aNbW = 10 * aNbW;
+ aNbF = 20 * aNbF;
+ Standard_Real aSum = aNbV + aNbE + aNbW + aNbF;
+ if (aSum == 0)
+ {
+ return aSteps;
+ }
+
+ aSteps(0) = aPart * aNbV / aSum;
+ aSteps(1) = aPart * aNbE / aSum;
+ aSteps(2) = aPart * aNbW / aSum;
+ aSteps(3) = aPart * aNbF / aSum;
+
+ return aSteps;
+}
+
//=======================================================================
//function : CollectFaces
//purpose :
//=======================================================================
void BOPAlgo_MakerVolume::CollectFaces()
{
- UserBreak();
//
Standard_Integer i, aNbShapes;
TopTools_ListIteratorOfListOfShape aIt;
//=======================================================================
void BOPAlgo_MakerVolume::MakeBox(TopTools_MapOfShape& theBoxFaces)
{
- UserBreak();
//
Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax, anExt;
//
//=======================================================================
void BOPAlgo_MakerVolume::BuildSolids(TopTools_ListOfShape& theLSR)
{
- UserBreak();
//
BOPAlgo_BuilderSolid aBS;
//
void BOPAlgo_MakerVolume::RemoveBox(TopTools_ListOfShape& theLSR,
const TopTools_MapOfShape& theBoxFaces)
{
- UserBreak();
//
TopTools_ListIteratorOfListOfShape aIt;
TopExp_Explorer aExp;
return;
}
- UserBreak();
-
// Get all non-compound shapes
TopTools_ListOfShape aLSC;
// Fence map
}
//! Performs the operation.
- Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
protected:
//! Checks the data.
Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
+ //! Analyze progress steps
+ Standard_EXPORT NCollection_Array1<Standard_Real> AnalyzeProgress() Standard_OVERRIDE;
+
//! Performs the operation.
- Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE;
+ Standard_EXPORT virtual void PerformInternal1 (const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Collects all faces.
Standard_EXPORT void CollectFaces();
#include <Precision.hxx>
#include <Standard_NotImplemented.hxx>
#include <Standard_ProgramError.hxx>
+#include <BOPAlgo_Alerts.hxx>
namespace
{
myReport(new Message_Report),
myRunParallel(myGlobalRunParallel),
myFuzzyValue(Precision::Confusion()),
- myProgressScope(0L),
myUseOBB(Standard_False)
{
BOPAlgo_LoadMessages();
myReport(new Message_Report),
myRunParallel(myGlobalRunParallel),
myFuzzyValue(Precision::Confusion()),
- myProgressScope(0L),
myUseOBB(Standard_False)
{
BOPAlgo_LoadMessages();
myFuzzyValue = Max(theFuzz, Precision::Confusion());
}
-
-//=======================================================================
-//function : SetProgressIndicator
-//purpose :
-//=======================================================================
-void BOPAlgo_Options::SetProgressIndicator
- (const Message_ProgressScope& theScope)
+Standard_Boolean BOPAlgo_Options::UserBreak(const Message_ProgressScope& thePS)
{
- myProgressScope = &theScope;
-}
-
-//=======================================================================
-//function : UserBreak
-//purpose :
-//=======================================================================
-void BOPAlgo_Options::UserBreak() const
-{
- if (!myProgressScope) {
- return;
- }
- if (myProgressScope->UserBreak()) {
- throw Standard_NotImplemented("BOPAlgo_Options::UserBreak(), method is not implemented");
+ if (thePS.UserBreak())
+ {
+ AddError(new BOPAlgo_AlertUserBreak);
+ return Standard_True;
}
+ return Standard_False;
}
+
//! - *Parallel processing mode* - provides the possibility to perform operation in parallel mode;
//! - *Fuzzy tolerance* - additional tolerance for the operation to detect
//! touching or coinciding cases;
-//! - *Progress indicator* - provides interface to track the progress of
-//! operation and stop the operation by user's break.
//! - *Using the Oriented Bounding Boxes* - Allows using the Oriented Bounding Boxes of the shapes
//! for filtering the intersections.
//!
return myFuzzyValue;
}
-public:
- //!@name Progress indicator
-
- //! Set the Progress Indicator object.
- Standard_EXPORT void SetProgressIndicator(const Message_ProgressScope& theProgress);
-
public:
//!@name Usage of Oriented Bounding boxes
protected:
- //! Breaks the execution if the break signal
- //! is indicated by myProgressIndicator.
- Standard_EXPORT void UserBreak() const;
+ //! Adds error to the report if the break signal was caught. Returns true in this case, false otherwise.
+ Standard_EXPORT Standard_Boolean UserBreak(const Message_ProgressScope& thePS);
protected:
Handle(Message_Report) myReport;
Standard_Boolean myRunParallel;
Standard_Real myFuzzyValue;
- const Message_ProgressScope* myProgressScope;
Standard_Boolean myUseOBB;
};
// function: Init
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::Init()
+void BOPAlgo_PaveFiller::Init(const Message_ProgressRange& theRange)
{
if (!myArguments.Extent()) {
AddError (new BOPAlgo_AlertTooFewArguments);
return;
}
//
+ Message_ProgressScope aPS(theRange, "Init", myArguments.Size());
TopTools_ListIteratorOfListOfShape aIt(myArguments);
- for (; aIt.More(); aIt.Next()) {
+ for (; aIt.More(); aIt.Next(), aPS.Next()) {
if (aIt.Value().IsNull()) {
AddError (new BOPAlgo_AlertNullInputShapes);
return;
// 4 NonDestructive flag
SetNonDestructive();
}
+
+NCollection_Array1<Standard_Real> BOPAlgo_PaveFiller::AnalyzeProgress()
+{
+ Standard_Integer aSize = 13;
+ NCollection_Array1<Standard_Real> aSteps(0, aSize - 1);
+ for (Standard_Integer i = 0; i < aSize; i++)
+ {
+ aSteps(i) = 0;
+ }
+
+ Standard_Real aPart = 95.;
+
+ myIterator->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
+ Standard_Real aPerformVVSize = myIterator->ExpectedLength();
+
+ myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE);
+ Standard_Real aPerformVESize = myIterator->ExpectedLength();
+
+ myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE);
+ Standard_Real aPerformEESize = myIterator->ExpectedLength();
+
+ myIterator->Initialize(TopAbs_VERTEX, TopAbs_FACE);
+ Standard_Real aPerformVFSize = myIterator->ExpectedLength();
+
+ myIterator->Initialize(TopAbs_EDGE, TopAbs_FACE);
+ Standard_Real aPerformEFSize = myIterator->ExpectedLength();
+
+ myIterator->Initialize(TopAbs_FACE, TopAbs_FACE);
+ Standard_Real aPerformFFSize = myIterator->ExpectedLength();
+
+ Standard_Real aStep1 = aPerformVVSize;
+ Standard_Real aStep2 = 2 * aPerformVESize;
+ Standard_Real aStep3 = 5 * aPerformEESize;
+ Standard_Real aStep4 = 5 * aPerformVFSize;
+ Standard_Real aStep5 = 10 * aPerformEFSize;
+ Standard_Real aStep6 = 0.1 * (aStep1 + aStep2 + aStep4);
+ Standard_Real aStep7 = 2 * aPerformEESize;
+ Standard_Real aStep8 = 2 * aPerformEFSize;
+ Standard_Real aStep9 = 30 * aPerformFFSize;
+ Standard_Real aStep10 = 0.2 * aStep3;
+ Standard_Real aStep11 = 0.2 * aStep9;
+ Standard_Real aStep12 = 0.2 * aStep3;
+
+ Standard_Real aSum = aStep1 + aStep2 + aStep3 + aStep4 + aStep5 + aStep6 +
+ aStep7 + aStep8 + aStep9 + aStep10 + aStep11 + aStep12;
+
+ if (!myNonDestructive)
+ {
+ aPart -= 5;
+ // step for init
+ aSteps(0) = 5;
+ }
+ if (!myIsPrimary)
+ {
+ aSum -= aStep8;
+ aStep8 = 0;
+ }
+ if (myGlue != BOPAlgo_GlueOff)
+ {
+ aSum -= aStep8;
+ aStep11 = 0;
+ }
+ if (myAvoidBuildPCurve)
+ {
+ aSum -= aStep12;
+ aStep12 = 0;
+ }
+
+ if (aSum == 0)
+ {
+ aSteps(0) = 95.;
+ return aSteps;
+ }
+ // step for PerformVV()
+ aSteps(1) = aPart * aStep1 / aSum;
+ // step for PerformVE()
+ aSteps(2) = aPart * aStep2 / aSum;
+ // step for PerformEE()
+ aSteps(3) = aPart * aStep3 / aSum;
+ // step for PerformVF()
+ aSteps(4) = aPart * aStep4 / aSum;
+ // step for PerformEF()
+ aSteps(5) = aPart * aStep5 / aSum;
+ // step for RepeatIntersection()
+ aSteps(6) = aPart * aStep6 / aSum;
+ // step for ForceInterfEE()
+ aSteps(7) = aPart * aStep7 / aSum;
+ // step for ForceInterfEF()
+ aSteps(8) = aPart * aStep8 / aSum;
+ // step for PerformFF()
+ aSteps(9) = aPart * aStep9 / aSum;
+ // step for MakeSplitEdges()
+ aSteps(10) = aPart * aStep10 / aSum;
+ // step for MakeBloks()
+ aSteps(11) = aPart * aStep11 / aSum;
+ // step for MakePCurves()
+ aSteps(12) = aPart * aStep12 / aSum;
+
+ return aSteps;
+}
+
//=======================================================================
// function: Perform
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::Perform()
+void BOPAlgo_PaveFiller::Perform(const Message_ProgressRange& theRange)
{
try {
OCC_CATCH_SIGNALS
- //
- PerformInternal();
+ //
+ PerformInternal(theRange);
}
//
catch (Standard_Failure const&) {
// function: PerformInternal
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::PerformInternal()
+void BOPAlgo_PaveFiller::PerformInternal(const Message_ProgressRange& theRange)
{
- Init();
+ Message_ProgressScope aPS(theRange, "Performing intersections of shapes", 100);
+
+ Init(aPS.Next(5));
if (HasErrors()) {
return;
}
+ NCollection_Array1<Standard_Real> aSteps = AnalyzeProgress();
//
- Prepare();
+ Prepare(aPS.Next(aSteps[0]));
if (HasErrors()) {
return;
}
// 00
- PerformVV();
+ PerformVV(aPS.Next(aSteps[1]));
if (HasErrors()) {
return;
}
// 01
- PerformVE();
+ PerformVE(aPS.Next(aSteps[2]));
if (HasErrors()) {
return;
}
//
UpdatePaveBlocksWithSDVertices();
// 11
- PerformEE();
+ PerformEE(aPS.Next(aSteps[3]));
if (HasErrors()) {
return;
}
UpdatePaveBlocksWithSDVertices();
// 02
- PerformVF();
+ PerformVF(aPS.Next(aSteps[4]));
if (HasErrors()) {
return;
}
UpdatePaveBlocksWithSDVertices();
// 12
- PerformEF();
+ PerformEF(aPS.Next(aSteps[5]));
if (HasErrors()) {
return;
}
UpdateInterfsWithSDVertices();
// Repeat Intersection with increased vertices
- RepeatIntersection();
+ RepeatIntersection(aPS.Next(aSteps[6]));
if (HasErrors())
return;
-
// Force intersection of edges after increase
// of the tolerance values of their vertices
- ForceInterfEE();
+ ForceInterfEE(aPS.Next(aSteps[7]));
+ if (HasErrors())
+ {
+ return;
+ }
// Force Edge/Face intersection after increase
// of the tolerance values of their vertices
- ForceInterfEF();
+ ForceInterfEF(aPS.Next(aSteps[8]));
+ if (HasErrors())
+ {
+ return;
+ }
//
// 22
- PerformFF();
+ PerformFF(aPS.Next(aSteps[9]));
if (HasErrors()) {
return;
}
//
myDS->RefineFaceInfoIn();
//
- MakeSplitEdges();
+ MakeSplitEdges(aPS.Next(aSteps[10]));
if (HasErrors()) {
return;
}
//
UpdatePaveBlocksWithSDVertices();
//
- MakeBlocks();
+ MakeBlocks(aPS.Next(aSteps[11]));
if (HasErrors()) {
return;
}
//
RemoveMicroEdges();
//
- MakePCurves();
+ MakePCurves(aPS.Next(aSteps[12]));
if (HasErrors()) {
return;
}
// function: RepeatIntersection
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::RepeatIntersection()
+void BOPAlgo_PaveFiller::RepeatIntersection(const Message_ProgressRange& theRange)
{
// Find all vertices with increased tolerance
TColStd_MapOfInteger anExtraInterfMap;
const Standard_Integer aNbS = myDS->NbSourceShapes();
+ 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;
myIterator->IntersectExt(anExtraInterfMap);
// Perform intersections with vertices
- PerformVV();
+
+ PerformVV(aPS.Next());
if (HasErrors())
return;
UpdatePaveBlocksWithSDVertices();
- PerformVE();
+ PerformVE(aPS.Next());
if (HasErrors())
return;
UpdatePaveBlocksWithSDVertices();
- PerformVF();
+ PerformVF(aPS.Next());
if (HasErrors())
return;
//! a copy of a sub-shape is created in the result if it is needed to be updated.
Standard_EXPORT Standard_Boolean NonDestructive() const;
- Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
Standard_EXPORT Standard_Boolean IsPrimary() const;
- Standard_EXPORT virtual void PerformInternal();
+ Standard_EXPORT virtual void PerformInternal(const Message_ProgressRange& theRange);
Standard_EXPORT virtual void Clear() Standard_OVERRIDE;
- Standard_EXPORT virtual void Init();
+ Standard_EXPORT virtual void Init(const Message_ProgressRange& theRange);
- Standard_EXPORT void Prepare();
+ Standard_EXPORT void Prepare(const Message_ProgressRange& theRange);
- Standard_EXPORT virtual void PerformVV();
+ Standard_EXPORT virtual void PerformVV(const Message_ProgressRange& theRange);
- Standard_EXPORT virtual void PerformVE();
+ Standard_EXPORT virtual void PerformVE(const Message_ProgressRange& theRange);
//! Performs the intersection of the vertices with edges.
Standard_EXPORT void IntersectVE(const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theVEPairs,
+ const Message_ProgressRange& theRange,
const Standard_Boolean bAddInterfs = Standard_True);
//! Splits the Pave Blocks of the given edges with the extra paves.<br>
//! of the Pave Blocks will also form a Common Block.
Standard_EXPORT void SplitPaveBlocks(const TColStd_MapOfInteger& theMEdges,
const Standard_Boolean theAddInterfs);
+
+ Standard_EXPORT NCollection_Array1<Standard_Real> AnalyzeProgress() Standard_OVERRIDE;
+
+ Standard_EXPORT virtual void PerformVF(const Message_ProgressRange& theRange);
- Standard_EXPORT virtual void PerformVF();
-
- Standard_EXPORT virtual void PerformEE();
+ Standard_EXPORT virtual void PerformEE(const Message_ProgressRange& theRange);
- Standard_EXPORT virtual void PerformEF();
+ Standard_EXPORT virtual void PerformEF(const Message_ProgressRange& theRange);
- Standard_EXPORT virtual void PerformFF();
+ Standard_EXPORT virtual void PerformFF(const Message_ProgressRange& theRange);
Standard_EXPORT void TreatVerticesEE();
Standard_EXPORT void MakeSDVerticesFF(const TColStd_DataMapOfIntegerListOfInteger& aDMVLV,
TColStd_DataMapOfIntegerInteger& theDMNewSD);
- Standard_EXPORT void MakeSplitEdges();
+ Standard_EXPORT void MakeSplitEdges(const Message_ProgressRange& theRange);
- Standard_EXPORT void MakeBlocks();
+ Standard_EXPORT void MakeBlocks(const Message_ProgressRange& theRange);
- Standard_EXPORT void MakePCurves();
+ Standard_EXPORT void MakePCurves(const Message_ProgressRange& theRange);
Standard_EXPORT Standard_Integer MakeSDVertices(const TColStd_ListOfInteger& theVertIndices,
const Standard_Boolean theAddInterfs = 1);
//! Performs intersection of new vertices, obtained in E/E and E/F intersections
Standard_EXPORT void PerformNewVertices(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
const Handle(NCollection_BaseAllocator)& theAllocator,
+ const Message_ProgressRange& theRange,
const Standard_Boolean theIsEEIntersection = Standard_True);
Standard_EXPORT Standard_Boolean CheckFacePaves (const TopoDS_Vertex& theVnew,
//! If the intersection says that the section edge is lying on the face
//! it will be added into FaceInfo structure of the face as IN edge
//! and will be used for splitting.
- Standard_EXPORT void PutSEInOtherFaces();
+ Standard_EXPORT void PutSEInOtherFaces(const Message_ProgressRange& theRange);
//! Analyzes the results of interferences of sub-shapes of the shapes
//! looking for self-interfering entities by the following rules:<br>
const TopoDS_Shape& theS2);
//! Repeat intersection of sub-shapes with increased vertices.
- Standard_EXPORT void RepeatIntersection();
+ Standard_EXPORT void RepeatIntersection(const Message_ProgressRange& theRange);
//! Updates vertices of CommonBlocks with real tolerance of CB.
Standard_EXPORT void UpdateVerticesOfCB();
//! The method looks for the additional common blocks among pairs of edges
//! with the same bounding vertices.
- Standard_EXPORT void ForceInterfEE();
+ Standard_EXPORT void ForceInterfEE(const Message_ProgressRange& theRange);
//! The method looks for the additional edge/face common blocks
//! among pairs of edge/face having the same vertices.
- Standard_EXPORT void ForceInterfEF();
+ Standard_EXPORT void ForceInterfEF(const Message_ProgressRange& theRange);
//! Performs intersection of given pave blocks
//! with all faces from arguments.
Standard_EXPORT void ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB,
+ const Message_ProgressRange& theRange,
const Standard_Boolean theAddInterf);
//! When all section edges are created and no increase of the tolerance
// function: PerformVV
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::PerformVV()
+void BOPAlgo_PaveFiller::PerformVV(const Message_ProgressRange& theRange)
{
Standard_Integer n1, n2, iFlag, aSize;
Handle(NCollection_BaseAllocator) aAllocator;
//
myIterator->Initialize(TopAbs_VERTEX, TopAbs_VERTEX);
aSize=myIterator->ExpectedLength();
+ Message_ProgressScope aPS(theRange, "PerformVV", 1);
if (!aSize) {
return;
}
//
// 1. Map V/LV
for (; myIterator->More(); myIterator->Next()) {
+ if (UserBreak(aPS))
+ {
+ return;
+ }
myIterator->Value(n1, n2);
//
if (myDS->HasInterf(n1, n2))
// 3. Make vertices
NCollection_List<TColStd_ListOfInteger>::Iterator aItB(aMBlocks);
for (; aItB.More(); aItB.Next()) {
+ if (UserBreak(aPS))
+ {
+ return;
+ }
const TColStd_ListOfInteger& aLI = aItB.Value();
MakeSDVertices(aLI);
}
TColStd_DataMapOfIntegerInteger& aDMII=myDS->ShapesSD();
aItDMII.Initialize(aDMII);
for (; aItDMII.More(); aItDMII.Next()) {
+ if (UserBreak(aPS))
+ {
+ return;
+ }
n1=aItDMII.Key();
myDS->InitPaveBlocksForVertex(n1);
}
const Handle(BOPDS_PaveBlock)& PaveBlock() const {
return myPB;
}
+ void SetRange(const Message_ProgressRange& theRange)
+ {
+ myRange = theRange;
+ }
//
virtual void Perform() {
- BOPAlgo_Algo::UserBreak();
+ Message_ProgressScope aPS(myRange, NULL, 1);
+ if (UserBreak(aPS))
+ {
+ return;
+ }
try
{
OCC_CATCH_SIGNALS
TopoDS_Edge myE;
Handle(IntTools_Context) myContext;
Handle(BOPDS_PaveBlock) myPB;
+private:
+ Message_ProgressRange myRange;
};
//=======================================================================
typedef NCollection_Vector<BOPAlgo_VertexEdge> BOPAlgo_VectorOfVertexEdge;
// function: PerformVE
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::PerformVE()
+void BOPAlgo_PaveFiller::PerformVE(const Message_ProgressRange& theRange)
{
FillShrunkData(TopAbs_VERTEX, TopAbs_EDGE);
//
myIterator->Initialize(TopAbs_VERTEX, TopAbs_EDGE);
+ Message_ProgressScope aPS(theRange, NULL, 1);
Standard_Integer iSize = myIterator->ExpectedLength();
if (!iSize) {
return;
// Prepare pairs for intersection
BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMVEPairs;
for (; myIterator->More(); myIterator->Next()) {
+ if (UserBreak(aPS))
+ {
+ return;
+ }
Standard_Integer nV, nE;
myIterator->Value(nV, nE);
//
pLV->Append(nV);
}
//
- IntersectVE(aMVEPairs);
+ IntersectVE(aMVEPairs, aPS.Next());
}
//=======================================================================
//=======================================================================
void BOPAlgo_PaveFiller::IntersectVE
(const BOPDS_IndexedDataMapOfPaveBlockListOfInteger& theVEPairs,
+ const Message_ProgressRange& theRange,
const Standard_Boolean theAddInterfs)
{
Standard_Integer i, aNbVE = theVEPairs.Extent();
// intersection of the same SD vertex with edge
NCollection_DataMap<BOPDS_Pair, TColStd_ListOfInteger, BOPDS_PairMapHasher> aDMVSD;
//
+ Message_ProgressScope aPSOuter(theRange, "Intersecting vertices with edges", 1);
for (i = 1; i <= aNbVE; ++i) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
const Handle(BOPDS_PaveBlock)& aPB = theVEPairs.FindKey(i);
Standard_Integer nE = aPB->OriginalEdge();
//
aVESolver.SetEdge(aE);
aVESolver.SetPaveBlock(aPB);
aVESolver.SetFuzzyValue(myFuzzyValue);
- if (myProgressScope != NULL)
- {
- aVESolver.SetProgressIndicator(*myProgressScope);
- }
}
}
//
+ aNbVE = aVVE.Length();
+
+ Message_ProgressScope aPS(aPSOuter.Next(), "Intersecting vertices with edges", aNbVE);
+ for (i = 0; i < aVVE.Length(); i++)
+ {
+ BOPAlgo_VertexEdge& aVESolver = aVVE.ChangeValue(i);
+ aVESolver.SetRange(aPS.Next());
+ }
// Perform intersection
//=============================================================
BOPTools_Parallel::Perform (myRunParallel, aVVE, myContext);
//=============================================================
+ if (HasErrors())
+ {
+ return;
+ }
//
// Keep the modified edges for further update
TColStd_MapOfInteger aMEdges;
//
// Analyze intersections
- aNbVE = aVVE.Length();
for (i = 0; i < aNbVE; ++i) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
const BOPAlgo_VertexEdge& aVESolver = aVVE(i);
if (aVESolver.Flag() != 0) {
if (aVESolver.HasErrors())
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();
IntTools_EdgeEdge::SetFuzzyValue(theFuzz);
}
//
+ void SetRange(const Message_ProgressRange& theRange)
+ {
+ myRange = theRange;
+ }
+ //
virtual void Perform() {
- BOPAlgo_Algo::UserBreak();
+ Message_ProgressScope aPS(myRange, NULL, 1);
+ if (UserBreak(aPS))
+ {
+ return;
+ }
TopoDS_Edge anE1 = myEdge1, anE2 = myEdge2;
Standard_Boolean hasTrsf = false;
try
Handle(BOPDS_PaveBlock) myPB2;
Bnd_Box myBox1;
Bnd_Box myBox2;
+private:
+ Message_ProgressRange myRange;
};
//
//=======================================================================
// function: PerformEE
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::PerformEE()
+void BOPAlgo_PaveFiller::PerformEE(const Message_ProgressRange& theRange)
{
FillShrunkData(TopAbs_EDGE, TopAbs_EDGE);
//
myIterator->Initialize(TopAbs_EDGE, TopAbs_EDGE);
Standard_Integer iSize = myIterator->ExpectedLength();
+ Message_ProgressScope aPSOuter(theRange, NULL, 100);
if (!iSize) {
return;
}
aEEs.SetIncrement(iSize);
//
for (; myIterator->More(); myIterator->Next()) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
myIterator->Value(nE1, nE2);
//
const BOPDS_ShapeInfo& aSIE1=myDS->ShapeInfo(nE1);
//
aIt1.Initialize(aLPB1);
for (; aIt1.More(); aIt1.Next()) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
Bnd_Box aBB1;
//
Handle(BOPDS_PaveBlock)& aPB1=aIt1.ChangeValue();
//
aIt2.Initialize(aLPB2);
for (; aIt2.More(); aIt2.Next()) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
Bnd_Box aBB2;
//
Handle(BOPDS_PaveBlock)& aPB2=aIt2.ChangeValue();
anEdgeEdge.SetEdge2(aE2, aT21, aT22);
anEdgeEdge.SetBoxes (aBB1, aBB2);
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
- if (myProgressScope != NULL)
- {
- anEdgeEdge.SetProgressIndicator(*myProgressScope);
- }
}//for (; aIt2.More(); aIt2.Next()) {
}//for (; aIt1.More(); aIt1.Next()) {
}//for (; myIterator->More(); myIterator->Next()) {
//
aNbEdgeEdge=aVEdgeEdge.Length();
+
+ Message_ProgressScope aPS(aPSOuter.Next(90), "Edge-edge perform", aNbEdgeEdge);
+ for (k = 0; k < aNbEdgeEdge; k++)
+ {
+ BOPAlgo_EdgeEdge& anEdgeEdge = aVEdgeEdge.ChangeValue(k);
+ anEdgeEdge.SetRange(aPS.Next());
+ }
//======================================================
BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
//======================================================
+ if (HasErrors())
+ {
+ return;
+ }
//
for (k = 0; k < aNbEdgeEdge; ++k) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
Bnd_Box aBB1, aBB2;
//
BOPAlgo_EdgeEdge& anEdgeEdge=aVEdgeEdge(k);
}
//
for (i=1; i<=aNbCPrts; ++i) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
const IntTools_CommonPrt& aCPart=aCPrts(i);
//
const TopoDS_Edge& aE1=aCPart.Edge1();
// Update vertices of common blocks with real CB tolerances
UpdateVerticesOfCB();
- PerformNewVertices(aMVCPB, aAllocator);
+ PerformNewVertices(aMVCPB, aAllocator, aPSOuter.Next(10));
+ if (HasErrors())
+ {
+ return;
+ }
//
if (aMEdges.Extent()) {
Standard_Integer aNbV = aMVCPB.Extent();
void BOPAlgo_PaveFiller::PerformNewVertices
(BOPDS_IndexedDataMapOfShapeCoupleOfPaveBlocks& theMVCPB,
const Handle(NCollection_BaseAllocator)& theAllocator,
+ const Message_ProgressRange& theRange,
const Standard_Boolean bIsEEIntersection)
{
Standard_Integer aNbV = theMVCPB.Extent();
BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE();
BOPDS_VectorOfInterfEF& aEFs = myDS->InterfEF();
//
+ // 4. Compute Extra Paves and split Pave blocks by the Extra paves
+ Message_ProgressScope aPS(theRange, NULL, 2);
Standard_Integer i, aNb = aImages.Extent();
- for (i = 1; i <= aNb; ++i) {
+ Message_ProgressScope aPS1(aPS.Next(), "Performing new vertices", aNb + aNbV);
+ for (i = 1; i <= aNb; ++i, aPS1.Next()) {
+ if (UserBreak(aPS))
+ {
+ return;
+ }
const TopoDS_Vertex& aV = TopoDS::Vertex(aImages.FindKey(i));
const TopTools_ListOfShape& aLVSD = aImages.FindFromIndex(i);
//
//
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);
//
// 3. Map PaveBlock/ListOfVertices to add to this PaveBlock ->aMPBLI
BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(100, theAllocator);
- for (i = 1; i <= aNbV; ++i) {
+ for (i = 1; i <= aNbV; ++i, aPS1.Next()) {
+ if (UserBreak(aPS))
+ {
+ return;
+ }
const BOPDS_CoupleOfPaveBlocks& aCPB = theMVCPB.FindFromIndex(i);
Standard_Integer iV = aCPB.Index();
//
}
}
}
- //
// 4. Compute Extra Paves and split Pave blocks by the Extra paves
- IntersectVE(aMPBLI, Standard_False);
+ IntersectVE(aMPBLI, aPS.Next(), Standard_False);
}
//=======================================================================
//function : TreatNewVertices
//function : ForceInterfEE
//purpose :
//=======================================================================
-void BOPAlgo_PaveFiller::ForceInterfEE()
+void BOPAlgo_PaveFiller::ForceInterfEE(const Message_ProgressRange& theRange)
{
// Now that we have vertices increased and unified, try to find additional
// common blocks among the pairs of edges.
// those pairs of pave blocks with the same bounding vertices.
Handle(NCollection_IncAllocator) anAlloc = new NCollection_IncAllocator;
-
+ Message_ProgressScope aPSOuter(theRange, NULL, 1);
// Initialize pave blocks for all vertices which participated in intersections
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)
{
myDS->InitPaveBlocksForVertex(i);
}
}
-
// Fill the connection map from bounding vertices to pave blocks
// having those bounding vertices
NCollection_IndexedDataMap<BOPDS_Pair,
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
for (Standard_Integer i = 1; i <= aNbPB; ++i)
{
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
const BOPDS_ListOfPaveBlock& aLPB = aPBMap(i);
if (aLPB.Extent() < 2)
continue;
{
anEdgeEdge.SetFuzzyValue(myFuzzyValue);
}
- if (myProgressScope != NULL)
- {
- anEdgeEdge.SetProgressIndicator(*myProgressScope);
- }
}
}
}
aMPBFence.Clear();
anAlloc->Reset();
+ Message_ProgressScope aPS(aPSOuter.Next(), "Intersection edge-edge", aNbPairs);
+ for (Standard_Integer i = 0; i < aNbPairs; i++)
+ {
+ BOPAlgo_EdgeEdge& anEdgeEdge = aVEdgeEdge.ChangeValue(i);
+ anEdgeEdge.SetRange(aPS.Next());
+ }
+
// Perform intersection of the found pairs
BOPTools_Parallel::Perform (myRunParallel, aVEdgeEdge);
-
+ if (HasErrors())
+ {
+ return;
+ }
BOPDS_VectorOfInterfEE& aEEs = myDS->InterfEE();
if (aEEs.IsEmpty())
aEEs.SetIncrement(10);
// intersection type only.
BOPDS_IndexedDataMapOfPaveBlockListOfPaveBlock aMPBLPB(1, anAlloc);
-
for (Standard_Integer i = 0; i < aNbPairs; ++i)
{
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
BOPAlgo_EdgeEdge& anEdgeEdge = aVEdgeEdge(i);
if (!anEdgeEdge.IsDone() || anEdgeEdge.HasErrors())
{
return myContext;
}
//
+ void SetRange(const Message_ProgressRange& theRange)
+ {
+ myRange = theRange;
+ }
+ //
virtual void Perform() {
- BOPAlgo_Algo::UserBreak();
+ Message_ProgressScope aPS(myRange, NULL, 1);
+ if (UserBreak(aPS))
+ {
+ return;
+ }
try
{
OCC_CATCH_SIGNALS
TopoDS_Vertex myV;
TopoDS_Face myF;
Handle(IntTools_Context) myContext;
+private:
+ Message_ProgressRange myRange;
};
//=======================================================================
typedef NCollection_Vector<BOPAlgo_VertexFace> BOPAlgo_VectorOfVertexFace;
// function: PerformVF
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::PerformVF()
+void BOPAlgo_PaveFiller::PerformVF(const Message_ProgressRange& theRange)
{
myIterator->Initialize(TopAbs_VERTEX, TopAbs_FACE);
Standard_Integer iSize = myIterator->ExpectedLength();
//
Standard_Integer nV, nF;
//
+ Message_ProgressScope aPSOuter(theRange, NULL, 1);
if (myGlue == BOPAlgo_GlueFull) {
// there is no need to intersect vertices with faces in this mode
// just initialize FaceInfo for all faces
// Avoid repeated intersection of the same vertex with face in case
// the group of vertices formed a single SD vertex
NCollection_DataMap<BOPDS_Pair, TColStd_MapOfInteger, BOPDS_PairMapHasher> aMVFPairs;
-
for (; myIterator->More(); myIterator->Next()) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
myIterator->Value(nV, nF);
//
if (myDS->IsSubShape(nV, nF)) {
aVertexFace.SetVertex(aV);
aVertexFace.SetFace(aF);
aVertexFace.SetFuzzyValue(myFuzzyValue);
- if (myProgressScope != NULL)
- {
- aVertexFace.SetProgressIndicator(*myProgressScope);
- }
+
}//for (; myIterator->More(); myIterator->Next()) {
//
aNbVF=aVVF.Length();
+ Message_ProgressScope aPS(aPSOuter.Next(), "Vertex-face perform", aNbVF);
+ for (k = 0; k < aNbVF; k++)
+ {
+ BOPAlgo_VertexFace& aVertexFace = aVVF.ChangeValue(k);
+ aVertexFace.SetRange(aPS.Next());
+ }
//================================================================
BOPTools_Parallel::Perform (myRunParallel, aVVF, myContext);
//================================================================
+ if (HasErrors())
+ {
+ return;
+ }
//
for (k=0; k < aNbVF; ++k) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
const BOPAlgo_VertexFace& aVertexFace=aVVF(k);
//
iFlag=aVertexFace.Flag();
myBox2 = theBox2;
}
//
+ void SetProgress (const Message_ProgressRange& theRange)
+ {
+ myRange = theRange;
+ }
+ //
virtual void Perform() {
- BOPAlgo_Algo::UserBreak();
+ Message_ProgressScope aPS(myRange, NULL, 1);
+ if (UserBreak(aPS))
+ {
+ return;
+ }
TopoDS_Face aFace = myFace;
TopoDS_Edge anEdge = myEdge;
Standard_Boolean hasTrsf = false;
Handle(BOPDS_PaveBlock) myPB;
Bnd_Box myBox1;
Bnd_Box myBox2;
+
+private:
+ Message_ProgressRange myRange;
};
//
//=======================================================================
//function : PerformEF
//purpose :
//=======================================================================
-void BOPAlgo_PaveFiller::PerformEF()
+void BOPAlgo_PaveFiller::PerformEF(const Message_ProgressRange& theRange)
{
FillShrunkData(TopAbs_EDGE, TopAbs_FACE);
//
myIterator->Initialize(TopAbs_EDGE, TopAbs_FACE);
+ Message_ProgressScope aPSOuter(theRange, "Intersecting edges with faces", 100);
Standard_Integer iSize = myIterator->ExpectedLength();
if (!iSize) {
return;
aEFs.SetIncrement(iSize);
//
for (; myIterator->More(); myIterator->Next()) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
myIterator->Value(nE, nF);
//
const BOPDS_ShapeInfo& aSIE=myDS->ShapeInfo(nE);
BOPDS_ListOfPaveBlock& aLPB=myDS->ChangePaveBlocks(nE);
aIt.Initialize(aLPB);
for (; aIt.More(); aIt.Next()) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
Handle(BOPDS_PaveBlock)& aPB=aIt.ChangeValue();
//
const Handle(BOPDS_PaveBlock) aPBR=myDS->RealPaveBlock(aPB);
aEdgeFace.SetBoxes (myDS->ShapeInfo(nE).Box(), myDS->ShapeInfo (nF).Box());
aEdgeFace.SetFuzzyValue(myFuzzyValue);
aEdgeFace.UseQuickCoincidenceCheck(bExpressCompute);
- //
+
IntTools_Range aSR(aTS1, aTS2);
- IntTools_Range anewSR=aSR;
+ IntTools_Range anewSR = aSR;
BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, anewSR);
aEdgeFace.SetNewSR(anewSR);
//
IntTools_Range aPBRange(aT1, aT2);
aSR = aPBRange;
BOPTools_AlgoTools::CorrectRange(aE, aF, aSR, aPBRange);
- aEdgeFace.SetRange (aPBRange);
- if (myProgressScope != NULL)
- {
- aEdgeFace.SetProgressIndicator(*myProgressScope);
- }
+ aEdgeFace.SetRange(aPBRange);
+ //
// Save the pair to avoid their forced intersection
BOPDS_MapOfPaveBlock* pMPB = myFPBDone.ChangeSeek(nF);
if (!pMPB)
}//for (; myIterator->More(); myIterator->Next()) {
//
aNbEdgeFace=aVEdgeFace.Length();
+ Message_ProgressScope aPS(aPSOuter.Next(90), "Edge-face perform", aNbEdgeFace);
+ for (Standard_Integer index = 0; index < aNbEdgeFace; index++)
+ {
+ BOPAlgo_EdgeFace& aEdgeFace = aVEdgeFace.ChangeValue(index);
+ aEdgeFace.SetProgress(aPS.Next());
+ }
//=================================================================
BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
//=================================================================
+ if (HasErrors())
+ {
+ return;
+ }
//
for (k=0; k < aNbEdgeFace; ++k) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
BOPAlgo_EdgeFace& aEdgeFace=aVEdgeFace(k);
if (!aEdgeFace.IsDone() || aEdgeFace.HasErrors()) {
// Warn about failed intersection of sub-shapes
}
//
for (i=1; i<=aNbCPrts; ++i) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
const IntTools_CommonPrt& aCPart=aCPrts(i);
aType=aCPart.Type();
switch (aType) {
//=========================================
BOPAlgo_Tools::PerformCommonBlocks(aMPBLI, aAllocator, myDS, myContext);
UpdateVerticesOfCB();
- PerformNewVertices(aMVCPB, aAllocator, Standard_False);
+ PerformNewVertices(aMVCPB, aAllocator, aPSOuter.Next(10), Standard_False);
+ if (HasErrors())
+ {
+ return;
+ }
//
// Update FaceInfoIn for all faces having EF common parts
myDS->UpdateFaceInfoIn (aMIEFC);
//function : ForceInterfEF
//purpose :
//=======================================================================
-void BOPAlgo_PaveFiller::ForceInterfEF()
+void BOPAlgo_PaveFiller::ForceInterfEF(const Message_ProgressRange& theRange)
{
+ Message_ProgressScope aPS(theRange, NULL, 1);
if (!myIsPrimary)
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
}
// Perform intersection of collected pave blocks with faces
- ForceInterfEF(aMPB, Standard_True);
+
+ ForceInterfEF(aMPB, aPS.Next(), Standard_True);
}
//=======================================================================
//purpose :
//=======================================================================
void BOPAlgo_PaveFiller::ForceInterfEF(const BOPDS_IndexedMapOfPaveBlock& theMPB,
+ const Message_ProgressRange& theRange,
const Standard_Boolean theAddInterf)
{
+ Message_ProgressScope aPSOuter(theRange, NULL, 1);
if (theMPB.IsEmpty())
return;
-
// Fill the tree with bounding boxes of the pave blocks
BOPTools_BoxTree aBBTree;
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))
{
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
aEdgeFace.SetFuzzyValue(myFuzzyValue + aTolAdd);
aEdgeFace.UseQuickCoincidenceCheck(Standard_True);
aEdgeFace.SetRange(IntTools_Range(aPB->Pave1().Parameter(), aPB->Pave2().Parameter()));
- if (myProgressScope != NULL)
- {
- aEdgeFace.SetProgressIndicator(*myProgressScope);
- }
}
}
}
aPBMap.Clear();
anAlloc->Reset();
+ Message_ProgressScope aPS(aPSOuter.Next(), "Checking for coinciding edges and faces", aNbEFs);
+ for (Standard_Integer i = 0; i < aNbEFs; i++)
+ {
+ BOPAlgo_EdgeFace& aEdgeFace = aVEdgeFace.ChangeValue(i);
+ aEdgeFace.SetProgress(aPS.Next());
+ }
// Perform intersection of the found pairs
BOPTools_Parallel::Perform (myRunParallel, aVEdgeFace, myContext);
+ if (HasErrors())
+ {
+ return;
+ }
BOPDS_VectorOfInterfEF& aEFs = myDS->InterfEF();
if (theAddInterf && aEFs.IsEmpty())
// Collect all pairs for common block creation
BOPDS_IndexedDataMapOfPaveBlockListOfInteger aMPBLI(1, anAlloc);
-
for (Standard_Integer i = 0; i < aNbEFs; ++i)
{
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
BOPAlgo_EdgeFace& anEdgeFace = aVEdgeFace(i);
if (!anEdgeFace.IsDone() || anEdgeFace.HasErrors())
{
IntTools_FaceFace::SetFuzzyValue(theFuzz);
}
//
+ void SetProgress(const Message_ProgressRange& theRange)
+ {
+ myRange = theRange;
+ }
+ //
const gp_Trsf& Trsf() const { return myTrsf; }
//
virtual void Perform() {
- BOPAlgo_Algo::UserBreak();
+ Message_ProgressScope aPS(myRange, NULL, 1);
+ if (UserBreak(aPS))
+ {
+ return;
+ }
try
{
OCC_CATCH_SIGNALS
Bnd_Box myBox1;
Bnd_Box myBox2;
gp_Trsf myTrsf;
+
+ private:
+ Message_ProgressRange myRange;
};
//
//=======================================================================
//function : PerformFF
//purpose :
//=======================================================================
-void BOPAlgo_PaveFiller::PerformFF()
+void BOPAlgo_PaveFiller::PerformFF(const Message_ProgressRange& theRange)
{
myIterator->Initialize(TopAbs_FACE, TopAbs_FACE);
Standard_Integer iSize = myIterator->ExpectedLength();
+ Message_ProgressScope aPSOuter(theRange, NULL, 1);
if (!iSize) {
return;
}
// Initialize interferences
myIterator->Initialize(TopAbs_FACE, TopAbs_FACE);
for (; myIterator->More(); myIterator->Next()) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
myIterator->Value(nF1, nF2);
if (myGlue == BOPAlgo_GlueOff)
//
aFaceFace.SetParameters(bApprox, bCompC2D1, bCompC2D2, anApproxTol);
aFaceFace.SetFuzzyValue(myFuzzyValue);
- if (myProgressScope != NULL)
- {
- aFaceFace.SetProgressIndicator(*myProgressScope);
- }
}
else {
// for the Glue mode just add all interferences of that type
}
}//for (; myIterator->More(); myIterator->Next()) {
//
+ Standard_Integer k, aNbFaceFace = aVFaceFace.Length();;
+ Message_ProgressScope aPS(aPSOuter.Next(), "Intersecting faces", aNbFaceFace);
+ for (k = 0; k < aVFaceFace.Size(); k++)
+ {
+ BOPAlgo_FaceFace& aFaceFace = aVFaceFace.ChangeValue(k);
+ aFaceFace.SetProgress(aPS.Next());
+ }
//======================================================
// Perform intersection
BOPTools_Parallel::Perform (myRunParallel, aVFaceFace);
+ if (HasErrors())
+ {
+ return;
+ }
//======================================================
// Treatment of the results
- Standard_Integer k, aNbFaceFace = aVFaceFace.Length();
+
for (k = 0; k < aNbFaceFace; ++k) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
BOPAlgo_FaceFace& aFaceFace = aVFaceFace(k);
aFaceFace.Indices(nF1, nF2);
if (!aFaceFace.IsDone() || aFaceFace.HasErrors()) {
//
BOPDS_VectorOfCurve& aVNC = aFF.ChangeCurves();
for (Standard_Integer i = 1; i <= aNbCurves; ++i) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
Bnd_Box aBox;
const IntTools_Curve& aIC = aCvsX(i);
Standard_Boolean bIsValid = IntTools_Tools::CheckCurve(aIC, aBox);
//function : MakeBlocks
//purpose :
//=======================================================================
-void BOPAlgo_PaveFiller::MakeBlocks()
+void BOPAlgo_PaveFiller::MakeBlocks(const Message_ProgressRange& theRange)
{
+ Message_ProgressScope aPSOuter(theRange, NULL, 2);
if (myGlue != BOPAlgo_GlueOff) {
return;
}
//
BOPDS_VectorOfInterfFF& aFFs=myDS->InterfFF();
Standard_Integer aNbFF = aFFs.Length();
+ Message_ProgressScope aPS(aPSOuter.Next(), "Making blocks", aNbFF);
if (!aNbFF) {
return;
}
// Map of PaveBlocks with the faces to which it has to be added
BOPAlgo_DataMapOfPaveBlockListOfInteger aPBFacesMap;
//
- for (i=0; i<aNbFF; ++i) {
- //
- UserBreak();
+ for (i=0; i<aNbFF; ++i, aPS.Next()) {
+ if (UserBreak(aPS))
+ {
+ return;
+ }
//
BOPDS_InterfFF& aFF=aFFs(i);
aFF.Indices(nF1, nF2);
//
// Treat possible common zones by trying to put each section edge
// into all faces, not participated in creation of that edge, as IN edge
- PutSEInOtherFaces();
+
+ PutSEInOtherFaces(aPSOuter.Next());
//
//-----------------------------------------------------scope t
aMVStick.Clear();
}
//
// 2 Fuse shapes
- if (myProgressScope != NULL)
- {
- aPF.SetProgressIndicator(*myProgressScope);
- }
aPF.SetRunParallel(myRunParallel);
aPF.SetArguments(aLS);
aPF.Perform();
//function : PutSEInOtherFaces
//purpose :
//=======================================================================
-void BOPAlgo_PaveFiller::PutSEInOtherFaces()
+void BOPAlgo_PaveFiller::PutSEInOtherFaces(const Message_ProgressRange& theRange)
{
// Try to intersect each section edge with the faces
// not participated in its creation
BOPDS_VectorOfInterfFF& aFFs = myDS->InterfFF();
const Standard_Integer aNbFF = aFFs.Length();
+ 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)
}
}
// Perform intersection of collected pave blocks
- ForceInterfEF(aMPBScAll, Standard_False);
+ ForceInterfEF(aMPBScAll, aPS.Next(), Standard_False);
}
//=======================================================================
myContext = aContext;
}
//
+ void SetRange(const Message_ProgressRange& theRange)
+ {
+ myRange = theRange;
+ }
+ //
virtual void Perform () {
- BOPAlgo_Algo::UserBreak();
+ Message_ProgressScope aPS(myRange, NULL, 1);
+ if (UserBreak(aPS))
+ {
+ return;
+ }
myTol = BOPAlgo_Tools::ComputeToleranceOfCB(myCB, myDS, myContext);
BOPTools_AlgoTools::MakeSplitEdge(myE,
myV1, myT1,
//
BOPDS_PDS myDS;
Handle(IntTools_Context) myContext;
+private:
+ Message_ProgressRange myRange;
};
//
//=======================================================================
return myContext;
}
//
+ void SetRange(const Message_ProgressRange& theRange)
+ {
+ myRange = theRange;
+ }
+ //
virtual void Perform() {
+ Message_ProgressScope aPS(myRange, NULL, 1);
+ if (UserBreak(aPS))
+ {
+ return;
+ }
try
{
OCC_CATCH_SIGNALS
Standard_Real myNewTol;
//
Handle(IntTools_Context) myContext;
+ private:
+ Message_ProgressRange myRange;
};
//
//=======================================================================
Standard_Boolean IsToUpdate() const {
return myToUpdate;
}
+ void SetRange(const Message_ProgressRange& theRange)
+ {
+ myRange = theRange;
+ }
//
void Perform() {
+ Message_ProgressScope aPS(myRange, NULL, 1);
+ if (!aPS.More())
+ {
+ return;
+ }
BRepLib::BuildPCurveForEdgeOnPlane(myE, myF, myCurve, myToUpdate);
};
//
TopoDS_Face myF;
Handle(Geom2d_Curve) myCurve;
Standard_Boolean myToUpdate;
+private:
+ Message_ProgressRange myRange;
};
//=======================================================================
typedef NCollection_Vector<BOPAlgo_BPC> BOPAlgo_VectorOfBPC;
// function: MakeSplitEdges
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::MakeSplitEdges()
+void BOPAlgo_PaveFiller::MakeSplitEdges(const Message_ProgressRange& theRange)
{
BOPDS_VectorOfListOfPaveBlock& aPBP=myDS->ChangePaveBlocksPool();
Standard_Integer aNbPBP = aPBP.Length();
+ Message_ProgressScope aPSOuter(theRange, NULL, 1);
if(!aNbPBP) {
return;
}
//
for (i = 0; i < aNbPBP; ++i)
{
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
BOPDS_ListOfPaveBlock& aLPB = aPBP(i);
//
aItPB.Initialize(aLPB);
aBSE.SetCommonBlock(aCB);
}
aBSE.SetDS(myDS);
- if (myProgressScope != NULL)
- {
- aBSE.SetProgressIndicator(*myProgressScope);
- }
} // for (; aItPB.More(); aItPB.Next()) {
} // for (i=0; i<aNbPBP; ++i) {
//
aNbVBSE=aVBSE.Length();
+ Message_ProgressScope aPS(aPSOuter.Next(), "MakeSplitEdges", aNbVBSE);
+ for (k = 0; k < aNbVBSE; k++)
+ {
+ BOPAlgo_SplitEdge& aBSE = aVBSE.ChangeValue(k);
+ aBSE.SetRange(aPS.Next());
+ }
//======================================================
BOPTools_Parallel::Perform (myRunParallel, aVBSE, myContext);
//======================================================
+ if (HasErrors())
+ {
+ return;
+ }
//
for (k=0; k < aNbVBSE; ++k) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
BOPAlgo_SplitEdge& aBSE=aVBSE(k);
//
const TopoDS_Edge& aSp=aBSE.SplitEdge();
// function: MakePCurves
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::MakePCurves()
+void BOPAlgo_PaveFiller::MakePCurves(const Message_ProgressRange& theRange)
{
+ Message_ProgressScope aPSOuter(theRange, NULL, 1);
if (myAvoidBuildPCurve ||
(!mySectionAttribute.PCurveOnS1() && !mySectionAttribute.PCurveOnS2()))
return;
//
aNbFI=aFIP.Length();
for (i=0; i<aNbFI; ++i) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
const BOPDS_FaceInfo& aFI=aFIP(i);
nF1=aFI.Index();
//
BOPAlgo_MPC& aMPC=aVMPC.Appended();
aMPC.SetEdge(aE);
aMPC.SetFace(aF1F);
- if (myProgressScope != NULL)
- {
- aMPC.SetProgressIndicator(*myProgressScope);
- }
}
//
// On
aMPC.SetEdge(aE);
aMPC.SetFace(aF1F);
- if (myProgressScope != NULL)
- {
- aMPC.SetProgressIndicator(*myProgressScope);
- }
}
}// for (i=0; i<aNbFI; ++i) {
//
aMPC.SetEdge(aE);
aMPC.SetFace(aFf[m]);
aMPC.SetFlag(Standard_True);
- if (myProgressScope != NULL)
- {
- aMPC.SetProgressIndicator(*myProgressScope);
- }
}
}
}
}// for (i=0; i<aNbFF; ++i) {
}//if (bPCurveOnS1 || bPCurveOnS2 ) {
//
+ Message_ProgressScope aPS(aPSOuter.Next(), "Projecting edges on faces", aVMPC.Length());
+ for (i = 0; i < aVMPC.Length(); i++)
+ {
+ BOPAlgo_MPC& aMPC = aVMPC.ChangeValue(i);
+ aMPC.SetRange(aPS.Next());
+ }
//======================================================
BOPTools_Parallel::Perform (myRunParallel, aVMPC, myContext);
//======================================================
+ if (HasErrors())
+ {
+ return;
+ }
// Add warnings of the failed projections and update edges with new pcurves
Standard_Integer aNb = aVMPC.Length();
for (i = 0; i < aNb; ++i)
{
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
const BOPAlgo_MPC& aMPC = aVMPC(i);
if (aMPC.HasErrors())
{
// function: Prepare
// purpose:
//=======================================================================
-void BOPAlgo_PaveFiller::Prepare()
+void BOPAlgo_PaveFiller::Prepare(const Message_ProgressRange& theRange)
{
if (myNonDestructive) {
// do not allow storing pcurves in original edges if non-destructive mode is on
TopTools_IndexedMapOfShape aMF;
//
aNb=3;
+ Message_ProgressScope aPSOuter(theRange, NULL, 1);
for(i=0; i<aNb; ++i) {
myIterator->Initialize(aType[i], aType[2]);
for (; myIterator->More(); myIterator->Next()) {
}
}
//
+ Message_ProgressScope aPS(aPSOuter.Next(), "Building 2d curves on planar faces", aVBPC.Length());
+ for (i = 0; i < aVBPC.Length(); i++)
+ {
+ BOPAlgo_BPC& aBPC = aVBPC.ChangeValue(i);
+ aBPC.SetRange(aPS.Next());
+ }
//======================================================
BOPTools_Parallel::Perform (myRunParallel, aVBPC);
//======================================================
-
+ if (UserBreak(aPS))
+ {
+ return;
+ }
// pcurves are built, and now update edges
BRep_Builder aBB;
TopoDS_Edge E;
for (i = 0; i < aVBPC.Length(); i++) {
+ if (UserBreak(aPSOuter))
+ {
+ return;
+ }
const BOPAlgo_BPC& aBPC=aVBPC(i);
if (aBPC.IsToUpdate()) {
Standard_Real aTolE = BRep_Tool::Tolerance(aBPC.GetEdge());
// function: Perform
// purpose: Performs the removal of the requested faces from the input shape
//=======================================================================
-void BOPAlgo_RemoveFeatures::Perform()
+void BOPAlgo_RemoveFeatures::Perform(const Message_ProgressRange& /*theRange*/)
{
try
{
public: //! @name Performing the operation
//! Performs the operation
- Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
public: //! @name Clearing the contents of the algorithm
//
CheckFiller();
}
+
+//=======================================================================
+//function : AnalyzeProgress
+//purpose :
+//=======================================================================
+NCollection_Array1<Standard_Real> BOPAlgo_Section::AnalyzeProgress()
+{
+ Standard_Integer aSize = 3;
+ NCollection_Array1<Standard_Real> aSteps(0, aSize - 1);
+ for (Standard_Integer i = 0; i < aSize; i++)
+ {
+ aSteps(i) = 0;
+ }
+
+ Standard_Real aPart = 100.;
+ Standard_Integer aNbV = myDS->ShapesSD().Size();
+ Standard_Integer aNbE = 0;
+ Standard_Integer aNbF = 0;
+ for (Standard_Integer i = 0; i < myDS->NbSourceShapes(); i++)
+ {
+ const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
+ switch (aSI.ShapeType())
+ {
+ case TopAbs_EDGE:
+ aNbE++;
+ break;
+ case TopAbs_FACE:
+ aNbF++;
+ break;
+ default:
+ break;
+ }
+ }
+
+ aNbE = 5 * aNbE;
+ aNbF = 20 * aNbF;
+
+ Standard_Real aSum = aNbV + aNbE + aNbF;
+ if (aSum == 0)
+ {
+ return aSteps;
+ }
+
+ aSteps(0) = aPart * aNbV / aSum;
+ aSteps(1) = aPart * aNbE / aSum;
+ aSteps(2) = aPart * aNbF / aSum;
+
+ return aSteps;
+}
+
//=======================================================================
//function : PerformInternal1
//purpose :
//=======================================================================
void BOPAlgo_Section::PerformInternal1
- (const BOPAlgo_PaveFiller& theFiller)
+ (const BOPAlgo_PaveFiller& theFiller, const Message_ProgressRange& theRange)
{
myPaveFiller=(BOPAlgo_PaveFiller*)&theFiller;
myDS=myPaveFiller->PDS();
return;
}
//
+ Message_ProgressScope aPS(theRange, "Building result of SECTION operation", 100);
+ NCollection_Array1<Standard_Real> aSteps = AnalyzeProgress();
// 3. Fill Images
// 3.1 Vertices
- FillImagesVertices();
+ FillImagesVertices(aPS.Next(aSteps(0)));
if (HasErrors()) {
return;
}
return;
}
// 3.2 Edges
- FillImagesEdges();
+ FillImagesEdges(aPS.Next(aSteps(1)));
if (HasErrors()) {
return;
}
return;
}
// 4. Section
- BuildSection();
+ BuildSection(aPS.Next(aSteps(2)));
//
if (HasErrors()) {
return;
//function : BuildSection
//purpose :
//=======================================================================
-void BOPAlgo_Section::BuildSection()
+void BOPAlgo_Section::BuildSection(const Message_ProgressRange& theRange)
{
+ Message_ProgressScope aPS(theRange, "BuildSection", 1);
Standard_Integer i, aNbMS, aNbLE;
Standard_Integer j, nE, nV, aNb, aNbF, aNbPBSc;
TopoDS_Shape aRC, aRC1;
// 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;
//
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()) {
// 3.1 Set to treat => aLS
aIt.Initialize(aLSA);
for (; aIt.More(); aIt.Next()) {
+ if (UserBreak(aPS))
+ {
+ return;
+ }
const TopoDS_Shape& aSA=aIt.Value();
//
aLS.Clear();
//
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) {
//
aNbMS=aMVE.Extent();
for (i=1; i<=aNbMS; ++i) {
+ if (UserBreak(aPS))
+ {
+ return;
+ }
const TopoDS_Shape& aV=aMVE.FindKey(i);
const TopTools_ListOfShape& aLE=aMVE.FindFromIndex(i);
aNbLE=aLE.Extent();
Standard_EXPORT virtual void CheckData() Standard_OVERRIDE;
//! Combine the result of section operation
- Standard_EXPORT virtual void BuildSection();
+ Standard_EXPORT virtual void BuildSection(const Message_ProgressRange& theRange);
+
+ //! AnalyzeProgress
+ Standard_EXPORT NCollection_Array1<Standard_Real> AnalyzeProgress() Standard_OVERRIDE;
//! Performs calculations using prepared Filler object <thePF>
- Standard_EXPORT virtual void PerformInternal1(const BOPAlgo_PaveFiller& thePF) Standard_OVERRIDE;
+ Standard_EXPORT virtual void PerformInternal1(const BOPAlgo_PaveFiller& thePF, const Message_ProgressRange& theRange) Standard_OVERRIDE;
private:
//function : Perform
//purpose :
//=======================================================================
-void BOPAlgo_ShellSplitter::Perform()
+void BOPAlgo_ShellSplitter::Perform(const Message_ProgressRange& /*theRange*/)
{
GetReport()->Clear();
//
Standard_EXPORT const TopTools_ListOfShape& StartElements() const;
//! performs the algorithm
- Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! returns the loops
Standard_EXPORT const TopTools_ListOfShape& Shells() const;
//function : Perform
//purpose :
//=======================================================================
-void BOPAlgo_Splitter::Perform()
+void BOPAlgo_Splitter::Perform(const Message_ProgressRange& theRange)
{
GetReport()->Clear();
//
BOPAlgo_PaveFiller *pPF = new BOPAlgo_PaveFiller();
pPF->SetArguments(aLS);
pPF->SetRunParallel(myRunParallel);
- if (myProgressScope != NULL)
- {
- pPF->SetProgressIndicator(*myProgressScope);
- }
+
pPF->SetFuzzyValue(myFuzzyValue);
pPF->SetNonDestructive(myNonDestructive);
pPF->SetGlue(myGlue);
pPF->SetUseOBB(myUseOBB);
//
- pPF->Perform();
+ Message_ProgressScope aPS(theRange, "BOPAlgo_Splitter", 10);
+ pPF->Perform(aPS.Next(9));
+ if (HasErrors())
+ {
+ return;
+ }
//
myEntryPoint = 1;
- PerformInternal(*pPF);
+ PerformInternal(*pPF, aPS.Next(1));
}
//=======================================================================
Standard_EXPORT BOPAlgo_Splitter(const Handle(NCollection_BaseAllocator)& theAllocator);
//! Performs the operation
- Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
protected:
}
//! Performs the classification
- virtual void Perform();
+ virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange());
//! Returns the faces classified as IN for solid
const TopTools_ListOfShape& InFaces() const
//function : BOPAlgo_FillIn3DParts::Perform
//purpose :
//=======================================================================
-void BOPAlgo_FillIn3DParts::Perform()
+void BOPAlgo_FillIn3DParts::Perform(const Message_ProgressRange& theRange)
{
- BOPAlgo_Algo::UserBreak();
+ Message_ProgressScope aPS(theRange, NULL, 1);
+ if (UserBreak(aPS))
+ {
+ return;
+ }
myInFaces.Clear();
//function : Perform
//purpose :
//=======================================================================
-void BOPAlgo_WireSplitter::Perform()
+void BOPAlgo_WireSplitter::Perform(const Message_ProgressRange& /*theRange*/)
{
GetReport()->Clear();
//
//! Returns the context
Standard_EXPORT const Handle(IntTools_Context)& Context();
- Standard_EXPORT virtual void Perform() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Perform(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
static void MakeWire(TopTools_ListOfShape& theLE, TopoDS_Wire& theW);
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
+#include <Draw_ProgressIndicator.hxx>
+
#include <stdio.h>
#include <string.h>
pBuilder->SetUseOBB(BOPTest_Objects::UseOBB());
pBuilder->SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
//
- pBuilder->Build();
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+ pBuilder->Build(aProgress->Start());
pBuilder->SimplifyResult(BOPTest_Objects::UnifyEdges(),
BOPTest_Objects::UnifyFaces(),
BOPTest_Objects::Angular());
aBuilder.SetUseOBB(BOPTest_Objects::UseOBB());
aBuilder.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
//
- aBuilder.Build();
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+ aBuilder.Build(aProgress->Start());
aBuilder.SimplifyResult(BOPTest_Objects::UnifyEdges(),
BOPTest_Objects::UnifyFaces(),
BOPTest_Objects::Angular());
aSplitter.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
//
// performing operation
- aSplitter.Build();
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+ aSplitter.Build(aProgress->Start());
aSplitter.SimplifyResult(BOPTest_Objects::UnifyEdges(),
BOPTest_Objects::UnifyFaces(),
BOPTest_Objects::Angular());
#include <TopoDS_Iterator.hxx>
#include <TopoDS_Shape.hxx>
#include <TopTools_ListOfShape.hxx>
+#include <Draw_ProgressIndicator.hxx>
#include <stdio.h>
//
bRunParallel=BOPTest_Objects::RunParallel();
bNonDestructive = BOPTest_Objects::NonDestructive();
BOPAlgo_GlueEnum aGlue = BOPTest_Objects::Glue();
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
//
aLC.Append(aS1);
aLC.Append(aS2);
pPF->SetGlue(aGlue);
pPF->SetUseOBB(BOPTest_Objects::UseOBB());
//
- pPF->Perform();
+ pPF->Perform(aProgress->Start());
BOPTest::ReportAlerts(pPF->GetReport());
//
return 0;
}
//
bRunParallel=BOPTest_Objects::RunParallel();
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
//
const TopoDS_Shape& aS1=aLC.First();
const TopoDS_Shape& aS2=aLC.Last();
aBOP.SetCheckInverted(BOPTest_Objects::CheckInverted());
aBOP.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
//
- aBOP.PerformWithFiller(*pPF);
+ aBOP.PerformWithFiller(*pPF, aProgress->Start());
BOPTest::ReportAlerts(aBOP.GetReport());
// Store the history of Boolean operation into the session
aBOP.SetCheckInverted(BOPTest_Objects::CheckInverted());
aBOP.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
//
- aBOP.PerformWithFiller(*pPF);
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+ aBOP.PerformWithFiller(*pPF, aProgress->Start());
BOPTest::ReportAlerts(aBOP.GetReport());
// Store the history of Section operation into the session
//
BRepAlgoAPI_Section aSec(aS1, aS2, Standard_False);
//
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
aSec.Approximation(bApp);
aSec.ComputePCurveOn1(bPC1);
aSec.ComputePCurveOn2(bPC2);
aSec.SetGlue(aGlue);
aSec.SetUseOBB(BOPTest_Objects::UseOBB());
//
- aSec.Build();
-
+ aSec.Build(aProgress->Start());
// Store the history of Section operation into the session
if (BRepTest_Objects::IsHistoryNeeded())
BRepTest_Objects::SetHistory(aSec.History());
aPF.SetGlue(aGlue);
aPF.SetUseOBB(BOPTest_Objects::UseOBB());
//
- aPF.Perform();
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+ Message_ProgressScope aPS(aProgress->Start(), "BOP", 10);
+ aPF.Perform(aPS.Next(9));
BOPTest::ReportAlerts(aPF.GetReport());
if (aPF.HasErrors()) {
return 0;
aBOP.SetCheckInverted(BOPTest_Objects::CheckInverted());
aBOP.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
//
- aBOP.PerformWithFiller(aPF);
+ aBOP.PerformWithFiller(aPF, aPS.Next(1));
BOPTest::ReportAlerts(aBOP.GetReport());
// Store the history of Boolean operation into the session
aMV.SetUseOBB(BOPTest_Objects::UseOBB());
aMV.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
//
- aMV.Perform();
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+ aMV.Perform(aProgress->Start());
BOPTest::ReportAlerts(aMV.GetReport());
// Store the history of Volume Maker into the session
#include <BRepTest_Objects.hxx>
+#include <Draw_ProgressIndicator.hxx>
+
static Standard_Integer bcbuild (Draw_Interpretor&, Standard_Integer, const char**);
static Standard_Integer bcaddall (Draw_Interpretor&, Standard_Integer, const char**);
static Standard_Integer bcremoveall (Draw_Interpretor&, Standard_Integer, const char**);
aCBuilder.SetUseOBB(BOPTest_Objects::UseOBB());
aCBuilder.SetToFillHistory(BRepTest_Objects::IsHistoryNeeded());
//
- aCBuilder.PerformWithFiller(aPF);
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+ aCBuilder.PerformWithFiller(aPF, aProgress->Start());
BOPTest::ReportAlerts(aCBuilder.GetReport());
-
// Store the history of the Cells Builder into the session
if (BRepTest_Objects::IsHistoryNeeded())
BRepTest_Objects::SetHistory(aCBuilder.Arguments(), aCBuilder);
#include <BRepBuilderAPI_Copy.hxx>
#include <DBRep.hxx>
#include <Draw.hxx>
+#include <Draw_ProgressIndicator.hxx>
#include <OSD_Timer.hxx>
#include <TCollection_AsciiString.hxx>
#include <TopExp_Explorer.hxx>
OSD_Timer aTimer;
aTimer.Start();
//
- aChecker.Perform();
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+ aChecker.Perform(aProgress->Start());
//
aTimer.Stop();
//
}
}
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
// run checker
- aChecker.Perform();
-
+ aChecker.Perform(aProgress->Start());
// process result of checking
if(!aChecker.HasFaulty()) {
di << "Shape(s) seem(s) to be valid for BOP." << "\n";
#include <OSD_Timer.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS.hxx>
+#include <Draw_ProgressIndicator.hxx>
#include <stdio.h>
#include <string.h>
OSD_Timer aTimer;
aTimer.Start();
//
- aPF.Perform();
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+ aPF.Perform(aProgress->Start());
BOPTest::ReportAlerts(aPF.GetReport());
if (aPF.HasErrors()) {
return 0;
aTimer.Start();
//
// perform the operation
- pSplitter->PerformWithFiller(aPF);
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+ pSplitter->PerformWithFiller(aPF, aProgress->Start());
//
aTimer.Stop();
BOPTest::ReportAlerts(pSplitter->GetReport());
//function : Build
//purpose : compute the section
//=======================================================================
- void BRepAlgo_Section::Build()
+ void BRepAlgo_Section::Build(const Message_ProgressRange& /*theRange*/)
{
if (myS1Changed ||
myS2Changed ||
//! You may also have combined these computation
//! options: look at the example given above to illustrate
//! the use of the constructors.
- Standard_EXPORT void Build() Standard_OVERRIDE;
+ Standard_EXPORT void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Identifies the ancestor faces of the new
//! intersection edge E resulting from the last
using BOPAlgo_Options::DumpWarnings;
using BOPAlgo_Options::ClearWarnings;
using BOPAlgo_Options::GetReport;
- using BOPAlgo_Options::SetProgressIndicator;
using BOPAlgo_Options::SetUseOBB;
protected:
//function : Build
//purpose :
//=======================================================================
-void BRepAlgoAPI_BooleanOperation::Build()
+void BRepAlgoAPI_BooleanOperation::Build(const Message_ProgressRange& theRange)
{
// Set Not Done status by default
NotDone();
}
}
+ Message_ProgressScope aPS(theRange, NULL, myIsIntersectionNeeded ? 100 : 30);
// If necessary perform intersection of the argument shapes
if (myIsIntersectionNeeded)
{
aLArgs.Append(it.Value());
// Perform intersection
- IntersectShapes(aLArgs);
+ IntersectShapes(aLArgs, aPS.Next(70));
if (HasErrors())
{
if (aDumpOper.IsDump())
}
// Build the result
- BuildResult();
+ BuildResult(aPS.Next(30));
+ if (HasErrors())
+ {
+ return;
+ }
if (aDumpOper.IsDump()) {
Standard_Boolean isDumpRes = myShape.IsNull() ||
public: //! @name Performing the operation
//! Performs the Boolean operation.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
protected: //! @name Constructors
//function : Build
//purpose :
//=======================================================================
-void BRepAlgoAPI_BuilderAlgo::Build()
+void BRepAlgoAPI_BuilderAlgo::Build(const Message_ProgressRange& theRange)
{
// Setting not done status
NotDone();
// Destroy the tools if necessary
Clear();
+ Message_ProgressScope aPS(theRange, "Performing General Fuse operation", 100);
// If necessary perform intersection of the argument shapes
- IntersectShapes(myArguments);
+ IntersectShapes(myArguments, aPS.Next(70));
if (HasErrors())
return;
myBuilder = new BOPAlgo_Builder(myAllocator);
// Set arguments to builder
myBuilder->SetArguments(myArguments);
-
// Build the result basing on intersection results
- BuildResult();
+ BuildResult(aPS.Next(30));
}
//=======================================================================
//function : IntersectShapes
//purpose : Intersects the given shapes with the intersection tool
//=======================================================================
-void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArgs)
+void BRepAlgoAPI_BuilderAlgo::IntersectShapes(const TopTools_ListOfShape& theArgs, const Message_ProgressRange& theRange)
{
+ Message_ProgressScope aPS(theRange, NULL, 1);
if (!myIsIntersectionNeeded)
return;
myDSFiller->SetArguments(theArgs);
// Set options for intersection
myDSFiller->SetRunParallel(myRunParallel);
- if (myProgressScope != NULL)
- {
- myDSFiller->SetProgressIndicator(*myProgressScope);
- }
+
myDSFiller->SetFuzzyValue(myFuzzyValue);
myDSFiller->SetNonDestructive(myNonDestructive);
myDSFiller->SetGlue(myGlue);
// Set Face/Face intersection options to the intersection algorithm
SetAttributes();
// Perform intersection
- myDSFiller->Perform();
+ myDSFiller->Perform(aPS.Next());
// Check for the errors during intersection
GetReport()->Merge(myDSFiller->GetReport());
}
//function : BuildResult
//purpose : Builds the result shape
//=======================================================================
-void BRepAlgoAPI_BuilderAlgo::BuildResult()
+void BRepAlgoAPI_BuilderAlgo::BuildResult(const Message_ProgressRange& theRange)
{
// Set options to the builder
myBuilder->SetRunParallel(myRunParallel);
- if (myProgressScope != NULL)
- {
- myBuilder->SetProgressIndicator(*myProgressScope);
- }
+
myBuilder->SetCheckInverted(myCheckInverted);
myBuilder->SetToFillHistory(myFillHistory);
// Perform building of the result with pre-calculated intersections
- myBuilder->PerformWithFiller(*myDSFiller);
+ Message_ProgressScope aPS(theRange, NULL, 1);
+ myBuilder->PerformWithFiller(*myDSFiller, aPS.Next());
// Merge the warnings of the Building part
GetReport()->Merge(myBuilder->GetReport());
// Check for the errors
public: //! @name Performing the operation
//! Performs the algorithm
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
public: //! @name Result simplification
protected: //! @name Protected methods for shapes intersection and building result
//! Intersects the given shapes with the intersection tool
- Standard_EXPORT void IntersectShapes(const TopTools_ListOfShape& theArgs);
+ Standard_EXPORT void IntersectShapes(const TopTools_ListOfShape& theArgs, const Message_ProgressRange& theRange);
//! Builds the resulting shape
- Standard_EXPORT void BuildResult();
+ Standard_EXPORT void BuildResult(const Message_ProgressRange& theRange = Message_ProgressRange());
protected: //! @name Clearing the contents of the algorithm
//=======================================================================
BRepAlgoAPI_Check::BRepAlgoAPI_Check(const TopoDS_Shape& theS,
const Standard_Boolean bTestSE,
- const Standard_Boolean bTestSI)
+ const Standard_Boolean bTestSI,
+ const Message_ProgressRange& theRange)
:
BOPAlgo_Options(),
myS1(theS),
myTestSI(bTestSI),
myOperation(BOPAlgo_UNKNOWN)
{
- Perform();
+ Perform(theRange);
}
//=======================================================================
const TopoDS_Shape& theS2,
const BOPAlgo_Operation theOp,
const Standard_Boolean bTestSE,
- const Standard_Boolean bTestSI)
+ const Standard_Boolean bTestSI,
+ const Message_ProgressRange& theRange)
:
BOPAlgo_Options(),
myS1(theS1),
myTestSI(bTestSI),
myOperation(theOp)
{
- Perform();
+ Perform(theRange);
}
//=======================================================================
//function : Perform
//purpose :
//=======================================================================
-void BRepAlgoAPI_Check::Perform()
+void BRepAlgoAPI_Check::Perform(const Message_ProgressRange& theRange)
{
// Check the incompatibility of shapes types, small edges and self-interference
BOPAlgo_ArgumentAnalyzer anAnalyzer;
anAnalyzer.SelfInterMode() = myTestSI;
// Set options from BOPAlgo_Options
anAnalyzer.SetRunParallel(myRunParallel);
- if (myProgressScope != NULL)
- {
- anAnalyzer.SetProgressIndicator(*myProgressScope);
- }
anAnalyzer.SetFuzzyValue(myFuzzyValue);
// Perform the check
- anAnalyzer.Perform();
+ Message_ProgressScope aPS(theRange, "Performing CHECK operation", 1);
+ anAnalyzer.Perform(aPS.Next());
+ if (UserBreak(aPS))
+ {
+ return;
+ }
// Get the results
myFaultyShapes = anAnalyzer.GetCheckResult();
#include <Standard_Boolean.hxx>
#include <Standard_Real.hxx>
#include <TopoDS_Shape.hxx>
+#include <Message_ProgressRange.hxx>
//! The class Check provides a diagnostic tool for checking the validity
//! on small edges or not; by default it is set to TRUE;
//! @param bTestSI [in] - flag which specifies whether to check the shape
//! on self-interference or not; by default it is set to TRUE;
+ //! @param theRange [in] - parameter to use progrs indicator
Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS,
const Standard_Boolean bTestSE = Standard_True,
- const Standard_Boolean bTestSI = Standard_True);
+ const Standard_Boolean bTestSI = Standard_True,
+ const Message_ProgressRange& theRange = Message_ProgressRange());
//! Constructor for checking the couple of shapes.
//! Additionally to the validity checks of each given shape,
//! on small edges or not; by default it is set to TRUE;
//! @param bTestSI [in] - flag which specifies whether to check the shape
//! on self-interference or not; by default it is set to TRUE;
+ //! @param theRange [in] - parameter to use progrs indicator
Standard_EXPORT BRepAlgoAPI_Check(const TopoDS_Shape& theS1,
const TopoDS_Shape& theS2,
const BOPAlgo_Operation theOp = BOPAlgo_UNKNOWN,
const Standard_Boolean bTestSE = Standard_True,
- const Standard_Boolean bTestSI = Standard_True);
+ const Standard_Boolean bTestSI = Standard_True,
+ const Message_ProgressRange& theRange = Message_ProgressRange());
public: //! @name Initializing the algorithm
public: //! @name Performing the operation
//! Performs the check.
- Standard_EXPORT void Perform();
+ Standard_EXPORT void Perform(const Message_ProgressRange& theRange = Message_ProgressRange());
public: //! @name Getting the results.
//purpose :
//=======================================================================
BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1,
- const TopoDS_Shape& S2)
+ const TopoDS_Shape& S2,
+ const Message_ProgressRange& theRange)
:
BRepAlgoAPI_BooleanOperation(S1, S2, BOPAlgo_CUT)
{
- Build();
+ Message_ProgressScope aPS(theRange, "Performing CUT operation", 1);
+ Build(aPS.Next());
}
//=======================================================================
//function : BRepAlgoAPI_Cut
BRepAlgoAPI_Cut::BRepAlgoAPI_Cut(const TopoDS_Shape& S1,
const TopoDS_Shape& S2,
const BOPAlgo_PaveFiller& aDSF,
- const Standard_Boolean bFWD)
+ const Standard_Boolean bFWD,
+ const Message_ProgressRange& theRange)
:
BRepAlgoAPI_BooleanOperation(S1, S2, aDSF,
(bFWD) ? BOPAlgo_CUT : BOPAlgo_CUT21)
{
- Build();
+ Message_ProgressScope aPS(theRange, "Performing CUT operation", 1);
+ Build(aPS.Next());
}
//! <S2> -tool
//! <anOperation> - the type of the operation
//! Obsolete
- Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
+ Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
+ const Message_ProgressRange& theRange = Message_ProgressRange());
//! Constructor with two shapes
//! <S1> -argument
//! <anOperation> - the type of the operation
//! <PF> - PaveFiller object that is carried out
//! Obsolete
- Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF, const Standard_Boolean bFWD = Standard_True);
+ Standard_EXPORT BRepAlgoAPI_Cut(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF,
+ const Standard_Boolean bFWD = Standard_True,
+ const Message_ProgressRange& theRange = Message_ProgressRange());
//function : Build
//purpose :
//=======================================================================
-void BRepAlgoAPI_Defeaturing::Build()
+void BRepAlgoAPI_Defeaturing::Build(const Message_ProgressRange& /*theRange*/)
{
// Set not done state for the operation
NotDone();
public: //! @name Performing the operation
//! Performs the operation
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
public: //! @name History Methods
//purpose :
//=======================================================================
BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1,
- const TopoDS_Shape& S2)
+ const TopoDS_Shape& S2,
+ const Message_ProgressRange& theRange)
:
BRepAlgoAPI_BooleanOperation(S1, S2, BOPAlgo_FUSE)
{
- Build();
+ Message_ProgressScope aPS(theRange, "Performing FUSE operation", 1);
+ Build(aPS.Next());
}
//=======================================================================
//function : BRepAlgoAPI_Fuse
//=======================================================================
BRepAlgoAPI_Fuse::BRepAlgoAPI_Fuse(const TopoDS_Shape& S1,
const TopoDS_Shape& S2,
- const BOPAlgo_PaveFiller& aDSF)
+ const BOPAlgo_PaveFiller& aDSF,
+ const Message_ProgressRange& theRange)
:
BRepAlgoAPI_BooleanOperation(S1, S2, aDSF, BOPAlgo_FUSE)
{
- Build();
+ Message_ProgressScope aPS(theRange, "Performing FUSE operation", 1);
+ Build(aPS.Next());
}
//! <S2> -tool
//! <anOperation> - the type of the operation
//! Obsolete
- Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2);
+ Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
+ const Message_ProgressRange& theRange = Message_ProgressRange());
//! Constructor with two shapes
//! <S1> -argument
//! <anOperation> - the type of the operation
//! <PF> - PaveFiller object that is carried out
//! Obsolete
- Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF);
+ Standard_EXPORT BRepAlgoAPI_Fuse(const TopoDS_Shape& S1, const TopoDS_Shape& S2, const BOPAlgo_PaveFiller& aDSF,
+ const Message_ProgressRange& theRange = Message_ProgressRange());
//function : Build
//purpose :
//=======================================================================
-void BRepAlgoAPI_Section::Build()
+void BRepAlgoAPI_Section::Build(const Message_ProgressRange& theRange)
{
- BRepAlgoAPI_BooleanOperation::Build();
+ Message_ProgressScope aPS(theRange, "Performing SECTION operation", 1);
+ BRepAlgoAPI_BooleanOperation::Build(aPS.Next());
}
//=======================================================================
//function : HasAncestorFaceOn1
//! Performs the algorithm
//! Filling interference Data Structure (if it is necessary)
//! Building the result of the operation.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! get the face of the first part giving section edge <E>.
// function: Build
// purpose:
//=======================================================================
-void BRepAlgoAPI_Splitter::Build()
+void BRepAlgoAPI_Splitter::Build(const Message_ProgressRange& theRange)
{
// Set Not Done status by default
NotDone();
}
// If necessary perform intersection of the argument shapes
+ Message_ProgressScope aPS(theRange, "Performing Split operation", myIsIntersectionNeeded ? 100 : 30);
if (myIsIntersectionNeeded)
{
// Combine Arguments and Tools for intersection into a single list
aLArgs.Append(it.Value());
// Perform intersection
- IntersectShapes(aLArgs);
+ IntersectShapes(aLArgs, aPS.Next(70));
if (HasErrors())
return;
}
((BOPAlgo_Splitter*)myBuilder)->SetTools(myTools);
// Build result shape basing on the intersection results
- BuildResult();
+ BuildResult(aPS.Next(30));
}
//! Performs the Split operation.
//! Performs the intersection of the argument shapes (both objects and tools)
//! and splits objects by the tools.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
protected: //! @name Fields
//purpose :
//=======================================================================
-void BRepBuilderAPI_MakeShape::Build()
+void BRepBuilderAPI_MakeShape::Build(const Message_ProgressRange& /*theRange*/)
{
}
#include <TopTools_ListOfShape.hxx>
#include <BRepBuilderAPI_Command.hxx>
#include <Standard_Boolean.hxx>
+#include <Message_ProgressRange.hxx>
class StdFail_NotDone;
class TopoDS_Shape;
//! This is called by Shape(). It does nothing but
//! may be redefined.
- Standard_EXPORT virtual void Build();
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange());
//! Returns a shape built by the shape construction algorithm.
//! Raises exception StdFail_NotDone if the shape was not built.
}
}
+//=======================================================================
+//function : AnalyzeProgress
+//purpose :
+//=======================================================================
+NCollection_Array1<Standard_Real> BRepFeat_Builder::AnalyzeProgress()
+{
+ Standard_Integer aSize = 3;
+ NCollection_Array1<Standard_Real> aSteps(0, aSize - 1);
+ for (Standard_Integer i = 0; i < aSize; i++)
+ {
+ aSteps(i) = 0;
+ }
+
+ Standard_Real aPart = 100.;
+ Standard_Integer aNbSh = 0;
+ Standard_Integer aNbS = 0;
+ Standard_Integer aNbC = 0;
+ for (Standard_Integer i = 0; i < myDS->NbSourceShapes(); i++)
+ {
+ const BOPDS_ShapeInfo& aSI = myDS->ShapeInfo(i);
+ switch (aSI.ShapeType())
+ {
+ case TopAbs_SHELL:
+ aNbSh++;
+ break;
+ case TopAbs_SOLID:
+ aNbS++;
+ break;
+ case TopAbs_COMPOUND:
+ aNbC++;
+ break;
+ default:
+ break;
+ }
+ }
+
+ aNbSh = 10 * aNbSh;
+ aNbS = 10 * aNbS;
+ aNbC = 5 * aNbC;
+ Standard_Real aSum = aNbSh + aNbS + aNbC;
+ if (aSum == 0)
+ {
+ return aSteps;
+ }
+
+ aSteps(0) = aPart * aNbSh / aSum;
+ aSteps(1) = aPart * aNbS / aSum;
+ aSteps(2) = aPart * aNbC / aSum;
+
+ return aSteps;
+}
+
//=======================================================================
//function : PerformResult
//purpose :
//=======================================================================
- void BRepFeat_Builder::PerformResult()
+ void BRepFeat_Builder::PerformResult(const Message_ProgressRange& theRange)
{
myOperation = myFuse ? BOPAlgo_FUSE : BOPAlgo_CUT;
//
if (!myShapes.IsEmpty()) {
+ Message_ProgressScope aPS(theRange, "BRepFeat_Builder", 100);
//
+ NCollection_Array1<Standard_Real> aSteps = AnalyzeProgress();
Prepare();
//
RebuildFaces();
//
- FillImagesContainers(TopAbs_SHELL);
+ FillImagesContainers(TopAbs_SHELL, aPS.Next(aSteps(0)));
if (HasErrors()) {
return;
}
//
- FillImagesSolids();
+ FillImagesSolids(aPS.Next(aSteps(1)));
if (HasErrors()) {
return;
}
return;
}
//
- FillImagesCompounds();
+ FillImagesCompounds(aPS.Next(aSteps(2)));
if (HasErrors()) {
return;
}
//! Main function to build the result of the
//! local operation required.
- Standard_EXPORT void PerformResult();
+ Standard_EXPORT void PerformResult(const Message_ProgressRange& theRange = Message_ProgressRange());
//! Rebuilds faces in accordance with the kept parts of the tool.
Standard_EXPORT void RebuildFaces();
protected:
+ //! AnalyzeProgress
+ Standard_EXPORT NCollection_Array1<Standard_Real> AnalyzeProgress() Standard_OVERRIDE;
//! Prepares builder of local operation.
Standard_EXPORT virtual void Prepare() Standard_OVERRIDE;
//function : Build
//purpose :
//=======================================================================
-void BRepFeat_Gluer::Build()
+void BRepFeat_Gluer::Build(const Message_ProgressRange& /*theRange*/)
{
myGluer.Perform();
if (myGluer.IsDone()) {
//! This is called by Shape(). It does nothing but
//! may be redefined.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! returns the status of the Face after
//! the shape creation.
//function : Build
//purpose :
//=======================================================================
-void BRepFeat_SplitShape::Build ()
+void BRepFeat_SplitShape::Build (const Message_ProgressRange& /*theRange*/)
{
mySShape.Perform(myWOnShape);
if (mySShape.IsDone()) {
Standard_EXPORT const TopTools_ListOfShape& Right() const;
//! Builds the cut and the resulting faces and edges as well.
- Standard_EXPORT void Build() Standard_OVERRIDE;
+ Standard_EXPORT void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns true if the shape has been deleted.
Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& S) Standard_OVERRIDE;
//purpose :
//=======================================================================
-void BRepFilletAPI_MakeChamfer::Build()
+void BRepFilletAPI_MakeChamfer::Build(const Message_ProgressRange& /*theRange*/)
{
myBuilder.Compute();
if (myBuilder.IsDone()){
//! intersection of 4 or more edges of the shape, or
//! - the intersection of the chamfer with a face which
//! limits the contour is not fully contained in this face.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Reinitializes this algorithm, thus canceling the effects of the Build function.
//! This function allows modifications to be made to the
//purpose :
//=======================================================================
-void BRepFilletAPI_MakeFillet::Build()
+void BRepFilletAPI_MakeFillet::Build(const Message_ProgressRange& /*theRange*/)
{
myBuilder.Compute();
if(myBuilder.IsDone()) {
//! intersection of 4 or more edges of the shape, or
//! - the intersection of the fillet with a face which limits
//! the contour is not fully contained in this face.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Reinitializes this algorithm, thus canceling the effects of the Build function.
//! This function allows modifications to be made to the
//purpose :
//=======================================================================
-void BRepFilletAPI_MakeFillet2d::Build()
+void BRepFilletAPI_MakeFillet2d::Build(const Message_ProgressRange& /*theRange*/)
{
// test if the operation is done
if (Status() == ChFi2d_IsDone) {
ChFi2d_ConstructionError Status() const;
//! Update the result and set the Done flag
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//purpose :
//=======================================================================
-void BRepOffsetAPI_DraftAngle::Build()
+void BRepOffsetAPI_DraftAngle::Build(const Message_ProgressRange& /*theRange*/)
{
Handle(Draft_Modification)::DownCast (myModification)->Perform();
if (!Handle(Draft_Modification)::DownCast (myModification)->IsDone()) {
Standard_EXPORT const TopTools_ListOfShape& ModifiedFaces() const;
//! Builds the resulting shape (redefined from MakeShape).
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
Standard_EXPORT void CorrectWires();
//function : Build
//purpose :
//=======================================================================
-void BRepOffsetAPI_MakeEvolved::Build()
+void BRepOffsetAPI_MakeEvolved::Build(const Message_ProgressRange& /*theRange*/)
{
if (myEvolved.IsDone())
{
Standard_EXPORT const BRepFill_Evolved& Evolved() const;
//! Builds the resulting shape (redefined from MakeShape).
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns the shapes created from a subshape
//! <SpineShape> of the spine and a subshape
//function : Build
//purpose : builds the resulting face
//======================================================================
-void BRepOffsetAPI_MakeFilling::Build()
+void BRepOffsetAPI_MakeFilling::Build(const Message_ProgressRange& /*theRange*/)
{
myFilling.Build();
myShape = myFilling.Face();
Standard_EXPORT Standard_Integer Add (const Standard_Real U, const Standard_Real V, const TopoDS_Face& Support, const GeomAbs_Shape Order);
//! Builds the resulting faces
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Tests whether computation of the filling plate has been completed.
Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
//purpose :
//=======================================================================
-void BRepOffsetAPI_MakeOffset::Build()
+void BRepOffsetAPI_MakeOffset::Build(const Message_ProgressRange& /*theRange*/)
{
Done();
}
Standard_EXPORT void Perform (const Standard_Real Offset, const Standard_Real Alt = 0.0);
//! Builds the resulting shape (redefined from MakeShape).
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! returns a list of the created shapes
//! from the shape <S>.
//function : Build
//purpose :
//=======================================================================
-void BRepOffsetAPI_MakeOffsetShape::Build()
+void BRepOffsetAPI_MakeOffsetShape::Build(const Message_ProgressRange& /*theRange*/)
{
}
Standard_EXPORT virtual const BRepOffset_MakeOffset& MakeOffset() const;
//! Does nothing.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns the list of shapes generated from the shape <S>.
Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
//purpose :
//=======================================================================
-void BRepOffsetAPI_MakePipe::Build()
+void BRepOffsetAPI_MakePipe::Build(const Message_ProgressRange& /*theRange*/)
{
myShape = myPipe.Shape();
//Check for emptiness of result
Standard_EXPORT const BRepFill_Pipe& Pipe() const;
//! Builds the resulting shape (redefined from MakeShape).
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns the TopoDS Shape of the bottom of the prism.
Standard_EXPORT TopoDS_Shape FirstShape() Standard_OVERRIDE;
//function :Build()
//purpose :
//=======================================================================
- void BRepOffsetAPI_MakePipeShell::Build()
+ void BRepOffsetAPI_MakePipeShell::Build(const Message_ProgressRange& /*theRange*/)
{
Standard_Boolean Ok;
Ok = myPipe->Build();
Standard_EXPORT void Simulate (const Standard_Integer NumberOfSection, TopTools_ListOfShape& Result);
//! Builds the resulting shape (redefined from MakeShape).
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Transforms the sweeping Shell in Solid.
//! If a propfile is not closed returns False
//function : Build
//purpose :
//=======================================================================
-void BRepOffsetAPI_MakeThickSolid::Build()
+void BRepOffsetAPI_MakeThickSolid::Build(const Message_ProgressRange& /*theRange*/)
{
}
const Standard_Boolean RemoveIntEdges = Standard_False);
// Does nothing.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns the list of shapes modified from the shape
//! <S>.
//purpose :
//=======================================================================
-void BRepOffsetAPI_MiddlePath::Build()
+void BRepOffsetAPI_MiddlePath::Build(const Message_ProgressRange& /*theRange*/)
{
TopTools_ListIteratorOfListOfShape itl;
//! a wire or a face
Standard_EXPORT BRepOffsetAPI_MiddlePath(const TopoDS_Shape& aShape, const TopoDS_Shape& StartShape, const TopoDS_Shape& EndShape);
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
myNormalProjector.Compute3d(With3d);
}
- void BRepOffsetAPI_NormalProjection::Build()
+ void BRepOffsetAPI_NormalProjection::Build(const Message_ProgressRange& /*theRange*/)
{
myNormalProjector.Build();
myShape = myNormalProjector.Projection();
//! Builds the result of the projection as a compound of
//! wires. Tries to build oriented wires.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns true if the object was correctly built by the shape
//! construction algorithm.
//purpose :
//=======================================================================
-void BRepOffsetAPI_ThruSections::Build()
+void BRepOffsetAPI_ThruSections::Build(const Message_ProgressRange& /*theRange*/)
{
//Check set of section for right configuration of punctual sections
Standard_Integer i;
//! the optimization.
Standard_EXPORT void CriteriumWeight (Standard_Real& W1, Standard_Real& W2, Standard_Real& W3) const;
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns the TopoDS Shape of the bottom of the loft if solid
Standard_EXPORT const TopoDS_Shape& FirstShape() const;
//function : Build
//purpose :
//=======================================================================
-void BRepPreviewAPI_MakeBox::Build()
+void BRepPreviewAPI_MakeBox::Build(const Message_ProgressRange& /*theRange*/)
{
gp_Pnt anLocation = myWedge.Axes().Location();
BRepPreviewAPI_MakeBox() {}
//! Creates a preview depending on point values.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
private:
//purpose :
//=======================================================================
-void BRepPrimAPI_MakeBox::Build()
+void BRepPrimAPI_MakeBox::Build(const Message_ProgressRange& /*theRange*/)
{
Solid();
}
Standard_EXPORT BRepPrim_Wedge& Wedge();
//! Stores the solid in myShape.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns the constructed box as a shell.
Standard_EXPORT const TopoDS_Shell& Shell();
//purpose :
//=======================================================================
-void BRepPrimAPI_MakeOneAxis::Build()
+void BRepPrimAPI_MakeOneAxis::Build(const Message_ProgressRange& /*theRange*/)
{
BRep_Builder B;
B.MakeSolid(TopoDS::Solid(myShape));
Standard_EXPORT virtual Standard_Address OneAxis() = 0;
//! Stores the solid in myShape.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns the lateral face of the rotational primitive.
Standard_EXPORT const TopoDS_Face& Face();
//purpose :
//=======================================================================
-void BRepPrimAPI_MakePrism::Build()
+void BRepPrimAPI_MakePrism::Build(const Message_ProgressRange& /*theRange*/)
{
myShape = myPrism.Shape();
Done();
Standard_EXPORT const BRepSweep_Prism& Prism() const;
//! Builds the resulting shape (redefined from MakeShape).
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns the TopoDS Shape of the bottom of the prism.
Standard_EXPORT TopoDS_Shape FirstShape() Standard_OVERRIDE;
//purpose :
//=======================================================================
-void BRepPrimAPI_MakeRevol::Build()
+void BRepPrimAPI_MakeRevol::Build(const Message_ProgressRange& /*theRange*/)
{
if (myIsBuild)
{
Standard_EXPORT const BRepSweep_Revol& Revol() const;
//! Builds the resulting shape (redefined from MakeShape).
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns the first shape of the revol (coinciding with
//! the generating shape).
//purpose :
//=======================================================================
-void BRepPrimAPI_MakeWedge::Build()
+void BRepPrimAPI_MakeWedge::Build(const Message_ProgressRange& /*theRange*/)
{
BRep_Builder B;
B.MakeSolid(TopoDS::Solid(myShape));
Standard_EXPORT BRepPrim_Wedge& Wedge();
//! Stores the solid in myShape.
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
//! Returns the constructed box in the form of a shell.
Standard_EXPORT const TopoDS_Shell& Shell();
#include <TopAbs.hxx>
#include <DrawTrSurf.hxx>
#include <Message.hxx>
+#include <Draw_ProgressIndicator.hxx>
#include <stdio.h>
}
BOPAlgo_PaveFiller theDSFiller;
+ Handle(Draw_ProgressIndicator) aProgress = new Draw_ProgressIndicator(di, 1);
+ Message_ProgressScope aPS(aProgress->Start(), NULL, 10);
TopTools_ListOfShape aLS;
aLS.Append(S1);
aLS.Append(S2);
theDSFiller.SetArguments(aLS);
//
- theDSFiller.Perform();
+ theDSFiller.Perform(aPS.Next(8));
if (theDSFiller.HasErrors()) {
Message::SendFail() << "Check types of the arguments, please";
return 1;
}
BRepAlgoAPI_BooleanOperation* pBuilder=NULL;
-
if (fuse)
- pBuilder = new BRepAlgoAPI_Fuse( S1, S2, theDSFiller );
+ pBuilder = new BRepAlgoAPI_Fuse( S1, S2, theDSFiller, aPS.Next(2) );
else
- pBuilder = new BRepAlgoAPI_Cut ( S1, S2, theDSFiller );
+ pBuilder = new BRepAlgoAPI_Cut ( S1, S2, theDSFiller, Standard_True, aPS.Next(2));
Standard_Boolean anIsDone = pBuilder->IsDone();
if (!anIsDone)
//purpose :
//=======================================================================
- void ShapeConstruct_MakeTriangulation::Build()
+ void ShapeConstruct_MakeTriangulation::Build(const Message_ProgressRange& /*theRange*/)
{
if (myShape.IsNull()) {
// Triangulate polygonal wire
Standard_EXPORT ShapeConstruct_MakeTriangulation(const TopoDS_Wire& wire, const Standard_Real prec = 0.0);
- Standard_EXPORT virtual void Build() Standard_OVERRIDE;
+ Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;