Changeset 3947


Ignore:
Timestamp:
Sep 22, 2013 1:49:00 PM (11 years ago)
Author:
ldelgass
Message:

Remove unused method/event, send VTK data when blob isn't defined: we should
probably use the type method of the dataobj, but this method isn't currently
reliable or well-defined: is it the incoming type of data or the outgoing,
converted type of data? What is the enum of possible values?

File:
1 edited

Legend:

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

    r3946 r3947  
    9090    protected method ReceiveLegend { tf vmin vmax size }
    9191    protected method Rotate {option x y}
    92     protected method SendDataObjs {}
    9392    protected method SendTransferFuncs {}
    9493    protected method Slice {option args}
     
    136135    private variable _serverObjs   ;# maps dataobj-component to volume ID
    137136                                    # in the server
    138     private variable _sendobjs ""  ;# list of data objs to send to server
    139137    private variable _recvObjs  ;# list of data objs to send to server
    140138    private variable _obj2style    ;# maps dataobj-component to transfunc
     
    182180    $_dispatcher register !legend
    183181    $_dispatcher dispatch $this !legend "[itcl::code $this ResizeLegend]; list"
    184 
    185     # Send dataobjs event
    186     $_dispatcher register !send_dataobjs
    187     $_dispatcher dispatch $this !send_dataobjs \
    188         "[itcl::code $this SendDataObjs]; list"
    189182
    190183    # Send transferfunctions event
     
    584577# ----------------------------------------------------------------------
    585578itcl::body Rappture::FlowvisViewer::destructor {} {
    586     set _sendobjs ""  ;# stop any send in progress
    587579    $_dispatcher cancel !rebuild
    588     $_dispatcher cancel !send_dataobjs
    589580    $_dispatcher cancel !send_transfunc
    590581    image delete $_image(plot)
     
    955946    # disconnected -- no more data sitting on server
    956947    array unset _serverObjs
    957     set _sendobjs ""
    958 }
    959 
    960 # ----------------------------------------------------------------------
    961 # USAGE: SendDataObjs
    962 #
    963 # Used internally to send a series of volume objects off to the
    964 # server.  Sends each object, a little at a time, with updates in
    965 # between so the interface doesn't lock up.
    966 # ----------------------------------------------------------------------
    967 itcl::body Rappture::FlowvisViewer::SendDataObjs {} {
    968     blt::busy hold $itk_component(hull)
    969     foreach dataobj $_sendobjs {
    970         foreach comp [$dataobj components] {
    971             # Send the data as one huge base64-encoded mess -- yuck!
    972             set data [$dataobj blob $comp]
    973             set nbytes [string length $data]
    974             set extents [$dataobj extents $comp]
    975 
    976             # I have a field. Is a vector field or a volume field?
    977             if { $extents == 1 } {
    978                 set cmd "volume data follows $nbytes $dataobj-$comp\n"
    979             } else {
    980                 set cmd [FlowCmd $dataobj $comp $nbytes $extents]
    981                 if { $cmd == "" } {
    982                     puts stderr "no command"
    983                     continue
    984                 }
    985             }
    986             f { ![SendBytes $cmd] } {
    987                 puts stderr "can't send"
    988                 return
    989             }
    990             if { ![SendBytes $data] } {
    991                 puts stderr "can't send"
    992                 return
    993             }
    994             NameTransferFunc $dataobj $comp
    995             set _recvObjs($dataobj-$comp) 1
    996         }
    997     }
    998     set _sendobjs ""
    999     blt::busy release $itk_component(hull)
    1000 
    1001     # Turn on buffering of commands to the server.  We don't want to
    1002     # be preempted by a server disconnect/reconnect (which automatically
    1003     # generates a new call to Rebuild).   
    1004     StartBufferingCommands
    1005 
    1006     # activate the proper volume
    1007     set _first [lindex [get] 0]
    1008     if { "" != $_first } {
    1009         set axis [$_first hints updir]
    1010         if {"" != $axis} {
    1011             SendCmd "up $axis"
    1012         }
    1013 
    1014         if 0 {
    1015         set location [$_first hints camera]
    1016         if { $location != "" } {
    1017             array set _view $location
    1018         }
    1019         set _settings($this-qw)    $_view(qw)
    1020         set _settings($this-qx)    $_view(qx)
    1021         set _settings($this-qy)    $_view(qy)
    1022         set _settings($this-qz)    $_view(qz)
    1023         set _settings($this-xpan)  $_view(xpan)
    1024         set _settings($this-ypan)  $_view(ypan)
    1025         set _settings($this-zoom)  $_view(zoom)
    1026         set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
    1027         $_arcball quaternion $q
    1028         SendCmd "camera orient $q"
    1029         SendCmd "camera reset"
    1030         PanCamera
    1031         SendCmd "camera zoom $_view(zoom)"
    1032         }
    1033         # The active transfer function is by default the first component of
    1034         # the first data object.  This assumes that the data is always
    1035         # successfully transferred.
    1036         set comp [lindex [$_first components] 0]
    1037         set _activeTf [lindex $_obj2style($_first-$comp) 0]
    1038     }
    1039 
    1040     SendCmd "flow reset"
    1041     StopBufferingCommands
    1042948}
    1043949
     
    12481154        foreach comp [$dataobj components] {
    12491155            set tag $dataobj-$comp
    1250             # Send the data as one huge base64-encoded mess -- yuck!
    1251             set data [$dataobj blob $comp]
     1156            set isvtk 0
     1157            # FIXME: Would like to use the type method of the dataobj
     1158            # but the returned value isn't well defined now
     1159            if {[catch {
     1160                # Send the data as one huge base64-encoded mess -- yuck!
     1161                set data [$dataobj blob $comp]
     1162            }]} {
     1163                set data [$dataobj vtkdata $comp]
     1164                set isvtk 1
     1165            }
    12521166            set nbytes [string length $data]
    12531167            if { $_reportClientInfo }  {
     
    12641178            set extents [$dataobj extents $comp]
    12651179            # I have a field. Is a vector field or a volume field?
    1266             if { $extents == 1 } {
     1180            if { !$isvtk && $extents == 1 } {
    12671181                set cmd "volume data follows $nbytes $tag\n"
    12681182            } else {
Note: See TracChangeset for help on using the changeset viewer.