Changeset 5269 for branches/1.3


Ignore:
Timestamp:
Apr 17, 2015, 10:10:05 PM (9 years ago)
Author:
ldelgass
Message:

Split out DrawLegend? method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3/gui/scripts/nanovisviewer.tcl

    r5268 r5269  
    9595    private method Disconnect {}
    9696    private method DoResize {}
     97    private method DrawLegend { tf }
    9798    private method EventuallyResize { w h }
    9899    private method EventuallyResizeLegend { }
     
    729730
    730731#
    731 # ReceiveLegend --
    732 #
    733 #       The procedure is the response from the render server to each "legend"
    734 #       command.  The server sends back a "legend" command invoked our
    735 #       the slave interpreter.  The purpose is to collect data of the image
    736 #       representing the legend in the canvas.  In addition, the isomarkers
    737 #       of the active transfer function are displayed.
    738 #
    739 #       I don't know is this is the right place to display the isomarkers.
    740 #       I don't know all the different paths used to draw the plot. There's
    741 #       "Rebuild", "add", etc.
    742 #
    743 itcl::body Rappture::NanovisViewer::ReceiveLegend { tf vmin vmax size } {
    744     if { ![isconnected] } {
    745         return
    746     }
    747     set bytes [ReceiveBytes $size]
    748     $_image(legend) configure -data $bytes
    749     ReceiveEcho <<line "<read $size bytes for [image width $_image(legend)]x[image height $_image(legend)] legend>"
    750 
     732# DrawLegend --
     733#
     734itcl::body Rappture::NanovisViewer::DrawLegend { tf } {
    751735    set c $itk_component(legend)
    752736    set w [winfo width $c]
     
    765749            [itcl::code $this AddIsoMarker %x %y]
    766750    }
    767     # Display the markers used by the active transfer function.
    768 
     751
     752    # Display the markers used by the current transfer function.
    769753    array set limits [limits $tf]
    770754    $c itemconfigure vmin -text [format %.2g $limits(min)]
     
    797781        }
    798782    }
     783}
     784
     785#
     786# ReceiveLegend --
     787#
     788#       The procedure is the response from the render server to each "legend"
     789#       command.  The server sends back a "legend" command invoked our
     790#       the slave interpreter.  The purpose is to collect data of the image
     791#       representing the legend in the canvas.  In addition, the
     792#       active transfer function is displayed.
     793#
     794#
     795itcl::body Rappture::NanovisViewer::ReceiveLegend { tf vmin vmax size } {
     796    if { ![isconnected] } {
     797        return
     798    }
     799    set bytes [ReceiveBytes $size]
     800    $_image(legend) configure -data $bytes
     801    ReceiveEcho <<line "<read $size bytes for [image width $_image(legend)]x[image height $_image(legend)] legend>"
     802
     803    DrawLegend $tf
    799804}
    800805
Note: See TracChangeset for help on using the changeset viewer.