7c15f86d35e3c9483cf156c934f2244a18de8980
[occt.git] / tests / bugs / vis / bug26304
1 puts "============"
2 puts "CR26304"
3 puts "============"
4 puts ""
5
6 ##########################################################################################
7 puts "Visualization - wrong calculation of point in SelectMgr_RectangularFrustum::DetectedPoint"
8 ##########################################################################################
9
10 proc findPoint {theInfoString} {
11   puts $theInfoString
12   set aStringArr [split $theInfoString " "]
13   set aSize [llength $aStringArr]
14   for {set aIdx 0} {$aIdx < $aSize} {incr aIdx} {
15     set aItem [lindex $theInfoString $aIdx]
16     if {[string compare $aItem "Point:"] == 0} {
17         set aX [string trim [lindex $theInfoString [expr $aIdx + 1]]]
18         set aY [string trim [lindex $theInfoString [expr $aIdx + 2]]]
19         set aZ [string trim [lindex $theInfoString [expr $aIdx + 3]]]
20         return [list $aX $aY $aZ]
21       }
22     }
23 }
24
25 pload VISUALIZATION MODELING
26
27 vinit View1
28 vsetdispmode 1
29 box b 100 100 100
30 vdisplay b
31 vfit
32 vselect 48 258
33
34 set anOut [split [vstate -entities] "\n"]
35 set aPnt [findPoint [lindex $anOut 1]]
36 vpoint p {*}$aPnt
37 vfit
38
39 vviewparams -scale 22.3 -proj 0.576 -0.78 0.24 -up -0.21 0.136 0.967
40 vviewparams -at 10.887 16.807 36.2306 -eye 111.071 -118.34 77.44
41
42 if {[vreadpixel 103 293 name] != "YELLOW 1"} {
43   puts "ERROR: Wrong point calculated"
44 }
45
46 vdump ${imagedir}/${casename}.png