DiscussionsIssue archiveOCCT:Data Exchange

Archived issue #0023328

Importing VRML files with "scaleOrientation" not possible

CommunityOCCT:Data Exchangeclosed7 public notes

Search issues

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.

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)"

Public activity

7 archived notes

Participants are labeled by their role within this record.

01Commenter 2
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.
02Commenter 2
Branch CR23328 is ready to be reviewed
03Commenter 3
Branch CR23328 is ready to be tested
04Commenter 2
Branch [archived branch] has been updated forcibly by Commenter 3.

[revision removed]
05Commenter 2
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

06Commenter 3
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.
07Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records