MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0023474Community[OCCT] OCCT:Visualizationpublic2012-10-16 14:372013-12-19 13:59
ReporterPawel 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformWindowsOSVC++ 2008OS Version32 bit
Product Version[OCCT] 6.5.4 
Target Version[OCCT] 6.7.0Fixed in Version[OCCT] 6.7.0 
Summary0023474: Changing material/color/transparency of a shaded AIS_Shape requires 'Redisplay'
DescriptionI've been testing the feature introduced in 23407 (Draw face outlines for XDE objects) and I spotted the following problem: When drawing face outlines of AIS_Shapes:

AIS_InteractiveContext::DefaultDrawer()->SetFaceBoundaryDraw(Standard_True)

The method AIS_Shape::SetMaterial(const Graphic3d_MaterialAspect& aMat) did not update the presentation for shaded presentation (in other words the material was not updated after setting it). I needed to call AIS_InteractiveContext::Redisplay on the corresponding object for the change to take effect.
Steps To ReproduceUse MFC samples to reproduce.
- call AIS_InteractiveContext::DefaultDrawer()->SetFaceBoundaryDraw(Standard_True) after creating AIS_InteractiveContext
- Create a shape (e.g. sphere)
- Display it in shaded mode
- Change material

=======================
And a DRAW reproducer:
box b 10 20 30
vinit
vdisplay b
vfit
vsetdispmode b 1
vsetcolor b RED
vshowfaceboundary b 1
vsetcolor b BLUE

Additional information
and documentation updates
Further investigation revealed that within the body of AIS_Shape::SetMaterial the call (AIS_Shape.cxx, line 639)

if (aGroup->IsGroupPrimitivesAspectSet(Graphic3d_ASPECT_FILL_AREA))

returned false and so

aGroup->SetGroupPrimitivesAspect(anAreaAsp);

was not called.

Further, I realized that StdPrs_ShadedShapes.cxx, in method

static void ComputeFaceBoundaries

a new group is created but not all the aspects are copied and so the group behaves as if there were no aspect for 'Graphic3d_ASPECT_FILL_AREA'.
TagsNo tags attached.
Test case numberbugs vis(004) bug23474
Attached Filespng file icon correct.png (34,860 bytes) 2013-11-04 16:44
png file icon faulty.png (28,502 bytes) 2013-11-04 16:44

- Relationships
related to 0023387closedbugmaster Community Visualization - transparency of specified material is ignored within AIS_Shape::SetMaterial() 
related to 0023519closedbugmaster Community Mixing wireframe and shaded visualization impacts performance 

-  Notes
(0021792)
Pawel (developer)
2012-10-16 14:53

Branch CR23474 has been pushed.

As a solution I have obtained a reference to the existing Graphic3d_Group instead of creating a new one. That solved the problem. However, maybe it is better/necessary (my understanding for the Visualization module is unfortunately limited) to create a new group. In that case all the aspect information (Graphic3d_AspectLine3d, Graphic3d_AspectFillArea3d, Graphic3d_AspectText3d etc.) should be copied to the new group, I guess.

Please review.
(0021793)
Pawel (developer)
2012-10-16 14:55

Dear bugmaster, please add relation to the issue 0023407.
(0021915)
san (developer)
2012-10-24 11:12

We need some time to analyze the proposed solution. The point is that AIS_Shape::Compute() creates several Graphic3d_Group instances while the patch modifies the aspect of one of the groups only, so some side effects are possible.
(0025819)
Pawel (developer)
2013-10-01 14:26

Dear Sergey,

can you please consider incorporating/verifying this patch for the upcoming 6.7.0 release? I've been using it for a year now and haven't been able to spot any resulting problems.

Thanks
(0026427)
san (developer)
2013-11-01 19:34

Dear kgv,

Can you please review the patch and send it to testing if it is OK?
(0026438)
kgv (developer)
2013-11-04 14:49
edited on: 2013-11-04 14:50

I have no objections against the patch - re-using of the group looks reasonable in this case. Although I am unable to check original problem due to missing reference snapshots.

Patch has been re-based and pushed to branch CR23474_1.
Ready for testing.

(0026439)
Pawel (developer)
2013-11-04 16:48

I have attached two snaphots illustrating how the test DRAW script works like with (correct.png) and without (faulty.png) the proposed patch.

In the current implementation the line:

vsetcolor b BLUE

has no effect and the box remains red. After the patch is applied the box changes color (it's not really blue because of the material properties).
(0026473)
mkv (tester)
2013-11-06 13:52

Dear BugMaster,

Branch CR23474_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: ebd78273ddeca84e68f18765c1d3196f98639ac8

Number of compiler warnings:

occt component :
Linux: 320 (323 on master)
Windows: 0 (0 on master)

products component :
Linux: 188 (189 on master)
Windows: 287 (287 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
http://occt-tests/CR23474-1-master-occt/Debian60-64/bugs/vis/bug23474.html [^]
http://occt-tests/CR23474-1-master-occt/Windows-32-VC9/bugs/vis/bug23474.html [^]
bugs vis(004) bug23474: OK

Testing on Linux:
Total MEMORY difference: 355397792 / 356295124
Total CPU difference: 42998.710000000625 / 40672.21000000072

Testing on Windows:
Total MEMORY difference: 410980760 / 406471844
Total CPU difference: 29134.109375 / 34772.53125

There are not differences in images found by testdiff.
(0026540)
mkv (tester)
2013-11-11 15:14

Dear BugMaster,

Branch CR23474_1 was rebased on current master. Branch CR23474_1 (and products from GIT master) was compiled on Linux and Windows platforms and tested.
SHA-1: 83e5dabfb0e3698209d4a5001fb886075210017b

Number of compiler warnings:

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

products component :
Linux: 188 (188 on master)
Windows: 287 (287 on master)

Regressions/Differences:
No regressions/differences

Testing cases:
http://occt-tests/CR23474-01-master-occt/Debian60-64/bugs/vis/bug23474.html [^]
http://occt-tests/CR23474-01-master-occt/Windows-32-VC9/bugs/vis/bug23474.html [^]
bugs vis(004) bug23474: OK

Testing on Linux:
Total MEMORY difference: 356189692 / 356528316
Total CPU difference: 42744.18000000111 / 42450.47000000157

Testing on Windows:


There are not differences in images found by testdiff.

- Related Changesets
occt: master 7893b2fa
Timestamp: 2012-10-16 10:42:13
Author: Pawel
Committer: bugmaster
Details ] Diff ]
0023474: Changing material/color/transparency of a shaded AIS_Shape requires 'Redisplay'

Getting the current group instead of creating new one. Otherwise the necessary aspect information is lost.
mod - src/StdPrs/StdPrs_ShadedShape.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2012-10-16 14:37 Pawel New Issue
2012-10-16 14:37 Pawel Assigned To => Pawel
2012-10-16 14:40 abv Relationship added related to 0023407
2012-10-16 14:53 Pawel Note Added: 0021792
2012-10-16 14:53 Pawel Assigned To Pawel => bugmaster
2012-10-16 14:53 Pawel Status new => resolved
2012-10-16 14:55 Pawel Note Added: 0021793
2012-10-16 17:42 Pawel Description Updated View Revisions
2012-10-16 18:01 abv Assigned To bugmaster => san
2012-10-19 13:12 Pawel Steps to Reproduce Updated View Revisions
2012-10-23 12:00 abv Target Version 6.5.4 => 6.6.0
2012-10-24 11:12 san Note Added: 0021915
2012-10-27 03:46 san Relationship added related to 0023387
2012-11-07 15:40 Pawel Relationship added related to 0023519
2013-02-26 18:31 san Target Version 6.6.0 => 6.7.0
2013-10-01 14:26 Pawel Note Added: 0025819
2013-10-01 14:26 Pawel Status resolved => feedback
2013-11-01 19:34 san Assigned To san => kgv
2013-11-01 19:34 san Note Added: 0026427
2013-11-04 14:49 kgv Note Added: 0026438
2013-11-04 14:49 kgv Assigned To kgv => bugmaster
2013-11-04 14:49 kgv Status feedback => reviewed
2013-11-04 14:50 kgv Note Edited: 0026438 View Revisions
2013-11-04 16:44 Pawel File Added: correct.png
2013-11-04 16:44 Pawel File Added: faulty.png
2013-11-04 16:48 Pawel Note Added: 0026439
2013-11-06 13:52 mkv Note Added: 0026473
2013-11-06 13:53 mkv Test case number => bugs vis(004) bug23474
2013-11-06 13:53 mkv Assigned To bugmaster => mkv
2013-11-11 15:14 mkv Note Added: 0026540
2013-11-11 15:14 mkv Assigned To mkv => bugmaster
2013-11-11 15:14 mkv Status reviewed => tested
2013-11-15 10:24 bugmaster Changeset attached => occt master 7893b2fa
2013-11-15 10:24 bugmaster Status tested => verified
2013-11-15 10:24 bugmaster Resolution open => fixed
2013-12-19 13:51 bugmaster Status verified => closed
2013-12-19 13:59 bugmaster Fixed in Version => 6.7.0


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker