Index: mttroot/mtt/bin/trans/struc2gnuplot_txt2wish ================================================================== --- mttroot/mtt/bin/trans/struc2gnuplot_txt2wish +++ mttroot/mtt/bin/trans/struc2gnuplot_txt2wish @@ -146,19 +146,21 @@ pack .plotbar.select -expand false -fill x -side right # button bar canvas .buttonbar +button .buttonbar.rotate -text "Rotate 3D" -relief raised -command { rotate_3d } button .buttonbar.replot -text "Refresh" -relief raised -command { puts "replot" } button .buttonbar.newwin -text "New Plot" -relief raised -command { set windownum [expr 1 + \$windownum] puts "set term x11 \$windownum" } pack .buttonbar.newwin -expand false -side right pack .buttonbar.replot -expand false -side right +pack .buttonbar.rotate -expand false -side right ## parameter list canvas canvas .parameters listbox .parameters.list -background oldlace -foreground black scrollbar .parameters.yscrollbar -orient v @@ -477,10 +479,39 @@ } else { return "" } } +proc "rotate_3d" "" { + listbox .f -background slateblue + set xrot 30 + set yrot 60 + set scale 1 + set zscale 1 + scale .f.xrot -background slateblue -foreground yellow -label "Rotate X" -orient h -from "0" -to "180" -command { do_rotate_3d "xrot" } + scale .f.yrot -background slateblue -foreground yellow -label "Rotate Z" -orient h -from "0" -to "360" -command { do_rotate_3d "yrot" } + scale .f.scale -background slateblue -foreground yellow -label "Scale" -orient h -from "-4" -to "4" -command { do_rotate_3d "scale" } + scale .f.zscale -background slateblue -foreground yellow -label "Scale Z" -orient h -from "-4" -to "4" -command { do_rotate_3d "zscale" } + button .f.ok -background slateblue -foreground yellow -text "OK" -command { destroy .f } + pack .f.xrot -side top + pack .f.yrot -side top + pack .f.scale -side top + pack .f.zscale -side top + pack .f.ok -side bottom + place .f -in .parameters -relx 0 -rely 0 -relwidth 1 -relheight 1 -anchor nw -bordermode outside +} + +proc "do_rotate_3d" "var val" { + switch -- \$var { + xrot { puts "set view \$val,,, ; replot" } + yrot { puts "set view ,\$val,, ; replot" } + scale { puts "set view ,,[expr pow(2,\$val)], ; replot" } + zscale { puts "set view ,,,[expr pow(2,\$val)] ; replot" } + } +} + + # Defaults set parameter "" set windownum 0 set view outputs set lastplot ""