Changeset 4548 for branches/1.3


Ignore:
Timestamp:
Jul 17, 2014, 10:20:51 PM (5 years ago)
Author:
ldelgass
Message:

merge r3947 from trunk

Location:
branches/1.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

    • Property svn:mergeinfo changed
      /trunkmerged: 3947
  • branches/1.3/gui/scripts/flowvisviewer.tcl

    r4547 r4548  
    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
     
    564557# ----------------------------------------------------------------------
    565558itcl::body Rappture::FlowvisViewer::destructor {} {
    566     set _sendobjs ""  ;# stop any send in progress
    567559    $_dispatcher cancel !rebuild
    568     $_dispatcher cancel !send_dataobjs
    569560    $_dispatcher cancel !send_transfunc
    570561    image delete $_image(plot)
     
    935926    # disconnected -- no more data sitting on server
    936927    array unset _serverObjs
    937     set _sendobjs ""
    938 }
    939 
    940 # ----------------------------------------------------------------------
    941 # USAGE: SendDataObjs
    942 #
    943 # Used internally to send a series of volume objects off to the
    944 # server.  Sends each object, a little at a time, with updates in
    945 # between so the interface doesn't lock up.
    946 # ----------------------------------------------------------------------
    947 itcl::body Rappture::FlowvisViewer::SendDataObjs {} {
    948     blt::busy hold $itk_component(hull)
    949     foreach dataobj $_sendobjs {
    950         foreach comp [$dataobj components] {
    951             # Send the data as one huge base64-encoded mess -- yuck!
    952             set data [$dataobj blob $comp]
    953             set nbytes [string length $data]
    954             set extents [$dataobj extents $comp]
    955 
    956             # I have a field. Is a vector field or a volume field?
    957             if { $extents == 1 } {
    958                 set cmd "volume data follows $nbytes $dataobj-$comp\n"
    959             } else {
    960                 set cmd [FlowCmd $dataobj $comp $nbytes $extents]
    961                 if { $cmd == "" } {
    962                     puts stderr "no command"
    963                     continue
    964                 }
    965             }
    966             f { ![SendBytes $cmd] } {
    967                 puts stderr "can't send"
    968                 return
    969             }
    970             if { ![SendBytes $data] } {
    971                 puts stderr "can't send"
    972                 return
    973             }
    974             NameTransferFunc $dataobj $comp
    975             set _recvObjs($dataobj-$comp) 1
    976         }
    977     }
    978     set _sendobjs ""
    979     blt::busy release $itk_component(hull)
    980 
    981     # Turn on buffering of commands to the server.  We don't want to
    982     # be preempted by a server disconnect/reconnect (which automatically
    983     # generates a new call to Rebuild).   
    984     StartBufferingCommands
    985 
    986     # activate the proper volume
    987     set _first [lindex [get] 0]
    988     if { "" != $_first } {
    989         set axis [$_first hints updir]
    990         if {"" != $axis} {
    991             SendCmd "up $axis"
    992         }
    993 
    994         if 0 {
    995         set location [$_first hints camera]
    996         if { $location != "" } {
    997             array set _view $location
    998         }
    999         set _settings($this-qw)    $_view(qw)
    1000         set _settings($this-qx)    $_view(qx)
    1001         set _settings($this-qy)    $_view(qy)
    1002         set _settings($this-qz)    $_view(qz)
    1003         set _settings($this-xpan)  $_view(xpan)
    1004         set _settings($this-ypan)  $_view(ypan)
    1005         set _settings($this-zoom)  $_view(zoom)
    1006         set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
    1007         $_arcball quaternion $q
    1008         SendCmd "camera orient $q"
    1009         SendCmd "camera reset"
    1010         PanCamera
    1011         SendCmd "camera zoom $_view(zoom)"
    1012         }
    1013         # The active transfer function is by default the first component of
    1014         # the first data object.  This assumes that the data is always
    1015         # successfully transferred.
    1016         set comp [lindex [$_first components] 0]
    1017         set _activeTf [lindex $_obj2style($_first-$comp) 0]
    1018     }
    1019 
    1020     SendCmd "flow reset"
    1021     StopBufferingCommands
    1022928}
    1023929
     
    12281134        foreach comp [$dataobj components] {
    12291135            set tag $dataobj-$comp
    1230             # Send the data as one huge base64-encoded mess -- yuck!
    1231             set data [$dataobj blob $comp]
     1136            set isvtk 0
     1137            # FIXME: Would like to use the type method of the dataobj
     1138            # but the returned value isn't well defined now
     1139            if {[catch {
     1140                # Send the data as one huge base64-encoded mess -- yuck!
     1141                set data [$dataobj blob $comp]
     1142            }]} {
     1143                set data [$dataobj vtkdata $comp]
     1144                set isvtk 1
     1145            }
    12321146            set nbytes [string length $data]
    12331147            if { $_reportClientInfo }  {
     
    12441158            set extents [$dataobj extents $comp]
    12451159            # I have a field. Is a vector field or a volume field?
    1246             if { $extents == 1 } {
     1160            if { !$isvtk && $extents == 1 } {
    12471161                set cmd "volume data follows $nbytes $tag\n"
    12481162            } else {
Note: See TracChangeset for help on using the changeset viewer.