MantisBT - Open CASCADE
View Issue Details
0026925Open CASCADE[OCCT] OCCT:Data Exchangepublic2015-11-25 11:042020-05-16 14:21
gka 
dpasukhi 
normalmajor 
verifiedfixed 
[OCCT] 6.9.1 
[OCCT] 7.5.0* 
bugs/step/bug26925
0026925: Data Exchange - Exception can be raised if assembly is empty
Exception can be raised if assembly is empty. See comment to issue 0026314:
This fix broke the following logic that used to work in pre-7.0.

"In pre-7.0 one could create a structure of labels using plain OCAF/XDE API:
-assembly
 -instance
  -part (with shape)
and call ShapeTool::UpdateAssembly (asm_label). The latter would create a valid shape to be attached to asm_label.

Current implementation throws an exception:
  TopoDS_Shape aShape = GetShape(L); //<-- returns null
  Standard_Boolean isFree = aShape.Free(); //exception is thrown

The implementation assumes that the asm_label always contains some non-null shape."
Bugs is not reproduced in current OCCT version
No tags attached.
child of 0026314closed gka Method XCAFDoc_ShapeTool::SetShape() works not correctly. 
? 26925.tcl (208) 2019-09-12 17:13
https://tracker.dev.opencascade.org/
Issue History
2015-11-25 11:04gkaNew Issue
2015-11-25 11:04gkaAssigned To => gka
2015-11-25 11:05gkaRelationship addedchild of 0026314
2016-02-17 10:56abvTarget Version7.0.0 => 7.1.0
2016-10-26 11:39gkaTarget Version7.1.0 => 7.2.0
2017-07-27 09:24abvTarget Version7.2.0 => 7.4.0
2019-09-04 17:41kgvSummaryException can be raised if assembly is empty => Data Exchange - Exception can be raised if assembly is empty
2019-09-12 12:43gkaStatusnew => assigned
2019-09-12 17:12gkaNote Added: 0087026
2019-09-12 17:13gkaFile Added: 26925.tcl
2019-09-12 17:13gkaNote Edited: 0087026bug_revision_view_page.php?bugnote_id=87026#r21811
2019-09-12 17:14gkaAssigned Togka => abv
2019-09-12 17:14gkaStatusassigned => resolved
2019-09-12 17:14gkaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=21813#r21813
2019-09-14 08:25abvNote Added: 0087080
2019-09-14 08:25abvAssigned Toabv => gka
2019-09-14 08:25abvStatusresolved => assigned
2019-09-14 08:25abvTarget Version7.4.0 => 7.5.0*
2020-04-15 21:27gkaAssigned Togka => dpasukhi
2020-05-12 19:50gitNote Added: 0092080
2020-05-12 19:53dpasukhiStatusassigned => resolved
2020-05-13 13:45ikaNote Added: 0092086
2020-05-13 13:46ikaNote Added: 0092087
2020-05-13 13:46ikaAssigned Todpasukhi => bugmaster
2020-05-13 13:46ikaStatusresolved => reviewed
2020-05-15 11:06bugmasterNote Added: 0092129
2020-05-15 11:06bugmasterStatusreviewed => tested
2020-05-15 11:07bugmasterTest case number => bugs/step/bug26925
2020-05-16 14:07dpasukhiChangeset attached => occt master 72e6020d
2020-05-16 14:07dpasukhiAssigned Tobugmaster => dpasukhi
2020-05-16 14:07dpasukhiStatustested => verified
2020-05-16 14:07dpasukhiResolutionopen => fixed
2020-05-16 14:21gitNote Added: 0092184

Notes
(0087026)
gka   
2019-09-12 17:12   
(edited on: 2019-09-12 17:13)
In the current development version this scenario works correctly.
Method XCAFDoc_ShapeTool::UpdateAssembly to increase performance was replaced on the method XCAFDoc_ShapeTool::UpdateAssemblies which updated whole document.
At current OCCT version described scenario can be reproduced in Test Harness with following sequence of commands shown in log hereafter (see attached script 26925.tcl)


Draw[3]> XNewDoc D1
Draw[4]> XNewShape D1
0:1:1:1
Draw[7]> DFB D1
browser_D1
Draw[8]> box a 0 0 0 10 10 10
Draw[9]> XAddShape D1 a 0
0:1:1:2
Draw[10]> ttranslate a 10 0 0
Draw[11]> XAddComponent D1 0:1:1:1 a
0:1:1:1
Draw[11]> XGetShape s0 D1 0:1:1:1
Draw[12]> dump s0


*********** Dump of s0 *************
Shape : 1, FORWARD

Dump of 1 TShapes

-----------------

Flags : Free, Modified, Checked, Orientable, Closed, Infinite, Convex, Locked

TShape # 1 : COMPOUND 11000000 000001D69C4A9550



 -------
Dump of 0 Curve2ds
 -------


 -------
Dump of 0 Curves
 -------

 -------
Dump of 0 Polygon3Ds
 -------
 -------
Dump of 0 PolygonOnTriangulations
 -------

 -------
Dump of 0 surfaces
 -------

 -------
Dump of 0 Triangulations
 -------



 -------
 Dump of 0 Locations
 -------



Draw[20]>Draw[21]> he XUpd*
XUpdateAssemblies : Doc : updates assembly compounds
Draw[21]> XUpdateAssemblies D1
Draw[22]> XGetShape s1 D1 0:1:1:1
Draw[23]> nbs s1
Number of shapes in s1
 VERTEX : 8
 EDGE : 12
 WIRE : 6
 FACE : 6
 SHELL : 1
 SOLID : 1
 COMPSOLID : 0
 COMPOUND : 1
 SHAPE : 35

(0087080)
abv   
2019-09-14 08:25   
Proposed DRAW commands do not allow reproducing the situation described in the issue since command XNewShape creates empty compound, i.e. the shape on the assembly root label always exists. By looking in the code I suspect that if the assembly label has no shape attached, it will not be updated with UpdateAssemblies() (i.e. no exception but also no action). To be checked
(0092080)
git   
2020-05-12 19:50   
Branch CR26925 has been created by dpasukhi.

SHA-1: 72e6020d50e6d78474fbd4dfb420db28ff92caa0


Detailed log of new commits:

Author: dpasukhi
Date: Tue May 12 19:51:12 2020 +0300

    0026925: Data Exchange - Exception can be raised if assembly is empty
    
    - Issue is done in previous version OCCT
    - Add test to verify the creating of the label structure using plain OCAF/XDE API
    - Situation when the assembly label has no shape attached is correct
(0092086)
ika   
2020-05-13 13:45   
Only one test case was added, it passed successfully:
http://occt-tests/CR26925-master-dpasukhi-OCCT/Windows-64-VC14/bugs/step/bug26925.html [^]
http://occt-tests/CR26925-master-dpasukhi-OCCT/Debian80-64/bugs/step/bug26925.html [^]

No remarks.
(0092087)
ika   
2020-05-13 13:46   
Dear bugmaster,

please integrate:
OCCT - CR26925
PRODUCTS - NOT
(0092129)
bugmaster   
2020-05-15 11:06   
Combination -
OCCT branch : WEEK-20
master SHA - d9eb6aca8789e6b8ff6742e3ad60a4dadf0cd37e
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : WEEK-20 SHA - eb85b0feb479f67f3a505bcb285922a288149f74
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:
Debian80-64:
OCCT
Total CPU difference: 17146.6200000001 / 17177.020000000186 [-0.18%]
Products
Total CPU difference: 11178.21000000009 / 11272.470000000078 [-0.84%]
Windows-64-VC14:
OCCT
Total CPU difference: 18609.671875 / 18646.015625 [-0.19%]
Products
Total CPU difference: 13007.71875 / 13180.21875 [-1.31%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0092184)
git   
2020-05-16 14:21   
Branch CR26925 has been deleted by inv.

SHA-1: 72e6020d50e6d78474fbd4dfb420db28ff92caa0