Changeset 3440 for trunk/gui


Ignore:
Timestamp:
Mar 4, 2013 6:51:12 AM (11 years ago)
Author:
gah
Message:

reassert outline on/off after every rebuild

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/nanovisviewer.tcl

    r3421 r3440  
    861861        DoResize
    862862        if { $_reportClientInfo }  {
    863             # Tell the server the name of the tool, the version, and
    864             # dataset that we are rendering.  Have to do it here because
    865             # we don't know what data objects are using the renderer until
    866             # be get here.
    867863            global env
    868864
     
    936932        PanCamera
    937933        SendCmd "camera zoom $_view(zoom)"
    938         InitSettings light2side light transp isosurface grid axes outline
     934        InitSettings light2side light transp isosurface grid axes
    939935       
    940936        foreach axis {x y z} {
     
    953949        }
    954950    }
     951    # Outline seems to need to be reset every update.
     952    InitSettings outline
    955953    # nothing to send -- activate the proper ivol
    956954    SendCmd "volume state 0"
  • trunk/gui/scripts/vtkisosurfaceviewer.tcl

    r3438 r3440  
    664664itcl::body Rappture::VtkIsosurfaceViewer::scale { args } {
    665665    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        }
    681697    }
    682698}
     
    22042220
    22052221    # 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
    22072224        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]
    22092226    } else {
    22102227        set value 0.0
     
    23472364            incr offset $lineht
    23482365        }
    2349         $pixels expr {round($pixels + $offset)}
    23502366        # 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        }
    23602380    }
    23612381
     
    23652385    # Reset the item coordinates according the current size of the plot.
    23662386    $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]
    23722391    }
    23732392    set y 2
Note: See TracChangeset for help on using the changeset viewer.