MantisBT - Community
View Issue Details
0023123Community[OCCT] OCCT:Visualizationpublic2012-04-27 15:342012-11-16 13:16
Pawel 
dbv 
normalminor 
closedfixed 
WindowsVC++ 200832 bit
[OCCT] 6.5.3 
[OCCT] 6.5.4[OCCT] 6.5.4 
chl 935 T0
0023123: Bug/Regression in visualization of XDE documents in shaded mode
When displaying an XDE document in shaded mode incorrect colors are used (use the attached STEP file, Draw reproducer below).

In OCCT 6.5.2 the visualization is OK (see attached picture: left - OCCT 6.5.2, right - OCCT 6.5.3).
Draw reproducer:

ReadStep D test.step
XShow D
vfit
vsetdispmode 1
Code to construct the sample XDE document:

        //
        TopoDS_Shape s1 = BRepPrimAPI_MakeBox(gp_Pnt(0, 0, 0), gp_Pnt(10, 30, 20));
        TopoDS_Shape s2 = BRepPrimAPI_MakeBox(gp_Pnt(50, 50, 50), gp_Pnt(10, 20, 20));
        TopoDS_Shape s3 = BRepPrimAPI_MakeBox(gp_Pnt(0, 0, 0), gp_Pnt(-10, -20, -20));
        TopoDS_Shape s4 = BRepBuilderAPI_MakeEdge(gp_Lin(gp_Pnt(0,0,100), gp_Dir(1, 0, 0)), gp_Pnt(-100, 0, 100), gp_Pnt(-50,0,100));
        //
        Standard_Boolean makeAssembly = Standard_True;

        //============
        gp_Trsf t0/*identity*/, t1, t2, t3;
        t1.SetTranslation(gp_Vec(-25, 0, 0));
        t2.SetTranslation(gp_Vec( 25, 0, 0));
        t3.SetTranslation(gp_Vec( 25, 50, 0));

        TopLoc_Location location0(t0);
        TopLoc_Location location1(t1);
        TopLoc_Location location2(t2);
        TopLoc_Location location3(t3);

        //===========
        TDF_Label lab1 = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->NewShape();
        XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->SetShape(lab1, s1);
        TDataStd_Name::Set(lab1, "Box1");

        TDF_Label lab2 = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->NewShape();
        XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->SetShape(lab2, s2);
        TDataStd_Name::Set(lab2, "Box2");

        TDF_Label lab3 = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->NewShape();
        XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->SetShape(lab3, s3);
        TDataStd_Name::Set(lab3, "Box3");

        TDF_Label lab4 = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->NewShape();
        XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->SetShape(lab4, s4);
        TDataStd_Name::Set(lab4, "Edge4");

        TDF_Label labelA02 = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->NewShape();
        TDataStd_Name::Set(labelA02, "ASSEMBLY02");

        TDF_Label labelA01 = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->NewShape();
        TDataStd_Name::Set(labelA01, "ASSEMBLY01");

        TDF_Label labelA0 = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->NewShape();
        TDataStd_Name::Set(labelA0, "ASSEMBLY");

        TDF_Label component03 = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->AddComponent(labelA0, lab2, location1);
        TDF_Label component04 = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->AddComponent(labelA0, lab2, location2);
        TDF_Label component05 = XCAFDoc_DocumentTool::ShapeTool (aDoc->Main ())->AddComponent(labelA0, lab4, location0);
        

        XCAFDoc_DocumentTool::ShapeTool (labelA02)->AddComponent(labelA02, lab3, location1);
        XCAFDoc_DocumentTool::ShapeTool (labelA02)->AddComponent(labelA02, lab3, location2);
        XCAFDoc_DocumentTool::ShapeTool (labelA02)->AddComponent(labelA02, lab1, location2);
        TDF_Label componentA02 = XCAFDoc_DocumentTool::ShapeTool (labelA01)->AddComponent(labelA01, labelA02, location1);
        //
        TDF_Label component11 = XCAFDoc_DocumentTool::ShapeTool (labelA01)->AddComponent(labelA01, lab1, location2);
        XCAFDoc_DocumentTool::ShapeTool (labelA0)->AddComponent(labelA0, labelA01, location2);

        //
        Quantity_Color blue(0,0,1, Quantity_TOC_RGB);
        Quantity_Color green(0,1,0, Quantity_TOC_RGB);
        XCAFDoc_DocumentTool::ColorTool (labelA0)->AddColor(blue);
        XCAFDoc_DocumentTool::ColorTool (labelA0)->AddColor(green);
        XCAFDoc_DocumentTool::ColorTool (labelA0)->SetColor(component05, blue, XCAFDoc_ColorGen);
        XCAFDoc_DocumentTool::ColorTool (labelA0)->SetColor(component03, green, XCAFDoc_ColorGen);
        XCAFDoc_DocumentTool::ColorTool (labelA0)->SetColor(component04, blue, XCAFDoc_ColorGen);
No tags attached.
? test.step (60,664) 2012-04-27 15:34
https://tracker.dev.opencascade.org/
png test.png (14,062) 2012-04-27 15:35
https://tracker.dev.opencascade.org/
jpg DFB.JPG (63,599) 2012-06-22 13:49
https://tracker.dev.opencascade.org/
? T0 (1,568) 2012-07-05 15:29
https://tracker.dev.opencascade.org/
Issue History
2012-04-27 15:34PawelNew Issue
2012-04-27 15:34PawelAssigned To => bugmaster
2012-04-27 15:34PawelFile Added: test.step
2012-04-27 15:35PawelDescription Updatedbug_revision_view_page.php?rev_id=3860#r3860
2012-04-27 15:35PawelFile Added: test.png
2012-04-27 15:36PawelDescription Updatedbug_revision_view_page.php?rev_id=3861#r3861
2012-04-27 15:49abvAssigned Tobugmaster => gka
2012-04-27 15:49abvStatusnew => assigned
2012-06-22 10:43gkaAssigned Togka => dbv
2012-06-22 13:47gkaNote Added: 0020764
2012-06-22 13:49gkaFile Added: DFB.JPG
2012-07-03 19:07dbvNote Added: 0020854
2012-07-03 19:07dbvAssigned Todbv => gka
2012-07-03 19:07dbvStatusassigned => resolved
2012-07-04 00:17PawelNote Added: 0020855
2012-07-04 17:23gkaNote Added: 0020857
2012-07-04 17:23gkaStatusresolved => reviewed
2012-07-04 17:31mkvAssigned Togka => mkv
2012-07-05 15:28mkvNote Added: 0020861
2012-07-05 15:29mkvFile Added: T0
2012-07-05 15:30mkvTest case number => chl 935 T0
2012-07-05 15:30mkvAssigned Tomkv => bugmaster
2012-07-05 15:30mkvStatusreviewed => tested
2012-07-09 13:40PawelNote Added: 0020880
2012-07-10 14:33dbvChangeset attached => occt master c983f722
2012-07-10 14:33dbvAssigned Tobugmaster => dbv
2012-07-10 14:33dbvStatustested => verified
2012-07-10 14:33dbvResolutionopen => fixed
2012-07-10 14:54PawelTarget Version => 6.5.4
2012-11-16 13:15bugmasterFixed in Version => 6.5.4
2012-11-16 13:16bugmasterStatusverified => closed

Notes
(0020764)
gka   
2012-06-22 13:47   
Dear Dimitry.

I made preliminary analysis of this bug and found that attached test file read in document correctly in version OCC6.5.3. It is possible to note in the structure obtained document represented on DFBrowser (please see attached picture).
Seems that this bug in the visualization due to that both boxes have the same TShape.
(0020854)
dbv   
2012-07-03 19:07   
Dear Galina,

thank you for the analysis, the bug was actually in the visualization. In XCAFPrs_AISObject::Compute method it is necessary to create new group before adding styled item. Otherwise last style will be applied to both shapes.

Fix has been pushed to the git branch CR23123.

Please review.

(0020855)
Pawel   
2012-07-04 00:17   
Hello guys,

can you please check if this issue/solution is related to 0023236?

I'm still a bit overwhelmed with the diversity of OCCT and wasn't sure where to look.

Thanks!
Pawel
(0020857)
gka   
2012-07-04 17:23   
Dear Bugmaster.

Could you please to test branch CR23123
(0020861)
mkv   
2012-07-05 15:28   
Dear BugMaster,
The workbenches
KAS:dev:mkv-23123-occt (GIT branch CR23123)
KAS:dev:mkv-23123-products (GIT master)
were compiled on Linux platform and tested.

Regression:
Not detected

Improvements:
chl 934 R6

Testing case:
chl 935 T0 testing case was created for issue.
It is OK in this branch.
It is FAULTY in in current master (KAS:dev:products-20120622-opt).

See results in /QADisk/occttests/results/KAS/dev/mkv-23123-products_04072012/lin
See reference results in /QADisk/occttests/results/KAS/dev/products-20120622-opt_22062012/lin
See test cases in /QADisk/occttests/tests/ED
N.B. In order to launch testing case you can make use the following instructions
http://doc/doku.php?id=occt:certification [^]
(0020880)
Pawel   
2012-07-09 13:40   
Fix positively tested. The issue can be closed.