# # Copyright 2002 (c) Pointwise, Inc. # All rights reserved. # # This sample Gridgen script is not supported by Pointwise, Inc. # It is provided freely for demonstration purposes only. # SEE THE WARRANTY DISCLAIMER AT THE BOTTOM OF THIS FILE. # # Creates a small GUI for principal axis orientations gg::tkLoad # X right, Y up proc cbXY { } { gg::dispViewReset -rotation -pan } # Y right, Z up proc cbYZ { } { gg::dispViewReset -rotation -pan gg::dispViewRot X -90 gg::dispViewRot Z -90 return } # Z right, X up proc cbZX { } { gg::dispViewReset -rotation -pan gg::dispViewRot Y 90 gg::dispViewRot Z 90 return } # rotate Left (-90 around screen-Y) proc cbL { } { gg::dispViewRot -screenspace Y -90 return } # rotate Right (+90 around screen-Y) proc cbR { } { gg::dispViewRot -screenspace Y 90 return } # rotate Up (-90 around screen-X) proc cbU { } { gg::dispViewRot -screenspace X -90 return } # rotate Down (+90 around screen-X) proc cbD { } { gg::dispViewRot -screenspace X 90 return } proc buildWidgets {} { set butWid 7 set top . wm title $top "Principal Axis Orientations" # Create a label for the title set l [label $top.title -text "Principal Axis Orientations"] # Get the default font and increase the size slightly for the label set font [$l cget -font] set fontFamily [font actual $font -family] set fontSize [font actual $font -size] set bigLabelFont [font create -family fontFamily -weight bold \ -size [expr {2 * $fontSize}]] $l configure -font $bigLabelFont pack $l -side top -fill x -pady 5 # Add a separator set f [frame $top.hr1 -height 2 -relief sunken -borderwidth 1] pack $f -side top -fill x -expand true # Add a frame to hold the XY, YZ, and ZX buttons set f [frame $top.frameXY] # 3 buttons for XY, YZ, and ZX orientations and Cancel set butXY "$f.button1" button $butXY -text "XY" -width $butWid -command [list cbXY] set butYZ "$f.button2" button $butYZ -text "YZ" -width $butWid -command [list cbYZ] set butZX "$f.button3" button $butZX -text "ZX" -width $butWid -command [list cbZX] # Place buttons and make visible pack $butXY $butYZ $butZX -side left -padx 5 pack $f -side top -pady 5 # Add a frame to hold the 90 deg buttons set f [frame $top.frame90] # 4 buttons for rotate Left, Right, Up, and Down by 90 degrees set butL "$f.button4" button $butL -text "Left" -width $butWid -command [list cbL] set butR "$f.button5" button $butR -text "Right" -width $butWid -command [list cbR] set butU "$f.button6" button $butU -text "Up" -width $butWid -command [list cbU] set butD "$f.button7" button $butD -text "Down" -width $butWid -command [list cbD] set l [label "$f.label" -text "90 deg" -justify center] # Use the grid geometry manager to arrange the buttons grid $butL -column 0 -row 1 -padx 2 -pady 2 grid $butR -column 2 -row 1 -padx 2 -pady 2 grid $butU -column 1 -row 0 -padx 2 -pady 2 grid $butD -column 1 -row 2 -padx 2 -pady 2 grid $l -column 1 -row 1 -padx 2 -pady 2 pack $f -side top -pady 5 # Add another separator set f [frame $top.hr2 -height 2 -relief sunken -borderwidth 1] pack $f -side top -fill x -expand true set butCancel [button "$top.cancel" -text "Close" -width $butWid \ -command exit] pack $butCancel -side right -pady 5 -padx 5 } buildWidgets gg::tkLoop # # DISCLAIMER: # TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, POINTWISE DISCLAIMS # ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED # TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE, WITH REGARD TO THIS SCRIPT. TO THE MAXIMUM EXTENT PERMITTED # BY APPLICABLE LAW, IN NO EVENT SHALL POINTWISE BE LIABLE TO ANY PARTY # FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES # WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF # BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE # USE OF OR INABILITY TO USE THIS SCRIPT EVEN IF POINTWISE HAS BEEN # ADVISED OF THE POSSIBILITY OF SUCH DAMAGES AND REGARDLESS OF THE # FAULT OR NEGLIGENCE OF POINTWISE. #