Changeset 5353 for branches/1.3
- Timestamp:
- Apr 29, 2015, 12:20:16 AM (10 years ago)
- Location:
- branches/1.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/gui/scripts/molvisviewer.tcl
r5220 r5353 41 41 itk_option define -device device Device "" 42 42 43 private variable _icon 044 private variable _getimage 045 private variable _mevent; # info used for mouse event operations46 private variable _rocker; # info used for rock operations47 private variable _dlist ""; # list of dataobj objects48 private variable _dataobjs; # data objects on server49 private variable _dobj2transparency;# maps dataobj => transparency50 private variable _dobj2raise; # maps dataobj => raise flag 0/151 52 private variable _active; # array of active models.53 private variable _obj2models; # array containing list of models54 # for each data object.55 private variable _view56 private variable _click57 58 private variable _model59 private variable _mlist60 private variable _mrep "ballnstick"61 62 private variable _imagecache63 private variable _state64 private variable _labels "default"65 private variable _cacheid ""66 private variable _cacheimage ""67 private variable _first ""68 69 private common _settings ; # Array of settings for all known70 # widgets71 private variable _initialized72 73 private common _downloadPopup; # Download options from popup74 private variable _pdbdata; # PDB data from run file sent to pymol75 private common _hardcopy76 private variable _nextToken 077 private variable _resizePending 0;78 private variable _updatePending 0;79 private variable _rotatePending 0;80 private variable _width81 private variable _height82 private variable _reset 1; # Restore camera settings83 private variable _cell 0; # Restore camera settings84 85 43 constructor { servers args } { 86 44 Rappture::VisViewer::constructor $servers … … 94 52 Rappture::VisViewer::SetServerList "pymol" $namelist 95 53 } 96 private method BuildSettingsTab {}97 private method DoResize {}98 private method DoRotate {}99 private method DoUpdate {}100 private method EventuallyResize { w h }101 private method EventuallyRotate { a b c }102 private method EventuallyChangeSettings { args }103 private method GetImage { widget }104 private method ReceiveImage { size cacheid frame rock }105 private method WaitIcon { option widget }106 private method AddImageControls { frame widget }107 private method SetWaitVariable { value } {108 set _getimage $value109 }110 private method WaitForResponse {} {111 tkwait variable [itcl::scope _getimage]112 return $_getimage113 }114 protected method Map {}115 protected method Pan {option x y}116 protected method Rebuild { }117 protected method Rotate {option x y}118 protected method SendCmd { string }119 protected method Unmap {}120 protected method Vmouse {option b m x y}121 protected method Vmouse2 {option b m x y}122 protected method Zoom {option {factor 10}}123 124 54 public method Connect {} 125 55 public method Disconnect {} … … 134 64 # do nothing 135 65 } 136 137 private method UpdateState { args }138 139 66 public method snap { w h } 67 68 protected method Map {} 69 protected method Pan {option x y} 70 protected method Rebuild {} 71 protected method Rotate {option x y} 72 protected method SendCmd { string } 73 protected method Unmap {} 74 protected method Vmouse {option b m x y} 75 protected method Vmouse2 {option b m x y} 76 protected method Zoom {option {factor 10}} 77 78 private method AddImageControls { frame widget } 79 private method BuildSettingsTab {} 80 private method CartoonTrace {option {model "all"}} 81 private method Cell {option} 82 private method ComputeParallelepipedVertices { dataobj } 83 private method DoResize {} 84 private method DoRotate {} 85 private method DoUpdate {} 86 private method EventuallyChangeSettings { args } 87 private method EventuallyResize { w h } 88 private method EventuallyRotate { a b c } 89 private method GetImage { widget } 140 90 private method Opacity {option} 91 private method OrthoProjection {option} 92 private method ReceiveImage { size cacheid frame rock } 93 private method Representation { {option ""} } 94 private method Rock {option} 95 private method SetWaitVariable { value } { 96 set _getimage $value 97 } 141 98 private method SphereScale {option {models "all"} } 142 99 private method StickRadius {option {models "all"} } 143 private method OrthoProjection {option} 144 private method Representation { {option ""} } 145 private method CartoonTrace {option {model "all"}} 146 private method ComputeParallelepipedVertices { dataobj } 147 private method Cell {option} 148 private method Rock {option} 100 private method UpdateState { args } 101 private method WaitForResponse {} { 102 tkwait variable [itcl::scope _getimage] 103 return $_getimage 104 } 105 private method WaitIcon { option widget } 106 107 private variable _icon 0 108 private variable _getimage 0 109 private variable _mevent; # info used for mouse event operations 110 private variable _rocker; # info used for rock operations 111 private variable _dlist ""; # list of dataobj objects 112 private variable _dataobjs; # data objects on server 113 private variable _dobj2transparency;# maps dataobj => transparency 114 private variable _dobj2raise; # maps dataobj => raise flag 0/1 115 116 private variable _active; # array of active models. 117 private variable _obj2models; # array containing list of models 118 # for each data object. 119 private variable _view 120 private variable _click 121 122 private variable _model 123 private variable _mlist 124 private variable _mrep "ballnstick" 125 126 private variable _imagecache 127 private variable _state 128 private variable _labels "default" 129 private variable _cacheid "" 130 private variable _cacheimage "" 131 private variable _first "" 132 133 private variable _initialized 134 135 private variable _pdbdata; # PDB data from run file sent to pymol 136 private variable _nextToken 0 137 private variable _resizePending 0; 138 private variable _updatePending 0; 139 private variable _rotatePending 0; 140 private variable _width 141 private variable _height 142 private variable _reset 1; # Restore camera settings 143 private variable _cell 0; # Restore camera settings 144 145 private common _settings; # Array of settings for all known 146 # widgets 147 private common _downloadPopup; # Download options from popup 148 private common _hardcopy 149 149 } 150 150 … … 181 181 $_dispatcher register !rocker 182 182 $_dispatcher dispatch $this !rocker "[itcl::code $this Rock step]; list" 183 183 184 # Mouse Event 184 185 $_dispatcher register !mevent 185 186 $_dispatcher dispatch $this !mevent "[itcl::code $this _mevent]; list" 187 186 188 $_dispatcher register !pngtimeout 187 189 $_dispatcher register !waiticon … … 472 474 } 473 475 set _dobj2raise($dataobj) $params(-raise) 474 debug "setting parameters for $dataobj \n"476 debug "setting parameters for $dataobj" 475 477 476 478 if { [isconnected] } { … … 731 733 732 734 itcl::body Rappture::MolvisViewer::SendCmd { cmd } { 733 debug " in SendCmd ($cmd)\n"735 debug "cmd: ($cmd)" 734 736 735 737 if { $_state(server) != $_state(client) } { … … 763 765 } 764 766 set data [ReceiveBytes $size] 765 #debug "success: reading $size bytes from proxy \n"767 #debug "success: reading $size bytes from proxy" 766 768 if { [string match "print*" $cacheid] } { 767 769 # $frame is the token that we sent to the proxy. … … 877 879 # ---------------------------------------------------------------------- 878 880 itcl::body Rappture::MolvisViewer::Rebuild {} { 879 debug " in rebuild"881 debug "Enter" 880 882 set changed 0 881 883 … … 1124 1126 SendCmd "pan $_view(x) $_view(y)" 1125 1127 SendCmd "zoom $_view(zoom)" 1126 debug "r ebuild: rotate $_view(mx) $_view(my) $_view(mz)"1128 debug "rotate $_view(mx) $_view(my) $_view(mz)" 1127 1129 1128 1130 SendCmd "raw -defer {zoom complete=1}" … … 1156 1158 blt::busy release $itk_component(hull) 1157 1159 1158 debug " exiting rebuild"1160 debug "Exit" 1159 1161 } 1160 1162 … … 1425 1427 #SendCmd "rotate $mx $my $mz" 1426 1428 EventuallyRotate $mx $my $mz 1427 debug " _vmmouse:rotate $_view(mx) $_view(my) $_view(mz)"1429 debug "rotate $_view(mx) $_view(my) $_view(mz)" 1428 1430 } 1429 1431 set _mevent(x) $x … … 1522 1524 EventuallyRotate $a $b $c 1523 1525 #SendCmd "rotate $a $b $c" 1524 debug " Rotate$x $y: rotate $_view(vx) $_view(vy) $_view(vz)"1526 debug "x,y: $x $y: rotate $_view(vx) $_view(vy) $_view(vz)" 1525 1527 set _click(x) $x 1526 1528 set _click(y) $y … … 1692 1694 DoResize 1693 1695 SendCmd "rotate $_view(mx) $_view(my) $_view(mz)" 1694 debug " ResetView:rotate $_view(mx) $_view(my) $_view(mz)"1696 debug "rotate $_view(mx) $_view(my) $_view(mz)" 1695 1697 SendCmd "pan $_view(x) $_view(y)" 1696 1698 SendCmd "zoom $_view(zoom)"
Note: See TracChangeset
for help on using the changeset viewer.