625e1958 |
1 | puts "===============================================" |
2 | puts "AIS_Manipulator - check zoom persistence option" |
3 | puts "===============================================" |
4 | |
5 | set anImage1 $imagedir/${casename}_1.png |
6 | set anImage2 $imagedir/${casename}_2.png |
7 | set anImage3 $imagedir/${casename}_3.png |
8 | set anImage4 $imagedir/${casename}_4.png |
9 | set anImage5 $imagedir/${casename}_5.png |
10 | set anImage6 $imagedir/${casename}_6.png |
11 | |
12 | # ------------------------------------- |
13 | # create manipulated and helper objects |
14 | # ------------------------------------- |
15 | |
16 | box b1 0 0 0 20 20 20 |
17 | box b2 80 0 0 20 20 20 |
18 | vdisplay b1 |
19 | vdisplay b2 |
20 | vtrihedron tri |
21 | vsetdispmode 1 |
22 | vaxo |
23 | vfit |
24 | |
25 | # -------------------------------------------------------- |
26 | # create and test non-zoom persistent manipulator (test 1) |
27 | # -------------------------------------------------------- |
28 | |
29 | vmanipulator m1 -attach b1 -adjustPosition 1 -adjustSize 1 -enableModes 1 -zoomable 1 |
30 | |
31 | set mouse_pick_1 {84 135} |
32 | set mouse_pick_2 {29 103} |
33 | set mouse_pick_3 {29 103} |
34 | set mouse_drag_3 {121 126} |
35 | |
36 | # pick at default zoom |
37 | vmoveto 0 0 |
38 | vmoveto {*}$mouse_pick_1 |
39 | vdump $anImage1 |
40 | |
41 | # pick at changed zoom |
42 | vzoom 1.5 |
43 | vmoveto 0 0 |
44 | vmoveto {*}$mouse_pick_2 |
45 | vdump $anImage2 |
46 | |
47 | # drag object |
48 | vselect {*}$mouse_pick_3 |
49 | vmanipulator m1 -startTransform {*}$mouse_pick_3 |
50 | vmanipulator m1 -transform {*}$mouse_drag_3 |
51 | vmanipulator m1 -stopTransform |
52 | vselect 0 0 |
53 | vdump $anImage3 |
54 | |
55 | # ---------------------------------------------------- |
56 | # create and test zoom persistent manipulator (test 2) |
57 | # ---------------------------------------------------- |
58 | |
59 | vfit |
60 | |
91d96372 |
61 | vmanipulator m2 -attach b2 -adjustPosition 1 -adjustSize 0 -enableModes 1 -zoomable 0 -size 40 |
625e1958 |
62 | |
63 | set mouse_pick_1 {341 283} |
64 | set mouse_pick_2 {277 246} |
65 | set mouse_pick_3 {277 246} |
66 | set mouse_drag_3 {210 210} |
67 | |
68 | # pick at default zoom |
69 | vmoveto 0 0 |
70 | vmoveto {*}$mouse_pick_1 |
71 | vdump $anImage4 |
72 | |
73 | # pick at changed zoom |
74 | vzoom 0.5 |
75 | vmoveto 0 0 |
76 | vmoveto {*}$mouse_pick_2 |
77 | vdump $anImage5 |
78 | |
79 | # drag object |
80 | vselect {*}$mouse_pick_3 |
81 | vmanipulator m2 -startTransform {*}$mouse_pick_3 |
82 | vmanipulator m2 -transform {*}$mouse_drag_3 |
83 | vmanipulator m2 -stopTransform |
84 | vselect 0 0 |
85 | vdump $anImage6 |
86 | |
87 | set to_dump_screen 0 |