0000572: add a method to Part module to read BRep data from string
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5410 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
@@ -609,6 +609,32 @@ void TopoShape::importBrep(const char *FileName)
|
||||
}
|
||||
}
|
||||
|
||||
void TopoShape::importBrep(std::istream& str)
|
||||
{
|
||||
try {
|
||||
// read brep-file
|
||||
BRep_Builder aBuilder;
|
||||
TopoDS_Shape aShape;
|
||||
#if OCC_HEX_VERSION >= 0x060300
|
||||
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);
|
||||
#endif
|
||||
this->_Shape = aShape;
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle(Standard_Failure) aFail = Standard_Failure::Caught();
|
||||
throw Base::Exception(aFail->GetMessageString());
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
throw Base::Exception(e.what());
|
||||
}
|
||||
}
|
||||
|
||||
void TopoShape::write(const char *FileName) const
|
||||
{
|
||||
Base::FileInfo File(FileName);
|
||||
|
||||
Reference in New Issue
Block a user