mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-08 18:40:55 +03:00
0029791: Visualization - Wrong result of SelectMgr_RectangularFrustum::IsClipped
SelectMgr_RectangularFrustum::computeClippingRange() fix skipping depth range starting behind the ray.
This commit is contained in:
parent
3e782664b8
commit
fad3eca77f
@ -675,18 +675,15 @@ void SelectMgr_RectangularFrustum::computeClippingRange (const Graphic3d_Sequenc
|
|||||||
}
|
}
|
||||||
|
|
||||||
// compute distance to point of pick line intersection with the plane
|
// compute distance to point of pick line intersection with the plane
|
||||||
Standard_Real aParam = aDistance / aDotProduct;
|
const Standard_Real aParam = aDistance / aDotProduct;
|
||||||
|
const gp_Pnt anIntersectionPt = myNearPickedPnt.XYZ() + myViewRayDir.XYZ() * aParam;
|
||||||
// check if ray intersects the plane, in case aIntDist < 0
|
Standard_Real aDistToPln = anIntersectionPt.Distance (myNearPickedPnt);
|
||||||
// the plane is "behind" the ray
|
|
||||||
if (aParam < 0.0)
|
if (aParam < 0.0)
|
||||||
{
|
{
|
||||||
continue;
|
// the plane is "behind" the ray
|
||||||
|
aDistToPln = -aDistToPln;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gp_Pnt anIntersectionPt = myNearPickedPnt.XYZ() + myViewRayDir.XYZ() * aParam;
|
|
||||||
const Standard_Real aDistToPln = anIntersectionPt.Distance (myNearPickedPnt);
|
|
||||||
|
|
||||||
// change depth limits for case of opposite and directed planes
|
// change depth limits for case of opposite and directed planes
|
||||||
if (aDotProduct < 0.0)
|
if (aDotProduct < 0.0)
|
||||||
{
|
{
|
||||||
|
21
tests/bugs/vis/bug29791
Normal file
21
tests/bugs/vis/bug29791
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "0029791: Visualization - Wrong result of SelectMgr_RectangularFrustum::IsClipped"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
|
||||||
|
pload MODELING VISUALIZATION
|
||||||
|
restore [locate_data_file occ/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 "Error: object is not clipped" }
|
||||||
|
if { [vreadpixel 300 200 rgb name] != "GOLDENROD1" } { puts "Error: object should NOT be selected" }
|
||||||
|
|
||||||
|
vdump $imagedir/${casename}.png
|
Loading…
x
Reference in New Issue
Block a user