Part: Allow to disable progress bar in brep string reader

This commit is contained in:
Yorik van Havre
2018-07-19 11:57:07 -03:00
parent cc0fb2a5a9
commit c93ff200ca
4 changed files with 16 additions and 10 deletions

View File

@@ -597,18 +597,21 @@ void TopoShape::importBrep(const char *FileName)
}
}
void TopoShape::importBrep(std::istream& str)
void TopoShape::importBrep(std::istream& str, int indicator)
{
try {
// read brep-file
BRep_Builder aBuilder;
TopoDS_Shape aShape;
#if OCC_VERSION_HEX >= 0x060300
Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100);
pi->NewScope(100, "Reading BREP file...");
pi->Show();
BRepTools::Read(aShape,str,aBuilder,pi);
pi->EndScope();
if (indicator) {
Handle(Message_ProgressIndicator) pi = new ProgressIndicator(100);
pi->NewScope(100, "Reading BREP file...");
pi->Show();
BRepTools::Read(aShape,str,aBuilder,pi);
pi->EndScope();
} else
BRepTools::Read(aShape,str,aBuilder);
#else
BRepTools::Read(aShape,str,aBuilder);
#endif