MantisBT - Community
View Issue Details
0028890Community[OCCT] OCCT:Visualizationpublic2017-07-04 13:022017-09-29 16:28
Vico Liang 
bugmaster 
normalmajor 
closedfixed 
WindowsVC++ 201364 bit
[OCCT] 7.1.0 
[OCCT] 7.2.0[OCCT] 7.2.0 
bugs vis bug28890
0028890: Visualization - After closing all views and then display the view again, just the first view has object(s) displayed
Steps to reproduce the problem:
1. Create AIS_InteractiveContext myAISContext1, myAISContext2;
2. Display any kind of AIS_InteractiveObject inside myAISContext1, myAISContext2;
3. Create two views to display objects: aView1 for myAISContext1, aView2 for myAISContext2;
// Till now, all is ok;
4. Close these two views aView1 and aView2, both views are removed with view->Remove() function.
5. Create two new views again: aView3 for myAISContext1, aView4 for myAISContext2;

NOTE, the bug occurs in the last step, aView3 will show the object as expected, but aView4 display nothing.

I debug the problem and find the causes:
Graphic3d_GraphicDriver will release all opengl internal resource if there is no any view exist and the IsDeviceLost will return true. If there is a new view need to display objects it will try to rebuild the Graphic3d_Structure. The problem occurs that it just rebuild the first view's Graphic3d_Structure and the later view's structure will not be built since after the frist view building structure, IsDeviceLost will return false, see detailed in method:void V3d_View::Redraw()

pload MODELING VISUALIZATION
vclear
vclose ALL
box b1_1 0 0 0 1 2 3
box b1_2 0 3 0 3 1 2
box b2_1 0 0 0 3 1 2
box b2_2 0 3 0 1 2 3

# fill first Viewer
vinit Driver1/Viewer1/View1
vzbufftrihedron
vdisplay -dispMode 1 b1_1 b1_2
vfit
vsetcolor b1_1 RED
vsetcolor b1_2 GREEN

# fill second Viewer
vinit Driver1/Viewer2/View1
vzbufftrihedron
vdisplay -dispMode 1 b2_1 b2_2
vfit
vsetcolor b2_1 RED
vsetcolor b2_2 GREEN

# enable RayTracing which sets DeviceLost flag
vactivate Driver1/Viewer1/View1
vraytrace 1
# OK - first View is redrawn in Ray-Trace mode

vactivate Driver1/Viewer2/View1
vraytrace 1
# KO - objects within second View were not re-computed for Ray-Tracing

No tags attached.
Issue History
2017-07-04 13:02Vico LiangNew Issue
2017-07-04 13:02Vico LiangAssigned To => kgv
2017-07-04 13:11Vico LiangDescription Updatedbug_revision_view_page.php?rev_id=17028#r17028
2017-07-07 16:18kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=17051#r17051
2017-07-07 17:03kgvSummaryAfter closing all views and then display the view again, just the first view has object(s) displayed => Visualization - After closing all views and then display the view again, just the first view has object(s) displayed
2017-07-07 17:06gitNote Added: 0068093
2017-07-07 17:14gitNote Added: 0068094
2017-07-07 17:24gitNote Added: 0068097
2017-07-07 17:24kgvNote Added: 0068098
2017-07-07 17:24kgvAssigned Tokgv => apl
2017-07-07 17:24kgvStatusnew => resolved
2017-07-11 10:53gitNote Added: 0068177
2017-07-11 11:42aplNote Added: 0068182
2017-07-11 11:42aplAssigned Toapl => bugmaster
2017-07-11 11:42aplStatusresolved => reviewed
2017-07-11 12:20mkvAssigned Tobugmaster => mkv
2017-07-11 17:30mkvNote Added: 0068192
2017-07-11 17:30mkvNote Added: 0068193
2017-07-11 17:30mkvAssigned Tomkv => kgv
2017-07-11 17:30mkvStatusreviewed => assigned
2017-07-11 17:30mkvTest case number => bugs vis bug28890
2017-07-11 19:25kgvNote Added: 0068201
2017-07-11 19:25kgvAssigned Tokgv => bugmaster
2017-07-11 19:25kgvStatusassigned => resolved
2017-07-11 19:25kgvStatusresolved => reviewed
2017-07-11 19:26kgvNote Edited: 0068201bug_revision_view_page.php?bugnote_id=68201#r17074
2017-07-11 20:10mkvAssigned Tobugmaster => mkv
2017-07-12 16:26mkvNote Added: 0068213
2017-07-12 16:27mkvNote Added: 0068214
2017-07-12 16:27mkvAssigned Tomkv => bugmaster
2017-07-12 16:27mkvStatusreviewed => tested
2017-07-14 13:55bugmasterChangeset attached => occt master 851dacdb
2017-07-14 13:55bugmasterStatustested => verified
2017-07-14 13:55bugmasterResolutionopen => fixed
2017-07-17 10:05gitNote Added: 0068348
2017-09-29 16:18aivFixed in Version => 7.2.0
2017-09-29 16:28aivStatusverified => closed

Notes
(0068093)
git   
2017-07-07 17:06   
Branch CR28890 has been created by kgv.

SHA-1: 0541b64c1eddb9e22a6db93ae90e17d1c8d47c10


Detailed log of new commits:

Author: kgv
Date: Fri Jul 7 17:06:09 2017 +0300

    0028890: Visualization - After closing all views and then display the view again, just the first view has object(s) displayed
    
    DeviceLost flag has been moved from Graphic3d_GraphicDriver to Graphic3d_StructureManager,
    so that all Viewers sharing the same Driver instance are properly invalidated.
    
    Fixed clearing of objects by vclear command in case of multiple Viewers.
(0068094)
git   
2017-07-07 17:14   
Branch CR28890 has been updated forcibly by kgv.

SHA-1: aea112813c46a5546310d4ab0b2dfd40d261ae22
(0068097)
git   
2017-07-07 17:24   
Branch CR28890 has been updated forcibly by kgv.

SHA-1: 0bd26fac10d213fabea7e9f0cad82937ad70f18c
(0068098)
kgv   
2017-07-07 17:24   
Patch is ready for review.
(0068177)
git   
2017-07-11 10:53   
Branch CR28890 has been updated forcibly by kgv.

SHA-1: 56e7c4cbd182beabac4090e2b114fe974b825b06
(0068182)
apl   
2017-07-11 11:42   
Dear bugmaster,

Please test the patch.
(0068192)
mkv   
2017-07-11 17:30   
Dear BugMaster,
Branch CR28890 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: 56e7c4cbd182beabac4090e2b114fe974b825b06

Number of compiler warnings:

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

products component :
Linux: 64 (64 on master)
Windows: 0 (0 on master)
MacOS : 1162
There are following compilation errors on Windows platform:
http://jenkins-test-09.nnov.opencascade.com:8080/view/CR28890-master/view/SAMPLES/job/CR28890-master-Products-Windows-64-VC10-sample-csharp/1/parsed_console/ [^]
1>occcsharp_wrap.cxx(106200) : error C2661: 'OpenGl_View::OpenGl_View' : no overloaded function takes 5 arguments
1>occcsharp_wrap.cxx(106255) : error C2661: 'D3DHost_View::D3DHost_View' : no overloaded function takes 5 arguments

http://jenkins-test-09.nnov.opencascade.com:8080/view/CR28890-master/view/SAMPLES/job/CR28890-master-Products-Windows-64-VC10-sample-java/1/parsed_console/ [^]
..\..\..\OCCwrapJava\occjava_wrap.cxx(119098): error C2661: 'OpenGl_View::OpenGl_View' : no overloaded function takes 5 arguments [C:\install\CR28890-master\Windows-64-VC10-opt\Products\samples\java\win64\VC10\cmake\OCCwrapJava.vcxproj]
  ..\..\..\OCCwrapJava\occjava_wrap.cxx(119098): error C2661: 'OpenGl_View::OpenGl_View' : no overloaded function takes 5 arguments [C:\install\CR28890-master\Windows-64-VC10-opt\Products\samples\java\win64\VC10\cmake\OCCwrapJava.vcxproj]
    1 Error(s)

Regressions/Differences/Improvements:
No regressions/differences

Testing cases:
http://occt-tests/CR28890-master-OCCT/Debian70-64/bugs/vis/bug28890.html [^]
http://occt-tests/CR28890-master-OCCT/Windows-64-VC10/bugs/vis/bug28890.html [^]
bugs vis bug28890: OK

Testing on Linux:
occt component :
Total CPU difference: 18949.42000000012 / 19289.600000000315 [-1.76%]
Total MEMORY difference: 92162000 / 91873630 [+0.31%]
products component :
Total CPU difference: 6444.170000000065 / 6487.850000000069 [-0.67%]
Total MEMORY difference: 37647654 / 37650261 [-0.01%]
Testing on Windows:
occt component :
Total CPU difference: 17773.19392999852 / 17787.234019998614 [-0.08%]
Total MEMORY difference: 59027834 / 59031436 [-0.01%]
products component :
Total CPU difference: 6675.688392600067 / 6584.849010300061 [+1.38%]
Total MEMORY difference: 27877015 / 28099545 [-0.79%]

There are no differences in images found by testdiff.
(0068193)
mkv   
2017-07-11 17:30   
Dear kgv,
Branch CR28890 has been rejected due to:
- compilation errors on Windows platform in Samples
(0068201)
kgv   
2017-07-11 19:25   
(edited on: 2017-07-11 19:26)
Please check Product samples compilation within patch pushed to Products.

(0068213)
mkv   
2017-07-12 16:26   
Dear BugMaster,
Branch CR28890 from products git-repository was compiled on Linux, MacOS and Windows platforms on Release mode.
SHA-1: 2cc6d6cf3d6e1ae59261b1d954aeeb4300efc741

Number of compiler warnings:

products component :
Linux: 64 (64 on master)
Windows: 0 (0 on master)
MacOS : 1136

There are not compilation errors on Windows platform in Samples
(0068214)
mkv   
2017-07-12 16:27   
Dear BugMaster,
Branch CR28890 from occt git-repository and branch CR28890 from products git-repository are TESTED.
(0068348)
git   
2017-07-17 10:05   
Branch CR28890 has been deleted by kgv.

SHA-1: 56e7c4cbd182beabac4090e2b114fe974b825b06