MantisBT - Community
View Issue Details
0029791Community[OCCT] OCCT:Visualizationpublic2018-05-21 14:412018-07-06 18:49
Freeman 
abv 
highminor 
closedfixed 
WindowsVC++ 201564 bit
[OCCT] 6.9.0 
[OCCT] 7.3.0[OCCT] 7.3.0 
bugs vis bug29791
0029791: Visualization - Wrong result of SelectMgr_RectangularFrustum::IsClipped
I faced with a problem with function SelectMgr_RectangularFrustum::IsClipped.

So when the clip plane has been added to the bottle, one can see a highlighting, when mouse cursor on the clipped part of a shape.

If you look at SelectMgr_ViewerSelector::checkOverlap you could see a call of mySelectingVolumeMgr.IsClipped (*aSelectable->ClipPlanes(), aPickResult.Depth()). Where mySelectingVolumeMgr is of SelectMgr_RectangularFrustum

This function returns wrong results sometimes (e.g. when you add plane or several parallel planes perpendicular to the view plane)
pload MODELING VISUALIZATION
restore [locate_data_file bottle.brep] b
vclear
vinit View1
vdisplay -dispMode 1 -highMode 1 b
vfit
vzbufftrihedron
vviewparams -scale 14.7435 -proj 0.193921 -0.891229 0.410007 -up -0.0205984 0.414149 0.909976 -at 11.3689 
1.32152 24.9954
vclipplane p -equation 1 0 0 -20 -set
vmoveto 150 200
vstate -entities
vselect 150 200
if { [vreadpixel 150 200 rgb name] != "BLACK"      } { puts "Error1" }
if { [vreadpixel 300 200 rgb name] != "GOLDENROD1" } { puts "Error2" }



To represent a problem, one can try this code:

    TopoDS_Shape bottle = MakeBottle(70, 100, 30);
    Handle(AIS_Shape) aBottle = new AIS_Shape(bottle);
    Handle(Graphic3d_ClipPlane) planeLeft = new
    Graphic3d_ClipPlane(gp_Pln(gp_Pnt(20, 0, 0), gp::DX()));
    aBottle->AddClipPlane(planeLeft);

    myContext->Display(aBottle, true);
(MakeBottle - simple function from OCCT docs making sample bottle).
https://www.opencascade.com/content/wrong-result-selectmgrrectangularfrustumisclipped [^]
No tags attached.
related to 0029934closed bugmaster Open CASCADE Visualization - handle properly orthogonal clipping plane within SelectMgr_RectangularFrustum::computeClippingRange() 
child of 0024623closed bugmaster Open CASCADE Visualization - improve selection mechanism 
Issue History
2018-05-21 14:41FreemanNew Issue
2018-05-21 14:41FreemanAssigned To => kgv
2018-05-24 18:48kgvSummaryWrong result of SelectMgr_RectangularFrustum::IsClipped => Visualization - Wrong result of SelectMgr_RectangularFrustum::IsClipped
2018-05-24 18:48kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=19163#r19163
2018-05-24 18:48kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=19164#r19164
2018-05-24 18:50kgvProduct Version7.2.0 => 7.1.0
2018-05-24 19:00kgvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=19165#r19165
2018-05-24 19:21kgvNote Added: 0076299
2018-05-24 19:22kgvRelationship addedchild of 0024623
2018-05-24 19:22kgvProduct Version7.1.0 => 6.9.0
2018-05-24 19:22kgvTarget Version => 7.4.0
2018-05-24 19:46kgvNote Deleted: 0076299
2018-05-24 20:04gitNote Added: 0076302
2018-05-24 20:07gitNote Added: 0076304
2018-05-24 20:10gitNote Added: 0076305
2018-05-24 20:20kgvTarget Version7.4.0 => 7.3.0
2018-05-24 21:43gitNote Added: 0076307
2018-05-24 21:44gitNote Added: 0076308
2018-05-25 07:34kgvNote Added: 0076309
2018-05-25 07:34kgvAssigned Tokgv => san
2018-05-25 07:34kgvPrioritynormal => high
2018-05-25 07:34kgvStatusnew => resolved
2018-05-25 11:26sanNote Added: 0076314
2018-05-25 11:26sanAssigned Tosan => bugmaster
2018-05-25 11:26sanStatusresolved => reviewed
2018-05-25 13:30bugmasterTest case number => bugs vis bug29791
2018-05-25 13:34bugmasterNote Added: 0076323
2018-05-25 13:34bugmasterStatusreviewed => tested
2018-05-29 12:33abvChangeset attached => occt master 2b8e3efe
2018-05-29 12:33abvAssigned Tobugmaster => abv
2018-05-29 12:33abvStatustested => verified
2018-05-29 12:33abvResolutionopen => fixed
2018-05-29 15:54abvChangeset attached => occt master fad3eca7
2018-06-23 13:56gitNote Added: 0076957
2018-06-23 13:56gitNote Added: 0076958
2018-06-29 21:13aivFixed in Version => 7.3.0
2018-06-29 21:18aivStatusverified => closed
2018-07-06 18:49kgvRelationship addedrelated to 0029934

Notes
(0076302)
git   
2018-05-24 20:04   
Branch CR29791_1 has been created by kgv.

SHA-1: c6766a66052316decdf32ae8354bdf70f340e08f


Detailed log of new commits:

Author: kgv
Date: Thu May 24 20:01:48 2018 +0300

    0029791: Visualization - Wrong result of SelectMgr_RectangularFrustum::IsClipped
    
    SelectMgr_RectangularFrustum::computeClippingRange() - do not skip depth range starting behind the ray.

Author: kgv
Date: Fri Apr 27 20:53:50 2018 +0300

    0029729: Visualization, Graphic3d_ClipPlane - add support of clipping plane chains
    
    Graphic3d_ClipPlane now can define a Chain of Planes (logical AND).
    OpenGl_ShaderManager - added new GLSL sub-programs for clipping plane chains.
    Bnd_Range::TrimFrom(), ::TrimTo() - added auxiliary methods for trimming the range.
    SelectMgr_ViewClipRange now handles non-continuous clipping range.
    Graphic3d_SequenceOfHClipPlane now aggregates NCollection_Sequence instead of inheritance.
    OpenGl_CappingPlaneResource - triangulation has been adjusted to make front face following CCW order.
(0076304)
git   
2018-05-24 20:07   
Branch CR29791_1 has been updated forcibly by kgv.

SHA-1: eb94be5f25331cab01db3b368bc60a0659977878
(0076305)
git   
2018-05-24 20:10   
Branch CR29791_2 has been created by kgv.

SHA-1: 9c41b118f76fef36ba79976246f4f1fa5016f4f1


Detailed log of new commits:

Author: kgv
Date: Thu May 24 20:10:32 2018 +0300

    0029791: Visualization - Wrong result of SelectMgr_RectangularFrustum::IsClipped
    
    SelectMgr_RectangularFrustum::computeClippingRange() fix skipping depth range starting behind the ray.
(0076307)
git   
2018-05-24 21:43   
Branch CR29791_1 has been updated forcibly by kgv.

SHA-1: 7a6f6fee31705d66f956e4204ce2b34575b73490
(0076308)
git   
2018-05-24 21:44   
Branch CR29791_2 has been updated forcibly by kgv.

SHA-1: f2a065648110b863da4c5b641294110338ecf5a5
(0076309)
kgv   
2018-05-25 07:34   
Patch is ready for review.

http://jenkins-test-11.nnov.opencascade.com:8080/view/CR29791_2-master-KGV/ [^]
(0076314)
san   
2018-05-25 11:26   
Branch CR29791_2 reviewed without remarks.
(0076323)
bugmaster   
2018-05-25 13:34   
Combination -
OCCT branch : CR29791_2 SHA - f2a065648110b863da4c5b641294110338ecf5a5
Products branch : master SHA - 0503d2e80bad20c78461c45f990db7f47ea81501
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

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 18226.470000000027 / 18176.60999999981 [+0.27%]
Products
Total CPU difference: 7428.720000000049 / 7438.350000000027 [-0.13%]
Windows-64-VC10:
OCCT
Total CPU difference: 18017.819098098553 / 17976.931235998483 [+0.23%]
Products
Total CPU difference: 8197.072544999859 / 8185.31006959986 [+0.14%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
(0076957)
git   
2018-06-23 13:56   
Branch CR29791_1 has been deleted by kgv.

SHA-1: 7a6f6fee31705d66f956e4204ce2b34575b73490
(0076958)
git   
2018-06-23 13:56   
Branch CR29791_2 has been deleted by kgv.

SHA-1: f2a065648110b863da4c5b641294110338ecf5a5