Index: mttroot/mtt/bin/trans/struc2gnuplot_txt2wish ================================================================== --- mttroot/mtt/bin/trans/struc2gnuplot_txt2wish +++ mttroot/mtt/bin/trans/struc2gnuplot_txt2wish @@ -146,21 +146,34 @@ 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 + +# rotation bar +canvas .rotationbar +scale .rotationbar.xrot -label "Rotate X" -orient h -from "0" -to "180" -command { do_rotate_3d "xrot" } +scale .rotationbar.zrot -label "Rotate Z" -orient h -from "0" -to "360" -command { do_rotate_3d "zrot" } +pack .rotationbar.xrot -side left +pack .rotationbar.zrot -side right +.rotationbar.xrot set 30 +.rotationbar.zrot set 60 +pack .rotationbar -expand false -fill x -side bottom + +proc "enable_rotationbar" "" { +} +proc "disable_rotationbar" "" { +} ## parameter list canvas canvas .parameters listbox .parameters.list -background oldlace -foreground black scrollbar .parameters.yscrollbar -orient v @@ -303,10 +316,11 @@ global dimension global plottype global lastplot switch -- \$dimension { 2D { + disable_rotationbar switch -- \$plottype { Single { puts "set xlabel '\$xtitle'" puts "set ylabel '\$ytitle'" puts "set nokey" @@ -323,10 +337,11 @@ } } } } 3D { + enable_rotationbar switch -- \$plottype { Single { puts "set xlabel '\$xtitle'" puts "set ylabel '\$ytitle'" puts "set zlabel '\$ztitle'" @@ -479,33 +494,14 @@ } 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" } + zrot { puts "set view ,\$val,, ; replot" } scale { puts "set view ,,[expr pow(2,\$val)], ; replot" } zscale { puts "set view ,,,[expr pow(2,\$val)] ; replot" } } } Index: mttroot/mtt/lib/rep/gnuplot_rep.make ================================================================== --- mttroot/mtt/lib/rep/gnuplot_rep.make +++ mttroot/mtt/lib/rep/gnuplot_rep.make @@ -4,11 +4,11 @@ MTTFLAGS = $(OPTS) all: $(SYS)_gnuplot.$(LANG) $(SYS)_gnuplot.view: $(SYS)_gnuplot.wish $(SYS)_odes.dat2 - sh $(SYS)_gnuplot.wish | gnuplot -geometry 400x300 + sh $(SYS)_gnuplot.wish | gnuplot -geometry 400x300 2> .gnuplot.log $(SYS)_gnuplot.wish: $(SYS)_struc.txt $(MTTPATH)/trans/struc2gnuplot_txt2wish $(SYS) $(SYS)_gnuplot.txt: $(SYS)_struc.txt $(MTTPATH)/trans/struc2gnuplot_txt.exe