1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-03 17:56:21 +03:00

0030066: Data Exchange - Fail to load VRML from ArcGIS

Fixed VrmlData_Scene::readHeader method
This commit is contained in:
ichesnok 2023-03-27 09:37:44 +01:00 committed by vglukhik
parent 3cf0f6c033
commit c4f56862ab
2 changed files with 22 additions and 5 deletions

View File

@ -314,12 +314,23 @@ VrmlData_ErrorStatus VrmlData_Scene::ReadLine (VrmlData_InBuffer& theBuffer)
VrmlData_ErrorStatus VrmlData_Scene::readHeader (VrmlData_InBuffer& theBuffer)
{
VrmlData_ErrorStatus aStat = readLine (theBuffer);
if (aStat == VrmlData_StatusOK &&
!VRMLDATA_LCOMPARE(theBuffer.LinePtr, "#VRML V2.0"))
aStat = VrmlData_NotVrmlFile;
else
VrmlData_ErrorStatus aStat = readLine(theBuffer);
if (aStat != VrmlData_StatusOK)
{
return VrmlData_NotVrmlFile;
}
TCollection_AsciiString aHeader(theBuffer.LinePtr);
// The max possible header size is 25 (with spaces)
// 4 (max BOM size) + 11 (search string) + 9 (max size for encoding)
if (aHeader.Length() <= 25 &&
aHeader.Search("#VRML V2.0") != -1)
{
aStat = readLine(theBuffer);
}
else
{
aStat = VrmlData_NotVrmlFile;
}
return aStat;
}

View File

@ -0,0 +1,6 @@
puts "========"
puts "0030066: Data Exchange - Fail to load VRML from ArcGIS"
puts "========"
puts ""
loadvrml sh [locate_data_file bug30066.wrl]