0023970: Ignore dot-paths when searching for data files
[occt.git] / src / DrawResources / SCAN.tcl
1 # Copyright (c) 1999-2012 OPEN CASCADE SAS
2 #
3 # The content of this file is subject to the Open CASCADE Technology Public
4 # License Version 6.5 (the "License"). You may not use the content of this file
5 # except in compliance with the License. Please obtain a copy of the License
6 # at http://www.opencascade.org and read it completely before using this file.
7 #
8 # The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 # main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
10 #
11 # The Original Code and all software distributed under the License is
12 # distributed on an "AS IS" basis, without warranty of any kind, and the
13 # Initial Developer hereby disclaims all such warranties, including without
14 # limitation, any warranties of merchantability, fitness for a particular
15 # purpose or non-infringement. Please see the License for the specific terms
16 # and conditions governing the rights and limitations under the License.
17
18 proc 2dscan {} {
19     dtyp .
20     set name [lastrep id x y MOUSEbutton]
21     global $name
22     lastrep id x1 y1 z1 MOUSEbutton
23     dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
24     erase $name
25     draw id 6 $name
26     while {[dval MOUSEbutton] == 0} {
27         pick id x2 y2 z2 MOUSEbutton nowait
28         dset dx x2-x1 dy y2-y1 dz z2-z1  x1 x2  y1 y2  z1 z2
29         draw id 6 $name
30         2dtranslate $name dx dy
31         draw id 6 $name
32     }
33     draw id 6 $name
34     if {[dval MOUSEbutton] == 1} { display $name; return; }
35     dset dx x0-x2 dy y0-y2 dz z0-z2
36     2dtranslate $name dx dy
37     display $name
38 }
39
40 proc scan {} {
41     dtyp .
42     set name [lastrep id x y MOUSEbutton]
43     global $name
44     lastrep id x1 y1 z1 MOUSEbutton
45     dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
46     erase $name
47     draw id 6 $name
48     while {[dval MOUSEbutton] == 0} {
49         pick id x2 y2 z2 MOUSEbutton nowait
50         dset dx x2-x1 dy y2-y1 dz z2-z1  x1 x2  y1 y2  z1 z2
51         draw id 6 $name
52         translate $name dx dy dz
53         draw id 6 $name
54     }
55     draw id 6 $name
56     if {[dval MOUSEbutton] == 1} { display $name; return; }
57     dset dx x0-x2 dy y0-y2 dz z0-z2
58     translate $name dx dy dz
59     display $name
60 }
61
62 proc scanx {} {
63     dtyp .
64     set name [lastrep id x y MOUSEbutton]
65     global $name
66     lastrep id x1 y1 z1 MOUSEbutton
67     dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
68     erase $name
69     draw id 6 $name
70     while {[dval MOUSEbutton] == 0} {
71         pick id x2 y2 z2 MOUSEbutton nowait
72         dset dx x2-x1 x1 x2
73         draw id 6 $name
74         translate $name dx 0 0
75         draw id 6 $name
76     }
77     draw id 6 $name
78     if {[dval MOUSEbutton] == 1} {display $name; return;}
79     dset dx x0-x2 
80     translate $name dx 0 0
81     display $name
82 }
83
84 proc scany {} {
85     dtyp .
86     set name [lastrep id x y MOUSEbutton]
87     global $name
88     lastrep id x1 y1 z1 MOUSEbutton
89     dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
90     erase $name
91     draw id 6 $name
92     while {[dval MOUSEbutton] == 0} {
93         pick id x2 y2 z2 MOUSEbutton nowait
94         dset dy y2-y1 y1 y2
95         draw id 6 $name
96         translate $name 0 dy 0
97         draw id 6 $name
98     }
99     draw id 6 $name
100     if {[dval MOUSEbutton] == 1} { display $name; return;}
101     dset dy y0-y2
102     translate $name 0 dy 0
103     display $name
104 }
105
106 proc scanz {} {
107     dtyp .
108     set name [lastrep id x y MOUSEbutton]
109     global $name
110     lastrep id x1 y1 z1 MOUSEbutton
111     dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
112     erase $name
113     draw id 6 $name
114     while {[dval MOUSEbutton] == 0} {
115         pick id x2 y2 z2 MOUSEbutton nowait
116         dset dz z2-z1 z1 z2
117         draw id 6 $name
118         translate $name 0 0 dz
119         draw id 6 $name
120     }
121     draw id 6 $name
122     if {[dval MOUSEbutton] == 1} { display $name; return;}
123     dset dz z0-z2
124     translate $name 0 0 dz
125     display $name
126 }
127
128 proc tscan {} {
129     dtyp .
130     set name [lastrep id x y MOUSEbutton]
131     global $name
132     lastrep id x1 y1 z1 MOUSEbutton
133     dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
134     while {[dval MOUSEbutton] == 0} {
135         pick id x2 y2 z2 MOUSEbutton nowait
136         dset dx x2-x0 dy y2-y0 dz z2-z0
137         eval ttranslate [explode $name e] dx dy dz
138         repaint
139     }
140     if {[dval MOUSEbutton] == 3} return;
141     dset dx x2-x0 dy y2-y0 dz z2-z0
142     ttranslate $name dx dy dz
143 }
144
145 proc tscanx {} {
146     dtyp .
147     set name [lastrep id x y MOUSEbutton]
148     global $name
149     lastrep id x1 y1 z1 MOUSEbutton
150     dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
151     while {[dval MOUSEbutton] == 0} {
152         pick id x2 y2 z2 MOUSEbutton nowait
153         dset dx x2-x0
154         eval ttranslate [explode $name e] dx 0 0
155         repaint
156     }
157     if {[dval MOUSEbutton] == 3} return;
158     dset dx x2-x0 
159     ttranslate $name dx 0 0
160 }
161
162 proc tscany {} {
163     dtyp .
164     set name [lastrep id x y MOUSEbutton]
165     global $name
166     lastrep id x1 y1 z1 MOUSEbutton
167     dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
168     while {[dval MOUSEbutton] == 0} {
169         pick id x2 y2 z2 MOUSEbutton nowait
170         dset dy y2-y0
171         eval ttranslate [explode $name e] 0 dy 0
172         repaint
173     }
174     if {[dval MOUSEbutton] == 3} return;
175     dset dy y2-y0
176     ttranslate $name 0 dy 0
177 }
178
179 proc tscanz {} {
180     dtyp .
181     set name [lastrep id x y MOUSEbutton]
182     global $name
183     lastrep id x1 y1 z1 MOUSEbutton
184     dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
185     while {[dval MOUSEbutton] == 0} {
186         pick id x2 y2 z2 MOUSEbutton nowait
187         dset dz z2-z0
188         eval ttranslate [explode $name e] 0 0 dz
189         repaint
190     }
191     if {[dval MOUSEbutton] == 3} return;
192     dset dz z2-z0
193     ttranslate $name 0 0 dz
194 }
195
196