View Issue Details

IDProjectCategoryView StatusLast Update
0023123CommunityOCCT:Visualizationpublic2012-11-16 13:16
ReporterPawel Assigned Todbv 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2008 
Product Version6.5.3 
Target Version6.5.4Fixed in Version6.5.4 
Summary0023123: Bug/Regression in visualization of XDE documents in shaded mode
DescriptionWhen 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).
Steps To ReproduceDraw reproducer:

ReadStep D test.step
XShow D
vfit
vsetdispmode 1
Additional information
and documentation updates
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);
TagsNo tags attached.
Test case numberchl 935 T0

Attached Files

  • test.step (60,664 bytes)
  • test.png (14,062 bytes)
  • DFB.JPG (63,599 bytes)
  • T0 (1,568 bytes)

Activities

Pawel

2012-04-27 15:34

developer  

test.step (60,664 bytes)

Pawel

2012-04-27 15:35

developer  

test.png (14,062 bytes)

gka

2012-06-22 13:47

developer   ~0020764

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.

gka

2012-06-22 13:49

developer  

DFB.JPG (63,599 bytes)

dbv

2012-07-03 19:07

developer   ~0020854

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.

Pawel

2012-07-04 00:17

developer   ~0020855

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

gka

2012-07-04 17:23

developer   ~0020857

Dear Bugmaster.

Could you please to test branch CR23123

mkv

2012-07-05 15:28

tester   ~0020861

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

mkv

2012-07-05 15:29

tester  

T0 (1,568 bytes)

Pawel

2012-07-09 13:40

developer   ~0020880

Fix positively tested. The issue can be closed.

Related Changesets

occt: master c983f722

2012-07-03 14:55:57

dbv

Details Diff
0023123: Bug/Regression in visualization of XDE documents in shaded mode

Added new group creation before adding styled item in XCAFPrs_AISObject::Compute
Affected Issues
0023123
mod - src/XCAFPrs/XCAFPrs_AISObject.cxx Diff File

Issue History

Date Modified Username Field Change
2012-04-27 15:34 Pawel New Issue
2012-04-27 15:34 Pawel Assigned To => bugmaster
2012-04-27 15:34 Pawel File Added: test.step
2012-04-27 15:35 Pawel Description Updated
2012-04-27 15:35 Pawel File Added: test.png
2012-04-27 15:36 Pawel Description Updated
2012-04-27 15:49 abv Assigned To bugmaster => gka
2012-04-27 15:49 abv Status new => assigned
2012-06-22 10:43 gka Assigned To gka => dbv
2012-06-22 13:47 gka Note Added: 0020764
2012-06-22 13:49 gka File Added: DFB.JPG
2012-07-03 19:07 dbv Note Added: 0020854
2012-07-03 19:07 dbv Assigned To dbv => gka
2012-07-03 19:07 dbv Status assigned => resolved
2012-07-04 00:17 Pawel Note Added: 0020855
2012-07-04 17:23 gka Note Added: 0020857
2012-07-04 17:23 gka Status resolved => reviewed
2012-07-04 17:31 mkv Assigned To gka => mkv
2012-07-05 15:28 mkv Note Added: 0020861
2012-07-05 15:29 mkv File Added: T0
2012-07-05 15:30 mkv Test case number => chl 935 T0
2012-07-05 15:30 mkv Assigned To mkv => bugmaster
2012-07-05 15:30 mkv Status reviewed => tested
2012-07-09 13:40 Pawel Note Added: 0020880
2012-07-10 14:33 dbv Changeset attached => occt master c983f722
2012-07-10 14:33 dbv Assigned To bugmaster => dbv
2012-07-10 14:33 dbv Status tested => verified
2012-07-10 14:33 dbv Resolution open => fixed
2012-07-10 14:54 Pawel Target Version => 6.5.4
2012-11-16 13:15 bugmaster Fixed in Version => 6.5.4
2012-11-16 13:16 bugmaster Status verified => closed