Move.tcl 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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. # 02/02/1996 : pbo : creation
  15. # 25/10/1996 : pbo : add 2d view
  16. #
  17. # rotation/panning/zoom with buttons
  18. #
  19. frame .move -relief groove -borderwidth 1
  20. #toplevel .move
  21. frame .move.rotate -borderwidth 1
  22. label .move.rotate.title -text " Rotation "
  23. button .move.rotate.l -text " < " -command {l ; repaint}
  24. button .move.rotate.r -text " > " -command {r ; repaint}
  25. button .move.rotate.u -text " ^ " -command {u ; repaint}
  26. button .move.rotate.d -text " v " -command {d ; repaint}
  27. pack .move.rotate.title -side top
  28. pack .move.rotate.l -side left
  29. pack .move.rotate.r -side right
  30. pack .move.rotate.u -side top
  31. pack .move.rotate.d -side bottom
  32. pack .move.rotate
  33. frame .move.panning -borderwidth 1
  34. label .move.panning.title -text " Panning "
  35. button .move.panning.l -text " < " -command {pl ; 2dpl ; repaint}
  36. button .move.panning.r -text " > " -command {pr ; 2dpr ; repaint}
  37. button .move.panning.u -text " ^ " -command {pu ; 2dpu ; repaint}
  38. button .move.panning.d -text " v " -command {pd ; 2dpd ; repaint}
  39. pack .move.panning.title -side top
  40. pack .move.panning.l -side left
  41. pack .move.panning.r -side right
  42. pack .move.panning.u -side top
  43. pack .move.panning.d -side bottom
  44. pack .move.panning
  45. frame .move.zoom -borderwidth 1
  46. label .move.zoom.title -text " Zoom "
  47. button .move.zoom.mu -text " + " -command {mu ; 2dmu ; repaint}
  48. button .move.zoom.md -text " - " -command {md ; 2dmd ; repaint}
  49. button .move.zoom.fit -text "max" -command {fit ; 2dfit; repaint}
  50. button .move.zoom.w -text "win" -command {wzoom ; repaint}
  51. pack .move.zoom.title -side top
  52. pack .move.zoom.w -side left
  53. pack .move.zoom.fit -side right
  54. pack .move.zoom.mu -side top
  55. pack .move.zoom.md -side bottom
  56. pack .move.zoom
  57. frame .pick -borderwidth 1
  58. label .pick.title -text " Pick "
  59. button .pick.coords -text "Coords" -command {catch {puts [mpick]}}
  60. button .pick.dist -text "Dist" -command {catch {puts [mdist]}}
  61. button .pick.whatis -text "What is" -command {catch {puts [whatis .]}}
  62. button .pick.erase -text "Erase" -command {catch {puts [erase .]}}
  63. pack .pick.title
  64. pack .pick.coords -pady 2 -padx 10
  65. pack .pick.dist -pady 2 -padx 10
  66. pack .pick.whatis -pady 2 -padx 10
  67. pack .pick.erase -pady 2 -padx 10
  68. set ShowExtCommands 0
  69. proc ShowHideExtCommands {} {
  70. global ShowExtCommands
  71. if $ShowExtCommands {
  72. pack .move -pady 1 -padx 1 -side left
  73. pack .pick -pady 1 -padx 1
  74. } else {
  75. pack forget .move .pick
  76. }
  77. }