0026833: Create command checkview containing all viewer types
[occt.git] / tests / bugs / vis / bug25723
1 puts "============"
2 puts "OCC25723"
3 puts "Calculate the center of rotation taking into account structure visibility"
4 puts "============"
5 puts ""
6
7 set x_start_sel_coord 100
8 set y_start_sel_coord 104
9
10 set x_end_sel_coord 400
11 set y_end_sel_coord 400
12
13 set x_mouse_start_coord 100
14 set y_mouse_start_coord 100
15
16 set x_mouse_move_coord 300
17 set y_mouse_move_coord 300
18
19 set x_check_coord 220
20 set y_check_coord 50
21
22 box b1 0 0   0 10 10 10
23 box b2 0 0  20 10 10 10
24 box b3 0 0 -20 10 10 10
25 box b4 0 0  40 10 10 10
26
27 vinit View1
28 vclear
29 vaxo
30 vsetdispmode 1
31
32 # turn on solid selection
33 vselmode 6 1
34 vdisplay b1 b2 b3 b4
35 vfit
36
37 # select solid
38 vselect ${x_start_sel_coord} ${y_start_sel_coord} ${x_end_sel_coord} ${y_end_sel_coord}
39
40 # hide selected solids
41 verase
42
43 # rotation
44 vrotate -mouseStart ${x_mouse_start_coord} ${y_mouse_start_coord} -mouseMove ${x_mouse_move_coord} ${y_mouse_move_coord}
45
46 if {"[vreadpixel ${x_check_coord} ${y_check_coord} rgb name]" != "GOLDENROD2"} {
47   puts "Error: Rotation is not correct"
48 }
49
50 checkview -screenshot -3d -path ${imagedir}/${test_image}.png