View Issue Details

IDProjectCategoryView StatusLast Update
0026302Open CASCADEOCCT:Data Exchangepublic2023-08-01 15:09
ReporterinkAssigned Todpasukhi  
PrioritynormalSeverityfeature 
Status assignedResolutionopen 
Target VersionUnscheduled 
Summary0026302: Data Exchange - new functionality XCAFDoc_Editor::Compact() converting the assembly to compound
DescriptionNecessary to create new functionality: converting the assembly to compound.
Steps To Reproduce
pload ALL
box b1 0 0 0 10 10 10 
box b2 10 0 0 10 10 10 
box b3 20 0 0 10 10 10 
explode b1
explode b2
explode b3
explode b1_1
explode b2_1
explode b3_1
compound b1 b2 c1
compound c1 b3 c2
NewDocument D
XAddShape D c2 1
XSetColor D b1 1 0 0 
XSetColor D b2 0 1 0 
XSetColor D b3 0 0 1 
XSetColor D b1_1_4 1 1 0 
XSetColor D b2_1_4 0 1 1 
XSetColor D b3_1_4 1 0 1
XSetColor D b1_1_3 1 0 1 
XSetColor D b2_1_3 1 1 0 
XSetColor D b3_1_3 0 1 1
XCompact D c2
DFB D
TagsNo tags attached.
Test case numberbugs xde bug26302

Attached Files

  • test_unexpand.xbf (13,896 bytes)

Relationships

related to 0028104 closedsmoskvin Data Exchange - Extract sub-assembly (XDE) 
parent of 0026353 newinv Update of test case bugs xde bug25441 after fixes integration 0026302 and 0026216 
Not all the children of this issue are yet resolved or closed.

Activities

git

2015-06-02 14:42

administrator   ~0041840

Branch CR26302 has been created by ink.

SHA-1: b49cbd04c45183f6b4e0ac693879bf6571392497


Detailed log of new commits:

Author: ink
Date: Tue Jun 2 14:42:27 2015 +0300

    0026302: New functionality. Converting the assembly to compound.
    
    Added new functionality for converting the assembly to compaund.
    Added new drw command XCompact.
    Changed DumpShape and DumpAssembly
    Added test.

git

2015-06-02 14:49

administrator   ~0041843

Branch CR26302 has been updated forcibly by ink.

SHA-1: dc6a77ecc3e717767e7aff8dbac67ce8239aa4c3

gka

2015-08-18 18:37

developer   ~0044392

Branch CR26302 is ready to be tested

mkv

2015-08-18 20:20

tester   ~0044399

Dear ink,
could you please rebase branch CR26302 on current master, there are conflict files.

git

2015-08-19 12:14

administrator   ~0044410

Branch CR26302 has been updated forcibly by ink.

SHA-1: f08c61064ec52a3a323bf870c92825f096557c36

gka

2015-08-19 12:35

developer   ~0044412

Branch CR26302 is ready to be tested

git

2015-08-19 12:39

administrator   ~0044414

Branch CR26302 has been updated forcibly by ink.

SHA-1: 2092905e3adca1817741376533ab3458a4e07645

mkv

2015-08-20 12:58

tester   ~0044457

Dear BugMaster,
Branch CR26302 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 2092905e3adca1817741376533ab3458a4e07645

Number of compiler warnings:

occt component :
Linux: 15 (15 on master)
Windows: 0 (0 on master)

products component :
Linux: 39 (39 on master)
Windows: 0 (0 on master)

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR26302-master-occt-64/Debian70-64/bugs/xde/bug26302.html
http://occt-tests/CR26302-master-occt-64/Windows-64-VC10/bugs/xde/bug26302.html
bugs xde bug26302: OK

Testing on Linux:
occt component :
Total MEMORY difference: 90683087 / 90762094 [-0.09%]
Total CPU difference: 17772.12999999894 / 17774.979999998963 [-0.02%]
products component :
Total MEMORY difference: 24832129 / 24839015 [-0.03%]
Total CPU difference: 7363.159999999973 / 6874.220000000016 [+7.11%]

Testing on Windows:
occt component :
Total MEMORY difference: 56846211 / 56855559 [-0.02%]
Total CPU difference: 16403.427149499035 / 16438.246572699303 [-0.21%]
products component :
Total MEMORY difference: 16013614 / 16017814 [-0.03%]
Total CPU difference: 5143.243769299953 / 5265.439352599951 [-2.32%]

There are following differences in images found by testdiff.
http://occt-tests/CR26302-master-occt-64/Debian70-64/diff-Debian70-64.html
http://occt-tests/CR26302-master-occt-64/Windows-64-VC10/diff-Windows-64-VC10.html
IMAGE bugs xde bug26314: bug26314_Driver1_Document_d_View1.png differs
IMAGE bugs xde bug25441: bug25441_Driver1_Document_d_View1.png differs

git

2015-09-08 15:36

administrator   ~0045235

Branch CR26302 has been updated forcibly by ink.

SHA-1: 80002b9038c01d13d10745896ad2c95703df42aa

ink

2015-09-08 15:41

developer   ~0045237

Please retest this branch.

mkv

2015-09-09 18:43

tester   ~0045349

Dear BugMaster,
Branch CR26302 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: 80002b9038c01d13d10745896ad2c95703df42aa

Number of compiler warnings:

occt component :
Linux: 15 (15 on master)
Windows: 0 (0 on master)

products component :
Linux: 39 (39 on master)
Windows: 0 (0 on master)

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR26302-master-occt-64/Debian70-64/bugs/xde/bug26302.html
http://occt-tests/CR26302-master-occt-64/Windows-64-VC10/bugs/xde/bug26302.html
bugs xde bug26302: OK

Testing on Linux:
occt component :
Total MEMORY difference: 92130973 / 91940310 [+0.21%]
Total CPU difference: 17696.179999999 / 17713.70999999897 [-0.10%]
products component :
Total MEMORY difference: 25233538 / 25220029 [+0.05%]
Total CPU difference: 7074.129999999999 / 6936.800000000004 [+1.98%]

Testing on Windows:
occt component :
Total MEMORY difference: 57152192 / 57144575 [+0.01%]
Total CPU difference: 16380.510602598952 / 16584.46630999933 [-1.23%]
products component :
Total MEMORY difference: 16226011 / 16225943 [+0.00%]
Total CPU difference: 5269.198976699957 / 5398.88260799997 [-2.40%]

There are no differences in images found by testdiff.

git

2015-10-20 09:04

administrator   ~0047206

Branch CR26302 has been updated forcibly by ink.

SHA-1: b66a53723310b02e8ff8292ed660c2608700845d

ink

2015-10-20 09:05

developer   ~0047207

Please retest this branch.

mkv

2015-10-20 20:54

tester   ~0047246

Dear BugMaster,
Branch CR26302 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested on Release mode.
SHA-1: b66a53723310b02e8ff8292ed660c2608700845d

Number of compiler warnings:

occt component :
Linux: 8 (8 on master)
Windows: 0 (0 on master)

products component :
Linux: 39 (39 on master)
Windows: 0 (0 on master)

Regressions/Differences/Improvements:
http://occt-tests/CR26302-master-occt-64/Windows-64-VC10/summary.html
Failed:
  v3d materials bug24855, bug24872_1, bug24872_2
  v3d raytrace bug24130, bug24819, bug25201, bug25833, bug26070, connected, plastic, refraction, textures

Testing cases:
http://occt-tests/CR26302-master-occt-64/Debian70-64/bugs/xde/bug26302.html
http://occt-tests/CR26302-master-occt-64/Windows-64-VC10/bugs/xde/bug26302.html
bugs xde bug26302: FAILED

Testing on Linux:
occt component :
Total MEMORY difference: 92529966 / 92267597 [+0.28%]
Total CPU difference: 19913.179999999786 / 19657.53999999973 [+1.30%]
products component :
Total MEMORY difference: 26240960 / 26295062 [-0.21%]
Total CPU difference: 7431.209999999985 / 7414.720000000001 [+0.22%]

Testing on Windows:
occt component :
Total MEMORY difference: 57977968 / 57939402 [+0.07%]
Total CPU difference: 18145.225114798806 / 17938.757791298973 [+1.15%]
products component :
Total MEMORY difference: 17260380 / 17167618 [+0.54%]
Total CPU difference: 5748.1064465999825 / 5655.301451699955 [+1.64%]

There are differences in images found by testdiff.
http://occt-tests/CR26302-master-occt-64/Windows-64-VC10/diff-Windows-64-VC10.html

mkv

2015-10-20 20:55

tester   ~0047247

Dear ink,
Branch CR26302 has been rejected due to:
- regressions/differences/improvements
- failed test-case for issue
- CPU problem (see http://occt-tests/CR26302-master-occt-64/Windows-64-VC10/diff-Windows-64-VC10.html )
- differences in images

git

2015-10-21 11:39

administrator   ~0047260

Branch CR26302 has been updated by ink.

SHA-1: d1d5e1c42f7b600d2855928c9d70b58e6cc3a19a


Detailed log of new commits:

Author: ink
Date: Wed Oct 21 11:38:49 2015 +0300

    small corrections

git

2015-11-10 15:28

administrator   ~0048010

Branch CR26302 has been updated forcibly by ink.

SHA-1: 20d200197863c6c8d8b922b48ad73af5a4f7cb16

git

2015-11-12 14:30

administrator   ~0048109

Branch CR26302 has been updated forcibly by ink.

SHA-1: 632cbd61690b879f4abf9aaeacf2fde69a92cf70

git

2021-10-27 10:37

administrator   ~0104889

Branch CR26302_1 has been created by dpasukhi.

SHA-1: 23d936dc8916134191621757ca88a396ae1a239a


Detailed log of new commits:

Author: dpasukhi
Date: Wed Oct 27 02:43:26 2021 +0300

    0026302: Data Exchange - new functionality XCAFDoc_Editor::Compact() converting the assembly to compound
    
    Added XCAFDoc_Editor::Compact method to convert from assembly shape to compound

kgv

2021-10-27 10:48

developer   ~0104891

+  di.Add("XCompact", "XCompact Doc [{shLabel1 shLabel2 ...}|{shape1 shape2 ...}]", __FILE__, Compact, g);

Dmitry, could you please improve new command help to elaborate what new command does?

git

2021-10-27 15:22

administrator   ~0104901

Branch CR26302_1 has been updated forcibly by dpasukhi.

SHA-1: 66dcdab5293a8a708796bfaeb4b4dedb20355ad0

dpasukhi

2021-10-27 15:30

administrator   ~0104902

Dear IKA,
please review CR26302_1.
A brunch based on 0028104

A branch has been updated to new master.
Fixed problem with multiple referred shapes
Fixed problem with location.

A remark has been done.

All tests are OK, see:
http://jenkins-test-08.nnov.opencascade.com/view/CR26302_1-master-dpasukhi/view/COMPARE/

kgv

2021-10-27 15:53

developer   ~0104903

+  TopoDS_Compound Comp; // new compound for shape label
...
+  Handle(TDocStd_Document) Doc;

Could you please update the patch to follow OCCT name conventions?

+//purpose  : Converts all assambly in theDoc to compound

assambly -> assembly

+  //! Converts assembly shape to compound
+  Standard_EXPORT static Standard_Boolean Compact(const TDF_Label& theDoc,
+                                                  const TDF_Label& theShapeL);

Please document in more detail each argument @param and return value @return.
An extra elaboration what operation does would be also useful (e.g. "collapses the given assembly node (XCAFDoc_ShapeTool::IsAssembly()) with it's children into a single non-explorable node; this action has an opposite effect to Expand() operation").

+          di << "The shape is not assembly" << "\n";
+          return 1;
...


I think that it should be fine returning 0 here.

+        di << argv[i] << " is not a shape" << "\n"; return 1;

Please move return to a separate line.
"Syntax error: ...".

+  if (argc == 2)
+  {
+    if (!XCAFDoc_Editor::Compact(Doc->Main()))
+    {
+      di << "The shape is  not assembly" << "\n";
+      return 1;

Message is misleading - I guess "Nothing to compact in the document" would be better and no reason to return Tcl exception here.

+if { [regexp "PART COMPOUND 0:1:1:1 \"ASSEMBLY\"" [Xdump D]] != 1 } {

Making a screenshot of the document before and after Compact could be also useful.
It might be better comparing the whole result of Xdump with a reference data (like checkXDump in tests/de_mesh/begin) instead of grepping several particular lines.

kgv

2021-10-27 21:11

developer   ~0104918

git

2021-10-27 23:54

administrator   ~0104927

Branch CR26302_1 has been updated by dpasukhi.

SHA-1: 4e10b8b8a32a598c48e809d87af12b52ebaaba4b


Detailed log of new commits:

Author: dpasukhi
Date: Wed Oct 27 22:12:52 2021 +0300

    // all remarks have been done

git

2021-10-28 00:04

administrator   ~0104928

Branch CR26302_2 has been created by dpasukhi.

SHA-1: b41c1afd8566e69d49aadefcdd252c4dfe67cc6e


Detailed log of new commits:

Author: dpasukhi
Date: Wed Oct 27 02:43:26 2021 +0300

    0026302: Data Exchange - new functionality XCAFDoc_Editor::Compact() converting the assembly to compound
    
    Added XCAFDoc_Editor::Compact method to convert from assembly shape to compound

git

2021-10-28 10:52

administrator   ~0104933

Branch CR26302_2 has been updated forcibly by dpasukhi.

SHA-1: 9bddb75927e09d49ebf41d21a6ea8e1e4d1bcb36

git

2021-10-28 10:53

administrator   ~0104934

Branch CR26302_3 has been created by dpasukhi.

SHA-1: 970a748726edc27f6fdcaa3c29323de55710e24a


Detailed log of new commits:

Author: dpasukhi
Date: Wed Oct 27 02:43:26 2021 +0300

    0026302: Data Exchange - new functionality XCAFDoc_Editor::Compact() converting the assembly to compound
    
    Added XCAFDoc_Editor::Compact method to convert from assembly shape to compound

ika

2021-10-28 19:13

manager  

test_unexpand.xbf (13,896 bytes)

ika

2021-10-28 19:19

manager   ~0104947

Dear dpasukhi,

please find the attached file and a script below:

XOpen test_unexpand.xbf D
XCompact D 0:1:1:1
XExpand D 1

The resulting document is not the same to the initial one, some colors were missed, some subfaces of the original part shapes become children of the main assembly, in a few words, something went wrong. I'm sure that it is a Compact problem or Expand, but now the methods do not work well in pair.

Issue History

Date Modified Username Field Change
2015-06-02 13:54 ink New Issue
2015-06-02 13:54 ink Assigned To => abv
2015-06-02 14:42 git Note Added: 0041840
2015-06-02 14:49 git Note Added: 0041843
2015-06-02 14:51 ink Status new => resolved
2015-06-02 14:51 ink Steps to Reproduce Updated
2015-06-19 11:02 apv Relationship added parent of 0026353
2015-08-13 11:09 abv Assigned To abv => gka
2015-08-18 18:37 gka Note Added: 0044392
2015-08-18 18:37 gka Assigned To gka => bugmaster
2015-08-18 18:37 gka Status resolved => reviewed
2015-08-18 20:20 mkv Note Added: 0044399
2015-08-18 20:20 mkv Assigned To bugmaster => ink
2015-08-18 20:20 mkv Status reviewed => feedback
2015-08-19 12:14 git Note Added: 0044410
2015-08-19 12:15 ink Assigned To ink => gka
2015-08-19 12:15 ink Status feedback => resolved
2015-08-19 12:35 gka Note Added: 0044412
2015-08-19 12:35 gka Assigned To gka => bugmaster
2015-08-19 12:35 gka Status resolved => reviewed
2015-08-19 12:39 git Note Added: 0044414
2015-08-19 16:36 mkv Assigned To bugmaster => mkv
2015-08-20 12:58 mkv Note Added: 0044457
2015-08-20 12:58 mkv Assigned To mkv => ink
2015-08-20 12:58 mkv Status reviewed => feedback
2015-08-20 12:58 mkv Test case number => bugs xde bug26302
2015-09-08 15:36 git Note Added: 0045235
2015-09-08 15:38 ink Assigned To ink =>
2015-09-08 15:38 ink Assigned To => mkv
2015-09-08 15:41 ink Note Added: 0045237
2015-09-09 18:43 mkv Note Added: 0045349
2015-09-09 18:43 mkv Assigned To mkv => ink
2015-09-09 18:43 mkv Status feedback => assigned
2015-10-20 09:04 git Note Added: 0047206
2015-10-20 09:05 ink Note Added: 0047207
2015-10-20 09:06 ink Assigned To ink => mkv
2015-10-20 20:54 mkv Note Added: 0047246
2015-10-20 20:55 mkv Note Added: 0047247
2015-10-20 20:55 mkv Assigned To mkv => ink
2015-10-21 11:39 git Note Added: 0047260
2015-10-21 11:41 ink Assigned To ink => gka
2015-10-21 11:41 ink Status assigned => resolved
2015-11-10 15:28 git Note Added: 0048010
2015-11-12 14:30 git Note Added: 0048109
2015-12-18 15:19 abv Target Version 7.0.0 => 7.1.0
2016-10-26 11:55 gka Target Version 7.1.0 => 7.2.0
2017-08-15 12:42 abv Target Version 7.2.0 => 7.4.0
2019-09-04 13:04 abv Target Version 7.4.0 => 7.5.0
2020-09-23 11:50 gka Target Version 7.5.0 => 7.6.0
2021-10-25 10:50 dpasukhi Assigned To gka => dpasukhi
2021-10-25 14:20 kgv Summary New functionality. Converting the assembly to compound. => Data Exchange - New functionality. Converting the assembly to compound
2021-10-25 14:20 kgv Steps to Reproduce Updated
2021-10-25 14:21 kgv Severity minor => feature
2021-10-25 14:21 kgv Summary Data Exchange - New functionality. Converting the assembly to compound => Data Exchange - new functionality XCAFDoc_Editor::Compact() converting the assembly to compound
2021-10-25 16:09 kgv Status resolved => assigned
2021-10-27 10:37 git Note Added: 0104889
2021-10-27 10:45 dpasukhi Relationship added related to 0028104
2021-10-27 10:48 kgv Note Added: 0104891
2021-10-27 15:22 git Note Added: 0104901
2021-10-27 15:30 dpasukhi Note Added: 0104902
2021-10-27 15:30 dpasukhi Assigned To dpasukhi => ika
2021-10-27 15:30 dpasukhi Status assigned => resolved
2021-10-27 15:53 kgv Note Added: 0104903
2021-10-27 21:11 kgv Note Added: 0104918
2021-10-27 23:54 git Note Added: 0104927
2021-10-28 00:04 git Note Added: 0104928
2021-10-28 10:52 git Note Added: 0104933
2021-10-28 10:53 git Note Added: 0104934
2021-10-28 19:13 ika File Added: test_unexpand.xbf
2021-10-28 19:19 ika Note Added: 0104947
2021-10-28 19:19 ika Assigned To ika => dpasukhi
2021-10-28 19:19 ika Status resolved => assigned
2021-11-01 17:06 szy Target Version 7.6.0 => 7.7.0
2022-10-24 10:38 szy Target Version 7.7.0 => 7.8.0
2023-08-01 15:09 dpasukhi Target Version 7.8.0 => Unscheduled