View Issue Details

IDProjectCategoryView StatusLast Update
0029402CommunityOCCT:Application Frameworkpublic2018-06-29 21:19
ReporterszyAssigned Toapn  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version7.3.0 
Target Version7.3.0Fixed in Version7.3.0 
Summary0029402: In OCCT7.2.1-dev the names written into a FSD_File are associated with the wrong shapes.
DescriptionCustomer complaint:

"I am still experiencing problem with fsd files written by the following code:
   Handle(StdStorage_Data) data = new StdStorage_Data();
   .....adding a few roots to data ...
  NCollection_Handle<Storage_BaseDriver> fileDriver(new FSD_File());
  fileDriver->Open(TCollection_ExtendedString(fileName), Storage_VSWrite);
  StdStorage::Write(*fileDriver, data);
The file is written but names associated with different roots are not well preserved in a following StdStorage::Read.
To be more precise the names are associated with wrong shapes in the sense that they are permuted.
I have observed that the proper name association can be reestablished applying a small change to the function "Standard_Boolean StdStorage_RootData::Write(Storage_BaseDriver& theDriver)" which is defined in "src/StdStorage/StdStorage_RootData.cxx".
The changed lines are the following:
  theDriver.SetRootSectionSize(NumberOfRoots());
  int I=0; //HERE A COUNTER IS ADDED
  for (StdStorage_MapOfRoots::Iterator anIt(myObjects); anIt.More(); anIt.Next())
  {
    const Handle(StdStorage_Root)& aRoot = anIt.Value();
    try
    {
      OCC_CATCH_SIGNALS
// theDriver.WriteRoot(aRoot->Name(), aRoot->Reference(), aRoot->Type());
      I++;
      theDriver.WriteRoot(aRoot->Name(), I, aRoot->Type()); // HERE THE COUNTER IS USED IN PLACE OF aRoot->Reference()
    }
    catch (Storage_StreamTypeMismatchError)
    {
      myErrorStatus = Storage_VSTypeMismatch;
      myErrorStatusExt = "ReadRoot";
      return Standard_False;
    }
  }
With this change the arguments passed to the function "theDriver.WriteRoot(const TCollection_AsciiString& rootName, const Standard_Integer aRef, const TCollection_AsciiString& rootType)" are the same as it happens inside of the function
"void Storage_Schema::Write(Storage_BaseDriver& f, const Handle(Storage_Data)& aData) const"
which is defined in "src/Storage/Storage_Schema.cxx"
"

The problem is reproduced using Draw commands 'fsdwrite' & modified 'fsdread' .
Steps To ReproduceThe issue can be reproduced (tested) using new test case tests\persist\fsd\B2 and the modified Draw command "fsdread".
TagsNo tags attached.
Test case numberpersist fsd B2

Activities

git

2017-12-27 17:29

administrator   ~0073175

Branch CR29402 has been created by szy.

SHA-1: 68100ac965bb785a0e0ca6b2cddead9a2b60b821


Detailed log of new commits:

Author: szy
Date: Wed Dec 27 17:28:54 2017 +0300

    0029402: In OCCT7.2.1-dev the names written into a FSD_File are associated with the wrong shapes.
    
    //the issue is fixed using another solution (changing DataMap to IndexedDataMap).

szy

2017-12-28 09:52

manager   ~0073176

The issue is fixed by replacing DataMap to IndexedDataMap and tested:
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29402-master-szy-OCCT-Windows-64-VC10-opt-tests-compare-windows/1/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29402-master-szy-OCCT-Debian70-64-opt-tests-compare-linux/1/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29402-master-szy-Products-Windows-64-VC10-opt-tests-compare-windows/1/
- http://jenkins-test-10.nnov.opencascade.com:8080/job/CR29402-master-szy-Products-Debian70-64-opt-tests-compare-linux/1/

mpv

2017-12-28 11:14

developer   ~0073178

Please, correct the usage-text in DDocStd_ShapeSchemaCommands.cxx DDocStd_fsdread method.

git

2017-12-28 11:21

administrator   ~0073179

Branch CR29402 has been updated by szy.

SHA-1: b0c1144165b6e4895f3e462e8edadd9dc9589ab6


Detailed log of new commits:

Author: szy
Date: Thu Dec 28 11:21:04 2017 +0300

    0029402: In OCCT7.2.1-dev the names written into a FSD_File are associated with the wrong shapes.
    
    //Fixed misprint in comments to Draw command fsdread.

szy

2017-12-28 11:22

manager   ~0073180

The misprint fixed.
Review it, please.

git

2017-12-28 11:42

administrator   ~0073181

Branch CR29402_1 has been created by szy.

SHA-1: 5dee3b206404004ac3cd0bf208a569d384225781


Detailed log of new commits:

Author: szy
Date: Wed Dec 27 17:28:54 2017 +0300

    0029402: In OCCT7.2.1-dev the names written into a FSD_File are associated with the wrong shapes.
    
    //Fixed misprint in comments to Draw command fsdread.
    
    0029402: In OCCT7.2.1-dev the names written into a FSD_File are associated with the wrong shapes.
    
    The issue of incorrect Roots indexing is fixed by changing DataMap to IndexedDataMap.
    //Also Draw command fsdread is improved to allow restoring of shapes with kept names.

apn

2017-12-28 12:28

administrator   ~0073182

Combination -
OCCT branch : CR29402 SHA - 68100ac965bb785a0e0ca6b2cddead9a2b60b821
Products branch : master SHA - 8cfd04a34de609800e36c28f29ee8e42919a0098
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

Test case:
persist fsd B2 - OK

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 18443.819999999672 / 18513.219999999714 [-0.37%]
Products
Total CPU difference: 7502.219999999996 / 7509.620000000005 [-0.10%]
Windows-64-VC10:
OCCT
Total CPU difference: 17890.272680498576 / 17919.33566679854 [-0.16%]
Products
Total CPU difference: 8078.090582299989 / 8016.251785899991 [+0.77%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2018-01-11 11:10

administrator   ~0073335

Branch CR29402 has been deleted by kgv.

SHA-1: b0c1144165b6e4895f3e462e8edadd9dc9589ab6

git

2018-01-11 11:10

administrator   ~0073336

Branch CR29402_1 has been deleted by kgv.

SHA-1: 5dee3b206404004ac3cd0bf208a569d384225781

Related Changesets

occt: master 409095ba

2017-12-27 14:28:54

szy


Committer: apn Details Diff
0029402: In OCCT7.2.1-dev the names written into a FSD_File are associated with the wrong shapes.

The issue of incorrect Roots indexing is fixed by changing DataMap to IndexedDataMap.
Draw command fsdread was improved to allow restoring of shapes with kept names.
Affected Issues
0029402
mod - src/DDocStd/DDocStd_ShapeSchemaCommands.cxx Diff File
mod - src/StdStorage/StdStorage_MapOfRoots.hxx Diff File
mod - src/StdStorage/StdStorage_RootData.cxx Diff File
add - tests/persist/fsd/B2 Diff File

Issue History

Date Modified Username Field Change
2017-12-25 18:13 szy New Issue
2017-12-25 18:13 szy Assigned To => szy
2017-12-27 16:58 szy Status new => assigned
2017-12-27 17:29 git Note Added: 0073175
2017-12-27 17:33 szy Steps to Reproduce Updated
2017-12-28 09:52 szy Note Added: 0073176
2017-12-28 09:52 szy Assigned To szy => mpv
2017-12-28 09:52 szy Status assigned => resolved
2017-12-28 11:14 mpv Note Added: 0073178
2017-12-28 11:14 mpv Assigned To mpv => szy
2017-12-28 11:14 mpv Status resolved => assigned
2017-12-28 11:21 git Note Added: 0073179
2017-12-28 11:22 szy Note Added: 0073180
2017-12-28 11:22 szy Assigned To szy => mpv
2017-12-28 11:22 szy Status assigned => resolved
2017-12-28 11:33 mpv Assigned To mpv => bugmaster
2017-12-28 11:33 mpv Status resolved => reviewed
2017-12-28 11:42 git Note Added: 0073181
2017-12-28 12:28 apn Test case number => persist fsd B2
2017-12-28 12:28 apn Note Added: 0073182
2017-12-28 12:28 apn Status reviewed => tested
2017-12-30 18:43 apn Changeset attached => occt master 409095ba
2017-12-30 18:43 apn Assigned To bugmaster => apn
2017-12-30 18:43 apn Status tested => verified
2017-12-30 18:43 apn Resolution open => fixed
2018-01-11 11:10 git Note Added: 0073335
2018-01-11 11:10 git Note Added: 0073336
2018-02-18 23:38 abv Target Version 7.4.0 => 7.3.0
2018-06-29 21:15 aiv Fixed in Version => 7.3.0
2018-06-29 21:19 aiv Status verified => closed