Changeset 3779 for trunk/gui


Ignore:
Timestamp:
Jul 11, 2013, 8:52:48 AM (11 years ago)
Author:
ldelgass
Message:

Fixes for legend in glyph/isosurface viewer.

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r3759 r3779  
    136136    private variable _start 0
    137137    private variable _title ""
    138     private variable _glyph
    139     private variable _glyphsList ""
    140138
    141139    common _downloadPopup;              # download options from popup
     
    14871485#
    14881486itcl::body Rappture::VtkGlyphViewer::RequestLegend {} {
     1487    set _legendPending 0
    14891488    if { ![info exists _fields($_curFldName)] } {
    14901489        return
    14911490    }
    14921491    set fname $_curFldName
    1493     set _legendPending 0
    14941492    set font "Arial 8"
    14951493    set lineht [font metrics $font -linespace]
     
    22242222    set tx [expr $x + 15]
    22252223    set ty [expr $y - 5]
    2226     if { [info exists _glyph($y)] } {
    2227         Rappture::Tooltip::text $c [format "$title %g (glyph)" $_glyph($y)]
    2228     } else {
    2229         Rappture::Tooltip::text $c [format "$title %g" $value]
    2230     }
     2224    Rappture::Tooltip::text $c [format "$title %g" $value]
    22312225    Rappture::Tooltip::tooltip show $c +$tx,+$ty   
    22322226}
     
    23302324        $c create text $x $y \
    23312325            -anchor ne \
    2332             -fill $itk_option(-plotforeground) -tags "zmax legend" \
     2326            -fill $itk_option(-plotforeground) -tags "vmax legend" \
    23332327            -font $font
    23342328        incr y $lineht
     
    23402334        $c create text $x [expr {$h-2}] \
    23412335            -anchor se \
    2342             -fill $itk_option(-plotforeground) -tags "zmin legend" \
     2336            -fill $itk_option(-plotforeground) -tags "vmin legend" \
    23432337            -font $font
    23442338        $c bind sensor <Enter> [itcl::code $this EnterLegend %x %y]
     
    23462340        $c bind sensor <Motion> [itcl::code $this MotionLegend %x %y]
    23472341    }
    2348     $c delete isoline
    23492342    set x2 $x
    23502343    set iw [image width $_image(legend)]
    23512344    set ih [image height $_image(legend)]
    23522345    set x1 [expr $x2 - ($iw*12)/10]
    2353     # Draw the glyph on the legend.
    2354     array unset _glyph
    23552346
    23562347    $c bind title <ButtonPress> [itcl::code $this Combo post]
     
    23612352    if { [info exists _limits($_curFldName)] } {
    23622353        foreach { vmin vmax } $_limits($_curFldName) break
    2363         $c itemconfigure zmin -text [format %g $vmin]
    2364         $c itemconfigure zmax -text [format %g $vmax]
     2354        $c itemconfigure vmin -text [format %g $vmin]
     2355        $c itemconfigure vmax -text [format %g $vmax]
    23652356    }
    23662357    set y 2
     
    23722363        $c raise title
    23732364    }
    2374     $c coords zmax $x $y
     2365    $c coords vmax $x $y
    23752366    incr y $lineht
    23762367    $c coords colormap $x $y
    2377     set ix [image width $_image(legend)]
    2378     set ih [image height $_image(legend)]
    23792368    $c coords sensor [expr $x - $iw] $y $x [expr $y + $ih]
    23802369    $c raise sensor
    2381     $c coords zmin $x [expr {$h - 2}]
     2370    $c coords vmin $x [expr {$h - 2}]
    23822371}
    23832372
  • trunk/gui/scripts/vtkisosurfaceviewer.tcl

    r3767 r3779  
    15071507#
    15081508itcl::body Rappture::VtkIsosurfaceViewer::RequestLegend {} {
     1509    set _legendPending 0
    15091510    if { ![info exists _fields($_curFldName)] } {
    15101511        return
    15111512    }
    15121513    set fname $_curFldName
    1513     set _legendPending 0
    15141514    set font "Arial 8"
    15151515    set lineht [font metrics $font -linespace]
     
    23882388        $c create text $x $y \
    23892389            -anchor ne \
    2390             -fill $itk_option(-plotforeground) -tags "zmax legend" \
     2390            -fill $itk_option(-plotforeground) -tags "vmax legend" \
    23912391            -font $font
    23922392        incr y $lineht
     
    23982398        $c create text $x [expr {$h-2}] \
    23992399            -anchor se \
    2400             -fill $itk_option(-plotforeground) -tags "zmin legend" \
     2400            -fill $itk_option(-plotforeground) -tags "vmin legend" \
    24012401            -font $font
    24022402        $c bind sensor <Enter> [itcl::code $this EnterLegend %x %y]
     
    24432443    if { [info exists _limits($_curFldName)] } {
    24442444        foreach { vmin vmax } $_limits($_curFldName) break
    2445         $c itemconfigure zmin -text [format %g $vmin]
    2446         $c itemconfigure zmax -text [format %g $vmax]
     2445        $c itemconfigure vmin -text [format %g $vmin]
     2446        $c itemconfigure vmax -text [format %g $vmax]
    24472447    }
    24482448    set y 2
     
    24542454        $c raise title
    24552455    }
    2456     $c coords zmax $x $y
     2456    $c coords vmax $x $y
    24572457    incr y $lineht
    24582458    $c coords colormap $x $y
    2459     set ix [image width $_image(legend)]
    2460     set ih [image height $_image(legend)]
    24612459    $c coords sensor [expr $x - $iw] $y $x [expr $y + $ih]
    24622460    $c raise sensor
    2463     $c coords zmin $x [expr {$h - 2}]
     2461    $c coords vmin $x [expr {$h - 2}]
    24642462}
    24652463
Note: See TracChangeset for help on using the changeset viewer.