mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0029597: Data Exchange - unable to read VRML2 file
VrmlData_Scene::createNode() now handles Collision item. VrmlData_ArrayVec3d::ReadArray() now handles a case with omitted brackets. Added test bugs xde bug29597
This commit is contained in:
@@ -631,7 +631,16 @@ VrmlData_ErrorStatus VrmlData_ArrayVec3d::ReadArray
|
||||
// Read the body of the data node (list of triplets)
|
||||
if (OK(aStatus) && OK(aStatus, VrmlData_Scene::ReadLine(theBuffer))) {
|
||||
if (theBuffer.LinePtr[0] != '[') // opening bracket
|
||||
aStatus = VrmlData_VrmlFormatError;
|
||||
{
|
||||
// Handle case when brackets are ommited for single element of array
|
||||
gp_XYZ anXYZ;
|
||||
// Read three numbers (XYZ value)
|
||||
if (!OK(aStatus, Scene().ReadXYZ(theBuffer, anXYZ,
|
||||
isScale, Standard_False)))
|
||||
aStatus = VrmlData_VrmlFormatError;
|
||||
else
|
||||
vecValues.Append(anXYZ);
|
||||
}
|
||||
else {
|
||||
theBuffer.LinePtr++;
|
||||
for(;;) {
|
||||
|
@@ -203,6 +203,10 @@ VrmlData_ErrorStatus VrmlData_Group::Read (VrmlData_InBuffer& theBuffer)
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (VRMLDATA_LCOMPARE(theBuffer.LinePtr, "collide")) {
|
||||
TCollection_AsciiString aDummy;
|
||||
aStatus = Scene().ReadWord (theBuffer, aDummy);
|
||||
}
|
||||
else if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "Separator") ||
|
||||
VRMLDATA_LCOMPARE (theBuffer.LinePtr, "Switch")) {
|
||||
Standard_Boolean isBracketed (Standard_False);
|
||||
|
@@ -497,6 +497,9 @@ VrmlData_ErrorStatus VrmlData_Scene::createNode
|
||||
else if (VRMLDATA_LCOMPARE(theBuffer.LinePtr, "Separator"))
|
||||
aNode = new VrmlData_Group (* this, strName,
|
||||
Standard_False);
|
||||
else if (VRMLDATA_LCOMPARE(theBuffer.LinePtr, "Collision"))
|
||||
aNode = new VrmlData_Group (* this, strName,
|
||||
Standard_False);
|
||||
else if (VRMLDATA_LCOMPARE(theBuffer.LinePtr, "Switch"))
|
||||
aNode = new VrmlData_Group (* this, strName,
|
||||
Standard_False);
|
||||
|
Reference in New Issue
Block a user