SCAN.tcl 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. proc 2dscan {} {
  14. dtyp .
  15. set name [lastrep id x y MOUSEbutton]
  16. global $name
  17. lastrep id x1 y1 z1 MOUSEbutton
  18. dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
  19. erase $name
  20. draw id 6 $name
  21. while {[dval MOUSEbutton] == 0} {
  22. pick id x2 y2 z2 MOUSEbutton nowait
  23. dset dx x2-x1 dy y2-y1 dz z2-z1 x1 x2 y1 y2 z1 z2
  24. draw id 6 $name
  25. 2dtranslate $name dx dy
  26. draw id 6 $name
  27. }
  28. draw id 6 $name
  29. if {[dval MOUSEbutton] == 1} { display $name; return; }
  30. dset dx x0-x2 dy y0-y2 dz z0-z2
  31. 2dtranslate $name dx dy
  32. display $name
  33. }
  34. proc scan {} {
  35. dtyp .
  36. set name [lastrep id x y MOUSEbutton]
  37. global $name
  38. lastrep id x1 y1 z1 MOUSEbutton
  39. dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
  40. erase $name
  41. draw id 6 $name
  42. while {[dval MOUSEbutton] == 0} {
  43. pick id x2 y2 z2 MOUSEbutton nowait
  44. dset dx x2-x1 dy y2-y1 dz z2-z1 x1 x2 y1 y2 z1 z2
  45. draw id 6 $name
  46. translate $name dx dy dz
  47. draw id 6 $name
  48. }
  49. draw id 6 $name
  50. if {[dval MOUSEbutton] == 1} { display $name; return; }
  51. dset dx x0-x2 dy y0-y2 dz z0-z2
  52. translate $name dx dy dz
  53. display $name
  54. }
  55. proc scanx {} {
  56. dtyp .
  57. set name [lastrep id x y MOUSEbutton]
  58. global $name
  59. lastrep id x1 y1 z1 MOUSEbutton
  60. dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
  61. erase $name
  62. draw id 6 $name
  63. while {[dval MOUSEbutton] == 0} {
  64. pick id x2 y2 z2 MOUSEbutton nowait
  65. dset dx x2-x1 x1 x2
  66. draw id 6 $name
  67. translate $name dx 0 0
  68. draw id 6 $name
  69. }
  70. draw id 6 $name
  71. if {[dval MOUSEbutton] == 1} {display $name; return;}
  72. dset dx x0-x2
  73. translate $name dx 0 0
  74. display $name
  75. }
  76. proc scany {} {
  77. dtyp .
  78. set name [lastrep id x y MOUSEbutton]
  79. global $name
  80. lastrep id x1 y1 z1 MOUSEbutton
  81. dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
  82. erase $name
  83. draw id 6 $name
  84. while {[dval MOUSEbutton] == 0} {
  85. pick id x2 y2 z2 MOUSEbutton nowait
  86. dset dy y2-y1 y1 y2
  87. draw id 6 $name
  88. translate $name 0 dy 0
  89. draw id 6 $name
  90. }
  91. draw id 6 $name
  92. if {[dval MOUSEbutton] == 1} { display $name; return;}
  93. dset dy y0-y2
  94. translate $name 0 dy 0
  95. display $name
  96. }
  97. proc scanz {} {
  98. dtyp .
  99. set name [lastrep id x y MOUSEbutton]
  100. global $name
  101. lastrep id x1 y1 z1 MOUSEbutton
  102. dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
  103. erase $name
  104. draw id 6 $name
  105. while {[dval MOUSEbutton] == 0} {
  106. pick id x2 y2 z2 MOUSEbutton nowait
  107. dset dz z2-z1 z1 z2
  108. draw id 6 $name
  109. translate $name 0 0 dz
  110. draw id 6 $name
  111. }
  112. draw id 6 $name
  113. if {[dval MOUSEbutton] == 1} { display $name; return;}
  114. dset dz z0-z2
  115. translate $name 0 0 dz
  116. display $name
  117. }
  118. proc tscan {} {
  119. dtyp .
  120. set name [lastrep id x y MOUSEbutton]
  121. global $name
  122. lastrep id x1 y1 z1 MOUSEbutton
  123. dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
  124. while {[dval MOUSEbutton] == 0} {
  125. pick id x2 y2 z2 MOUSEbutton nowait
  126. dset dx x2-x0 dy y2-y0 dz z2-z0
  127. eval ttranslate [explode $name e] dx dy dz
  128. repaint
  129. }
  130. if {[dval MOUSEbutton] == 3} return;
  131. dset dx x2-x0 dy y2-y0 dz z2-z0
  132. ttranslate $name dx dy dz
  133. }
  134. proc tscanx {} {
  135. dtyp .
  136. set name [lastrep id x y MOUSEbutton]
  137. global $name
  138. lastrep id x1 y1 z1 MOUSEbutton
  139. dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
  140. while {[dval MOUSEbutton] == 0} {
  141. pick id x2 y2 z2 MOUSEbutton nowait
  142. dset dx x2-x0
  143. eval ttranslate [explode $name e] dx 0 0
  144. repaint
  145. }
  146. if {[dval MOUSEbutton] == 3} return;
  147. dset dx x2-x0
  148. ttranslate $name dx 0 0
  149. }
  150. proc tscany {} {
  151. dtyp .
  152. set name [lastrep id x y MOUSEbutton]
  153. global $name
  154. lastrep id x1 y1 z1 MOUSEbutton
  155. dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
  156. while {[dval MOUSEbutton] == 0} {
  157. pick id x2 y2 z2 MOUSEbutton nowait
  158. dset dy y2-y0
  159. eval ttranslate [explode $name e] 0 dy 0
  160. repaint
  161. }
  162. if {[dval MOUSEbutton] == 3} return;
  163. dset dy y2-y0
  164. ttranslate $name 0 dy 0
  165. }
  166. proc tscanz {} {
  167. dtyp .
  168. set name [lastrep id x y MOUSEbutton]
  169. global $name
  170. lastrep id x1 y1 z1 MOUSEbutton
  171. dset x0 x1 y0 y1 z0 z1 MOUSEbutton 0
  172. while {[dval MOUSEbutton] == 0} {
  173. pick id x2 y2 z2 MOUSEbutton nowait
  174. dset dz z2-z0
  175. eval ttranslate [explode $name e] 0 0 dz
  176. repaint
  177. }
  178. if {[dval MOUSEbutton] == 3} return;
  179. dset dz z2-z0
  180. ttranslate $name 0 0 dz
  181. }