Ignore:
Timestamp:
Mar 3, 2013, 12:52:51 PM (12 years ago)
Author:
gah
Message:

push SendCmd? into base class w/ buffering

File:
1 edited

Legend:

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

    r3395 r3421  
    5959    public method isconnected {}
    6060    public method limits { colormap }
    61     public method sendto { string }
    6261    public method parameters {title args} {
    6362        # do nothing
     
    8079    protected method ReceiveLegend { colormap title vmin vmax size }
    8180    protected method Rotate {option x y}
    82     protected method SendCmd {string}
    83     protected method SendCmdNoWait {string}
    8481    protected method Zoom {option}
    8582
     
    113110
    114111    private variable _arcball ""
    115     private variable _outbuf       ;    # buffer for outgoing commands
    116 
    117112    private variable _dlist ""     ;    # list of data objects
    118113    private variable _obj2datasets
     
    135130    private variable _first ""     ;    # This is the topmost dataset.
    136131    private variable _start 0
    137     private variable _buffering 0
    138132    private variable _title ""
    139133    private variable _seeds
     
    838832}
    839833
    840 #
    841 # sendto --
    842 #
    843 itcl::body Rappture::VtkVolumeViewer::sendto { bytes } {
    844     SendBytes "$bytes\n"
    845     StartWaiting
    846 }
    847 
    848 #
    849 # SendCmd
    850 #
    851 #       Send commands off to the rendering server.  If we're currently
    852 #       sending data objects to the server, buffer the commands to be
    853 #       sent later.
    854 #
    855 itcl::body Rappture::VtkVolumeViewer::SendCmd {string} {
    856     if { $_buffering } {
    857         append _outbuf $string "\n"
    858     } else {
    859         SendBytes "$string\n"
    860         StartWaiting
    861     }
    862 }
    863 
    864 #
    865 # SendCmdNoWait
    866 #
    867 #       Send commands off to the rendering server.  If we're currently
    868 #       sending data objects to the server, buffer the commands to be
    869 #       sent later.
    870 #
    871 itcl::body Rappture::VtkVolumeViewer::SendCmdNoWait {string} {
    872     if { $_buffering } {
    873         append _outbuf $string "\n"
    874     } else {
    875         SendBytes "$string\n"
    876     }
    877 }
    878 
    879834# ----------------------------------------------------------------------
    880835# USAGE: ReceiveImage -bytes <size> -type <type> -token <token>
     
    978933    # be preempted by a server disconnect/reconnect (which automatically
    979934    # generates a new call to Rebuild).   
    980     set _buffering 1
     935    StartBufferingCommands
     936
    981937    set _legendPending 1
    982938
    983939    if { $_reset } {
    984         if 1 {
     940        if { $_reportClientInfo } {
    985941            # Tell the server the name of the tool, the version, and dataset
    986942            # that we are rendering.  Have to do it here because we don't know
     
    1040996                set bytes [$dataobj vtkdata $comp]
    1041997                set length [string length $bytes]
    1042                 if 1 {
     998                if { $_reportClientInfo }  {
    1043999                    set info {}
    10441000                    lappend info "tool_id"       [$dataobj hints toolId]
     
    11361092        set _reset 0
    11371093    }
    1138     set _buffering 0;                        # Turn off buffering.
    1139 
    11401094    # Actually write the commands to the server socket.  If it fails, we don't
    11411095    # care.  We're finished here.
    11421096    blt::busy hold $itk_component(hull)
    1143     sendto $_outbuf;                       
     1097    StopBufferingCommands
    11441098    blt::busy release $itk_component(hull)
    1145     set _outbuf "";                        # Clear the buffer.               
    11461099}
    11471100
Note: See TracChangeset for help on using the changeset viewer.