// =======================================================================
gp_Pnt SelectMgr_RectangularFrustum::DetectedPoint (const Standard_Real theDepth) const
{
- return myNearPickedPnt.XYZ() + myViewRayDir.Normalized().XYZ() * theDepth;
+ return myNearPickedPnt.XYZ() + myViewRayDir.Normalized().XYZ() * theDepth / myScale;
}
// =======================================================================
puts "============"
-puts "CR26304"
+puts "0026304: Visualization - wrong calculation of point in SelectMgr_RectangularFrustum::DetectedPoint"
puts "============"
puts ""
-##########################################################################################
-puts "Visualization - wrong calculation of point in SelectMgr_RectangularFrustum::DetectedPoint"
-##########################################################################################
-
proc findPoint {theInfoString} {
puts $theInfoString
set aStringArr [split $theInfoString " "]
pload VISUALIZATION MODELING
+vclear
vinit View1
-vsetdispmode 1
-box b 100 100 100
-vdisplay b
+box b 100 100 100
+box bz 50 50 50
+vdisplay -dispMode 1 b
vfit
-vselect 48 258
+vdisplay -dispMode 1 -trsfPers zoom -trsfPersPos 0 -10 50 bz
+vaspects bz -setColor GREEN -setTransparency 0.5
-set anOut [split [vstate -entities] "\n"]
-set aPnt [findPoint [lindex $anOut 1]]
-vpoint p {*}$aPnt
-vfit
+vselect 20 200
+set anOut1 [split [vstate -entities] "\n"]
+set aPnt1 [findPoint [lindex $anOut1 1]]
+# expected 4.78109 -10 59.1192
+vpoint p1 {*}$aPnt1
-vviewparams -scale 22.3 -proj 0.576 -0.78 0.24 -up -0.21 0.136 0.967
-vviewparams -at 10.887 16.807 36.2306 -eye 111.071 -118.34 77.44
+vselect 48 258
+set anOut2 [split [vstate -entities] "\n"]
+set aPnt2 [findPoint [lindex $anOut2 1]]
+# expected 10.7493 0 28.4578
+vpoint p {*}$aPnt2
-if {[vreadpixel 103 293 name] != "YELLOW 1"} {
- puts "ERROR: Wrong point calculated"
-}
+vviewparams -scale 22.3 -proj 0.578415 -0.780275 0.237924 -up -0.212025 0.137838 0.967495 -at 10.887 16.807 36.2306
+
+if {[vreadpixel 103 293 rgb name] != "YELLOW"} { puts "ERROR: Wrong point calculated" }
+if {[vreadpixel 29 24 rgb name] != "YELLOW"} { puts "ERROR: Wrong point calculated" }
vdump ${imagedir}/${casename}.png