// commercial license or contractual agreement.
-#include <Message_ProgressIndicator.hxx>
+#include <Message_ProgressScope.hxx>
#include <StdFail_NotDone.hxx>
#include <StepShape_ClosedShell.hxx>
#include <StepShape_ConnectedFaceSet.hxx>
// Purpose :
// ============================================================================
TopoDSToStep_Builder::TopoDSToStep_Builder()
+: myError(TopoDSToStep_BuilderOther)
{
done = Standard_False;
}
TopoDSToStep_Builder::TopoDSToStep_Builder
(const TopoDS_Shape& aShape,
- TopoDSToStep_Tool& aTool, const Handle(Transfer_FinderProcess)& FP)
+ TopoDSToStep_Tool& aTool,
+ const Handle(Transfer_FinderProcess)& FP,
+ const Message_ProgressRange& theProgress)
{
done = Standard_False;
- Init(aShape, aTool, FP);
+ Init(aShape, aTool, FP, theProgress);
}
// ============================================================================
void TopoDSToStep_Builder::Init(const TopoDS_Shape& aShape,
TopoDSToStep_Tool& myTool,
- const Handle(Transfer_FinderProcess)& FP)
+ const Handle(Transfer_FinderProcess)& FP,
+ const Message_ProgressRange& theProgress)
{
if (myTool.IsBound(aShape)) {
return;
}
- Handle(Message_ProgressIndicator) progress = FP->GetProgress();
-
switch (aShape.ShapeType())
{
case TopAbs_SHELL:
- TopExp_Explorer myExp(myShell, TopAbs_FACE);
+ TopExp_Explorer anExp;
TopoDSToStep_MakeStepFace MkFace;
- for (;myExp.More();myExp.Next()) {
-
- const TopoDS_Face Face = TopoDS::Face(myExp.Current());
+ Standard_Integer nbshapes = 0;
+ for (anExp.Init(myShell, TopAbs_FACE); anExp.More(); anExp.Next())
+ nbshapes++;
+ Message_ProgressScope aPS(theProgress, NULL, nbshapes);
+ for (anExp.Init(myShell, TopAbs_FACE); anExp.More() && aPS.More(); anExp.Next(), aPS.Next())
+ {
+ const TopoDS_Face Face = TopoDS::Face(anExp.Current());
- MkFace.Init(Face, myTool, FP);
+ MkFace.Init(Face, myTool, FP);
if (MkFace.IsDone()) {
FS = Handle(StepShape_FaceSurface)::DownCast(MkFace.Value());
}
else {
// MakeFace Error Handling : warning only
-// cout << "Warning : one Face has not been mapped" << endl;
+// std::cout << "Warning : one Face has not been mapped" << std::endl;
// Handle(TransferBRep_ShapeMapper) errShape =
// new TransferBRep_ShapeMapper(Face);
// FP->AddWarning(errShape, " a Face from a Shell has not been mapped");
}
- if (!progress.IsNull()) progress->Increment();
}
+ if (!aPS.More())
+ return;
Standard_Integer nbFaces = mySeq.Length();
if ( nbFaces >= 1) {
// FP->AddWarning(errShape, " the Face has not been mapped");
done = Standard_False;
}
- if (!progress.IsNull()) progress->Increment();
break;
}
default: break;