Warnings on vc14 were eliminated
[occt.git] / src / DrawResources / Geometry.tcl
1 # Copyright (c) 1999-2014 OPEN CASCADE SAS
2 #
3 # This file is part of Open CASCADE Technology software library.
4 #
5 # This library is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU Lesser General Public License version 2.1 as published
7 # by the Free Software Foundation, with special exception defined in the file
8 # OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 # distribution for complete text of the license and disclaimer of any warranty.
10 #
11 # Alternatively, this file may be used under the terms of Open CASCADE
12 # commercial license or contractual agreement.
13
14 proc cmp {} {
15     dtyp .
16     set name [lastrep id x y b]
17     global $name
18     lastrep id x1 y1 z1 b
19     cfindp $name id x y pole
20     if {[dval pole] == 0} return
21     dset x0 x1 y0 y1 z0 z1 b 0
22     draw id 6 $name
23     while {[dval b] == 0} {
24         pick id x2 y2 z2 b nowait
25         dset dx x2-x1 dy y2-y1 dz z2-z1  x1 x2  y1 y2  z1 z2
26         draw id 6 $name
27         cmovep $name pole dx dy dz
28         draw id 6 $name
29     }
30     draw id 6 $name
31     if {[dval b] == 1} return;
32     dset dx x0-x2 dy y0-y2 dz z0-z2
33     cmovep $name pole dx dy dz
34 }
35
36 proc smp {} {
37     dtyp .
38     set name [lastrep id x y b]
39     global $name
40     lastrep id x1 y1 z1 b
41     sfindp $name id x y upole vpole
42     if {[dval upole] == 0} return
43     dset x0 x1 y0 y1 z0 z1 b 0
44     draw id 6 $name
45     while { [dval b] == 0} {
46         pick id x2 y2 z2 b nowait
47         dset dx x2-x1  dy y2-y1  dz z2-z1 x1 x2 y1 y2 z1 z2
48         draw id 6 $name
49         movep $name upole vpole dx dy dz
50         draw id 6 $name
51     }
52     draw id 6 $name
53     if {[dval b] == 1} return
54     dset dx x0-x2  dy y0-y2  dz z0-z2
55     movep $name upole vpole dx dy dz
56 }
57
58 #################################################
59 # smooth
60 #################################################
61
62 help smooth {smooth  cname tol [filename] } "DRAW Variables management"
63
64 proc smooth {name tol {file ""}} {
65     if {$file == ""} {
66         uplevel #0 "bsmooth $name $tol"
67     } else {
68         global Draw_DataDir
69         uplevel #0 "bsmooth $name $tol $Draw_DataDir/$file"
70     }
71     return $name
72 }
73
74 #################################################
75 # beziersmooth
76 #################################################
77
78 help beziersmooth { beziersmooth  cname tol deg [-GR -VA -PR] [filename] } "DRAW Variables management"
79
80 proc beziersmooth {name tol deg option {file ""}} {
81     if {$file == ""} {
82         uplevel #0 "bzsmooth $name $tol $deg $option"
83     } else {
84         global Draw_DataDir
85         uplevel #0 "bzsmooth $name $tol  $deg $option $Draw_DataDir/$file"
86     }
87     return $name
88 }
89
90 help pickf {name : extract picked with mouse face as a new variable\
91 } {DRAW Variables management}
92
93 proc pickf {name} {
94     global $name
95     eval renamevar "[pickface]" $name
96 }