Changeset 5143
- Timestamp:
- Mar 15, 2015, 1:59:34 AM (10 years ago)
- Location:
- branches/1.4
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.4
- Property svn:mergeinfo changed
/trunk merged: 5134-5135,5137-5141
- Property svn:mergeinfo changed
-
branches/1.4/gui/scripts/flowvisviewer.tcl
r5101 r5143 91 91 private method EventuallyGoto { nSteps } 92 92 private method EventuallyResizeLegend { } 93 private method FlowCmd { dataobj comp nbytes extents }94 93 private method GetDatasetsWithComponent { cname } 95 94 private method GetFlowInfo { widget } … … 112 111 private method ResizeLegend {} 113 112 private method Rotate {option x y} 113 private method SendFlowCmd { dataobj comp nbytes extents } 114 114 private method SendTransferFuncs {} 115 115 private method SetOrientation { side } … … 1159 1159 SendCmd "volume data follows $nbytes $tag" 1160 1160 } 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 1165 1163 } 1166 append _outbuf $cmd 1167 } 1168 append _outbuf $data 1164 } 1165 SendData $data 1169 1166 NameTransferFunc $dataobj $comp 1170 1167 set _recvObjs($tag) 1 … … 2539 2536 } 2540 2537 2541 itcl::body Rappture::FlowvisViewer:: FlowCmd { dataobj comp nbytes extents } {2538 itcl::body Rappture::FlowvisViewer::SendFlowCmd { dataobj comp nbytes extents } { 2542 2539 set tag "$dataobj-$comp" 2543 2540 if { ![info exists _obj2flow($tag)] } { 2544 append cmd "flow add $tag\n"2545 append cmd "$tag data follows $nbytes $extents\n"2546 return $cmd2541 SendCmd "flow add $tag" 2542 SendCmd "$tag data follows $nbytes $extents" 2543 return 0 2547 2544 } 2548 2545 set flowobj $_obj2flow($tag) 2549 2546 if { $flowobj == "" } { 2550 2547 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}" 2555 2551 array set info [$flowobj hints] 2556 2552 set _settings($this-volume) $info(volume) … … 2559 2555 set _settings($this-duration) $info(duration) 2560 2556 $itk_component(speed) value $info(speed) 2557 set cmd {} 2561 2558 append cmd "flow add $tag" 2562 2559 append cmd " -position $info(position)" … … 2565 2562 append cmd " -outline $info(outline)" 2566 2563 append cmd " -slice $info(streams)" 2567 append cmd " -arrows $info(arrows)\n" 2564 append cmd " -arrows $info(arrows)" 2565 SendCmd $cmd 2568 2566 foreach part [$flowobj particles] { 2567 set cmd {} 2569 2568 array unset info 2570 2569 array set info $part … … 2575 2574 append cmd " -axis $info(axis)" 2576 2575 append cmd " -color {$color}" 2577 append cmd " -size $info(size)\n" 2576 append cmd " -size $info(size)" 2577 SendCmd $cmd 2578 2578 } 2579 2579 foreach box [$flowobj boxes] { 2580 set cmd {} 2580 2581 array unset info 2581 2582 set info(corner1) "" … … 2591 2592 append cmd " -linewidth $info(linewidth) " 2592 2593 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 2597 2599 } 2598 2600 -
branches/1.4/gui/scripts/molvisviewer.tcl
r5016 r5143 966 966 # with the data payload immediately afterwards. 967 967 ServerCmd "loadpdb -defer follows $model $state $numBytes" 968 append _outbuf$data1968 SendData $data1 969 969 set _dataobjs($model-$state) 1 970 970 } … … 979 979 # with the data payload immediately afterwards. 980 980 ServerCmd "loadpdb -defer follows $model $state $numBytes" 981 append _outbuf$data2981 SendData $data2 982 982 set _dataobjs($model-$state) 1 983 983 } … … 1028 1028 # command with the data payload immediately afterwards. 1029 1029 ServerCmd "loadpdb -defer follows $model $state $numBytes" 1030 append _outbuf$data31030 SendData $data3 1031 1031 } 1032 1032 set _dataobjs($model-$state) 1 … … 1120 1120 set w [winfo width $itk_component(3dview)] 1121 1121 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)" 1129 1127 debug "rebuild: rotate $_view(mx) $_view(my) $_view(mz)" 1130 1128 -
branches/1.4/gui/scripts/nanovisviewer.tcl
r5101 r5143 429 429 image delete $_image(legend) 430 430 image delete $_image(download) 431 foreach name [array names _transferFunctionEditors] {431 foreach cname [array names _transferFunctionEditors] { 432 432 itcl::delete object $_transferFunctionEditors($cname) 433 433 } … … 939 939 } 940 940 SendCmd "volume data follows $nbytes $tag" 941 append _outbuf$data941 SendData $data 942 942 set _recvdDatasets($tag) 1 943 943 set _serverDatasets($tag) 0 -
branches/1.4/gui/scripts/transferfunctioneditor.tcl
r4504 r5143 146 146 147 147 itcl::body Rappture::TransferFunctionEditor::destructor {} { 148 $_canvas delete $_name 148 if { [winfo exists $_canvas] } { 149 $_canvas delete $_name 150 } 149 151 } 150 152 -
branches/1.4/gui/scripts/visviewer.tcl
r5133 r5143 29 29 private common _done ; # Used to indicate status of send. 30 30 private variable _buffer ; # buffer for incoming/outgoing commands 31 private variable _outbuf ; # buffer for outgoing commands 31 32 private variable _blockOnWrite 0; # Should writes to socket block? 32 33 private variable _initialized … … 46 47 protected variable _sid "" ; # socket connection to server 47 48 protected variable _maxConnects 100 48 protected variable _outbuf ; # buffer for outgoing commands49 49 protected variable _buffering 0 50 50 protected variable _cmdSeq 0 ; # Command sequence number -
branches/1.4/gui/scripts/vtkglyphviewer.tcl
r5096 r5143 837 837 $_dispatcher cancel !legend 838 838 # disconnected -- no more data sitting on server 839 set _outbuf ""840 839 array unset _datasets 841 840 array unset _data … … 1000 999 } 1001 1000 SendCmd "dataset add $tag data follows $length" 1002 append _outbuf$bytes1001 SendData $bytes 1003 1002 set _datasets($tag) 1 1004 1003 SetObjectStyle $dataobj $comp … … 1565 1564 if { $_currentColormap != "" } { 1566 1565 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" 1568 1572 } 1569 1573 } -
branches/1.4/gui/scripts/vtkheightmapviewer.tcl
r5095 r5143 139 139 private variable _changed 140 140 private variable _initialStyle ""; # First found style in dataobjects. 141 private variable _reset 1; # Indicates if camera needs to be reset142 # to starting position.143 private variable _beforeConnect 1; # Indicates if camera needs to be reset144 # 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 145 145 146 146 private variable _first "" ; # This is the topmost dataset. … … 1002 1002 } 1003 1003 SendCmd "dataset add $tag data follows $length" 1004 append _outbuf$bytes1004 SendData $bytes 1005 1005 set _datasets($tag) 1 1006 1006 SetObjectStyle $dataobj $comp … … 1019 1019 } 1020 1020 } 1021 if { $_first != "" 1021 if { $_first != "" } { 1022 1022 $itk_component(field) choices delete 0 end 1023 1023 $itk_component(fieldmenu) delete 0 end … … 1055 1055 1056 1056 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 } 1061 1064 } 1062 1065 if { $label == "" } { … … 1075 1078 1076 1079 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)] } { 1079 1091 set units [lindex $_fields($_curFldName) 1] 1080 1092 } 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] 1088 1096 } 1089 1097 # … … 1462 1470 return 1463 1471 } 1464 set label [$_first hints label] 1472 set label "" 1473 if { $_first != "" } { 1474 set label [$_first hints label] 1475 } 1465 1476 if { $label == "" } { 1466 1477 if { [string match "component*" $_curFldName] } { … … 1473 1484 SendCmd [list axis name z $label] 1474 1485 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] 1484 1499 # Get the new limits because the field changed. 1485 1500 ResetAxes … … 1721 1736 if { $_currentColormap != "" } { 1722 1737 set cmap $_currentColormap 1738 if { ![info exists _colormaps($cmap)] } { 1739 BuildColormap $cmap 1740 set _colormaps($cmap) 1 1741 } 1723 1742 #SendCmd "legend $cmap scalar $_curFldName {} $w $h 0" 1724 1743 SendCmd "legend2 $cmap $w $h" -
branches/1.4/gui/scripts/vtkimageviewer.tcl
r5095 r5143 980 980 } 981 981 SendCmd "dataset add $tag data follows $length" 982 append _outbuf$bytes982 SendData $bytes 983 983 set _datasets($tag) 1 984 984 SetObjectStyle $dataobj $comp … … 1558 1558 # Set the legend on the first image dataset. 1559 1559 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" 1562 1567 } 1563 1568 } -
branches/1.4/gui/scripts/vtkisosurfaceviewer.tcl
r5096 r5143 949 949 $_dispatcher cancel !legend 950 950 # disconnected -- no more data sitting on server 951 set _outbuf ""952 951 array unset _datasets 953 952 array unset _data … … 1112 1111 } 1113 1112 SendCmd "dataset add $tag data follows $length" 1114 append _outbuf$bytes1113 SendData $bytes 1115 1114 set _datasets($tag) 1 1116 1115 SetObjectStyle $dataobj $comp … … 1690 1689 if { $_currentColormap != "" } { 1691 1690 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" 1693 1697 } 1694 1698 } -
branches/1.4/gui/scripts/vtkmeshviewer.tcl
r5095 r5143 867 867 } 868 868 SendCmd "dataset add $tag data follows $length" 869 append _outbuf$bytes869 SendData $bytes 870 870 set _datasets($tag) 1 871 871 SetObjectStyle $dataobj -
branches/1.4/gui/scripts/vtkstreamlinesviewer.tcl
r5096 r5143 1008 1008 } 1009 1009 SendCmd "dataset add $tag data follows $length" 1010 append _outbuf$bytes1010 SendData $bytes 1011 1011 set _datasets($tag) 1 1012 1012 SetObjectStyle $dataobj $comp … … 2165 2165 set length [string length $seeds] 2166 2166 SendCmd "streamlines seed fmesh 200 data follows $length $tag" 2167 append _outbuf$seeds2167 SendData $seeds 2168 2168 set _seeds($dataobj) 1 2169 2169 } -
branches/1.4/gui/scripts/vtksurfaceviewer.tcl
r5096 r5143 784 784 $_dispatcher cancel !legend 785 785 # disconnected -- no more data sitting on server 786 set _outbuf ""787 786 array unset _datasets 788 787 array unset _data … … 947 946 } 948 947 SendCmd "dataset add $tag data follows $length" 949 append _outbuf$bytes948 SendData $bytes 950 949 set _datasets($tag) 1 951 950 SetObjectStyle $dataobj $comp … … 1476 1475 if { $_currentColormap != "" } { 1477 1476 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" 1479 1483 } 1480 1484 } -
branches/1.4/gui/scripts/vtkviewer.tcl
r5095 r5143 926 926 927 927 # disconnected -- no more data sitting on server 928 set _outbuf ""929 928 array unset _datasets 930 929 array unset _data … … 1084 1083 } 1085 1084 SendCmd "dataset add $tag data follows $length" 1086 append _outbuf$bytes1085 SendData $bytes 1087 1086 set _datasets($tag) 1 1088 1087 SetObjectStyle $dataobj $comp … … 1788 1787 foreach {dataobj comp} [split $dataset -] break 1789 1788 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" 1791 1791 break; 1792 1792 } -
branches/1.4/gui/scripts/vtkvolumeviewer.tcl
r5096 r5143 851 851 $_dispatcher cancel !legend 852 852 # disconnected -- no more data sitting on server 853 set _outbuf ""854 853 array unset _datasets 855 854 array unset _data … … 1027 1026 } 1028 1027 SendCmd "dataset add $tag data follows $length" 1029 append _outbuf$bytes1028 SendData $bytes 1030 1029 set _datasets($tag) 1 1031 1030 SetObjectStyle $dataobj $comp … … 1541 1540 foreach {dataobj comp} [split $dataset -] break 1542 1541 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" 1546 1544 break; 1547 1545 }
Note: See TracChangeset
for help on using the changeset viewer.