625e1958 |
1 | puts "=================================" |
2 | puts "AIS_Manipulator - scale an object" |
3 | puts "=================================" |
4 | |
0d828ac8 |
5 | pload MODELING VISUALIZATION |
6 | |
625e1958 |
7 | set anImage1 $imagedir/${casename}_1.png |
8 | set anImage2 $imagedir/${casename}_2.png |
9 | |
10 | # ------------------------------------- |
11 | # create manipulated and helper objects |
12 | # ------------------------------------- |
13 | |
14 | pcylinder c1_1 5 10 |
15 | pcylinder c1_2 3 10 |
16 | pcylinder c2 10 20 |
17 | ttranslate c1_1 100 0 20 |
18 | ttranslate c1_2 100 0 20 |
19 | trotate c1_2 100 0 25 0 1 0 90 |
20 | trotate c1_2 100 0 25 0 0 1 10 |
21 | ttranslate c2 100 0 0 |
22 | |
23 | compound c1_1 c1_2 c1 |
24 | |
25 | # ------------------------------------ |
26 | # display manipulated objects (test 1) |
27 | # ------------------------------------ |
28 | |
29 | vdisplay c1 |
30 | vdisplay c2 |
31 | vsetdispmode 1 |
32 | vaxo |
33 | vfit |
34 | |
35 | # ------------------ |
36 | # attach manipulator |
37 | # ------------------ |
38 | |
91d96372 |
39 | vmanipulator m -attach c1 -adjustPosition 1 -adjustSize 0 -enableModes 1 -size 40 |
625e1958 |
40 | |
41 | # -------------------------- |
7b5e532f |
42 | # test highlight and detection |
625e1958 |
43 | # -------------------------- |
44 | |
e2409d34 |
45 | set mouse_pick {229 141} |
625e1958 |
46 | |
47 | vmoveto {*}$mouse_pick |
48 | vdump $anImage1 |
49 | |
50 | # ------------------------- |
51 | # test scaling of an object |
52 | # ------------------------- |
53 | |
e2409d34 |
54 | set mouse_pick {229 141} |
55 | set mouse_drag {210 129} |
625e1958 |
56 | |
57 | vmoveto {*}$mouse_pick |
58 | vselect {*}$mouse_pick |
59 | vmanipulator m -startTransform {*}$mouse_pick |
60 | vmanipulator m -transform {*}$mouse_drag |
61 | vmanipulator m -stopTransform |
62 | vselect 0 0 |
63 | vdump $anImage2 |