Changeset 5273


Ignore:
Timestamp:
Apr 18, 2015, 2:28:21 AM (5 years ago)
Author:
ldelgass
Message:

Remove unused method/event, cleanups

File:
1 edited

Legend:

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

    r5272 r5273  
    110110    private method ResizeLegend {}
    111111    private method Rotate {option x y}
    112     private method SendDataObjs {}
    113112    private method SendFlowCmd { dataobj comp nbytes extents }
    114113    private method SendTransferFunctions {}
     
    133132    private variable _serverDatasets   ;# maps dataobj-component to volume ID
    134133                                        # in the server
    135     private variable _sendobjs ""      ;# list of data objs to send to server
    136134    private variable _recvdDatasets    ;# list of data objs to send to server
    137135    private variable _dataset2style    ;# maps dataobj-component to transfunc
     
    175173    $_dispatcher register !legend
    176174    $_dispatcher dispatch $this !legend "[itcl::code $this ResizeLegend]; list"
    177 
    178     # Send dataobjs event
    179     $_dispatcher register !send_dataobjs
    180     $_dispatcher dispatch $this !send_dataobjs \
    181         "[itcl::code $this SendDataObjs]; list"
    182175
    183176    # Send transferfunctions event
     
    558551# ----------------------------------------------------------------------
    559552itcl::body Rappture::FlowvisViewer::destructor {} {
    560     set _sendobjs ""  ;# stop any send in progress
    561553    $_dispatcher cancel !rebuild
    562     $_dispatcher cancel !send_dataobjs
    563554    $_dispatcher cancel !send_transfunc
    564555    image delete $_image(plot)
     
    912903    # disconnected -- no more data sitting on server
    913904    array unset _serverDatasets
    914     set _sendobjs ""
    915 }
    916 
    917 # ----------------------------------------------------------------------
    918 # USAGE: SendDataObjs
    919 #
    920 # Used internally to send a series of volume objects off to the
    921 # server.  Sends each object, a little at a time, with updates in
    922 # between so the interface doesn't lock up.
    923 # ----------------------------------------------------------------------
    924 itcl::body Rappture::FlowvisViewer::SendDataObjs {} {
    925     blt::busy hold $itk_component(hull)
    926     foreach dataobj $_sendobjs {
    927         foreach comp [$dataobj components] {
    928             # Send the data as one huge base64-encoded mess -- yuck!
    929             set data [$dataobj blob $comp]
    930             set nbytes [string length $data]
    931             set extents [$dataobj extents $comp]
    932 
    933             # I have a field. Is a vector field or a volume field?
    934             if { $extents == 1 } {
    935                 set cmd "volume data follows $nbytes $dataobj-$comp\n"
    936             } else {
    937                 set cmd [FlowCmd $dataobj $comp $nbytes $extents]
    938                 if { $cmd == "" } {
    939                     puts stderr "no command"
    940                     continue
    941                 }
    942             }
    943             f { ![SendBytes $cmd] } {
    944                 puts stderr "can't send"
    945                 return
    946             }
    947             if { ![SendBytes $data] } {
    948                 puts stderr "can't send"
    949                 return
    950             }
    951             NameTransferFunction $dataobj $comp
    952             set _recvdDatasets($dataobj-$comp) 1
    953         }
    954     }
    955     set _sendobjs ""
    956     blt::busy release $itk_component(hull)
    957 
    958     # Turn on buffering of commands to the server.  We don't want to
    959     # be preempted by a server disconnect/reconnect (which automatically
    960     # generates a new call to Rebuild).
    961     StartBufferingCommands
    962 
    963     # activate the proper volume
    964     set _first [lindex [get] 0]
    965     if { "" != $_first } {
    966         set axis [$_first hints updir]
    967         if {"" != $axis} {
    968             SendCmd "up $axis"
    969         }
    970 
    971         if 0 {
    972         set location [$_first hints camera]
    973         if { $location != "" } {
    974             array set _view $location
    975         }
    976         set _settings(-qw)    $_view(-qw)
    977         set _settings(-qx)    $_view(-qx)
    978         set _settings(-qy)    $_view(-qy)
    979         set _settings(-qz)    $_view(-qz)
    980         set _settings(-xpan)  $_view(-xpan)
    981         set _settings(-ypan)  $_view(-ypan)
    982         set _settings(-zoom)  $_view(-zoom)
    983         set q [ViewToQuaternion]
    984         $_arcball quaternion $q
    985         SendCmd "camera orient $q"
    986         SendCmd "camera reset"
    987         PanCamera
    988         SendCmd "camera zoom $_view(-zoom)"
    989         }
    990         # The active transfer function is by default the first component of
    991         # the first data object.  This assumes that the data is always
    992         # successfully transferred.
    993         set comp [lindex [$_first components] 0]
    994         set _activeTf [lindex $_dataset2style($_first-$comp) 0]
    995     }
    996 
    997     SendCmd "flow reset"
    998     StopBufferingCommands
    999905}
    1000906
     
    1083989    $c configure -background black
    1084990    set ly [expr {$h - 1}]
    1085     if {"" == [$c find withtag transfunc]} {
     991    if {"" == [$c find withtag colorbar]} {
    1086992        $c create image 10 10 -anchor nw \
    1087             -image $_image(legend) -tags transfunc
     993            -image $_image(legend) -tags colorbar
    1088994        $c create text $lx $ly -anchor sw \
    1089995            -fill $itk_option(-plotforeground) -tags "limits vmin"
    1090996        $c create text [expr {$w-$lx}] $ly -anchor se \
    1091997            -fill $itk_option(-plotforeground) -tags "limits vmax"
    1092         $c lower transfunc
    1093         $c bind transfunc <ButtonRelease-1> \
    1094             [itcl::code $this AddIsoMarker %x %y]
     998        $c lower colorbar
     999        $c bind colorbar <ButtonRelease-1> [itcl::code $this AddIsoMarker %x %y]
    10951000    }
    10961001
     
    10981003    set tf $_dataset2style($tag)
    10991004    array set limits [limits $tf]
    1100     $c itemconfigure vmin -text [format %.2g $limits(vmin)]
     1005    $c itemconfigure vmin -text [format %g $limits(vmin)]
    11011006    $c coords vmin $lx $ly
    11021007
    1103     $c itemconfigure vmax -text [format %.2g $limits(vmax)]
     1008    $c itemconfigure vmax -text [format %g $limits(vmax)]
    11041009    $c coords vmax [expr {$w-$lx}] $ly
    11051010
     
    20751980    set _limits(vmax) 1.0
    20761981    if { ![info exists _style2datasets($tf)] } {
    2077         puts stderr "no _style2datasets for $tf tf=($tf)"
     1982        puts stderr "no _style2datasets for tf=($tf)"
    20781983        return [array get _limits]
    20791984    }
    20801985    set min ""; set max ""
    2081     foreach {dataobj comp} $_style2objs($tf) {
     1986    foreach {dataobj comp} $_style2datasets($tf) {
    20821987        set tag $dataobj-$comp
    20831988        if { ![info exists _serverDatasets($tag)] } {
    2084             puts stderr "$tag not in serverObjs?"
     1989            puts stderr "$tag not in _serverDatasets?"
    20851990            continue
    20861991        }
Note: See TracChangeset for help on using the changeset viewer.