Changeset 5174 for branches/1.4
- Timestamp:
- Mar 29, 2015, 7:54:46 PM (10 years ago)
- Location:
- branches/1.4
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.4
-
branches/1.4/gui/scripts/field.tcl
r5095 r5174 1659 1659 $writer SetInputConnection [$reader GetOutputPort] 1660 1660 $writer SetFileName $tmpfile 1661 $writer SetFileTypeToBinary 1661 1662 $writer Write 1662 1663 rename $reader "" -
branches/1.4/gui/scripts/molvisviewer.tcl
r5143 r5174 1 1 # -*- mode: tcl; indent-tabs-mode: nil -*- 2 3 2 # ---------------------------------------------------------------------- 4 3 # COMPONENT: molvisviewer - view a molecule in 3D … … 117 116 protected method Rebuild { } 118 117 protected method Rotate {option x y} 119 protected method Se rverCmd { string }118 protected method SendCmd { string } 120 119 protected method Unmap {} 121 120 protected method Vmouse {option b m x y} … … 699 698 lappend info "user" $user 700 699 lappend info "session" $session 701 Se rverCmd "clientinfo [list $info]"700 SendCmd "clientinfo [list $info]" 702 701 } 703 702 … … 731 730 } 732 731 733 itcl::body Rappture::MolvisViewer::Se rverCmd { cmd } {734 debug "in Se rverCmd ($cmd)\n"732 itcl::body Rappture::MolvisViewer::SendCmd { cmd } { 733 debug "in SendCmd ($cmd)\n" 735 734 736 735 if { $_state(server) != $_state(client) } { 737 SendCmd "frame -defer $_state(client)"736 VisViewer::SendCmd "frame -defer $_state(client)" 738 737 set _state(server) $_state(client) 739 738 } 740 739 if { $_rocker(server) != $_rocker(client) } { 741 SendCmd "rock -defer $_rocker(client)"740 VisViewer::SendCmd "rock -defer $_rocker(client)" 742 741 set _rocker(server) $_rocker(client) 743 742 } 744 SendCmd "$cmd"743 VisViewer::SendCmd "$cmd" 745 744 } 746 745 … … 891 890 set _cacheid 0 892 891 893 Se rverCmd "raw -defer {set auto_color,0}"894 Se rverCmd "raw -defer {set auto_show_lines,0}"892 SendCmd "raw -defer {set auto_color,0}" 893 SendCmd "raw -defer {set auto_show_lines,0}" 895 894 } 896 895 set _first "" … … 935 934 lappend info "tool_revision" \ 936 935 [$xmlobj get tool.version.application.revision] 937 Se rverCmd "clientinfo [list $info]"936 SendCmd "clientinfo [list $info]" 938 937 } 939 938 foreach _atom [$dataobj children -type atom components.molecule] { … … 965 964 # We know we're buffered here, so append the "loadpdb" command 966 965 # with the data payload immediately afterwards. 967 Se rverCmd "loadpdb -defer follows $model $state $numBytes"966 SendCmd "loadpdb -defer follows $model $state $numBytes" 968 967 SendData $data1 969 968 set _dataobjs($model-$state) 1 … … 978 977 # We know we're buffered here, so append the "loadpdb" command 979 978 # with the data payload immediately afterwards. 980 Se rverCmd "loadpdb -defer follows $model $state $numBytes"979 SendCmd "loadpdb -defer follows $model $state $numBytes" 981 980 SendData $data2 982 981 set _dataobjs($model-$state) 1 … … 1027 1026 # We know we're buffered here, so append the "loadpdb" 1028 1027 # command with the data payload immediately afterwards. 1029 Se rverCmd "loadpdb -defer follows $model $state $numBytes"1028 SendCmd "loadpdb -defer follows $model $state $numBytes" 1030 1029 SendData $data3 1031 1030 } … … 1051 1050 if { $vector != "" } { 1052 1051 set vertices [ComputeParallelepipedVertices $dataobj] 1053 Se rverCmd "raw -defer {verts = \[$vertices\]\n}"1054 Se rverCmd "raw -defer {run \$PYMOL_SITE_PATH/rappture/box.py\n}"1055 Se rverCmd "raw -defer {draw_box(verts)\n}"1052 SendCmd "raw -defer {verts = \[$vertices\]\n}" 1053 SendCmd "raw -defer {run \$PYMOL_SITE_PATH/rappture/box.py\n}" 1054 SendCmd "raw -defer {draw_box(verts)\n}" 1056 1055 set _cell 1 1057 1056 } … … 1063 1062 foreach model [array names _mlist] { 1064 1063 if { $_mlist($model) == 1 } { 1065 Se rverCmd "disable -defer $model"1064 SendCmd "disable -defer $model" 1066 1065 set _mlist($model) 0 1067 1066 set changed 1 1068 1067 } elseif { $_mlist($model) == 2 } { 1069 1068 set _mlist($model) 1 1070 Se rverCmd "enable -defer $model"1069 SendCmd "enable -defer $model" 1071 1070 set changed 1 1072 1071 } elseif { $_mlist($model) == 3 } { … … 1084 1083 set rep $_model($model-newrep) 1085 1084 set transp $_model($model-newtransparency) 1086 Se rverCmd "representation -defer -model $model $rep"1085 SendCmd "representation -defer -model $model $rep" 1087 1086 set changed 1 1088 1087 set _model($model-transparency) $_model($model-newtransparency) … … 1103 1102 set _state(server) 1 1104 1103 set _state(client) 1 1105 Se rverCmd "frame 1"1104 SendCmd "frame 1" 1106 1105 set flush 1 1107 1106 } elseif { ![info exists _imagecache($state,$_rocker(client))] } { 1108 1107 set _state(server) $state 1109 1108 set _state(client) $state 1110 Se rverCmd "frame $state"1109 SendCmd "frame $state" 1111 1110 set flush 1 1112 1111 } else { … … 1120 1119 set w [winfo width $itk_component(3dview)] 1121 1120 set h [winfo height $itk_component(3dview)] 1122 Se rverCmd "reset"1123 Se rverCmd "screen $w $h"1124 Se rverCmd "rotate $_view(mx) $_view(my) $_view(mz)"1125 Se rverCmd "pan $_view(x) $_view(y)"1126 Se rverCmd "zoom $_view(zoom)"1121 SendCmd "reset" 1122 SendCmd "screen $w $h" 1123 SendCmd "rotate $_view(mx) $_view(my) $_view(mz)" 1124 SendCmd "pan $_view(x) $_view(y)" 1125 SendCmd "zoom $_view(zoom)" 1127 1126 debug "rebuild: rotate $_view(mx) $_view(my) $_view(mz)" 1128 1127 1129 Se rverCmd "raw -defer {zoom complete=1}"1128 SendCmd "raw -defer {zoom complete=1}" 1130 1129 set _reset 0 1131 1130 } … … 1151 1150 set readyForNextFrame 0; # Don't advance to the next frame 1152 1151 # until we get an image. 1153 #Se rverCmd "ppm"; # Flush the results.1152 #SendCmd "ppm"; # Flush the results. 1154 1153 } 1155 1154 blt::busy hold $itk_component(hull) … … 1183 1182 1184 1183 itcl::body Rappture::MolvisViewer::DoResize { } { 1185 Se rverCmd "screen $_width $_height"1184 SendCmd "screen $_width $_height" 1186 1185 $_image(plot) configure -width $_width -height $_height 1187 1186 # Immediately invalidate cache, defer update until mapped … … 1200 1199 1201 1200 itcl::body Rappture::MolvisViewer::DoRotate {} { 1202 Se rverCmd "rotate $_view(a) $_view(b) $_view(c)"1201 SendCmd "rotate $_view(a) $_view(b) $_view(c)" 1203 1202 array unset _imagecache 1204 1203 set _rotatePending 0 … … 1245 1244 set _view(y) [expr $_view(y) + $dy] 1246 1245 array unset _imagecache 1247 Se rverCmd "pan $dx $dy"1246 SendCmd "pan $dx $dy" 1248 1247 return 1249 1248 } … … 1260 1259 set _view(y) [expr $_view(y) + $dy] 1261 1260 array unset _imagecache 1262 Se rverCmd "pan $dx $dy"1261 SendCmd "pan $dx $dy" 1263 1262 } 1264 1263 set _mevent(x) $x … … 1281 1280 "in" { 1282 1281 set _view(zoom) [expr $_view(zoom) + $factor] 1283 Se rverCmd "zoom $factor"1282 SendCmd "zoom $factor" 1284 1283 } 1285 1284 "out" { 1286 1285 set _view(zoom) [expr $_view(zoom) - $factor] 1287 Se rverCmd "zoom -$factor"1286 SendCmd "zoom -$factor" 1288 1287 } 1289 1288 "reset" { 1290 1289 set _view(zoom) 0 1291 Se rverCmd "reset"1290 SendCmd "reset" 1292 1291 } 1293 1292 } … … 1332 1331 if { ![info exists _imagecache($_state(server),$_rocker(client))] } { 1333 1332 set _rocker(server) $_rocker(client) 1334 Se rverCmd "rock $_rocker(client)"1333 SendCmd "rock $_rocker(client)" 1335 1334 } 1336 1335 UpdateState … … 1365 1364 } 1366 1365 } 1367 Se rverCmd "vmouse $vButton $vModifier $vState $x $y"1366 SendCmd "vmouse $vButton $vModifier $vState $x $y" 1368 1367 set _mevent(time) $now 1369 1368 } … … 1424 1423 set _view(my) [expr {$_view(my) + $my}] 1425 1424 set _view(mz) [expr {$_view(mz) + $mz}] 1426 #Se rverCmd "rotate $mx $my $mz"1425 #SendCmd "rotate $mx $my $mz" 1427 1426 EventuallyRotate $mx $my $mz 1428 1427 debug "_vmmouse: rotate $_view(mx) $_view(my) $_view(mz)" … … 1522 1521 }] 1523 1522 EventuallyRotate $a $b $c 1524 #Se rverCmd "rotate $a $b $c"1523 #SendCmd "rotate $a $b $c" 1525 1524 debug "Rotate $x $y: rotate $_view(vx) $_view(vy) $_view(vz)" 1526 1525 set _click(x) $x … … 1581 1580 } 1582 1581 if { [isconnected] } { 1583 Se rverCmd "representation -model $model $option"1582 SendCmd "representation -model $model $option" 1584 1583 #$_dispatcher event -idle !rebuild 1585 1584 } … … 1622 1621 "Use perspective projection" 1623 1622 set _settings($this-ortho) 1 1624 Se rverCmd "orthoscopic on"1623 SendCmd "orthoscopic on" 1625 1624 } else { 1626 1625 $itk_component(ortho) configure -image [Rappture::icon molvis-3dpers] … … 1628 1627 "Use orthoscopic projection" 1629 1628 set _settings($this-ortho) 0 1630 Se rverCmd "orthoscopic off"1629 SendCmd "orthoscopic off" 1631 1630 } 1632 1631 } … … 1662 1661 "Hide the cell." 1663 1662 set _settings($this-showcell) 1 1664 Se rverCmd "raw {show everything,unitcell}"1663 SendCmd "raw {show everything,unitcell}" 1665 1664 } else { 1666 1665 Rappture::Tooltip::for $itk_component(ortho) \ 1667 1666 "Show the cell." 1668 1667 set _settings($this-showcell) 0 1669 Se rverCmd "raw {hide everything,unitcell}"1668 SendCmd "raw {hide everything,unitcell}" 1670 1669 } 1671 1670 } … … 1690 1689 height 0 1691 1690 } 1692 Se rverCmd "reset"1691 SendCmd "reset" 1693 1692 DoResize 1694 Se rverCmd "rotate $_view(mx) $_view(my) $_view(mz)"1693 SendCmd "rotate $_view(mx) $_view(my) $_view(mz)" 1695 1694 debug "ResetView: rotate $_view(mx) $_view(my) $_view(mz)" 1696 Se rverCmd "pan $_view(x) $_view(y)"1697 Se rverCmd "zoom $_view(zoom)"1695 SendCmd "pan $_view(x) $_view(y)" 1696 SendCmd "zoom $_view(zoom)" 1698 1697 } 1699 1698 … … 1779 1778 focus $inner.cancel 1780 1779 1781 Se rverCmd "print $token $width $height $bgcolor"1780 SendCmd "print $token $width $height $bgcolor" 1782 1781 1783 1782 $popup activate $widget below … … 1843 1842 set _settings($this-spherescale) $radius 1844 1843 if { $models == "all" } { 1845 Se rverCmd "spherescale -model all $radius"1844 SendCmd "spherescale -model all $radius" 1846 1845 return 1847 1846 } 1848 1847 set overrideradius [expr $radius * 0.8] 1849 Se rverCmd "spherescale -model all $overrideradius"1848 SendCmd "spherescale -model all $overrideradius" 1850 1849 foreach model $models { 1851 1850 if { [info exists _active($model)] } { 1852 Se rverCmd "spherescale -model $model $radius"1851 SendCmd "spherescale -model $model $radius" 1853 1852 } 1854 1853 } … … 1879 1878 set _settings($this-stickradius) $radius 1880 1879 if { $models == "all" } { 1881 Se rverCmd "stickradius -model all $radius"1880 SendCmd "stickradius -model all $radius" 1882 1881 return 1883 1882 } 1884 1883 set overrideradius [expr $radius * 0.8] 1885 Se rverCmd "stickradius -model all $overrideradius"1884 SendCmd "stickradius -model all $overrideradius" 1886 1885 foreach model $models { 1887 1886 if { [info exists _active($model)] } { 1888 Se rverCmd "stickradius -model $model $radius"1887 SendCmd "stickradius -model $model $radius" 1889 1888 } 1890 1889 } … … 1918 1917 set models [array names _active] 1919 1918 if { [llength $models] == 0 } { 1920 Se rverCmd "transparency -model all $transparency"1919 SendCmd "transparency -model all $transparency" 1921 1920 return 1922 1921 } 1923 1922 set overridetransparency 0.60 1924 Se rverCmd "transparency -model all $overridetransparency"1923 SendCmd "transparency -model all $overridetransparency" 1925 1924 foreach model $models { 1926 Se rverCmd "transparency -model $model $transparency"1925 SendCmd "transparency -model $model $transparency" 1927 1926 } 1928 1927 } … … 1948 1947 set _settings($this-showlabels) $showlabels 1949 1948 if { $models == "all" } { 1950 Se rverCmd "label -model all $showlabels"1949 SendCmd "label -model all $showlabels" 1951 1950 return 1952 1951 } 1953 Se rverCmd "label -model all off"1952 SendCmd "label -model all off" 1954 1953 if { $showlabels } { 1955 1954 foreach model $models { 1956 1955 if { [info exists _active($model)] } { 1957 Se rverCmd "label -model $model $showlabels"1956 SendCmd "label -model $model $showlabels" 1958 1957 } 1959 1958 } … … 1980 1979 set _settings($this-cartoontrace) $trace 1981 1980 if { $models == "all" } { 1982 Se rverCmd "cartoontrace -model all $trace"1981 SendCmd "cartoontrace -model all $trace" 1983 1982 return 1984 1983 } 1985 Se rverCmd "cartoontrace -model all off"1984 SendCmd "cartoontrace -model all off" 1986 1985 if { $trace } { 1987 1986 foreach model $models { 1988 1987 if { [info exists _active($model)] } { 1989 Se rverCmd "cartoontrace -model $model $trace"1988 SendCmd "cartoontrace -model $model $trace" 1990 1989 } 1991 1990 } -
branches/1.4/gui/scripts/vtksurfaceviewer.tcl
r5173 r5174 99 99 private method Rotate {option x y} 100 100 private method SetCurrentColormap { color } 101 private method SetCurrentFieldName { dataobj } 101 102 private method SetLegendTip { x y } 102 103 private method SetObjectStyle { dataobj comp } … … 924 925 set _first "" 925 926 SendCmd "dataset visible 0" 927 eval scale $_dlist 926 928 foreach dataobj [get -objects] { 927 929 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 928 930 set _first $dataobj 931 SetCurrentFieldName $dataobj 929 932 } 930 933 set _obj2datasets($dataobj) "" … … 964 967 } 965 968 966 if { $_first != "" } {967 $itk_component(field) choices delete 0 end968 $itk_component(fieldmenu) delete 0 end969 array unset _fields970 set _curFldName ""971 foreach cname [$_first components] {972 foreach fname [$_first fieldnames $cname] {973 if { [info exists _fields($fname)] } {974 continue975 }976 foreach { label units components } \977 [$_first fieldinfo $fname] break978 $itk_component(field) choices insert end "$fname" "$label"979 $itk_component(fieldmenu) add radiobutton -label "$label" \980 -value $label -variable [itcl::scope _curFldLabel] \981 -selectcolor red \982 -activebackground $itk_option(-plotbackground) \983 -activeforeground $itk_option(-plotforeground) \984 -font "Arial 8" \985 -command [itcl::code $this Combo invoke]986 set _fields($fname) [list $label $units $components]987 if { $_curFldName == "" } {988 set _curFldName $fname989 set _curFldLabel $label990 }991 }992 }993 $itk_component(field) value $_curFldLabel994 }995 969 InitSettings -isolinesvisible -surfacevisible -outline 996 970 if { $_reset } { … … 1020 994 set _reset 0 1021 995 } 996 # Redraw the legend even if we're using the same colormap. The position 997 # of the isolines may have changed because the range of data changed. 998 DrawLegend 1022 999 1023 1000 # Actually write the commands to the server socket. If it fails, we don't … … 1914 1891 set tag $dataobj-$comp 1915 1892 array set style { 1916 -color BCGYR1917 -edgecolor black1918 -edges 01919 -isolinecolor white1893 -color BCGYR 1894 -edgecolor black 1895 -edges 0 1896 -isolinecolor white 1920 1897 -isolinesvisible 0 1921 -levels 101922 -lighting 11923 -linewidth 1.01924 -opacity 1.01925 -outline 01926 -surfacevisible 11927 -wireframe 01898 -levels 10 1899 -lighting 1 1900 -linewidth 1.0 1901 -opacity 1.0 1902 -outline 0 1903 -surfacevisible 1 1904 -wireframe 0 1928 1905 } 1929 1906 array set style [$dataobj style $comp] … … 1985 1962 1986 1963 SendCmd "polydata add $tag" 1964 if { $_curFldName != "" } { 1965 SendCmd "polydata colormode $_colorMode $_curFldName $tag" 1966 } 1987 1967 SendCmd "polydata edges $style(-edges) $tag" 1988 1968 set _settings(-surfaceedges) $style(-edges) … … 2343 2323 blt::vector destroy $v 2344 2324 } 2325 2326 itcl::body Rappture::VtkSurfaceViewer::SetCurrentFieldName { dataobj } { 2327 set _first $dataobj 2328 $itk_component(field) choices delete 0 end 2329 $itk_component(fieldmenu) delete 0 end 2330 array unset _fields 2331 set _curFldName "" 2332 foreach cname [$_first components] { 2333 foreach fname [$_first fieldnames $cname] { 2334 if { [info exists _fields($fname)] } { 2335 continue 2336 } 2337 foreach { label units components } \ 2338 [$_first fieldinfo $fname] break 2339 $itk_component(field) choices insert end "$fname" "$label" 2340 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2341 -value $label -variable [itcl::scope _curFldLabel] \ 2342 -selectcolor red \ 2343 -activebackground $itk_option(-plotbackground) \ 2344 -activeforeground $itk_option(-plotforeground) \ 2345 -font "Arial 8" \ 2346 -command [itcl::code $this LegendTitleAction save] 2347 set _fields($fname) [list $label $units $components] 2348 if { $_curFldName == "" } { 2349 set _curFldName $fname 2350 set _curFldLabel $label 2351 } 2352 } 2353 } 2354 $itk_component(field) value $_curFldLabel 2355 }
Note: See TracChangeset
for help on using the changeset viewer.