0027536: Visualization - incorrect behavior of zoom persisted objects
[occt.git] / tests / bugs / vis / bug26719_1
1 puts "============"
2 puts "CR26719"
3 puts "============"
4 puts ""
5
6 ##########################################################################################
7 puts "Visualization - cannot pick zoom persistent object"
8 ##########################################################################################
9
10 pload VISUALIZATION MODELING
11
12 vinit
13 vsetdispmode 1
14
15 restore [locate_data_file face1.brep] f
16 vdisplay f
17 box b1 25 25 25
18 vdisplay b1 -trsfPers zoom -trsfPersPos 0 0 0
19
20 vviewparams -scale 588.7 -proj 0.69 -0.64 -0.38
21 vviewparams -up -0.16 -0.32 0.93 -at -0.47 -0.042 0.4
22 vviewparams -eye 0.7 -1.14 -0.17
23
24 # move cursor to the box and check if is highlighted
25 # with dynamic highlight color, check that the face is
26 # not highlighted
27 vmoveto 280 290
28 if {[vreadpixel 297 297 name] != "CYAN1 1"} {
29   puts "ERROR: zoom persistent box is not highlighted dynamically!"
30 }
31 if {[vreadpixel 372 210 name] != "GOLDENROD1 1"} {
32   puts "ERROR: the shape behind zoom persistent object was highlighted instead!"
33 }
34 vdump ${imagedir}/${casename}_1.png
35
36 vmoveto 0 0
37
38 vviewparams -scale 689.79 -proj 0.78 0.63 -0.00067
39 vviewparams -up -0.13 0.16 -0.98 -at -0.36 -0.016 0.31
40 vviewparams -eye 0.96 1.053 0.31
41
42 # check if the depth is calculated correctly on border points
43 # of the objects
44
45 # move to a point on the box and check if it
46 # will be highlighted dynamically
47 vmoveto 264 135
48
49 if {[vreadpixel 275 142 name] != "CYAN1 1"} {
50   puts "ERROR: zoom persistent box is not highlighted dynamically in precision test!"
51 }
52 if {[vreadpixel 243 123 name] != "LIGHTGOLDENROD1 1"} {
53   puts "ERROR: the shape behind zoom persistent object was highlighted instead in precision test!"
54 }
55 vdump ${imagedir}/${casename}_2.png
56 vmoveto 0 0
57
58 # move to a point on the face and check if it
59 # will be highlighted dynamically
60 vmoveto 259 135
61 if {[vreadpixel 275 142 name] != "GOLDENROD3 1"} {
62   puts "ERROR: zoom persistent box is highlighted instead in precision test!"
63 }
64 if {[vreadpixel 243 123 name] != "CYAN1 1"} {
65   puts "ERROR: the shape behind zoom persistent object was not highlighted dynamically in precision test!"
66 }
67 vdump ${imagedir}/${casename}_3.png
68
69 checkview -screenshot -3d -path ${imagedir}/${test_image}.png