Changeset 1711
- Timestamp:
- May 14, 2010, 8:22:20 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/molvisviewer.tcl
r1567 r1711 40 40 41 41 itk_option define -device device Device "" 42 43 private variable _icon 0 44 45 private variable _mevent; # info used for mouse event operations 46 private variable _rocker; # info used for rock operations 47 private variable _dlist ""; # list of dataobj objects 48 private variable _dataobjs; # data objects on server 49 private variable _dobj2transparency;# maps dataobj => transparency 50 private variable _dobj2raise; # maps dataobj => raise flag 0/1 51 52 private variable _active; # array of active models. 53 private variable _obj2models; # array containing list of models 54 # for each data object. 55 56 private variable _view 57 private variable _click 58 59 private variable _model 60 private variable _mlist 61 private variable _mrepresentation "ballnstick" 62 63 private variable _imagecache 64 private variable _state 65 private variable _labels "default" 66 private variable _cacheid "" 67 private variable _cacheimage "" 68 69 private variable _delta1 10 70 private variable _delta2 2 71 72 private common _settings ; # Array of settings for all known 73 # widgets 74 private variable _initialized 75 76 private common _downloadPopup; # Download options from popup 77 private variable _pdbdata; # PDB data from run file sent to pymol 78 private common _hardcopy 79 private variable _nextToken 0 80 private variable _outbuf ""; 81 private variable _buffering 0; 82 private variable _resizePending 0; 83 private variable _width 84 private variable _height 85 private variable _restore 1; # Restore camera settings 42 86 43 87 constructor { hostlist args } { … … 92 136 private method EnableDownload { popup what } 93 137 94 private variable _icon 095 96 private variable _mevent; # info used for mouse event operations97 private variable _rocker; # info used for rock operations98 private variable _dlist ""; # list of dataobj objects99 private variable _dataobjs; # data objects on server100 private variable _dobj2transparency;# maps dataobj => transparency101 private variable _dobj2raise; # maps dataobj => raise flag 0/1102 103 private variable _active; # array of active models.104 private variable _obj2models; # array containing list of models105 # for each data object.106 107 private variable _view108 private variable _click109 110 private variable _model111 private variable _mlist112 private variable _mrepresentation "ballnstick"113 114 private variable _imagecache115 private variable _state116 private variable _labels "default"117 private variable _cacheid ""118 private variable _cacheimage ""119 120 private variable _delta1 10121 private variable _delta2 2122 123 private common _settings ; # Array of settings for all known124 # widgets125 private variable _initialized126 127 private common _downloadPopup; # Download options from popup128 private variable _pdbdata; # PDB data from run file sent to pymol129 private common _hardcopy130 private variable _nextToken 0131 private variable _outbuf "";132 private variable _buffering 0;133 private variable _resizePending 0;134 private variable _width135 private variable _height136 138 } 137 139 … … 179 181 set _state(client) 1 180 182 set _hostlist $hostlist 183 set _restore 1 181 184 182 185 array set _view { … … 595 598 return 0 596 599 } 600 set _restore 1 597 601 set result [VisViewer::Connect $hosts] 598 602 if { $result } { … … 665 669 global count 666 670 incr count 667 debug "$count: cacheid=$cacheid frame=$frame\n"668 671 if { $cacheid != $_cacheid } { 669 672 array unset _imagecache … … 702 705 set _buffering 1 703 706 704 set _rocker(server) 0 705 set _cacheid 0 706 SendCmd "raw -defer {set auto_color,0}" 707 SendCmd "raw -defer {set auto_show_lines,0}" 708 707 if { $_restore } { 708 set _rocker(server) 0 709 set _cacheid 0 710 SendCmd "raw -defer {set auto_color,0}" 711 SendCmd "raw -defer {set auto_show_lines,0}" 712 SendCmd "raw -defer {set connect_mode,1}" 713 } 709 714 set dlist [get] 710 715 foreach dataobj $dlist { … … 797 802 set _mlist($model) 1 798 803 } 799 800 804 if { $_mlist($model) == 1 } { 801 805 if { [info exists _model($model-newtransparency)] || … … 842 846 Update 843 847 } 844 # Reset viewing parameters 845 set w [winfo width $itk_component(3dview)] 846 set h [winfo height $itk_component(3dview)] 847 SendCmd [subst { 848 reset 849 screen $w $h 850 rotate $_view(mx) $_view(my) $_view(mz) 851 pan $_view(x) $_view(y) 852 zoom $_view(zoom) 853 }] 854 debug "rebuild: rotate $_view(mx) $_view(my) $_view(mz)" 855 856 # foreach all models 857 spherescale update 858 stickradius update 859 labels update 860 opacity update 861 cartoontrace update 862 863 projection update 864 representation update 848 if { $_restore } { 849 # Set or restore viewing parameters. We do this for the first 850 # model and assume this works for everything else. 851 set w [winfo width $itk_component(3dview)] 852 set h [winfo height $itk_component(3dview)] 853 SendCmd [subst { 854 reset 855 screen $w $h 856 rotate $_view(mx) $_view(my) $_view(mz) 857 pan $_view(x) $_view(y) 858 zoom $_view(zoom) 859 }] 860 debug "rebuild: rotate $_view(mx) $_view(my) $_view(mz)" 861 # foreach all models 862 spherescale update 863 stickradius update 864 labels update 865 opacity update 866 cartoontrace update 867 868 projection update 869 representation update 870 set _restore 0 871 } 865 872 866 873 set _buffering 0; # Turn off buffering. … … 999 1006 after cancel $_rocker(afterid) 1000 1007 unset _rocker(afterid) 1008 } 1009 if { ![winfo viewable $itk_component(3dview)] } { 1010 return 1001 1011 } 1002 1012 set _rocker(on) $_settings($this-rock) … … 1356 1366 } 1357 1367 set _dobj2raise($dataobj) $params(-raise) 1368 debug "setting parameters for $dataobj\n" 1358 1369 1359 1370 if { [isconnected] } { 1371 debug "calling rebuild\n" 1360 1372 $_dispatcher event -idle !rebuild 1361 1373 } … … 1614 1626 set _settings($this-spherescale) $radius 1615 1627 if { $models == "all" } { 1616 set models [array names _mlist] 1628 SendCmd "spherescale -model all $radius" 1629 return 1617 1630 } 1618 1631 set overrideradius [expr $radius * 0.8] … … 1649 1662 set _settings($this-stickradius) $radius 1650 1663 if { $models == "all" } { 1651 set models [array names _mlist] 1664 SendCmd "stickradius -model all $radius" 1665 return 1652 1666 } 1653 1667 set overrideradius [expr $radius * 0.8] … … 1683 1697 } 1684 1698 set _settings($this-opacity) $opacity 1699 set transparency [expr 1.0 - $opacity] 1685 1700 if { $models == "all" } { 1686 set models [array names _mlist] 1701 SendCmd "transparency -model all $transparency" 1702 return 1687 1703 } 1688 1704 set overridetransparency 0.60 1689 set transparency [expr 1.0 - $opacity]1690 1705 SendCmd "transparency -model all $overridetransparency" 1691 1706 foreach model $models { … … 1714 1729 set _settings($this-showlabels) $showlabels 1715 1730 if { $models == "all" } { 1716 set models [array names _mlist] 1731 SendCmd "label -model all $showlabels" 1732 return 1717 1733 } 1718 1734 SendCmd "label -model all off" … … 1744 1760 set _settings($this-cartoontrace) $trace 1745 1761 if { $models == "all" } { 1746 set models [array names _mlist] 1762 SendCmd "cartoontrace -model all $trace" 1763 return 1747 1764 } 1748 1765 SendCmd "cartoontrace -model all off" … … 1849 1866 } 1850 1867 } 1868
Note: See TracChangeset
for help on using the changeset viewer.