Archived issue #0023328
Importing VRML files with "scaleOrientation" not possible
Description
Its not possible to import VRML files withe the VRMLData_Scene::<< operator which contains a "scaleOrientation" property in a (i.e.) "Transform" node.
The problem is in VRMLData_Group.cxx file:
VrmlData_ErrorStatus VrmlData_Group::Read (VrmlData_InBuffer& theBuffer)
VRMLDATA_LCOMPARE (theBuffer.LinePtr, "scaleOrientation") compares the two arguments with a count of the length of "scaleOrientation" (see strcmp()). But before this is done VRMLDATA_LCOMPARE (theBuffer.LinePtr, "scale") is called! And it will be compared "scaleOrientation" and "scale" but only the first five characters. So "scaleOrientation" will handled as an "scale" -> VRMLData_NumericInputError.
Solution: Swap the "scale" and "scaleOrientation" else if - block. Now "scaleOrientation" will be compared at first. Was testet.
The problem is in VRMLData_Group.cxx file:
VrmlData_ErrorStatus VrmlData_Group::Read (VrmlData_InBuffer& theBuffer)
VRMLDATA_LCOMPARE (theBuffer.LinePtr, "scaleOrientation") compares the two arguments with a count of the length of "scaleOrientation" (see strcmp()). But before this is done VRMLDATA_LCOMPARE (theBuffer.LinePtr, "scale") is called! And it will be compared "scaleOrientation" and "scale" but only the first five characters. So "scaleOrientation" will handled as an "scale" -> VRMLData_NumericInputError.
Solution: Swap the "scale" and "scaleOrientation" else if - block. Now "scaleOrientation" will be compared at first. Was testet.
Steps to reproduce
Write a simple file with "scaleOrientation" and import it with the VRMLData_Scene::<< operator. A VRMLData_NumericInputError will be returned. I tested it with a large complexe file and that simple file:
#VRML V2.0 utf8
DEF SCS_TRANS_2716156_traeger_prt Transform {
translation 0.000000 0.790000 0.030500
rotation 4.32964e-017 0.707107 0.707107 3.142
scaleOrientation 1 6.61192e-005 0.000159626 -0.785398
}
---------------------------------------------------------------------
Test script "bug23328" was added with data file "Attachment 2 (VRML)"
#VRML V2.0 utf8
DEF SCS_TRANS_2716156_traeger_prt Transform {
translation 0.000000 0.790000 0.030500
rotation 4.32964e-017 0.707107 0.707107 3.142
scaleOrientation 1 6.61192e-005 0.000159626 -0.785398
}
---------------------------------------------------------------------
Test script "bug23328" was added with data file "Attachment 2 (VRML)"
Public activity
7 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Participant.
[revision removed]
Detailed log of new commits:
Author: akz
Date: Fri Jan 23 13:28:13 2015 +0300
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.
[revision removed]
Detailed log of new commits:
Author: akz
Date: Fri Jan 23 13:28:13 2015 +0300
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.
Branch CR23328 is ready to be reviewed
Branch CR23328 is ready to be tested
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been updated by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Thu Jan 29 12:49:56 2015 +0300
Added test case bugs/xde/bug23328
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Thu Jan 29 12:49:56 2015 +0300
Added test case bugs/xde/bug23328
Dear Commenter 1,
Branch CR23328 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested in Release mode.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 18 (18 on master)
Windows: 0 (0 on master)
products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)
Regressions/Differences:
No regressions
Testing cases:
bugs xde bug23328 - OK
http://occt-tests/CR23328-master-occt/Debian60-64/bugs/xde/bug23328.html
http://occt-tests/CR23328-master-occt/Windows-32-VC10/bugs/xde/bug23328.html
Testing on Linux:
Total MEMORY difference: 369560932 / 370114884
Total CPU difference: 54432.75999999984 / 51750.710000000094
Testing on Windows:
Total MEMORY difference: 275915592 / 275761696
Total CPU difference: 35950.953125 / 38148.203125
There are not differences in images found by testdiff.
Branch CR23328 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested in Release mode.
[revision removed]
Number of compiler warnings:
occt component :
Linux: 18 (18 on master)
Windows: 0 (0 on master)
products component :
Linux: 11 (11 on master)
Windows: 1 (1 on master)
Regressions/Differences:
No regressions
Testing cases:
bugs xde bug23328 - OK
http://occt-tests/CR23328-master-occt/Debian60-64/bugs/xde/bug23328.html
http://occt-tests/CR23328-master-occt/Windows-32-VC10/bugs/xde/bug23328.html
Testing on Linux:
Total MEMORY difference: 369560932 / 370114884
Total CPU difference: 54432.75999999984 / 51750.710000000094
Testing on Windows:
Total MEMORY difference: 275915592 / 275761696
Total CPU difference: 35950.953125 / 38148.203125
There are not differences in images found by testdiff.
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Related records