Changeset 3440
- Timestamp:
- Mar 4, 2013, 6:51:12 AM (12 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/nanovisviewer.tcl
r3421 r3440 861 861 DoResize 862 862 if { $_reportClientInfo } { 863 # Tell the server the name of the tool, the version, and864 # dataset that we are rendering. Have to do it here because865 # we don't know what data objects are using the renderer until866 # be get here.867 863 global env 868 864 … … 936 932 PanCamera 937 933 SendCmd "camera zoom $_view(zoom)" 938 InitSettings light2side light transp isosurface grid axes outline934 InitSettings light2side light transp isosurface grid axes 939 935 940 936 foreach axis {x y z} { … … 953 949 } 954 950 } 951 # Outline seems to need to be reset every update. 952 InitSettings outline 955 953 # nothing to send -- activate the proper ivol 956 954 SendCmd "volume state 0" -
trunk/gui/scripts/vtkisosurfaceviewer.tcl
r3438 r3440 664 664 itcl::body Rappture::VtkIsosurfaceViewer::scale { args } { 665 665 foreach dataobj $args { 666 set string [limits $dataobj] 667 if { $string == "" } { 668 continue 669 } 670 array set lim $string 671 foreach axis { x y z v } { 672 set min ${axis}min 673 set max ${axis}max 674 if {![info exists _limits($min)] || $_limits($min) > $lim($min)} { 675 set _limits($min) $lim($min) 676 } 677 if {![info exists _limits($max)] || $_limits($max) < $lim($max)} { 678 set _limits($max) $lim($max) 679 } 680 } 666 foreach axis { x y z } { 667 set lim [$dataobj limits $axis] 668 if { ![info exists _limits($axis)] } { 669 set _limits($axis) $lim 670 continue 671 } 672 foreach {min max} $lim break 673 foreach {amin amax} $_limits($axis) break 674 if { $amin > $min } { 675 set amin $min 676 } 677 if { $amax < $max } { 678 set amax $max 679 } 680 set _limits($axis) [list $amin $amax] 681 } 682 foreach { fname lim } [$dataobj fieldlimits] { 683 if { ![info exists _limits($fname)] } { 684 set _limits($fname) $lim 685 continue 686 } 687 foreach {min max} $lim break 688 foreach {fmin fmax} $_limits($fname) break 689 if { $fmin > $min } { 690 set fmin $min 691 } 692 if { $fmax < $max } { 693 set fmax $max 694 } 695 set _limits($fname) [list $fmin $fmax] 696 } 681 697 } 682 698 } … … 2204 2220 2205 2221 # Compute the value of the point 2206 if { [info exists _limits(vmax)] && [info exists _limits(vmin)] } { 2222 if { [info exists _limits($_curFldName)] } { 2223 foreach { vmin vmax } $_limits($_curFldName) break 2207 2224 set t [expr 1.0 - (double($iy) / double($ih-1))] 2208 set value [expr $t * ($ _limits(vmax) - $_limits(vmin)) + $_limits(vmin)]2225 set value [expr $t * ($vmax - $vmin) + $vmin] 2209 2226 } else { 2210 2227 set value 0.0 … … 2347 2364 incr offset $lineht 2348 2365 } 2349 $pixels expr {round($pixels + $offset)}2350 2366 # Order of values is min to max. 2351 $values seq $_limits(zmin) $_limits(zmax) $_numContours 2352 set tags "isoline legend" 2353 foreach pos [$pixels range 0 end] value [$values range end 0] { 2354 set y1 [expr int($pos)] 2355 set id [$c create line $x1 $y1 $x2 $y1 -fill $color -tags $tags] 2356 $c bind $id <Enter> [itcl::code $this EnterIsoline %x %y $value] 2357 $c bind $id <Leave> [itcl::code $this LeaveIsoline] 2358 } 2359 blt::vector destroy $pixels $values 2367 if { [info exists _limits($_curFldName)] } { 2368 $pixels expr {round($pixels + $offset)} 2369 foreach { vmin vmax } $_limits(_$curFldName) break 2370 $values seq $vmin $vmax $_numContours 2371 set tags "isoline legend" 2372 foreach pos [$pixels range 0 end] value [$values range end 0] { 2373 set y1 [expr int($pos)] 2374 set id [$c create line $x1 $y1 $x2 $y1 -fill $color -tags $tags] 2375 $c bind $id <Enter> [itcl::code $this EnterIsoline %x %y $value] 2376 $c bind $id <Leave> [itcl::code $this LeaveIsoline] 2377 } 2378 blt::vector destroy $pixels $values 2379 } 2360 2380 } 2361 2381 … … 2365 2385 # Reset the item coordinates according the current size of the plot. 2366 2386 $c itemconfigure title -text $title 2367 if { [info exists _limits(zmin)] && $_limits(zmin) != "" } { 2368 $c itemconfigure zmin -text [format %g $_limits(zmin)] 2369 } 2370 if { [info exists _limits(zmax)] && $_limits(zmax) != "" } { 2371 $c itemconfigure zmax -text [format %g $_limits(zmax)] 2387 if { [info exists _limits($_curFldName)] } { 2388 foreach { vmin vmax } $_limits($_curFldName) break 2389 $c itemconfigure zmin -text [format %g $vmin] 2390 $c itemconfigure zmax -text [format %g $vmax] 2372 2391 } 2373 2392 set y 2
Note: See TracChangeset
for help on using the changeset viewer.