#include <IGESGraph_DefinitionLevel.hxx>
#include <IGESSolid_Face.hxx>
#include <IGESBasic_Name.hxx>
+#include <Message_ProgressScope.hxx>
#include <NCollection_DataMap.hxx>
#include <Standard_Transient.hxx>
#include <TCollection_AsciiString.hxx>
//purpose :
//=======================================================================
-Standard_Boolean IGESCAFControl_Writer::Transfer (const Handle(TDocStd_Document) &doc)
+Standard_Boolean IGESCAFControl_Writer::Transfer (const Handle(TDocStd_Document) &doc,
+ const Message_ProgressRange& theProgress)
{
// translate free top-level shapes of the DECAF document
Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( doc->Main() );
TDF_LabelSequence labels;
STool->GetFreeShapes ( labels );
- return Transfer (labels);
+ return Transfer (labels, theProgress);
}
//=======================================================================
//purpose :
//=======================================================================
-Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_Label& label)
+Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_Label& label,
+ const Message_ProgressRange& theProgress)
{
TDF_LabelSequence labels;
labels.Append( label );
- return Transfer( labels );
+ return Transfer( labels, theProgress );
}
//=======================================================================
//purpose :
//=======================================================================
-Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_LabelSequence& labels)
+Standard_Boolean IGESCAFControl_Writer::Transfer (const TDF_LabelSequence& labels,
+ const Message_ProgressRange& theProgress)
{
if ( labels.Length() <=0 ) return Standard_False;
- for ( Standard_Integer i=1; i <= labels.Length(); i++ ) {
+ Message_ProgressScope aPS(theProgress, "Labels", labels.Length());
+ for ( Standard_Integer i=1; i <= labels.Length() && aPS.More(); i++ )
+ {
TopoDS_Shape shape = XCAFDoc_ShapeTool::GetShape ( labels.Value(i) );
if ( ! shape.IsNull() )
- AddShape ( shape );
+ AddShape (shape, aPS.Next());
// IGESControl_Writer::Transfer ( shape );
}
//=======================================================================
Standard_Boolean IGESCAFControl_Writer::Perform (const Handle(TDocStd_Document) &doc,
- const Standard_CString filename)
+ const Standard_CString filename,
+ const Message_ProgressRange& theProgress)
{
- if ( ! Transfer ( doc ) ) return Standard_False;
+ if ( ! Transfer ( doc, theProgress ) ) return Standard_False;
return Write ( filename ) == IFSelect_RetDone;
}
//=======================================================================
Standard_Boolean IGESCAFControl_Writer::Perform (const Handle(TDocStd_Document) &doc,
- const TCollection_AsciiString &filename)
+ const TCollection_AsciiString &filename,
+ const Message_ProgressRange& theProgress)
{
- if ( ! Transfer ( doc ) ) return Standard_False;
+ if ( ! Transfer ( doc, theProgress ) ) return Standard_False;
return Write ( filename.ToCString() ) == IFSelect_RetDone;
}