TopTools_MapOfShape aMFDone;
//
if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) {
- BuildSplitsOfExtendedFaces(LFE, myAnalyse, AsDes, anEdgesOrigins, aFacesOrigins, aETrimEInf, IMOE);
+ BuildSplitsOfExtendedFaces(LFE, myAnalyse, AsDes, anEdgesOrigins, aFacesOrigins, aETrimEInf, IMOE, Message_ProgressRange());
//
TopTools_ListIteratorOfListOfShape aItLF(LFE);
for (; aItLF.More(); aItLF.Next()) {
}
//
if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) {
- BuildSplitsOfTrimmedFaces(LF, myAsDes, myImageOffset);
+ BuildSplitsOfTrimmedFaces(LF, myAsDes, myImageOffset, Message_ProgressRange());
}
else {
myMakeLoops.Build(LF,myAsDes,myImageOffset,myImageVV);
}
//
if ((myJoin == GeomAbs_Intersection) && myInter && myIsPlanar) {
- BuildSplitsOfTrimmedFaces(LOF, myAsDes, myImageOffset);
+ BuildSplitsOfTrimmedFaces(LOF, myAsDes, myImageOffset, Message_ProgressRange());
}
else {
myMakeLoops.BuildFaces(LOF,myAsDes,myImageOffset);
//=======================================================================
static void BuildSplitsOfTrimmedFace (const TopoDS_Face& theFace,
const TopoDS_Shape& theEdges,
- TopTools_ListOfShape& theLFImages)
+ TopTools_ListOfShape& theLFImages,
+ const Message_ProgressRange& theRange)
{
BOPAlgo_Splitter aSplitter;
//
aSplitter.AddArgument (theFace);
aSplitter.AddArgument (theEdges);
aSplitter.SetToFillHistory (Standard_False);
- aSplitter.Perform();
+ aSplitter.Perform(theRange);
if (aSplitter.HasErrors())
{
return;
public: //! @name Public methods to build the splits
//! Build splits of already trimmed faces
- void BuildSplitsOfTrimmedFaces();
+ void BuildSplitsOfTrimmedFaces(const Message_ProgressRange& theRange);
//! Building splits of not-trimmed offset faces.
//! For the cases in which invalidities will be found, these invalidities will be rebuilt.
- void BuildSplitsOfExtendedFaces();
+ void BuildSplitsOfExtendedFaces(const Message_ProgressRange& theRange);
private: //! @name private methods performing the job
private: //! @name Intersection and post-treatment of edges
//! Intersection of the trimmed edges among themselves
- void IntersectTrimmedEdges();
+ void IntersectTrimmedEdges(const Message_ProgressRange& theRange);
//! Saving connection from trimmed edges to not trimmed ones
void UpdateIntersectedEdges (const TopTools_ListOfShape& theLA,
//function : BuildSplitsOfTrimmedFaces
//purpose :
//=======================================================================
-void BRepOffset_BuildOffsetFaces::BuildSplitsOfTrimmedFaces()
+void BRepOffset_BuildOffsetFaces::BuildSplitsOfTrimmedFaces(const Message_ProgressRange& theRange)
{
if (!hasData (myFaces))
{
myEdgesOrigins = &anEdgesOrigins;
}
+ Message_ProgressScope aPS(theRange, NULL, 2);
+
// Fuse all edges
- IntersectTrimmedEdges();
+ IntersectTrimmedEdges(aPS.Next());
+ Message_ProgressScope aPSLoop(aPS.Next(), NULL, myFaces->Size());
for (TopTools_ListOfShape::Iterator aItLF (*myFaces); aItLF.More(); aItLF.Next())
{
+ if (!aPSLoop.More())
+ {
+ return;
+ }
const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value();
TopoDS_Shape aCE;
}
TopTools_ListOfShape aLFImages;
- BuildSplitsOfTrimmedFace (aF, aCE, aLFImages);
+ BuildSplitsOfTrimmedFace (aF, aCE, aLFImages, aPSLoop.Next());
myOFImages.Add (aF, aLFImages);
}
//function : BuildSplitsOfExtendedFaces
//purpose :
//=======================================================================
-void BRepOffset_BuildOffsetFaces::BuildSplitsOfExtendedFaces()
+void BRepOffset_BuildOffsetFaces::BuildSplitsOfExtendedFaces(const Message_ProgressRange& theRange)
{
// Check input data
if (!hasData (myFaces) || !hasData (myEdgesOrigins) || !hasData (myFacesOrigins) || !hasData (myETrimEInf))
return;
}
- // Fusing all trimmed offset edges to avoid self-intersections in the splits
- IntersectTrimmedEdges();
+ Message_ProgressScope aPS(theRange, NULL, 2);
+ // Fusing all trimmed offset edges to avoid self-intersections in the splits
+ IntersectTrimmedEdges(aPS.Next());
+ if (!aPS.More())
+ {
+ return;
+ }
// vertices to avoid
TopTools_MapOfShape aVertsToAvoid;
const Standard_Integer aNbMaxAttempts = 10;
for (Standard_Integer iCount = 0; iCount < aNbMaxAttempts; ++iCount)
{
+ if (!aPS.More())
+ {
+ return;
+ }
// Clear the data before further faces construction
myInvalidFaces.Clear();
myArtInvalidFaces.Clear();
//function : IntersectTrimmedEdges
//purpose :
//=======================================================================
-void BRepOffset_BuildOffsetFaces::IntersectTrimmedEdges()
+void BRepOffset_BuildOffsetFaces::IntersectTrimmedEdges(const Message_ProgressRange& theRange)
{
// get edges to intersect from descendants of the offset faces
TopTools_ListOfShape aLS;
//
+ Message_ProgressScope aPS(theRange, NULL, 2);
TopTools_ListIteratorOfListOfShape aItLF (*myFaces);
for (; aItLF.More(); aItLF.Next())
{
+ if (!aPS.More())
+ {
+ return;
+ }
const TopoDS_Face& aF = *(TopoDS_Face*)&aItLF.Value();
//
const TopTools_ListOfShape& aLE = myAsDes->Descendant (aF);
// perform intersection of the edges
BOPAlgo_Builder aGFE;
aGFE.SetArguments (aLS);
- aGFE.Perform();
+ aGFE.Perform(aPS.Next());
if (aGFE.HasErrors())
{
return;
//
TopTools_ListOfShape aLA;
// fill map with edges images
- for (TopTools_ListOfShape::Iterator aIt (aLS); aIt.More(); aIt.Next())
+ Message_ProgressScope aPSLoop(aPS.Next(), NULL, aLS.Size());
+ for (TopTools_ListOfShape::Iterator aIt (aLS); aIt.More(); aIt.Next(), aPSLoop.Next())
{
+ if (!aPSLoop.More())
+ {
+ return;
+ }
const TopoDS_Shape& aE = aIt.Value();
const TopTools_ListOfShape& aLEIm = aGFE.Modified (aE);
if (aLEIm.IsEmpty())
//=======================================================================
void BRepOffset_MakeOffset::BuildSplitsOfTrimmedFaces (const TopTools_ListOfShape& theLF,
const Handle (BRepAlgo_AsDes)& theAsDes,
- BRepAlgo_Image& theImage)
+ BRepAlgo_Image& theImage,
+ const Message_ProgressRange& theRange)
{
BRepOffset_BuildOffsetFaces aBFTool (theImage);
aBFTool.SetFaces (theLF);
aBFTool.SetAsDesInfo (theAsDes);
- aBFTool.BuildSplitsOfTrimmedFaces();
+ aBFTool.BuildSplitsOfTrimmedFaces(theRange);
}
//=======================================================================
TopTools_DataMapOfShapeListOfShape& theEdgesOrigins,
TopTools_DataMapOfShapeShape& theFacesOrigins,
TopTools_DataMapOfShapeShape& theETrimEInf,
- BRepAlgo_Image& theImage)
+ BRepAlgo_Image& theImage,
+ const Message_ProgressRange& theRange)
{
BRepOffset_BuildOffsetFaces aBFTool (theImage);
aBFTool.SetFaces (theLF);
aBFTool.SetEdgesOrigins (theEdgesOrigins);
aBFTool.SetFacesOrigins (theFacesOrigins);
aBFTool.SetInfEdges (theETrimEInf);
- aBFTool.BuildSplitsOfExtendedFaces();
+ aBFTool.BuildSplitsOfExtendedFaces(theRange);
}