0032155: Tests - remove broken command OCC280
[occt.git] / tests / bugs / vis / bug24307_1
CommitLineData
b7cd4ba7 1puts "========"
2puts "OCC24307 Objects clipping algorithm using BVH performance test: Solid spheres test"
3puts "========"
4
5# define objects' location parameters and their characteristics
6set SPHERES_NUM 10
7set SPERE_RADIUS 100
8set SPHERE_FINENESS 10
9set PERCENT_OF_INNER_SPHERES 30
10
11# window parameters
12set SMALL_WIN_WIDTH 512
13set SMALL_WIN_HEIGHT 512
14
15# other
16array set aSphereNames {}
17
b7cd4ba7 18pload VISUALIZATION MODELING
15669413 19vclear
b7cd4ba7 20vinit name=small_wnd l=32 t=32 w=$SMALL_WIN_WIDTH h=$SMALL_WIN_HEIGHT
21vactivate small_wnd
15669413 22vrenderparams -perfUpdateInterval 0
0e3025bc 23vrenderparams -frustumculling off
b7cd4ba7 24vautozfit 0
25vviewparams -scale 1.953125 -eye 0.57735026918962573 -0.57735026918962573 0.57735026918962573
26vzrange 1 512
b7cd4ba7 27vremove -all -noinfo
28
29puts [vdrawsphere tmp_sph $SPHERE_FINENESS]
30vremove -noinfo tmp_sph
31
32set aInnerSpheresNum [expr $SPHERES_NUM * $PERCENT_OF_INNER_SPHERES / 100]
33puts ""
34set aDebugInfo "Total number of visible objects: "
35append aDebugInfo $aInnerSpheresNum
36puts $aDebugInfo
37puts ""
38
39puts "Start displaying spheres without clipping..."
40set aInnerWidthStep [expr $SMALL_WIN_WIDTH / ($aInnerSpheresNum + 1)]
41set aInnerHeightStep [expr $SMALL_WIN_HEIGHT / ($aInnerSpheresNum + 1)]
42set aOuterStep [expr $SPERE_RADIUS * 3 / ($SPHERES_NUM - $aInnerSpheresNum + 1)]
43for {set i 0} {$i < $aInnerSpheresNum} {incr i} {
44 set aCurrName "inner_sph"
45 append aCurrName $i
46 set aX [expr - $SMALL_WIN_WIDTH / 2 + ($i + 1) * $aInnerWidthStep ]
47 set aY [expr - $SMALL_WIN_HEIGHT / 2 + ($i + 1) * $aInnerHeightStep ]
48 vdrawsphere $aCurrName $SPHERE_FINENESS $aX $aY 0 $SPERE_RADIUS 0 0
49 set aSphereNames($i) $aCurrName
50}
51for {set i $aInnerSpheresNum} {$i < $SPHERES_NUM} {incr i} {
52 set aCurrName "outer_sph"
53 append aCurrName $i
54 set aX [expr - $SMALL_WIN_WIDTH - $SPERE_RADIUS * 3 + ($i - $aInnerSpheresNum + 1) * $aOuterStep ]
55 set aY [expr - $SMALL_WIN_HEIGHT - $SPERE_RADIUS * 3 + ($i - $aInnerSpheresNum + 1) * $aOuterStep ]
56 vdrawsphere $aCurrName $SPHERE_FINENESS $aX $aY 0 $SPERE_RADIUS 0 0
57 set aSphereNames($i) $aCurrName
58}
59puts [vfps]
15669413 60vrenderparams -perfCounters none
61vdump $imagedir/${casename}_cull_off_ref.png
62vrenderparams -perfCounters verbose|nofps|nocpu
63vdump $imagedir/${casename}_cull_off.png
b7cd4ba7 64puts "All spheres were displayed."
65puts ""
66
67verase
68
69puts "Start displaying spheres with clipping..."
0e3025bc 70vrenderparams -frustumculling on
b7cd4ba7 71vdisplayall
72puts [vfps]
15669413 73vrenderparams -perfCounters none
74vdump $imagedir/${casename}_cull_on_ref.png
75vrenderparams -perfCounters verbose|nofps|nocpu
76vdump $imagedir/${casename}_cull_on.png
b7cd4ba7 77puts "All spheres were displayed."
78puts ""
79
15669413 80set aDiffImageResult [diffimage $imagedir/${casename}_cull_on_ref.png $imagedir/${casename}_cull_off_ref.png 0.1 0 0 $imagedir/${casename}_diff.png]
b7cd4ba7 81if {$aDiffImageResult != 0} {
82 puts "ERROR : Test failed: there is a difference between images rendered with and without clipping"
83}