Changeset 5050 for vmdshow/trunk
- Timestamp:
- Feb 28, 2015 7:23:06 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vmdshow/trunk/vmdserver.tcl
r4978 r5050 148 148 149 149 # ---------------------------------------------------------------------- 150 # USAGE: queryinfo <x> <y> ?-add? 151 # 152 # Resizes the visualization window to the given width <w> and height 153 # <h>. The next image sent should be this size. 154 # ---------------------------------------------------------------------- 155 proc cmd_queryinfo {x y args} { 156 global DisplayProps MolNames MolInfo 157 158 # be careful -- VMD uses coordinates from LOWER-left corner of window 159 set vmdy [expr {$DisplayProps(frameh)-$y}] 160 161 set vals [pick $x $vmdy] 162 if {$vals ne ""} { 163 array set data $vals 164 165 # map the molecule ID back to the name used within MD Showcase 166 foreach molname $MolNames { 167 if {$MolInfo($molname) == $data(mol)} { 168 set data(molname) $molname 169 break 170 } 171 } 172 173 # pass back the click coord on screen so we know where this came from 174 set data(screenx) $x 175 set data(screeny) $y 176 177 set vals [array get data] 178 } 179 return $vals 180 } 181 $parser alias queryinfo cmd_queryinfo 182 183 # ---------------------------------------------------------------------- 150 184 # USAGE: resize <w> <h> 151 185 # … … 328 362 # ---------------------------------------------------------------------- 329 363 proc cmd_load {args} { 330 global MolInfo 364 global MolInfo MolNames 331 365 332 366 # clear all existing molecules … … 335 369 } 336 370 catch {unset MolInfo} 371 set MolNames "" 337 372 338 373 # load new files … … 352 387 if {$op eq "new"} { 353 388 set newnum [lindex [molinfo list] end] 389 if {[lsearch -exact MolNames $name] < 0} { 390 lappend MolNames $name 391 } 354 392 set MolInfo($name) $newnum 355 393 set MolInfo($slot) $newnum … … 752 790 server_oops $cout $result 753 791 if { [string match "invalid command*" $result] } { 754 bgerror " I got ainvalid command: $result"792 bgerror "server received invalid command: $result" 755 793 exit 1 756 794 }
Note: See TracChangeset
for help on using the changeset viewer.