Changeset 5143 for branches/1.4/gui


Ignore:
Timestamp:
Mar 15, 2015 1:59:34 AM (9 years ago)
Author:
ldelgass
Message:

Merge r5134:5135,r5137:5141 from trunk

Location:
branches/1.4
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • branches/1.4

  • branches/1.4/gui/scripts/flowvisviewer.tcl

    r5101 r5143  
    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 }
     
    11591159                SendCmd "volume data follows $nbytes $tag"
    11601160            } else {
    1161                 set cmd [FlowCmd $dataobj $comp $nbytes $extents]
    1162                 if { $cmd == "" } {
    1163                     puts stderr "no command"
    1164                     continue
     1161                if {[SendFlowCmd $dataobj $comp $nbytes $extents] < 0} {
     1162                     continue
    11651163                }
    1166                 append _outbuf $cmd
    1167             }
    1168             append _outbuf $data
     1164            }
     1165            SendData $data
    11691166            NameTransferFunc $dataobj $comp
    11701167            set _recvObjs($tag) 1
     
    25392536}
    25402537
    2541 itcl::body Rappture::FlowvisViewer::FlowCmd { dataobj comp nbytes extents } {
     2538itcl::body Rappture::FlowvisViewer::SendFlowCmd { dataobj comp nbytes extents } {
    25422539    set tag "$dataobj-$comp"
    25432540    if { ![info exists _obj2flow($tag)] } {
    2544         append cmd "flow add $tag\n"
    2545         append cmd "$tag data follows $nbytes $extents\n"
    2546         return $cmd
     2541        SendCmd "flow add $tag"
     2542        SendCmd "$tag data follows $nbytes $extents"
     2543        return 0
    25472544    }
    25482545    set flowobj $_obj2flow($tag)
    25492546    if { $flowobj == "" } {
    25502547        puts stderr "no flowobj"
    2551         return ""
    2552     }
    2553     set cmd {}
    2554     append cmd "if {\[flow exists $tag\]} {flow delete $tag}\n"
     2548        return -1
     2549    }
     2550    SendCmd "if {\[flow exists $tag\]} {flow delete $tag}"
    25552551    array set info  [$flowobj hints]
    25562552    set _settings($this-volume) $info(volume)
     
    25592555    set _settings($this-duration) $info(duration)
    25602556    $itk_component(speed) value $info(speed)
     2557    set cmd {}
    25612558    append cmd "flow add $tag"
    25622559    append cmd " -position $info(position)"
     
    25652562    append cmd " -outline $info(outline)"
    25662563    append cmd " -slice $info(streams)"
    2567     append cmd " -arrows $info(arrows)\n"
     2564    append cmd " -arrows $info(arrows)"
     2565    SendCmd $cmd
    25682566    foreach part [$flowobj particles] {
     2567        set cmd {}
    25692568        array unset info
    25702569        array set info $part
     
    25752574        append cmd " -axis $info(axis)"
    25762575        append cmd " -color {$color}"
    2577         append cmd " -size $info(size)\n"
     2576        append cmd " -size $info(size)"
     2577        SendCmd $cmd
    25782578    }
    25792579    foreach box [$flowobj boxes] {
     2580        set cmd {}
    25802581        array unset info
    25812582        set info(corner1) ""
     
    25912592        append cmd " -linewidth $info(linewidth) "
    25922593        append cmd " -corner1 {$info(corner1)} "
    2593         append cmd " -corner2 {$info(corner2)}\n"
    2594     }
    2595     append cmd "$tag data follows $nbytes $extents\n"
    2596     return $cmd
     2594        append cmd " -corner2 {$info(corner2)}"
     2595        SendCmd $cmd
     2596    }
     2597    SendCmd "$tag data follows $nbytes $extents"
     2598    return 0
    25972599}
    25982600
  • branches/1.4/gui/scripts/molvisviewer.tcl

    r5016 r5143  
    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
     
    11201120        set w  [winfo width $itk_component(3dview)]
    11211121        set h  [winfo height $itk_component(3dview)]
    1122         ServerCmd [subst {
    1123             reset
    1124             screen $w $h
    1125             rotate $_view(mx) $_view(my) $_view(mz)
    1126             pan $_view(x) $_view(y)
    1127             zoom $_view(zoom)
    1128         }]
     1122        ServerCmd "reset"
     1123        ServerCmd "screen $w $h"
     1124        ServerCmd "rotate $_view(mx) $_view(my) $_view(mz)"
     1125        ServerCmd "pan $_view(x) $_view(y)"
     1126        ServerCmd "zoom $_view(zoom)"
    11291127        debug "rebuild: rotate $_view(mx) $_view(my) $_view(mz)"
    11301128
  • branches/1.4/gui/scripts/nanovisviewer.tcl

    r5101 r5143  
    429429    image delete $_image(legend)
    430430    image delete $_image(download)
    431     foreach name [array names _transferFunctionEditors] {
     431    foreach cname [array names _transferFunctionEditors] {
    432432        itcl::delete object $_transferFunctionEditors($cname)
    433433    }
     
    939939                }
    940940                SendCmd "volume data follows $nbytes $tag"
    941                 append _outbuf $data
     941                SendData $data
    942942                set _recvdDatasets($tag) 1
    943943                set _serverDatasets($tag) 0
  • branches/1.4/gui/scripts/transferfunctioneditor.tcl

    r4504 r5143  
    146146
    147147itcl::body Rappture::TransferFunctionEditor::destructor {} {
    148     $_canvas delete $_name
     148    if { [winfo exists $_canvas] } {
     149        $_canvas delete $_name
     150    }
    149151}
    150152
  • branches/1.4/gui/scripts/visviewer.tcl

    r5133 r5143  
    2929    private common _done            ;   # Used to indicate status of send.
    3030    private variable _buffer        ;   # buffer for incoming/outgoing commands
     31    private variable _outbuf       ;    # buffer for outgoing commands
    3132    private variable _blockOnWrite 0;   # Should writes to socket block?
    3233    private variable _initialized
     
    4647    protected variable _sid ""      ;   # socket connection to server
    4748    protected variable _maxConnects 100
    48     protected variable _outbuf       ;    # buffer for outgoing commands
    4949    protected variable _buffering 0
    5050    protected variable _cmdSeq 0     ;    # Command sequence number
  • branches/1.4/gui/scripts/vtkglyphviewer.tcl

    r5096 r5143  
    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
     
    15651564    if { $_currentColormap != ""  } {
    15661565        set cmap $_currentColormap
    1567         SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0"
     1566        if { ![info exists _colormaps($cmap)] } {
     1567            BuildColormap $cmap
     1568            set _colormaps($cmap) 1
     1569        }
     1570        #SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0"
     1571        SendCmd "legend2 $cmap $w $h"
    15681572    }
    15691573}
  • branches/1.4/gui/scripts/vtkheightmapviewer.tcl

    r5095 r5143  
    139139    private variable _changed
    140140    private variable _initialStyle "";  # First found style in dataobjects.
    141     private variable _reset 1;          # Indicates if camera needs to be reset
    142                                         # to starting position.
    143     private variable _beforeConnect 1;  # Indicates if camera needs to be reset
    144                                         # to starting position.
     141    private variable _reset 1;          # Indicates if the connection to the
     142                                        # render server was reset
     143    private variable _beforeConnect 1;  # Indicates if we are in the constructor
     144                                        # before the server connection is made
    145145
    146146    private variable _first ""     ;    # This is the topmost dataset.
     
    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
     
    10191019        }
    10201020    }
    1021     if { $_first != ""  } {
     1021    if { $_first != "" } {
    10221022        $itk_component(field) choices delete 0 end
    10231023        $itk_component(fieldmenu) delete 0 end
     
    10551055
    10561056        foreach axis { x y z } {
    1057             if { $axis == "z" } {
    1058                 set label [$_first hints label]
    1059             } else {
    1060                 set label [$_first hints ${axis}label]
     1057            set label ""
     1058            if { $_first != "" } {
     1059                if { $axis == "z" } {
     1060                    set label [$_first hints label]
     1061                } else {
     1062                    set label [$_first hints ${axis}label]
     1063                }
    10611064            }
    10621065            if { $label == "" } {
     
    10751078
    10761079            set units ""
    1077             if {$axis == "z" && [$_first hints ${axis}units] == ""} {
    1078                 if {$_curFldName != ""} {
     1080            if { $_first != "" } {
     1081                if { $axis == "z" } {
     1082                    set units [$_first hints units]
     1083                } else {
     1084                    set units [$_first hints ${axis}units]
     1085                }
     1086            }
     1087            if { $units == "" && $axis == "z" } {
     1088                if { $_first != "" && [$_first hints zunits] != "" } {
     1089                    set units [$_first hints zunits]
     1090                } elseif { [info exists _fields($_curFldName)] } {
    10791091                    set units [lindex $_fields($_curFldName) 1]
    10801092                }
    1081             } else {
    1082                 set units [$_first hints ${axis}units]
    1083             }
    1084             if { $units != "" } {
    1085                 # May be a space in the axis units.
    1086                 SendCmd [list axis units $axis $units]
    1087             }
     1093            }
     1094            # May be a space in the axis units.
     1095            SendCmd [list axis units $axis $units]
    10881096        }
    10891097        #
     
    14621470                return
    14631471            }
    1464             set label [$_first hints label]
     1472            set label ""
     1473            if { $_first != "" } {
     1474                set label [$_first hints label]
     1475            }
    14651476            if { $label == "" } {
    14661477                if { [string match "component*" $_curFldName] } {
     
    14731484            SendCmd [list axis name z $label]
    14741485
    1475             if { [$_first hints zunits] == "" } {
    1476                 set units [lindex $_fields($_curFldName) 1]
    1477             } else {
    1478                 set units [$_first hints zunits]
    1479             }
    1480             if { $units != "" } {
    1481                 # May be a space in the axis units.
    1482                 SendCmd [list axis units z $units]
    1483             }
     1486            set units ""
     1487            if { $_first != "" } {
     1488                set units [$_first hints units]
     1489            }
     1490            if { $units == "" } {
     1491                if { $_first != "" && [$_first hints zunits] != "" } {
     1492                    set units [$_first hints zunits]
     1493                } elseif { [info exists _fields($_curFldName)] } {
     1494                    set units [lindex $_fields($_curFldName) 1]
     1495                }
     1496            }
     1497            # May be a space in the axis units.
     1498            SendCmd [list axis units z $units]
    14841499            # Get the new limits because the field changed.
    14851500            ResetAxes
     
    17211736    if { $_currentColormap != ""  } {
    17221737        set cmap $_currentColormap
     1738        if { ![info exists _colormaps($cmap)] } {
     1739           BuildColormap $cmap
     1740           set _colormaps($cmap) 1
     1741        }
    17231742        #SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"
    17241743        SendCmd "legend2 $cmap $w $h"
  • branches/1.4/gui/scripts/vtkimageviewer.tcl

    r5095 r5143  
    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
     
    15581558    # Set the legend on the first image dataset.
    15591559    if { $_currentColormap != "" && $_currentColormap != "none" } {
    1560         #SendCmd "legend $_currentColormap scalar $_curFldName {} $w $h 0"
    1561         SendCmd "legend2 $_currentColormap $w $h"
     1560        set cmap $_currentColormap
     1561        if { ![info exists _colormaps($cmap)] } {
     1562            BuildColormap $cmap
     1563            set _colormaps($cmap) 1
     1564        }
     1565        #SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"
     1566        SendCmd "legend2 $cmap $w $h"
    15621567    }
    15631568}
  • branches/1.4/gui/scripts/vtkisosurfaceviewer.tcl

    r5096 r5143  
    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
     
    16901689    if { $_currentColormap != ""  } {
    16911690        set cmap $_currentColormap
    1692         SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"
     1691        if { ![info exists _colormaps($cmap)] } {
     1692            BuildColormap $cmap
     1693            set _colormaps($cmap) 1
     1694        }
     1695        #SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"
     1696        SendCmd "legend2 $cmap $w $h"
    16931697    }
    16941698}
  • branches/1.4/gui/scripts/vtkmeshviewer.tcl

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

    r5096 r5143  
    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    }
  • branches/1.4/gui/scripts/vtksurfaceviewer.tcl

    r5096 r5143  
    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
     
    14761475    if { $_currentColormap != ""  } {
    14771476        set cmap $_currentColormap
    1478         SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"
     1477        if { ![info exists _colormaps($cmap)] } {
     1478            BuildColormap $cmap
     1479            set _colormaps($cmap) 1
     1480        }
     1481        #SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"
     1482        SendCmd "legend2 $cmap $w $h"
    14791483    }
    14801484}
  • branches/1.4/gui/scripts/vtkviewer.tcl

    r5095 r5143  
    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
     
    17881787        foreach {dataobj comp} [split $dataset -] break
    17891788        if { [info exists _dataset2style($dataset)] } {
    1790             SendCmd "legend $_dataset2style($dataset) vmag {} {} $w $h 0"
     1789            #SendCmd "legend $_dataset2style($dataset) vmag {} {} $w $h 0"
     1790            SendCmd "legend2 $_dataset2style($dataset) $w $h"
    17911791            break;
    17921792        }
  • branches/1.4/gui/scripts/vtkvolumeviewer.tcl

    r5096 r5143  
    851851    $_dispatcher cancel !legend
    852852    # disconnected -- no more data sitting on server
    853     set _outbuf ""
    854853    array unset _datasets
    855854    array unset _data
     
    10271026                }
    10281027                SendCmd "dataset add $tag data follows $length"
    1029                 append _outbuf $bytes
     1028                SendData $bytes
    10301029                set _datasets($tag) 1
    10311030                SetObjectStyle $dataobj $comp
     
    15411540        foreach {dataobj comp} [split $dataset -] break
    15421541        if { [info exists _dataset2style($dataset)] } {
    1543             SendCmd \
    1544                 "legend2 $_dataset2style($dataset) $w $h"
    1545                 #"legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0"
     1542            #SendCmd "legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0"
     1543            SendCmd "legend2 $_dataset2style($dataset) $w $h"
    15461544            break;
    15471545        }
Note: See TracChangeset for help on using the changeset viewer.