Changeset 5081


Ignore:
Timestamp:
Mar 5, 2015 2:46:40 AM (9 years ago)
Author:
ldelgass
Message:

merge from trunk

Location:
vmdshow/branches/0.1
Files:
3 edited
4 copied

Legend:

Unmodified
Added
Removed
  • vmdshow/branches/0.1

  • vmdshow/branches/0.1/INSTALL.txt

    r4152 r5081  
    55Follow instructions in INSTALL.txt there.  You'll need the vmdserver.tcl
    66script from here.
    7 
    8 
    9 
    10 
  • vmdshow/branches/0.1/vmdserver.tcl

    r4453 r5081  
    7676  color
    7777  gettimestep
     78  graphics
    7879  imd
    7980  label
     
    147148
    148149# ----------------------------------------------------------------------
     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# ----------------------------------------------------------------------
     155proc 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# ----------------------------------------------------------------------
    149184# USAGE: resize <w> <h>
    150185#
     
    327362# ----------------------------------------------------------------------
    328363proc cmd_load {args} {
    329     global MolInfo
     364    global MolInfo MolNames
    330365
    331366    # clear all existing molecules
     
    334369    }
    335370    catch {unset MolInfo}
     371    set MolNames ""
    336372
    337373    # load new files
     
    351387        if {$op eq "new"} {
    352388            set newnum [lindex [molinfo list] end]
     389            if {[lsearch -exact MolNames $name] < 0} {
     390                lappend MolNames $name
     391            }
    353392            set MolInfo($name) $newnum
    354393            set MolInfo($slot) $newnum
     
    751790                server_oops $cout $result
    752791                if { [string match "invalid command*" $result] } {
    753                     bgerror "I got a invalid command: $result"
     792                    bgerror "server received invalid command: $result"
    754793                    exit 1
    755794                }
Note: See TracChangeset for help on using the changeset viewer.