- Timestamp:
- Nov 16, 2011, 12:56:37 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/configure.in
r2663 r2688 135 135 done 136 136 137 138 137 AC_ARG_WITH( 139 138 [ffmpeg], … … 165 164 166 165 TCL_INC_SPEC="$TCL_INCLUDE_SPEC" 167 168 166 169 167 AC_ARG_WITH( … … 244 242 # is all taken from the tclConfig.sh file. 245 243 #-------------------------------------------------------------------- 246 247 244 248 245 if test -f "${exec_prefix}/lib/tclConfig.sh" ; then -
trunk/gui/apps/Makefile.in
r2577 r2688 29 29 $(srcdir)/vtkviewer-test \ 30 30 $(srcdir)/flowvis-test \ 31 $(srcdir)/rpdiff \ 31 32 rappture \ 32 33 rappture.env \ … … 34 35 rappture.use \ 35 36 rerun \ 36 rpdiff \37 37 simsim \ 38 38 xmldiff \ … … 56 56 57 57 distclean: clean 58 $(RM) encodedata rappture.env rappture rappture.use rerun rpdiffsimsim xmldiff58 $(RM) encodedata rappture.env rappture rappture.use rerun simsim xmldiff 59 59 $(RM) Makefile *~ 60 60 -
trunk/gui/scripts/heightmapviewer.tcl
r2671 r2688 72 72 private method BuildCameraTab {} 73 73 private method PanCamera {} 74 75 private method AddImageControls { frame widget } 76 private method SetWaitVariable { value } { 77 set _getimage $value 78 } 79 private method GetWaitVariable {} { 80 return $_getimage 81 } 82 private method WaitForImage {} { 83 tkwait variable [itcl::scope _getimage] 84 return $_getimage 85 } 86 74 87 protected method CurrentSurfaces {{what -all}} 75 88 protected method Rebuild {} … … 104 117 private variable _resizePending 0 105 118 private variable _resizeLegendPending 0 119 private variable _frame 0; # Current frame number. 120 private variable _getimage 0; 121 private variable _downloadPopup 106 122 } 107 123 … … 138 154 $_parser alias legend [itcl::code $this ReceiveLegend] 139 155 156 array set _downloadPopup { 157 format image 158 image_controls "" 159 } 140 160 # Initialize the view to some default parameters. 141 161 array set _view { … … 482 502 } 483 503 controls { 484 # no controls for this download yet 485 return "" 504 set popup .heightmapviewerdownload 505 if {![winfo exists $popup]} { 506 # If we haven't created the popup yet, do it now 507 Rappture::Balloon $popup \ 508 -title "[Rappture::filexfer::label downloadWord] as..." 509 set inner [$popup component inner] 510 label $inner.summary -text "" -anchor w 511 pack $inner.summary -side top 512 radiobutton $inner.image -text "Image (PNG/JPEG/GIF)" \ 513 -variable \ 514 ::Rappture::HeightmapViewer::_downloadPopup(format) \ 515 -font "Arial 10 " \ 516 -value image 517 Rappture::Tooltip::for $inner.image "Save as image." 518 pack $inner.image -anchor w 519 button $inner.go -text [Rappture::filexfer::label download] \ 520 -command [lindex $args 0] 521 pack $inner.go -side bottom -pady 4 522 $inner.image select 523 } else { 524 set inner [$popup component inner] 525 } 526 set num [llength [get]] 527 set num [expr {($num == 1) ? "1 result" : "$num results"}] 528 set word [Rappture::filexfer::label downloadWord] 529 $inner.summary configure -text "$word $num in the following format:" 530 update idletasks ; # Fix initial sizes 531 return $popup 486 532 } 487 533 now { 488 # Get the image data (as base64) and decode it back to binary. 489 # This is better than writing to temporary files. When we switch 490 # to the BLT picture image it won't be necessary to decode the 491 # image data. 492 set bytes [$_image(download) data -format "jpeg -quality 100"] 493 set bytes [Rappture::encoding::decode -as b64 $bytes] 494 return [list .jpg $bytes] 534 set popup .heightmapviewerdownload 535 if { [winfo exists $popup] } { 536 $popup deactivate 537 } 538 switch -- $_downloadPopup(format) { 539 "image" { 540 set popup .heightmapviewerimage 541 if { ![winfo exists $popup] } { 542 # Create the balloon popup and and the print image 543 # dialog widget to it. 544 Rappture::Balloon $popup -title "Save as image..." \ 545 -deactivatecommand \ 546 [itcl::code $this SetWaitVariable 0] 547 set inner [$popup component inner] 548 AddImageControls $inner [lindex $args 0] 549 } else { 550 set inner [$popup component inner] 551 } 552 set _downloadPopup(image_controls) $inner 553 update 554 # Activate the popup and call for the output. 555 foreach { widget toolName plotName } $args break 556 SetWaitVariable 0 557 $popup activate $widget left 558 set bool [WaitForImage] 559 $popup deactivate 560 if { $bool } { 561 set inner $_downloadPopup(image_controls) 562 set fmt [$inner.format translate [$inner.format value]] 563 # Get the image data (as base64) and decode it back to 564 # binary. This is better than writing to temporary 565 # files. When we switch to the BLT picture image it 566 # won't be necessary to decode the image data. 567 switch $fmt { 568 "jpg" { 569 set bytes [$_image(download) data \ 570 -format "jpeg -quality 100"] 571 } 572 "png" { 573 set bytes [$_image(download) data -format "png"] 574 } 575 "gif" { 576 set bytes [$_image(download) data -format "gif"] 577 } 578 default { 579 return "" 580 } 581 } 582 set bytes [Rappture::encoding::decode -as b64 $bytes] 583 return [list .$fmt $bytes] 584 } 585 } 586 } 587 return "" 495 588 } 496 589 default { … … 1278 1371 return $img 1279 1372 } 1373 1374 1375 itcl::body Rappture::HeightmapViewer::AddImageControls { inner widget } { 1376 label $inner.size_l -text "Size:" -font "Arial 9" 1377 set _downloadPopup(image_controls) $inner 1378 set img $_image(plot) 1379 set res "[image width $img]x[image height $img]" 1380 Rappture::Combobox $inner.size -width 30 -editable no 1381 $inner.size choices insert end \ 1382 "draft" "Draft ($res)" 1383 1384 label $inner.bgcolor_l -text "Background:" -font "Arial 9" 1385 Rappture::Combobox $inner.bgcolor -width 30 -editable no 1386 $inner.bgcolor choices insert end \ 1387 "black" "Black" \ 1388 "white" "White" 1389 1390 label $inner.format_l -text "Format:" -font "Arial 9" 1391 Rappture::Combobox $inner.format -width 30 -editable no 1392 $inner.format choices insert end \ 1393 "png" "PNG (Portable Network Graphics format)" \ 1394 "jpg" "JPEG (Joint Photographic Experts Group format)" 1395 1396 button $inner.go -text [Rappture::filexfer::label download] \ 1397 -command [itcl::code $this SetWaitVariable 1] 1398 1399 blt::table $inner \ 1400 0,0 $inner.format_l -anchor e \ 1401 0,1 $inner.format -anchor w -fill x \ 1402 1,0 $inner.size_l -anchor e \ 1403 1,1 $inner.size -anchor w -fill x \ 1404 2,0 $inner.bgcolor_l -anchor e \ 1405 2,1 $inner.bgcolor -anchor w -fill x \ 1406 6,0 $inner.go -cspan 2 -pady 5 1407 $inner.bgcolor value "Black" 1408 $inner.size value "Draft ($res)" 1409 $inner.format value "PNG (Portable Network Graphics format)" 1410 } -
trunk/gui/scripts/histogramresult.tcl
r2547 r2688 792 792 } 793 793 } 794 set stepsize 1.0 794 795 if { [array size _xlabels] > 0 } { 795 796 set command [itcl::code $this FormatLabels] 797 if { [array size _xlabels] > 20 } { 798 set stepsize 0.0 799 } 796 800 } else { 797 801 set command "" 798 802 } 799 $g axis configure x -command $command 803 $g axis configure x -command $command -stepsize $stepsize 800 804 $g configure -invertxy $invert 801 805 $itk_component(legend) reset -
trunk/gui/scripts/molvisviewer.tcl
r2671 r2688 41 41 itk_option define -device device Device "" 42 42 43 44 43 private variable _icon 0 44 private variable _getimage 0 45 45 46 46 private variable _mevent; # info used for mouse event operations … … 107 107 private method ReceiveImage { size cacheid frame rock } 108 108 private method WaitIcon { option widget } 109 private method DownloadPopup { popup command } 110 private method EnableDownload { popup what } 109 110 private method AddImageControls { frame widget } 111 private method SetWaitVariable { value } { 112 set _getimage $value 113 } 114 private method WaitForResponse {} { 115 tkwait variable [itcl::scope _getimage] 116 return $_getimage 117 } 111 118 112 119 protected method Map {} … … 116 123 protected method SendCmd { string } 117 124 protected method Unmap {} 118 protected method Update { args }119 125 protected method Vmouse {option b m x y} 120 126 protected method Vmouse2 {option b m x y} … … 133 139 # do nothing 134 140 } 141 142 private method UpdateState { args } 143 135 144 public method snap { w h } 136 145 private method Opacity {option} … … 166 175 $_dispatcher dispatch $this !resize "[itcl::code $this DoResize]; list" 167 176 168 # Update event177 # Update state event 169 178 $_dispatcher register !update 170 179 $_dispatcher dispatch $this !update "[itcl::code $this DoUpdate]; list" … … 559 568 controls { 560 569 set popup .molvisviewerdownload 561 if { ![winfo exists .molvisviewerdownload] } { 562 set inner [DownloadPopup $popup [lindex $args 0]] 570 if {![winfo exists $popup]} { 571 # if we haven't created the popup yet, do it now 572 Rappture::Balloon $popup \ 573 -title "[Rappture::filexfer::label downloadWord] as..." 574 set inner [$popup component inner] 575 label $inner.summary -text "" -anchor w 576 radiobutton $inner.pdb \ 577 -text "PDB Protein Data Bank Format File" \ 578 -variable [itcl::scope _downloadPopup(format)] \ 579 -font "Arial 10 " \ 580 -value pdb 581 Rappture::Tooltip::for $inner.pdb \ 582 "Save as PDB Protein Data Bank format file." 583 radiobutton $inner.image -text "Image (PNG/JPEG/GIF)" \ 584 -variable [itcl::scope _downloadPopup(format)] \ 585 -font "Arial 10 " \ 586 -value image 587 Rappture::Tooltip::for $inner.image \ 588 "Save as image." 589 set f [frame $inner.frame] 590 button $f.ok -text "Save" \ 591 -highlightthickness 0 -pady 3 -padx 3 \ 592 -command [lindex $args 0] \ 593 -compound left \ 594 -image [Rappture::icon download] 595 button $f.cancel -text "Cancel" \ 596 -highlightthickness 0 -pady 3 -padx 3 \ 597 -command [list $popup deactivate] \ 598 -compound left \ 599 -image [Rappture::icon cancel] 600 blt::table $f \ 601 0,0 $f.ok \ 602 0,1 $f.cancel 603 blt::table $inner \ 604 0,0 $inner.pdb -anchor w \ 605 1,0 $inner.image -anchor w \ 606 2,0 $f -fill x -pady 4 607 $inner.pdb select 563 608 } else { 564 609 set inner [$popup component inner] 565 610 } 566 set _downloadPopup(image_controls) $inner.image_frame567 611 set num [llength [get]] 568 612 set num [expr {($num == 1) ? "1 result" : "$num results"}] … … 573 617 } 574 618 now { 575 576 619 set popup .molvisviewerdownload 577 if {[winfo exists .molvisviewerdownload]} {620 if {[winfo exists $popup]} { 578 621 $popup deactivate 579 622 } 580 623 switch -- $_downloadPopup(format) { 581 "image" {582 return [$this GetImage [lindex $args 0]]583 }584 624 "pdb" { 585 625 return [list .pdb $_pdbdata] 586 } 626 } 627 "image" { 628 set popup .molvisviewerimage 629 if { ![winfo exists $popup] } { 630 # Create the balloon popup and and the print image 631 # dialog widget to it. 632 Rappture::Balloon $popup -title "Save as image..." \ 633 -deactivatecommand \ 634 [itcl::code $this SetWaitVariable 0] 635 set inner [$popup component inner] 636 # Add image controls to the ballon popup 637 AddImageControls $inner [lindex $args 0] 638 } else { 639 set inner [$popup component inner] 640 } 641 update 642 # Activate the popup and call for the output. 643 foreach { widget toolName plotName } $args break 644 SetWaitVariable 0 645 $popup activate $widget left 646 set bool [WaitForResponse] 647 $popup deactivate 648 if { $bool } { 649 return [GetImage $widget] 650 } 651 return "" 652 } 587 653 } 588 654 } … … 688 754 set count 0 689 755 itcl::body Rappture::MolvisViewer::ReceiveImage { size cacheid frame rock } { 756 puts stderr "ReceiveImage size=$size cacheid=$cacheid frame=$frame rock=$rock" 690 757 global readyForNextFrame 691 758 set readyForNextFrame 1 … … 700 767 set data [ReceiveBytes $size] 701 768 #debug "success: reading $size bytes from proxy\n" 702 if { $cacheid == "print"} {769 if { [string match "print*" $cacheid] } { 703 770 # $frame is the token that we sent to the proxy. 704 set _hardcopy($this-$frame) $data 771 set _hardcopy($this-$cacheid) $data 772 puts stderr "setting _hardcopy($this-$cacheid)" 705 773 } else { 706 774 set _imagecache($tag) $data 707 775 #debug "CACHED: $tag,$cacheid" 708 776 $_image(plot) configure -data $data 709 if 0 {710 $_image(plot) write dummy.jpg -format jpeg711 puts stderr "image width=[image width $_image(plot)] height=[image height $_image(plot)]"712 puts stderr "screen width=$_width height=$_height"713 }714 777 set _image(id) $tag 715 778 } … … 1033 1096 } else { 1034 1097 set _state(client) $state 1035 Update 1098 UpdateState 1036 1099 set flush 0 1037 1100 } … … 1131 1194 itcl::body Rappture::MolvisViewer::DoRotate {} { 1132 1195 SendCmd "rotate $_view(a) $_view(b) $_view(c)" 1196 array unset _imagecache 1133 1197 set _rotatePending 0 1134 1198 } … … 1145 1209 1146 1210 itcl::body Rappture::MolvisViewer::DoUpdate { } { 1147 set scale $_settings($this-spherescale) 1148 set radius $_settings($this-stickradius) 1149 set overridescale [expr $scale * 0.8] 1150 set overrideradius [expr $radius * 0.8] 1151 SendCmd "spherescale -model all $overridescale" 1152 SendCmd "stickradius -model all $overrideradius" 1211 array unset _imagecache 1153 1212 set models [array names _mlist] 1154 foreach model $models { 1155 if { [info exists _active($model)] } { 1156 SendCmd "spherescale -model $model $scale" 1157 SendCmd "stickradius -model $model $radius" 1158 } 1159 } 1213 SphereScale $_settings($this-spherescale) $models 1214 StickRadius $_settings($this-stickradius) $models 1160 1215 set _updatePending 0 1161 1216 } … … 1182 1237 set _view(x) [expr $_view(x) + $dx] 1183 1238 set _view(y) [expr $_view(y) + $dy] 1239 array unset _imagecache 1184 1240 SendCmd "pan $dx $dy" 1185 1241 return … … 1196 1252 set _view(x) [expr $_view(x) + $dx] 1197 1253 set _view(y) [expr $_view(y) + $dy] 1254 array unset _imagecache 1198 1255 SendCmd "pan $dx $dy" 1199 1256 } … … 1228 1285 } 1229 1286 } 1230 } 1231 1232 itcl::body Rappture::MolvisViewer::Update { args } { 1287 array unset _imagecache 1288 } 1289 1290 itcl::body Rappture::MolvisViewer::UpdateState { args } { 1233 1291 set tag "$_state(client),$_rocker(client)" 1234 1292 if { $_image(id) != "$tag" } { … … 1269 1327 SendCmd "rock $_rocker(client)" 1270 1328 } 1271 Update 1329 UpdateState 1272 1330 } 1273 1331 if { $_rocker(on) && $option != "pause" } { … … 1492 1550 set option $_settings($this-model) 1493 1551 } 1552 array unset _imagecache 1494 1553 if { $option == "sticks" } { 1495 1554 set _settings($this-modelimg) [Rappture::icon lines] … … 1504 1563 set _settings($this-model) $option 1505 1564 set _mrep $option 1506 1507 1565 1508 1566 foreach model [array names _mlist] { … … 1530 1588 # ---------------------------------------------------------------------- 1531 1589 itcl::body Rappture::MolvisViewer::OrthoProjection {option} { 1590 array unset _imagecache 1532 1591 switch -- $option { 1533 1592 "orthoscopic" { … … 1591 1650 return 1592 1651 } 1652 array unset _imagecache 1593 1653 if { $cell } { 1594 1654 Rappture::Tooltip::for $itk_component(ortho) \ … … 1661 1721 1662 1722 set controls $_downloadPopup(image_controls) 1663 set combo $controls.size _combo1723 set combo $controls.size 1664 1724 set size [$combo translate [$combo value]] 1665 1725 switch -- $size { … … 1677 1737 } 1678 1738 default { 1679 error "unknown image size [$ inner.image_size_combo value]"1739 error "unknown image size [$combo value]" 1680 1740 } 1681 1741 } … … 1703 1763 set inner [$popup component inner] 1704 1764 } 1705 set combo $controls.bgcolor _combo1765 set combo $controls.bgcolor 1706 1766 set bgcolor [$combo translate [$combo value]] 1707 1767 … … 1728 1788 1729 1789 if { $_hardcopy($this-$token) != "" } { 1730 set combo $controls. type_combo1731 set type[$combo translate [$combo value]]1732 switch -- $ type{1790 set combo $controls.format 1791 set fmt [$combo translate [$combo value]] 1792 switch -- $fmt { 1733 1793 "jpg" { 1734 1794 set img [image create photo -data $_hardcopy($this-$token)] … … 1835 1895 1836 1896 itcl::body Rappture::MolvisViewer::Opacity { option } { 1897 array unset _imagecache 1837 1898 if { $option == "update" } { 1838 1899 set opacity $_settings($this-opacity) … … 1875 1936 error "bad option \"$option\"" 1876 1937 } 1938 # Clear the image cache 1939 array unset _imagecache 1877 1940 set _settings($this-showlabels) $showlabels 1878 1941 if { $models == "all" } { … … 1898 1961 # ---------------------------------------------------------------------- 1899 1962 itcl::body Rappture::MolvisViewer::CartoonTrace {option {models "all"}} { 1963 array unset _imagecache 1900 1964 set trace $_settings($this-cartoontrace) 1901 1965 if { $option == "update" } { … … 1921 1985 } 1922 1986 1923 itcl::body Rappture::MolvisViewer::DownloadPopup { popup command } { 1924 Rappture::Balloon $popup \ 1925 -title "[Rappture::filexfer::label downloadWord] as..." 1926 set inner [$popup component inner] 1927 label $inner.summary -text "" -anchor w -font "Arial 11 bold" 1928 radiobutton $inner.pdb_button -text "PDB Protein Data Bank Format File" \ 1929 -variable [itcl::scope _downloadPopup(format)] \ 1930 -command [itcl::code $this EnableDownload $popup pdb] \ 1931 -font "Arial 10 " \ 1932 -value pdb 1933 Rappture::Tooltip::for $inner.pdb_button \ 1934 "Save as PDB Protein Data Bank format file." 1935 radiobutton $inner.image_button -text "Image File" \ 1936 -variable [itcl::scope _downloadPopup(format)] \ 1937 -command [itcl::code $this EnableDownload $popup image] \ 1938 -font "Arial 10 " \ 1939 -value image 1940 Rappture::Tooltip::for $inner.image_button \ 1941 "Save as digital image." 1942 1943 set controls [frame $inner.image_frame -bd 2 -relief groove] 1944 label $controls.size_label -text "Size:" \ 1945 -font "Arial 9" 1987 itcl::body Rappture::MolvisViewer::AddImageControls { inner widget } { 1988 label $inner.size_l -text "Size:" -font "Arial 9" 1989 set _downloadPopup(image_controls) $inner 1946 1990 set img $_image(plot) 1947 1991 set res "[image width $img]x[image height $img]" 1948 Rappture::Combobox $ controls.size_combo -width 20 -editable no1949 $ controls.size_combochoices insert end \1992 Rappture::Combobox $inner.size -width 30 -editable no 1993 $inner.size choices insert end \ 1950 1994 "draft" "Draft (400x400)" \ 1951 1995 "standard" "Standard (1200x1200)" \ 1952 1996 "highquality" "High Quality (2400x2400)" 1953 1997 1954 label $controls.bgcolor_label -text "Background:" \ 1955 -font "Arial 9" 1956 Rappture::Combobox $controls.bgcolor_combo -width 20 -editable no 1957 $controls.bgcolor_combo choices insert end \ 1998 label $inner.bgcolor_l -text "Background:" -font "Arial 9" 1999 Rappture::Combobox $inner.bgcolor -width 30 -editable no 2000 $inner.bgcolor choices insert end \ 1958 2001 "black" "Black" \ 1959 2002 "white" "White" \ 1960 2003 "none" "Transparent (PNG only)" 1961 2004 1962 label $controls.type_label -text "Type:" \ 1963 -font "Arial 9" 1964 Rappture::Combobox $controls.type_combo -width 20 -editable no 1965 $controls.type_combo choices insert end \ 1966 "jpg" "JPEG Joint Photographic Experts Group Format (*.jpg)" \ 1967 "png" "PNG Portable Network Graphics Format (*.png)" 1968 1969 button $inner.go -text [Rappture::filexfer::label download] \ 1970 -command $command 1971 1972 blt::table $controls \ 1973 1,0 $controls.size_label -anchor e \ 1974 1,1 $controls.size_combo -anchor w -fill x \ 1975 2,0 $controls.bgcolor_label -anchor e \ 1976 2,1 $controls.bgcolor_combo -anchor w -fill x \ 1977 3,0 $controls.type_label -anchor e \ 1978 3,1 $controls.type_combo -anchor w -fill x 1979 blt::table configure $controls r0 -height 16 1980 blt::table configure $controls -padx 4 -pady {0 6} 2005 label $inner.format_l -text "Format:" -font "Arial 9" 2006 Rappture::Combobox $inner.format -width 30 -editable no 2007 $inner.format choices insert end \ 2008 "png" "PNG (Portable Network Graphics format)" \ 2009 "jpg" "JPEG (Joint Photographic Experts Group format)" \ 2010 "gif" "GIF (GIF Graphics Interchange Format)" 2011 2012 set f [frame $inner.frame] 2013 button $f.ok -text "Save" \ 2014 -highlightthickness 0 -pady 3 -padx 3 \ 2015 -command [itcl::code $this SetWaitVariable 1] \ 2016 -compound left \ 2017 -image [Rappture::icon download 2018 ] 2019 button $f.cancel -text "Cancel" \ 2020 -highlightthickness 0 -pady 3 -padx 3 \ 2021 -command [itcl::code $this SetWaitVariable 0] \ 2022 -compound left \ 2023 -image [Rappture::icon cancel] 2024 blt::table $f \ 2025 0,0 $f.ok \ 2026 0,1 $f.cancel 2027 1981 2028 blt::table $inner \ 1982 0,0 $inner.summary -cspan 2 \ 1983 1,0 $inner.pdb_button -cspan 2 -anchor w \ 1984 2,0 $inner.image_button -cspan 2 -rspan 2 -anchor nw -ipadx 2 -ipady 2 \ 1985 3,1 $controls -fill both \ 1986 6,0 $inner.go -cspan 2 -pady 5 1987 blt::table configure $inner c0 -width 11 1988 blt::table configure $inner r2 -height 11 1989 #blt::table configure $inner c1 -width 8 1990 raise $inner.image_button 1991 $inner.pdb_button invoke 1992 $controls.bgcolor_combo value "Black" 1993 $controls.size_combo value "Draft (400x400)" 1994 $controls.type_combo value "PNG Portable Network Graphics Format (*.png)" 1995 return $inner 1996 } 1997 1998 itcl::body Rappture::MolvisViewer::EnableDownload { popup what } { 1999 set inner [$popup component inner] 2000 switch -- $what { 2001 "pdb" { 2002 foreach w [winfo children $inner.image_frame] { 2003 $w configure -state disabled 2004 } 2005 } 2006 "image" { 2007 foreach w [winfo children $inner.image_frame] { 2008 $w configure -state normal 2009 } 2010 } 2011 default { 2012 error "unknown type of download" 2013 } 2014 } 2029 0,0 $inner.format_l -anchor e \ 2030 0,1 $inner.format -anchor w -fill x \ 2031 1,0 $inner.size_l -anchor e \ 2032 1,1 $inner.size -anchor w -fill x \ 2033 2,0 $inner.bgcolor_l -anchor e \ 2034 2,1 $inner.bgcolor -anchor w -fill x \ 2035 3,0 $f -cspan 2 -fill x 2036 blt::table configure $inner r0 r1 r2 r3 -pady { 4 0 } 2037 blt::table configure $inner r3 -pady { 4 4 } 2038 $inner.bgcolor value "Black" 2039 $inner.size value "Draft (400x400)" 2040 $inner.format value "PNG (Portable Network Graphics format)" 2015 2041 } 2016 2042 … … 2125 2151 } 2126 2152 2153 2154 -
trunk/lang/tcl/scripts/library.tcl
r2616 r2688 1 2 1 # ---------------------------------------------------------------------- 3 2 # COMPONENT: library - provides access to the XML library -
trunk/packages/vizservers/pymolproxy/pymolproxy2.c
r2637 r2688 94 94 static FILE *frecord; 95 95 static int recording = FALSE; 96 static int pymolIsAlive = TRUE; 96 97 97 98 #define WANT_DEBUG 0 … … 723 724 { 724 725 PymolProxy *p = clientData; 725 int i, push, defer, state, size;726 int i, push, defer, bool, size; 726 727 const char *model; 727 728 … … 729 730 model = "all"; 730 731 size = 14; 731 state= TRUE;732 bool = TRUE; 732 733 push = defer = FALSE; 733 734 for(i = 1; i < argc; i++) { … … 744 745 size = atoi(argv[i]); 745 746 } 746 } else if (Tcl_GetBoolean(interp, argv[i], & state) != TCL_OK) {747 } else if (Tcl_GetBoolean(interp, argv[i], &bool) != TCL_OK) { 747 748 return TCL_ERROR; 748 749 } … … 757 758 SendCmd(p, "set label_color,white,%s\nset label_size,%d,%s\n", 758 759 model, size, model); 759 if ( state) {760 if (bool) { 760 761 SendCmd(p, "label %s,\"%%s%%s\" %% (ID,name)\n", model); 761 762 } else { … … 843 844 p->flags |= FORCE_UPDATE; 844 845 } 846 p->cacheId = state; 845 847 846 848 /* Does not invalidate cache? */ … … 984 986 /* Force pymol to update the current scene. */ 985 987 SendCmd(p, "refresh\n"); 986 #ifdef notdef 987 SendCmd(p, "png \"- %d %d %d\"\n", p->frame, p->cacheId, p->rockOffset); 988 #endif 989 SendCmd(p, "png -\n"); 988 /* This is a hack. We're encoding the filename to pass extra information 989 * to the MyPNGWrite routine inside of pymol. Ideally these would be 990 * parameters of a new "molvispng" command that would be passed all the 991 * way through to MyPNGWrite. 992 * 993 * The extra information is contained in the token we get from the 994 * molvisviewer client, the frame number, and rock offset. */ 995 SendCmd(p, "png -:%d:%d:%d\n", p->cacheId, p->frame, p->rockOffset); 990 996 return p->status; 991 997 } … … 1001 1007 /* Force pymol to update the current scene. */ 1002 1008 SendCmd(p, "refresh\n"); 1003 #ifdef notdef 1004 SendCmd(p, "png \"- %d %d %d\",format=1\n", p->frame, p->cacheId, 1009 /* This is a hack. We're encoding the filename to pass extra information 1010 * to the MyPNGWrite routine inside of pymol. Ideally these would be 1011 * parameters of a new "molvispng" command that would be passed all the 1012 * way through to MyPNGWrite. 1013 * 1014 * The extra information is contained in the token we get from the 1015 * molvisviewer client, the frame number, and rock offset. */ 1016 SendCmd(p, "png -:%d:%d:%d,format=1\n", p->cacheId, p->frame, 1005 1017 p->rockOffset); 1006 #endif1007 SendCmd(p, "png -,format=1\n");1008 1018 p->flags &= ~(UPDATE_PENDING|FORCE_UPDATE); 1009 1019 return p->status; … … 1042 1052 SendCmd(p, "bg_color %s\nrefresh\n", bgcolor); 1043 1053 } 1044 SendCmd(p, "ray %d,%d\n", width, height); 1045 #ifdef notdef 1046 SendCmd(p, "png \"- print 0 0\",dpi=300\nbg_color black\n"); 1047 #endif 1048 SendCmd(p, "png -,dpi=300\nbg_color black\n"); 1054 /* This is a hack. We're encoding the filename to pass extra information 1055 * to the MyPNGWrite routine inside of pymol. Ideally these would be 1056 * parameters of a new "molvispng" command that would be passed all the 1057 * way through to MyPNGWrite. 1058 * 1059 * The extra information is contained in the token we get from the 1060 * molvisviewer client, the frame number, and rock offset. 1061 */ 1062 SendCmd(p, "png -:%s:0:0,width=%d,height=%d,ray=1,dpi=300\n", 1063 token, width, height); 1064 SendCmd(p, "bg_color black\n"); 1049 1065 return p->status; 1050 1066 } … … 1891 1907 { 1892 1908 ERROR("pymol (%d) died unexpectedly", stats.pid); 1909 pymolIsAlive = FALSE; 1893 1910 /*DoExit(1);*/ 1894 1911 } … … 1987 2004 exit(-1); 1988 2005 } else { 2006 pymolIsAlive = TRUE; 1989 2007 signal(SIGCHLD, ChildHandler); 1990 2008 } … … 2104 2122 #endif 2105 2123 Tcl_DStringInit(&command); 2106 for (;;) {2124 while (pymolIsAlive) { 2107 2125 tvPtr = NULL; 2108 2126 #if READ_DEBUG 2109 2127 DEBUG("Start I/O set"); 2110 2128 #endif 2111 while ( WaitForNextLine(&p->client, tvPtr)) {2129 while ((pymolIsAlive) && (WaitForNextLine(&p->client, tvPtr))) { 2112 2130 size_t numBytes; 2113 2131 const char *line; … … 2182 2200 #endif 2183 2201 list.headPtr = list.tailPtr = NULL; 2184 for (;;) {2202 while (pymolIsAlive) { 2185 2203 while (WaitForNextLine(bp, NULL)) { 2186 2204 Image *imgPtr; … … 2200 2218 return NULL; 2201 2219 } 2202 if (strncmp(line, "ppm image follows: ", 16) != 0) { 2220 #if WRITE_DEBUG 2221 DEBUG("Writer: line found is %s\n", line); 2222 #endif 2223 if (strncmp(line, "image follows: ", 15) != 0) { 2203 2224 continue; 2204 2225 } 2205 #ifdef notdef2206 2226 if (sscanf(line, "image follows: %d %s %d %d\n", &numBytes, cacheId, 2207 2227 &frameNum, &rockOffset) != 4) { … … 2210 2230 return NULL; 2211 2231 } 2212 #endif2213 if (sscanf(line, "ppm image follows: %d\n", &numBytes) != 1) {2214 ERROR("can't get # bytes from \"%s\"", line);2215 DEBUG("Leaving Writer thread");2216 return NULL;2217 }2218 2232 #if WRITE_DEBUG 2219 2233 DEBUG("found image line \"%.*s\"", numBytes, line); 2220 2234 #endif 2221 strcpy(cacheId, "0"); 2222 frameNum = 0; 2223 rockOffset = 0; 2224 sprintf(header, "nv>image %d %s %d %d\n", numBytes, cacheId, frameNum, 2225 rockOffset); 2235 sprintf(header, "nv>image %d %s %d %d\n", numBytes, cacheId, 2236 frameNum, rockOffset); 2226 2237 hdrLength = strlen(header); 2227 2238 #if WRITE_DEBUG 2228 DEBUG("Queueing image numBytes=%d frameNum=%d, rockOffset=%d size=%d\n", numBytes, frameNum, rockOffset, numBytes + hdrLength);2239 DEBUG("Queueing image numBytes=%d cacheId=%s, frameNum=%d, rockOffset=%d size=%d\n", numBytes, cacheId, frameNum, rockOffset, numBytes + hdrLength); 2229 2240 #endif 2230 2241 imgPtr = NewImage(&list, numBytes + hdrLength);
Note: See TracChangeset
for help on using the changeset viewer.