0030523: Visualization - Highlighting does not work anymore
[occt.git] / tests / v3d / manipulator / translate
CommitLineData
625e1958 1puts "====================================="
2puts "AIS_Manipulator - translate 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 5 10
16pcylinder c2 10 20
17ttranslate c1 100 0 20
18ttranslate c2 100 0 0
19trotate c1 100 0 25 0 1 0 90
20trotate c1 100 0 25 0 0 1 10
21
22# -------------------------------------
23# display manipulated objects (scene 1)
24# -------------------------------------
25
26vdisplay c1
27vdisplay c2
28vsetdispmode 1
29vaxo
30vfit
31
32# ------------------
33# attach manipulator
34# ------------------
35
91d96372 36vmanipulator m -attach c1 -adjustPosition 1 -adjustSize 0 -enableModes 1 -size 40
625e1958 37vmanipulator m -followRotation 1
38vmanipulator m -followTranslation 1
f522ce50 39vmanipulator m -part 0 4 0
40vmanipulator m -part 1 4 0
41vmanipulator m -part 2 4 0
625e1958 42
43# ----------------------------------------------------
44# test x translation transform (world reference frame)
45# ----------------------------------------------------
46
47set mouse_pick {204 112}
48set mouse_drag {204 156}
49
50vmoveto {*}$mouse_pick
51vselect {*}$mouse_pick
52vmanipulator m -startTransform {*}$mouse_pick
53vmanipulator m -transform {*}$mouse_drag
54vmanipulator m -stopTransform
55vselect 0 0
56vmoveto {*}$mouse_drag
57vdump $anImage1
58
59# ----------------------------------------------------
60# test y translation transform (world reference frame)
61# ----------------------------------------------------
62
63set mouse_pick {215 160}
64set mouse_drag {265 132}
65
66vmoveto {*}$mouse_pick
67vselect {*}$mouse_pick
68vmanipulator m -startTransform {*}$mouse_pick
69vmanipulator m -transform {*}$mouse_drag
70vmanipulator m -stopTransform
71vselect 0 0
72vmoveto {*}$mouse_drag
73vdump $anImage2
74
75# ----------------------------------------------------
76# test z translation transform (world reference frame)
77# ----------------------------------------------------
78
79set mouse_pick {263 145}
80set mouse_drag {127 065}
81
82vmoveto {*}$mouse_pick
83vselect {*}$mouse_pick
84vmanipulator m -startTransform {*}$mouse_pick
85vmanipulator m -transform {*}$mouse_drag
86vmanipulator m -stopTransform
87vselect 0 0
88vmoveto {*}$mouse_drag
89vdump $anImage3
90
91# -------------------------------------
92# display manipulated objects (scene 2)
93# -------------------------------------
94
95vremove -all
96vdisplay c1
97vdisplay c2
98vsetdispmode 1
99vaxo
100vfit
101
102# -------------------------------------------
103# attach manipulator and rotate around z axis
104# -------------------------------------------
105
91d96372 106vmanipulator m -attach c1 -adjustPosition 1 -adjustSize 0 -enableModes 1 -size 40
625e1958 107vmanipulator m -followRotation 1
108vmanipulator m -followTranslation 1
f522ce50 109vmanipulator m -part 0 4 0
110vmanipulator m -part 1 4 0
111vmanipulator m -part 2 4 0
625e1958 112
113set mouse_pick {223 143}
114set mouse_drag {181 141}
115
116vmoveto {*}$mouse_pick
117vselect {*}$mouse_pick
118vmanipulator m -startTransform {*}$mouse_pick
119vmanipulator m -transform {*}$mouse_drag
120vmanipulator m -stopTransform
121vselect 0 0
122vmoveto {*}$mouse_drag
123
124# ----------------------------------------------------
125# test x translation transform (object reference frame)
126# ----------------------------------------------------
127
128set mouse_pick {199 131}
129set mouse_drag {175 168}
130
131vmoveto {*}$mouse_pick
132vselect {*}$mouse_pick
133vmanipulator m -startTransform {*}$mouse_pick
134vmanipulator m -transform {*}$mouse_drag
135vmanipulator m -stopTransform
136vselect 0 0
137vmoveto {*}$mouse_drag
138vdump $anImage4
139
140# ----------------------------------------------------
141# test y translation transform (object reference frame)
142# ----------------------------------------------------
143
144set mouse_pick {199 164}
145set mouse_drag {246 177}
146
147vmoveto {*}$mouse_pick
148vselect {*}$mouse_pick
149vmanipulator m -startTransform {*}$mouse_pick
150vmanipulator m -transform {*}$mouse_drag
151vmanipulator m -stopTransform
152vselect 0 0
153vmoveto {*}$mouse_drag
154vdump $anImage5
155
156set to_dump_screen 0