DiscussionsIssue archiveOCCT:Data Exchange

Archived issue #0029873

Data Exchange - STEPCAFControl_Reader::Transfer() returns TRUE even when external files are missing

Open CASCADEOCCT:Data Exchangeclosed21 public notes

Search issues

Description

There are several issues with STEP files having external references:
- STEPCAFControl_Reader::Transfer() does NOT report failure if external files have not been found (see test case).
- testreadstep command reads STEP file without external references.
- If DOCUMENT_FILE refers to a subfolder, it is ignored and external files are not found. See "s1_pe_214.stp" referring to subfolder "s1_pe_214".

#0000310=DOCUMENT_TYPE('');
#311=DOCUMENT_FILE('s1_pe_214/foot_asm.stp','S1_PE_TOP - FOOT','',#0000310,'','');
#0000312=DOCUMENT_REPRESENTATION_TYPE('digital',#311);
#313=PROPERTY_DEFINITION('external definition','',#311);
#0000314=PROPERTY_DEFINITION_REPRESENTATION(#313,#0000242);
#315=DESCRIPTIVE_REPRESENTATION_ITEM('data format','STEP AP214');
#316=REPRESENTATION_CONTEXT('','document parameters');
#0000317=REPRESENTATION('document format',(#315),#316);
#0000318=PROPERTY_DEFINITION('document property','',#311);
#319=PROPERTY_DEFINITION_REPRESENTATION(#0000318,#0000317);
#320=EXTERNAL_SOURCE(IDENTIFIER('foot_asm.stp'));
#321=IDENTIFICATION_ROLE('document source','source system');
#322=APPLIED_EXTERNAL_IDENTIFICATION_ASSIGNMENT('foot_asm.stp',#321,#320,
(#311));
#323=APPLIED_DOCUMENT_REFERENCE(#311,'',(#0000247));
#0000324=OBJECT_ROLE('mandatory','');

Steps to reproduce

pload XDE VISUALIZATION
ReadStep D1 [locate_data_file trj4_xr1-db-214.stp]
XGetOneShape s1 D1
nbshapes s1
# OK - external files have been found and Shape is not empty

file copy -force [locate_data_file trj4_xr1-db-214.stp] test_copy.stp
ReadStep D2 test_copy.stp
XGetOneShape s2 D2
nbshapes s2
# KO - external files have NOT been found, the Shape is empty
# but ReadStep has not been reported any error!!!

Public activity

21 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: skl
Date: Tue Jul 10 14:45:11 2018 +0300

    0029873: Data Exchange - STEPCAFControl_Reader::Transfer() returns TRUE even when external files are missing
02Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
03Commenter 3
04Commenter 4
Branch CR29873 was reviewed
05Author
+  FILE* aFile = OSD_OpenFile(fullname, "r");

Opened file handles in several places are never closed.
Is it designed behavior?
06Author
Note that to check file existence only, it is usually done like this (without opening a file):
> OSD_File(aPath).Exists()
07Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
08Commenter 8
09Author
In addition, git commit does not describe important modifications in the code.
10Commenter 10
Please correct this fix in according to given remarks.
11Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: skl
Date: Thu Jul 12 11:35:43 2018 +0300

    0029873: Data Exchange - STEPCAFControl_Reader::Transfer() returns TRUE even when external files are missing
    
    Output information about failure during reading of external file is added (can be checked by using Draw command "tpstat" ).
    If reader can not find external file at the first found location it checks another information about file path and uses new location for import external file.

12Commenter 12
Please precise in the commit message in what entity new location was searched
13Commenter 2
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
14Commenter 14
Commit message is updated.
15Commenter 15
Branch CR29873 was reviewed
16Commenter 1
Combination -
OCCT branch : [archived branch] SHA - [revision removed]
Products branch : [archived branch] SHA - [revision removed]
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

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 17214.810000000103 / 17169.739999999776 [+0.26%]
Products
Total CPU difference: 7475.710000000031 / 7501.920000000043 [-0.35%]
Windows-64-VC10:
OCCT
Total CPU difference: 16982.487261398637 / 16852.39802749857 [+0.77%]
Products
Total CPU difference: 8240.206821499867 / 8212.11104139987 [+0.34%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
17Commenter 1
Branch was formed incorrectly

List of commits:
* 0029873: Data Exchange - STEPCAFControl_Reader::Transfer() returns TRUE even when external files are missing
* 0025852: Text to BRep algorithm produces bad faces for circled symbols
* 0029873: Data Exchange - STEPCAFControl_Reader::Transfer() returns TRUE even when external files are missing


18Commenter 2
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: skl
Date: Tue Jul 10 14:45:11 2018 +0300

    0029873: Data Exchange - STEPCAFControl_Reader::Transfer() returns TRUE even when external files are missing
    
    Output information about failure during reading of external file is added (can be checked by using Draw command "tpstat").
    If reader can not find external file at the first found location
    (using entity APPLIED_EXTERNAL_IDENTIFICATION_ASSIGNMENT) it checks another information about file path
    (using entity DOCUMENT_FILE related with early mentioned entity) and uses new location for import external file.
19Author
Please take branch CR29873_1.
20Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
21Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]