Changeset 5134


Ignore:
Timestamp:
Mar 14, 2015, 1:50:46 AM (10 years ago)
Author:
ldelgass
Message:

Use SendData? method to send binary data in viewers, make _outbuf private in
superclass.

Location:
trunk/gui/scripts
Files:
14 edited

Legend:

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

    r5100 r5134  
    9191    private method EventuallyGoto { nSteps }
    9292    private method EventuallyResizeLegend { }
    93     private method FlowCmd { dataobj comp nbytes extents }
    9493    private method GetDatasetsWithComponent { cname }
    9594    private method GetFlowInfo { widget }
     
    112111    private method ResizeLegend {}
    113112    private method Rotate {option x y}
     113    private method SendFlowCmd { dataobj comp nbytes extents }
    114114    private method SendTransferFuncs {}
    115115    private method SetOrientation { side }
     
    11741174                SendCmd "volume data follows $nbytes $tag"
    11751175            } else {
    1176                 set cmd [FlowCmd $dataobj $comp $nbytes $extents]
    1177                 if { $cmd == "" } {
    1178                     puts stderr "no command"
    1179                     continue
     1176                if {[SendFlowCmd $dataobj $comp $nbytes $extents] < 0} {
     1177                     continue
    11801178                }
    1181                 append _outbuf $cmd
    1182             }
    1183             append _outbuf $data
     1179            }
     1180            SendData $data
    11841181            NameTransferFunc $dataobj $comp
    11851182            set _recvObjs($tag) 1
     
    26142611}
    26152612
    2616 itcl::body Rappture::FlowvisViewer::FlowCmd { dataobj comp nbytes extents } {
     2613itcl::body Rappture::FlowvisViewer::SendFlowCmd { dataobj comp nbytes extents } {
    26172614    set tag "$dataobj-$comp"
    26182615    if { ![info exists _obj2flow($tag)] } {
    2619         append cmd "flow add $tag\n"
    2620         append cmd "$tag data follows $nbytes $extents\n"
    2621         return $cmd
     2616        SendCmd "flow add $tag"
     2617        SendCmd "$tag data follows $nbytes $extents"
     2618        return 0
    26222619    }
    26232620    set flowobj $_obj2flow($tag)
    26242621    if { $flowobj == "" } {
    26252622        puts stderr "no flowobj"
    2626         return ""
    2627     }
    2628     set cmd {}
    2629     append cmd "if {\[flow exists $tag\]} {flow delete $tag}\n"
     2623        return -1
     2624    }
     2625    SendCmd "if {\[flow exists $tag\]} {flow delete $tag}"
    26302626    array set info  [$flowobj hints]
    26312627    set _settings($this-volume) $info(volume)
     
    26342630    set _settings($this-duration) $info(duration)
    26352631    $itk_component(speed) value $info(speed)
     2632    set cmd {}
    26362633    append cmd "flow add $tag"
    26372634    append cmd " -position $info(position)"
     
    26402637    append cmd " -outline $info(outline)"
    26412638    append cmd " -slice $info(streams)"
    2642     append cmd " -arrows $info(arrows)\n"
     2639    append cmd " -arrows $info(arrows)"
     2640    SendCmd $cmd
    26432641    foreach part [$flowobj particles] {
     2642        set cmd {}
    26442643        array unset info
    26452644        array set info $part
     
    26502649        append cmd " -axis $info(axis)"
    26512650        append cmd " -color {$color}"
    2652         append cmd " -size $info(size)\n"
     2651        append cmd " -size $info(size)"
     2652        SendCmd $cmd
    26532653    }
    26542654    foreach box [$flowobj boxes] {
     2655        set cmd {}
    26552656        array unset info
    26562657        set info(corner1) ""
     
    26662667        append cmd " -linewidth $info(linewidth) "
    26672668        append cmd " -corner1 {$info(corner1)} "
    2668         append cmd " -corner2 {$info(corner2)}\n"
    2669     }
    2670     append cmd "$tag data follows $nbytes $extents\n"
    2671     return $cmd
     2669        append cmd " -corner2 {$info(corner2)}"
     2670        SendCmd $cmd
     2671    }
     2672    SendCmd "$tag data follows $nbytes $extents"
     2673    return 0
    26722674}
    26732675
  • trunk/gui/scripts/mapviewer.tcl

    r5120 r5134  
    11641164                set length [string length $bytes]
    11651165                SendCmd "map load data follows $length"
    1166                 append _outbuf $bytes
     1166                SendData $bytes
    11671167            } else {
    11681168                if { [info exists _mapsettings(style)] } {
  • trunk/gui/scripts/molvisviewer.tcl

    r5015 r5134  
    966966                # with the data payload immediately afterwards.
    967967                ServerCmd "loadpdb -defer follows $model $state $numBytes"
    968                 append _outbuf $data1
     968                SendData $data1
    969969                set _dataobjs($model-$state)  1
    970970            }
     
    979979                # with the data payload immediately afterwards.
    980980                ServerCmd "loadpdb -defer follows $model $state $numBytes"
    981                 append _outbuf $data2
     981                SendData $data2
    982982                set _dataobjs($model-$state)  1
    983983            }
     
    10281028                    # command with the data payload immediately afterwards.
    10291029                    ServerCmd "loadpdb -defer follows $model $state $numBytes"
    1030                     append _outbuf $data3
     1030                    SendData $data3
    10311031                }
    10321032                set _dataobjs($model-$state) 1
  • trunk/gui/scripts/nanovisviewer.tcl

    r5098 r5134  
    950950                }
    951951                SendCmd "volume data follows $nbytes $tag"
    952                 append _outbuf $data
     952                SendData $data
    953953                set _recvdDatasets($tag) 1
    954954                set _serverDatasets($tag) 0
  • trunk/gui/scripts/visviewer.tcl

    r5132 r5134  
    3030    private common _done            ;   # Used to indicate status of send.
    3131    private variable _buffer        ;   # buffer for incoming/outgoing commands
     32    private variable _outbuf       ;    # buffer for outgoing commands
    3233    private variable _blockOnWrite 0;   # Should writes to socket block?
    3334    private variable _initialized
     
    4748    protected variable _sid ""      ;   # socket connection to server
    4849    protected variable _maxConnects 100
    49     protected variable _outbuf       ;    # buffer for outgoing commands
    5050    protected variable _buffering 0
    5151    protected variable _cmdSeq 0     ;    # Command sequence number
  • trunk/gui/scripts/vtkglyphviewer.tcl

    r5094 r5134  
    837837    $_dispatcher cancel !legend
    838838    # disconnected -- no more data sitting on server
    839     set _outbuf ""
    840839    array unset _datasets
    841840    array unset _data
     
    1000999                }
    10011000                SendCmd "dataset add $tag data follows $length"
    1002                 append _outbuf $bytes
     1001                SendData $bytes
    10031002                set _datasets($tag) 1
    10041003                SetObjectStyle $dataobj $comp
  • trunk/gui/scripts/vtkheightmapviewer.tcl

    r5092 r5134  
    10021002                }
    10031003                SendCmd "dataset add $tag data follows $length"
    1004                 append _outbuf $bytes
     1004                SendData $bytes
    10051005                set _datasets($tag) 1
    10061006                SetObjectStyle $dataobj $comp
  • trunk/gui/scripts/vtkimageviewer.tcl

    r5094 r5134  
    980980                }
    981981                SendCmd "dataset add $tag data follows $length"
    982                 append _outbuf $bytes
     982                SendData $bytes
    983983                set _datasets($tag) 1
    984984                SetObjectStyle $dataobj $comp
  • trunk/gui/scripts/vtkisosurfaceviewer.tcl

    r5094 r5134  
    949949    $_dispatcher cancel !legend
    950950    # disconnected -- no more data sitting on server
    951     set _outbuf ""
    952951    array unset _datasets
    953952    array unset _data
     
    11121111                }
    11131112                SendCmd "dataset add $tag data follows $length"
    1114                 append _outbuf $bytes
     1113                SendData $bytes
    11151114                set _datasets($tag) 1
    11161115                SetObjectStyle $dataobj $comp
  • trunk/gui/scripts/vtkmeshviewer.tcl

    r5094 r5134  
    867867            }
    868868            SendCmd "dataset add $tag data follows $length"
    869             append _outbuf $bytes
     869            SendData $bytes
    870870            set _datasets($tag) 1
    871871            SetObjectStyle $dataobj
  • trunk/gui/scripts/vtkstreamlinesviewer.tcl

    r5092 r5134  
    10081008                }
    10091009                SendCmd "dataset add $tag data follows $length"
    1010                 append _outbuf $bytes
     1010                SendData $bytes
    10111011                set _datasets($tag) 1
    10121012                SetObjectStyle $dataobj $comp
     
    21652165        set length [string length $seeds]
    21662166        SendCmd "streamlines seed fmesh 200 data follows $length $tag"
    2167         append _outbuf $seeds
     2167        SendData $seeds
    21682168        set _seeds($dataobj) 1
    21692169    }
  • trunk/gui/scripts/vtksurfaceviewer.tcl

    r5094 r5134  
    784784    $_dispatcher cancel !legend
    785785    # disconnected -- no more data sitting on server
    786     set _outbuf ""
    787786    array unset _datasets
    788787    array unset _data
     
    947946                }
    948947                SendCmd "dataset add $tag data follows $length"
    949                 append _outbuf $bytes
     948                SendData $bytes
    950949                set _datasets($tag) 1
    951950                SetObjectStyle $dataobj $comp
  • trunk/gui/scripts/vtkviewer.tcl

    r5094 r5134  
    926926
    927927    # disconnected -- no more data sitting on server
    928     set _outbuf ""
    929928    array unset _datasets
    930929    array unset _data
     
    10841083                }
    10851084                SendCmd "dataset add $tag data follows $length"
    1086                 append _outbuf $bytes
     1085                SendData $bytes
    10871086                set _datasets($tag) 1
    10881087                SetObjectStyle $dataobj $comp
  • trunk/gui/scripts/vtkvolumeviewer.tcl

    r5092 r5134  
    884884    $_dispatcher cancel !legend
    885885    # disconnected -- no more data sitting on server
    886     set _outbuf ""
    887886    array unset _datasets
    888887    array unset _data
     
    10651064                }
    10661065                SendCmd "dataset add $tag data follows $length"
    1067                 append _outbuf $bytes
     1066                SendData $bytes
    10681067                set _datasets($tag) 1
    10691068                SetObjectStyle $dataobj $comp
Note: See TracChangeset for help on using the changeset viewer.