mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0028680: Data Exchange - allow reading of multi-domain STL files
Method RWStl::Read() is improved to support reading multi-domain STL files. Test added: bugs stlvrml bug28680
This commit is contained in:
@@ -132,18 +132,31 @@ Standard_Boolean RWStl_Reader::Read (const char* theFile,
|
||||
}
|
||||
|
||||
Standard_IStream aStream (&aBuf);
|
||||
if (IsAscii (aStream))
|
||||
|
||||
// get length of file to feed progress indicator in Ascii mode
|
||||
aStream.seekg (0, aStream.end);
|
||||
std::streampos theEnd = aStream.tellg();
|
||||
aStream.seekg (0, aStream.beg);
|
||||
|
||||
while (!aStream.eof() && !aStream.bad())
|
||||
{
|
||||
// get length of file to feed progress indicator
|
||||
aStream.seekg (0, aStream.end);
|
||||
std::streampos theEnd = aStream.tellg();
|
||||
aStream.seekg (0, aStream.beg);
|
||||
return ReadAscii (aStream, theEnd, theProgress);
|
||||
}
|
||||
else
|
||||
{
|
||||
return ReadBinary (aStream, theProgress);
|
||||
if (IsAscii (aStream))
|
||||
{
|
||||
if (!ReadAscii (aStream, theEnd, theProgress))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!ReadBinary (aStream, theProgress))
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
aStream >> std::ws; // skip any white spaces
|
||||
}
|
||||
return !aStream.bad();
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
Reference in New Issue
Block a user