43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
menu .menubar.edit.menu.axes
.menubar.edit.menu.axes add command -label "Cartesian" -underline 0 -command { puts "set nopolar ; replot" }
.menubar.edit.menu.axes add command -label "Polar" -underline 0 -command { puts "set polar ; replot" }
.menubar.edit.menu.axes add cascade -label "Ranges" -underline 0 -menu .menubar.edit.menu.axes.range
menu .menubar.edit.menu.axes.range
.menubar.edit.menu.axes.range add command -label "Set X" -underline 4 -command { puts "set xrange \[[get_value "X axis range? min:max" "*:*"]\]" }
.menubar.edit.menu.axes.range add command -label "Set Y" -underline 4 -command { puts "set yrange \[[get_value "Y axis range? min:max" "*:*"]\]" }
.menubar.edit.menu.axes.range add command -label "Set Z" -underline 4 -command { puts "set zrange \[[get_value "Z axis range? min:max" "*:*"]\]" }
menu .menubar.edit.menu.contour
.menubar.edit.menu.contour add command -label "Show Contour" -underline 0 -command { puts "set dgrid3d ; set contour ; replot" }
.menubar.edit.menu.contour add command -label "Hide Contour" -underline 0 -command { puts "set nodgrid3d ; set nocontour ; replot" }
.menubar.edit.menu.contour add cascade -label "Surface" -underline 0 -menu .menubar.edit.menu.contour.surface
menu .menubar.edit.menu.contour.surface
|
|
|
|
|
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
|
menu .menubar.edit.menu.axes
.menubar.edit.menu.axes add command -label "Cartesian" -underline 0 -command { puts "set nopolar ; replot" }
.menubar.edit.menu.axes add command -label "Polar" -underline 0 -command { puts "set polar ; replot" }
.menubar.edit.menu.axes add cascade -label "Ranges" -underline 0 -menu .menubar.edit.menu.axes.range
menu .menubar.edit.menu.axes.range
.menubar.edit.menu.axes.range add command -label "Set X" -underline 4 -command { puts "set xrange \[[get_value "X axis range? min:max" "*:*"]\] ; replot" }
.menubar.edit.menu.axes.range add command -label "Set Y" -underline 4 -command { puts "set yrange \[[get_value "Y axis range? min:max" "*:*"]\] ; replot" }
.menubar.edit.menu.axes.range add command -label "Set Z" -underline 4 -command { puts "set zrange \[[get_value "Z axis range? min:max" "*:*"]\] ; replot" }
menu .menubar.edit.menu.contour
.menubar.edit.menu.contour add command -label "Show Contour" -underline 0 -command { puts "set dgrid3d ; set contour ; replot" }
.menubar.edit.menu.contour add command -label "Hide Contour" -underline 0 -command { puts "set nodgrid3d ; set nocontour ; replot" }
.menubar.edit.menu.contour add cascade -label "Surface" -underline 0 -menu .menubar.edit.menu.contour.surface
menu .menubar.edit.menu.contour.surface
|
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
|
pack .buttonbar.replot -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" "" {
}
|
|
>
|
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
pack .buttonbar.replot -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 left
.rotationbar.xrot set 30
.rotationbar.zrot set 60
pack .rotationbar -expand false -fill x -side bottom
proc "enable_rotationbar" "" {
}
proc "disable_rotationbar" "" {
}
|
268
269
270
271
272
273
274
275
276
277
278
279
280
281
|
' Title=\$title Ny=${Ny} ${struc} >> ${out}
cat <<EOF >> ${out}
}
}
proc "plot" "title" {
global select
global view
global xcolumn
global ycolumn
global zcolumn
global xtitle
global ytitle
|
>
|
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
|
' Title=\$title Ny=${Ny} ${struc} >> ${out}
cat <<EOF >> ${out}
}
}
proc "plot" "title" {
global dimension
global select
global view
global xcolumn
global ycolumn
global zcolumn
global xtitle
global ytitle
|
296
297
298
299
300
301
302
303
304
305
306
307
308
309
|
"Select Y" {
set ycolumn \$column
set ytitle \$title
}
"Select Z" {
set zcolumn \$column
set ztitle \$title
}
}
plot_var
}
## call gnuplot
proc "plot_var" "" {
|
>
|
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
|
"Select Y" {
set ycolumn \$column
set ytitle \$title
}
"Select Z" {
set zcolumn \$column
set ztitle \$title
set dimension "3D"
}
}
plot_var
}
## call gnuplot
proc "plot_var" "" {
|
445
446
447
448
449
450
451
452
453
454
455
456
457
458
|
set get_value_status "cancel"
destroy .f
}
entry .f.entry
label .f.label -text "\$string"
.f.entry insert 0 "\$initial"
pack .f.buttons.ok -side left -expand false
pack .f.buttons.cancel -side left -expand false
pack .f.label -side top -expand false
pack .f.entry -side top -expand false
pack .f.buttons -side top -expand false
place .f -in .parameters -relx 0 -rely 0 -relwidth 1 -relheight 1 -anchor nw -bordermode outside
|
>
>
>
>
>
|
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
|
set get_value_status "cancel"
destroy .f
}
entry .f.entry
label .f.label -text "\$string"
.f.entry insert 0 "\$initial"
bind .f.entry <<Return>> {
set get_value_status "ok"
set get_value_retval [.f.entry get ]
destroy .f
}
pack .f.buttons.ok -side left -expand false
pack .f.buttons.cancel -side left -expand false
pack .f.label -side top -expand false
pack .f.entry -side top -expand false
pack .f.buttons -side top -expand false
place .f -in .parameters -relx 0 -rely 0 -relwidth 1 -relheight 1 -anchor nw -bordermode outside
|
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
|
} else {
return ""
}
}
proc "do_rotate_3d" "var val" {
switch -- \$var {
xrot { 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" }
}
}
# Defaults
set parameter ""
set windownum 0
set view outputs
set lastplot ""
set select "Select Y"
|
>
|
>
>
|
<
<
>
>
|
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
|
} else {
return ""
}
}
proc "do_rotate_3d" "var val" {
switch -- \$var {
xrot {
puts "set view \$val,,, ; replot"
}
zrot {
puts "set view ,\$val,, ; replot"
}
}
}
event add <<Return>> <Return>
# Defaults
set parameter ""
set windownum 0
set view outputs
set lastplot ""
set select "Select Y"
|