0028762: Visualization, Ray tracing - Implement depth-of-field effect
[occt.git] / tests / v3d / manipulator / rotate
CommitLineData
625e1958 1puts "=================================="
2puts "AIS_Manipulator - rotate an object"
3puts "=================================="
4
5set anImage1 $imagedir/${casename}_1.png
6set anImage2 $imagedir/${casename}_2.png
7set anImage3 $imagedir/${casename}_3.png
8set anImage4 $imagedir/${casename}_4.png
9set anImage5 $imagedir/${casename}_5.png
10
11# -------------------------------------
12# create manipulated and helper objects
13# -------------------------------------
14
15pcylinder c1_1 5 10
16pcylinder c1_2 3 10
17pcylinder c2 10 20
18ttranslate c1_1 100 0 20
19ttranslate c1_2 100 0 20
20trotate c1_2 100 0 25 0 1 0 90
21trotate c1_2 100 0 25 0 0 1 10
22ttranslate c2 100 0 0
23
24compound c1_1 c1_2 c1
25
26# ------------------------------------
27# display manipulated objects (test 1)
28# ------------------------------------
29
30vdisplay c1
31vdisplay c2
32vsetdispmode 1
33vaxo
34vfit
35
36# ------------------
37# attach manipulator
38# ------------------
39
91d96372 40vmanipulator m -attach c1 -adjustPosition 1 -adjustSize 0 -enableModes 1 -size 40
625e1958 41
42# ----------------------------------------------------
43# test rotation around x axis (object reference frame)
44# ----------------------------------------------------
45
46vmanipulator m -followRotation 1
47
48set mouse_pick {201 092}
49set mouse_drag {176 142}
50
51vmoveto {*}$mouse_pick
52vselect {*}$mouse_pick
53vmanipulator m -startTransform {*}$mouse_pick
54vmanipulator m -transform {*}$mouse_drag
55vmanipulator m -stopTransform
56vselect 0 0
57vmoveto {*}$mouse_drag
58vdump $anImage1
59
60# ----------------------------------------------------
61# test rotation around y axis (object reference frame)
62# ----------------------------------------------------
63
64vmanipulator m -followRotation 1
65
66set mouse_pick {173 137}
67set mouse_drag {233 140}
68
69vmoveto {*}$mouse_pick
70vselect {*}$mouse_pick
71vmanipulator m -startTransform {*}$mouse_pick
72vmanipulator m -transform {*}$mouse_drag
73vmanipulator m -stopTransform
74vselect 0 0
75vmoveto {*}$mouse_drag
76vdump $anImage2
77
78# ----------------------------------------------------
79# test rotation around z axis (object reference frame)
80# ----------------------------------------------------
81
82vmanipulator m -followRotation 1
83
84set mouse_pick {200 094}
85set mouse_drag {182 117}
86
87vmoveto {*}$mouse_pick
88vselect {*}$mouse_pick
89vmanipulator m -startTransform {*}$mouse_pick
90vmanipulator m -transform {*}$mouse_drag
91vmanipulator m -stopTransform
92vselect 0 0
93vmoveto {*}$mouse_drag
94vdump $anImage3
95
96# ------------------------------------
97# display manipulated objects (test 2)
98# ------------------------------------
99
100vremove -all
101vdisplay c1
102vdisplay c2
103vsetdispmode 1
104vaxo
105vfit
106
91d96372 107vmanipulator m -attach c1 -adjustPosition 1 -adjustSize 0 -enableModes 1 -size 40
625e1958 108vmanipulator m -followRotation 0
109
110# ---------------------------------------------------
111# test rotation around y axis (world reference frame)
112# ---------------------------------------------------
113
114set mouse_pick {211 095}
115set mouse_drag {230 127}
116
117vmoveto {*}$mouse_pick
118vselect {*}$mouse_pick
119vmanipulator m -startTransform {*}$mouse_pick
120vmanipulator m -transform {*}$mouse_drag
121vmanipulator m -stopTransform
122vselect 0 0
123vmoveto {*}$mouse_drag
124vdump $anImage4
125
126# ---------------------------------------------------
127# test rotation around z axis (world reference frame)
128# ---------------------------------------------------
129
130set mouse_pick {225 143}
131set mouse_drag {184 143}
132
133vmoveto {*}$mouse_pick
134vselect {*}$mouse_pick
135vmanipulator m -startTransform {*}$mouse_pick
136vmanipulator m -transform {*}$mouse_drag
137vmanipulator m -stopTransform
138vselect 0 0
139vmoveto {*}$mouse_drag
140vdump $anImage5
141
142set to_dump_screen 0