Overview
Comment:Refined rotation bar.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: c254a2279da12b61d7e4a2eea8a74cb6f5e60f4190e9bd93ece56b5f11f387a0
User & Date: geraint@users.sourceforge.net on 2002-07-20 14:19:14
Other Links: branch diff | manifest | tags
Context
2002-07-22
10:06:41
Stopped make from reporting an error when application is closed. check-in: eb397570aa user: geraint@users.sourceforge.net tags: origin/master, trunk
2002-07-20
14:19:14
Refined rotation bar. check-in: c254a2279d user: geraint@users.sourceforge.net tags: origin/master, trunk
2002-07-19
20:28:28
Added preliminary 3D rotation. check-in: bead94a31b user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/trans/struc2gnuplot_txt2wish from [df61ed3cec] to [9e7d64559f].

144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161














162
163
164
165
166
167
168
pack .plotbar.dim     -expand false -fill x -side right
pack .plotbar.plot    -expand false -fill x -side right
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

## configure scrollbars







<









|
>
>
>
>
>
>
>
>
>
>
>
>
>
>







144
145
146
147
148
149
150

151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
pack .plotbar.dim     -expand false -fill x -side right
pack .plotbar.plot    -expand false -fill x -side right
pack .plotbar.select  -expand false -fill x -side right

# button bar
canvas .buttonbar


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

# 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

## configure scrollbars
301
302
303
304
305
306
307

308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327

328
329
330
331
332
333
334
    global ytitle
    global ztitle
    global dimension
    global plottype
    global lastplot
    switch -- \$dimension {
	2D	{

	    switch -- \$plottype {
		Single	{
		    puts "set xlabel '\$xtitle'"
		    puts "set ylabel '\$ytitle'"
		    puts "set nokey"
		    puts "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"
		}
		Multi	{
		    puts "set xlabel ''"
		    puts "set ylabel ''"
		    puts "set key"
		    if {"\$lastplot" != "2D"} {
			puts "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"
		    } else {
			puts "replot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"	    
		    }
		}
	    }
	}
	3D	{

	    switch -- \$plottype {
		Single	{
		    puts "set xlabel '\$xtitle'"
		    puts "set ylabel '\$ytitle'"
		    puts "set zlabel '\$ztitle'"
		    puts "set nokey"
		    puts "splot '${dat2}' using \$xcolumn:\$ycolumn:\$zcolumn title 'z:\$ztitle  y:\$ytitle  x:\$xtitle' with lines"







>




















>







314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
    global ytitle
    global ztitle
    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"
		    puts "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"
		}
		Multi	{
		    puts "set xlabel ''"
		    puts "set ylabel ''"
		    puts "set key"
		    if {"\$lastplot" != "2D"} {
			puts "plot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"
		    } else {
			puts "replot '${dat2}' using \$xcolumn:\$ycolumn title 'y:\$ytitle  x:\$xtitle' with lines"	    
		    }
		}
	    }
	}
	3D	{
	    enable_rotationbar
	    switch -- \$plottype {
		Single	{
		    puts "set xlabel '\$xtitle'"
		    puts "set ylabel '\$ytitle'"
		    puts "set zlabel '\$ztitle'"
		    puts "set nokey"
		    puts "splot '${dat2}' using \$xcolumn:\$ycolumn:\$zcolumn title 'z:\$ztitle  y:\$ytitle  x:\$xtitle' with lines"
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
    if {"\$get_scale_status" == "ok"} {
	return "\$get_scale_retval"
    } 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







<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<



|







492
493
494
495
496
497
498



















499
500
501
502
503
504
505
506
507
508
509
    if {"\$get_scale_status" == "ok"} {
	return "\$get_scale_retval"
    } 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

Modified mttroot/mtt/lib/rep/gnuplot_rep.make from [cb814bcb10] to [1f957a8152].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# -*-makefile-*-
# create a gnuplot input file

MTTFLAGS	= $(OPTS)

all: $(SYS)_gnuplot.$(LANG)

$(SYS)_gnuplot.view: $(SYS)_gnuplot.wish $(SYS)_odes.dat2
	sh $(SYS)_gnuplot.wish | gnuplot -geometry 400x300

$(SYS)_gnuplot.wish: $(SYS)_struc.txt
	$(MTTPATH)/trans/struc2gnuplot_txt2wish $(SYS)

$(SYS)_gnuplot.txt: $(SYS)_struc.txt $(MTTPATH)/trans/struc2gnuplot_txt.exe
	$(MTTPATH)/trans/struc2gnuplot_txt.exe $(SYS) < $(SYS)_struc.txt > $(SYS)_gnuplot.txt









|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# -*-makefile-*-
# create a gnuplot input file

MTTFLAGS	= $(OPTS)

all: $(SYS)_gnuplot.$(LANG)

$(SYS)_gnuplot.view: $(SYS)_gnuplot.wish $(SYS)_odes.dat2
	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
	$(MTTPATH)/trans/struc2gnuplot_txt.exe $(SYS) < $(SYS)_struc.txt > $(SYS)_gnuplot.txt


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]