MantisBT - Community
View Issue Details
0029395Community[OCCT] OCCT:Visualizationpublic2017-12-20 12:082018-06-29 21:19
dipts 
kgv 
normalminor 
closedfixed 
WindowsVC++ 201564 bit
[OCCT] 7.1.0 
[OCCT] 7.3.0[OCCT] 7.3.0 
bugs vis bug29395
0029395: Visualization, V3d_View - Grid disappears forever after enabling RayTracing
After switching to raytracing (V3d_View::ChangeRenderingParams().Method = Graphic3d_RM_RAYTRACING) the grid disappears. It can never be reenabled, even after switching back to Graphic3d_RM_RASTERIZATION.

This does not happen if the grid was not enabled when switching to raytracing the first time. After that, the grid can be enabled or disabled, it is always shown correctly in all modes and after all switches.

This behaviour was found in OCCT 7.2.0 (can't select this version) with both rectangular and circular grid.

bugs vis bug29395

pload VISUALIZATION

# Rectangular Grid
vclear
vinit View1
vraytrace 0
vgrid r
vraytrace 1
checkcolor 198 197 0.5 0.5 0.5 
vclose

# Circular Grid
vclear
vinit View1
vraytrace 0
vgrid c
vraytrace 1
checkcolor 198 197 0.5 0.5 0.5
No tags attached.
? RaytracingGrid.tcl (171) 2017-12-20 12:58
https://tracker.dev.opencascade.org/
Issue History
2017-12-20 12:08diptsNew Issue
2017-12-20 12:08diptsAssigned To => kgv
2017-12-20 12:25kgvNote Added: 0073043
2017-12-20 12:58diptsFile Added: RaytracingGrid.tcl
2017-12-20 13:00diptsNote Added: 0073044
2018-01-10 14:27kgvNote Added: 0073284
2018-01-10 14:27kgvAssigned Tokgv => dipts
2018-01-10 14:27kgvStatusnew => feedback
2018-01-10 14:28kgvNote Edited: 0073284bug_revision_view_page.php?bugnote_id=73284#r18434
2018-01-10 14:28kgvNote Edited: 0073284bug_revision_view_page.php?bugnote_id=73284#r18435
2018-01-10 14:31kgvNote Edited: 0073284bug_revision_view_page.php?bugnote_id=73284#r18436
2018-01-10 14:32kgvNote Edited: 0073284bug_revision_view_page.php?bugnote_id=73284#r18437
2018-01-10 14:32kgvNote Edited: 0073284bug_revision_view_page.php?bugnote_id=73284#r18438
2018-01-10 14:32kgvNote Edited: 0073284bug_revision_view_page.php?bugnote_id=73284#r18439
2018-01-10 14:33kgvNote Edited: 0073284bug_revision_view_page.php?bugnote_id=73284#r18440
2018-02-06 00:03diptsStatusfeedback => assigned
2018-02-06 00:13gitNote Added: 0073828
2018-02-06 00:20diptsNote Added: 0073829
2018-02-06 00:20diptsAssigned Todipts => kgv
2018-02-06 00:20diptsStatusassigned => resolved
2018-02-06 00:20diptsSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18566#r18566
2018-02-08 13:54kgvNote Added: 0073881
2018-02-08 13:54kgvTarget Version => 7.4.0
2018-02-08 23:07gitNote Added: 0073895
2018-02-08 23:12diptsNote Added: 0073896
2018-02-11 09:51gitNote Added: 0073911
2018-02-11 11:56gitNote Added: 0073918
2018-02-11 11:59kgvSummaryGrid disappears forever after enabling raytracing => Visualization, V3d_View - Grid disappears forever after enabling RayTracing
2018-02-11 12:00kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18596#r18596
2018-02-11 12:02gitNote Added: 0073919
2018-02-11 12:07gitNote Added: 0073920
2018-02-11 15:08kgvNote Added: 0073924
2018-02-11 15:08kgvAssigned Tokgv => bugmaster
2018-02-11 15:08kgvStatusresolved => reviewed
2018-02-12 17:02apnTest case number => bugs vis bug29395
2018-02-12 17:02apnNote Added: 0073940
2018-02-12 17:02apnStatusreviewed => tested
2018-02-18 13:00kgvChangeset attached => occt master 5f6e3a07
2018-02-18 13:00kgvAssigned Tobugmaster => kgv
2018-02-18 13:00kgvStatustested => verified
2018-02-18 13:00kgvResolutionopen => fixed
2018-02-20 12:58aivTarget Version7.4.0 => 7.3.0
2018-03-06 15:50gitNote Added: 0074276
2018-03-06 15:50gitNote Added: 0074277
2018-06-29 21:15aivFixed in Version => 7.3.0
2018-06-29 21:19aivStatusverified => closed

Notes
(0073043)
kgv   
2017-12-20 12:25   
> I found no grid-related commands in DRAW.
It is "vgrid".
(0073044)
dipts   
2017-12-20 13:00   
> It is "vgrid".
Sorry, my fault (and undocumented :) ).

I have uploaded a test script.
(0073284)
kgv   
2018-01-10 14:27   
(edited on: 2018-01-10 14:33)
The problem is that V3d_RectangularGrid/V3d_CircularGrid do not implement automatic re-compute logic.

If you would like providing a patch - you can correct V3d_RectangularGrid/V3d_CircularGrid to follow the same logic
as V3d_Trihedron (specifically - see V3d_Trihedron::TrihedronStructure implementation in V3d_Trihedron.cxx):

//! Dummy implementation of Graphic3d_Structure overriding
//! ::Compute() method for handling Device Lost.
class V3d_Trihedron::TrihedronStructure : public Graphic3d_Structure
{
public:
  //! Main constructor.
  TrihedronStructure (const Handle(Graphic3d_StructureManager)& theManager,
                      V3d_Trihedron* theTrihedron)
  : Graphic3d_Structure (theManager), myTrihedron (theTrihedron) {}

  //! Override method to redirect to V3d_Trihedron.
  virtual void Compute() Standard_OVERRIDE { myTrihedron->compute(); }

private:
  V3d_Trihedron* myTrihedron;
};


(0073828)
git   
2018-02-06 00:13   
Branch CR29395 has been created by dipts.

SHA-1: 8c1599baa57936a45f2ae7f50fe8b11648824da3


Detailed log of new commits:

Author: dipts
Date: Mon Feb 5 22:11:42 2018 +0100

    0029395: Grid disappears forever after enabling raytracing
    
    Custom Graphic3d_Structure implementation has been added to V3d_RectangularGrid and V3d_CircularGrid to trigger recompute in case of device lost.
(0073829)
dipts   
2018-02-06 00:20   
Dear kgv,
thanks for giving me a point to start off. The branch is ready to review.
(0073881)
kgv   
2018-02-08 13:54   
New warnings appears: 2
 
Type : MSBuild
Category : C4355
File Name : c:/builds/CR29395-master-KGV/OCCT_SRC/src/V3d/V3d_CircularGrid.cxx
Line : 65
Message : this : used in base member initializer list

Type : MSBuild
Category : C4355
File Name : c:/builds/CR29395-master-KGV/OCCT_SRC/src/V3d/V3d_RectangularGrid.cxx
Line : 64
Message : this : used in base member initializer list
(0073895)
git   
2018-02-08 23:07   
Branch CR29395 has been updated by dipts.

SHA-1: 55e0c37779ef2fdfcf6000529411b908724ecafe


Detailed log of new commits:

Author: dipts
Date: Thu Feb 8 21:05:54 2018 +0100

    # Moved initialization of structure member to constructor code to avoid warning C4355.

(0073896)
dipts   
2018-02-08 23:12   
Corrected, please review.
(0073911)
git   
2018-02-11 09:51   
Branch CR29395 has been updated forcibly by kgv.

SHA-1: d75a01296138d10101e79234d95ad05818d2b952
(0073918)
git   
2018-02-11 11:56   
Branch CR29395 has been updated by kgv.

SHA-1: d4b08decf93af8f4312bf554f0a6f4585fe7a4ea


Detailed log of new commits:

Author: kgv
Date: Sun Feb 11 11:56:53 2018 +0300

    Do not compute primitive arrays before displaying the grid.

(0073919)
git   
2018-02-11 12:02   
Branch CR29395 has been updated by kgv.

SHA-1: 3ad1671ed20493aaf1ffe772907e7a1e19668ba3


Detailed log of new commits:

Author: kgv
Date: Sun Feb 11 12:02:09 2018 +0300

    # adjust test case

(0073920)
git   
2018-02-11 12:07   
Branch CR29395_1 has been created by kgv.

SHA-1: 5f6e3a0711c2562b899591b8087cd9ec7024b4eb


Detailed log of new commits:

Author: dipts
Date: Mon Feb 5 22:11:42 2018 +0100

    0029395: Visualization, V3d_View - Grid disappears forever after enabling RayTracing
    
    Custom Graphic3d_Structure implementation has been added to V3d_RectangularGrid and V3d_CircularGrid to trigger recompute in case of device lost.
    Primitive arrays are no more (re)computed while grid is not actually displayed.
(0073924)
kgv   
2018-02-11 15:08   
Please take the patch.

http://jenkins-test-10.nnov.opencascade.com:8080/view/CR29395_1-master-KGV [^]
(0073940)
apn   
2018-02-12 17:02   
Combination -
OCCT branch : CR29395_1 SHA - 5f6e3a0711c2562b899591b8087cd9ec7024b4eb
Products branch : master SHA - 41720ba4c544483d56753d7b5ec17b6a72bfac64
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

Test case:
bugs vis bug29395 - OK

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 18308.899999999656 / 18375.13999999976 [-0.36%]
Products
Total CPU difference: 7488.24 / 7504.959999999995 [-0.22%]
Windows-64-VC10:
OCCT
Total CPU difference: 17676.11450769864 / 17692.572613198507 [-0.09%]
Products
Total CPU difference: 8067.061311599993 / 8097.855908999923 [-0.38%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0074276)
git   
2018-03-06 15:50   
Branch CR29395 has been deleted by kgv.

SHA-1: 3ad1671ed20493aaf1ffe772907e7a1e19668ba3
(0074277)
git   
2018-03-06 15:50   
Branch CR29395_1 has been deleted by kgv.

SHA-1: 5f6e3a0711c2562b899591b8087cd9ec7024b4eb