From 4366363b04f24cae703353e72b049d7b2ade0ead Mon Sep 17 00:00:00 2001 From: akz Date: Thu, 29 Jan 2015 14:23:35 +0300 Subject: [PATCH] 0023328: Importing VRML files with "scaleOrientation" not possible If-else blocks "scale" and "scaleOrientation" was swapped. Now the comparing and interpretation of these key-words is correct. Added test case bugs/xde/bug23328 --- src/VrmlData/VrmlData_Group.cxx | 18 +++++++++--------- tests/bugs/xde/bug23328 | 17 +++++++++++++++++ 2 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 tests/bugs/xde/bug23328 diff --git a/src/VrmlData/VrmlData_Group.cxx b/src/VrmlData/VrmlData_Group.cxx index ca3990e931..86be019220 100644 --- a/src/VrmlData/VrmlData_Group.cxx +++ b/src/VrmlData/VrmlData_Group.cxx @@ -276,15 +276,7 @@ VrmlData_ErrorStatus VrmlData_Group::Read (VrmlData_InBuffer& theBuffer) aStatus = VrmlData_VrmlFormatError; break; } - else if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "scale")) { - if (myIsTransform) - aStatus = Scene().ReadXYZ (theBuffer, aScale, - Standard_False, Standard_True); - else { - aStatus = VrmlData_VrmlFormatError; - break; - } - } else if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "scaleOrientation")) + else if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "scaleOrientation")) if (myIsTransform) { if (OK(aStatus, Scene().ReadXYZ (theBuffer, aScaleAxis, Standard_False, Standard_False))) @@ -294,6 +286,14 @@ VrmlData_ErrorStatus VrmlData_Group::Read (VrmlData_InBuffer& theBuffer) aStatus = VrmlData_VrmlFormatError; break; } + else if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "scale")) + if (myIsTransform) + aStatus = Scene().ReadXYZ (theBuffer, aScale, + Standard_False, Standard_True); + else { + aStatus = VrmlData_VrmlFormatError; + break; + } else if (VRMLDATA_LCOMPARE (theBuffer.LinePtr, "translation")) if (myIsTransform) aStatus = Scene().ReadXYZ (theBuffer, aTrans, diff --git a/tests/bugs/xde/bug23328 b/tests/bugs/xde/bug23328 new file mode 100644 index 0000000000..3d597071aa --- /dev/null +++ b/tests/bugs/xde/bug23328 @@ -0,0 +1,17 @@ +puts "==========" +puts "OCC23328" +puts "==========" +puts "" +####################################################################################### +# Importing VRML files with "scaleOrientation" not possible +####################################################################################### + +set aFile [locate_data_file bug23328_occ23328.vrml] +set aLog [loadvrml test ${aFile}] +set aLength [string length ${aLog}] + +if { ${aLength} == 0 } { + puts "OK: Importing VRML files with scaleOrientation is possible" +} else { + puts "Error: Importing VRML files with scaleOrientation is not possible" +} -- 2.20.1