Changeset 4453


Ignore:
Timestamp:
Jul 1, 2014 9:11:09 AM (6 years ago)
Author:
ldelgass
Message:

sync with mdshowcase tool svn

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/vmd/vmdserver.tcl

    r4452 r4453  
    7373
    7474foreach cmd {
    75   vmdinfo
    76   vmdbench
     75  axes
    7776  color
    78   axes
     77  gettimestep
    7978  imd
    80   vmdcollab
     79  label
    8180  vmd_label
    8281  light
    8382  material
    84   vmd_menu
    85   stage
    86   light
    87   user
     83  measure
     84  mobile
    8885  mol
    8986  molinfo
    9087  molecule
    9188  mouse
    92   mobile
    93   spaceball
     89  parallel
    9490  plugin
     91  rawtimestep
    9592  render
    96   tkrender
    9793  rotate
    9894  rotmat
     95  scale
    9996  vmd_scale
     97  spaceball
     98  stage
     99  tkrender
     100  tool
    100101  translate
    101   sleep
    102   tool
    103   measure
    104   rawtimestep
    105   gettimestep
     102  user
     103  vmdcollab
    106104  vmdcon
     105  vmdinfo
     106  vmdbench
    107107  volmap
    108   parallel
    109108} {
    110109    $parser alias $cmd $cmd
     
    245244
    246245# ----------------------------------------------------------------------
     246# USAGE: setquality normal|high
     247#
     248# Sets the rendering quality for the scene--either "high" (GLSL) or
     249# normal.
     250# ----------------------------------------------------------------------
     251proc cmd_setquality {newval} {
     252    global DisplayProps
     253
     254    switch -- $newval {
     255        high {
     256            display rendermode GLSL
     257            set DisplayProps(rendermode) "GLSL"
     258        }
     259        normal {
     260            display rendermode Normal
     261            set DisplayProps(rendermode) "Normal"
     262        }
     263        default {
     264            error "bad quality value \"$newval\": should be normal or high"
     265        }
     266    }
     267}
     268$parser alias setquality cmd_setquality
     269
     270# ----------------------------------------------------------------------
    247271# USAGE: smoothreps <value>
    248272#
     
    284308
    285309# ----------------------------------------------------------------------
     310# These commands just confuse things, so ignore them silently.
     311# ----------------------------------------------------------------------
     312proc cmd_noop {args} {
     313    # do nothing
     314}
     315
     316$parser alias sleep cmd_noop
     317$parser alias menu cmd_noop
     318$parser alias vmd_menu cmd_noop
     319$parser alias play cmd_noop
     320$parser alias quit cmd_noop
     321
     322# ----------------------------------------------------------------------
    286323# USAGE: load <file> <file>...
    287324#
     
    290327# ----------------------------------------------------------------------
    291328proc cmd_load {args} {
     329    global MolInfo
     330
    292331    # clear all existing molecules
    293332    foreach nmol [molinfo list] {
    294333        mol delete $nmol
    295334    }
     335    catch {unset MolInfo}
    296336
    297337    # load new files
    298     set op "new"
     338    if {![regexp {^@name:} $args]} {
     339        # make sure that there is at least one name in the list
     340        set args [linsert $args 0 "@name:0"]
     341    }
     342
     343    set slot 0
    299344    foreach file $args {
     345        if {[regexp {^@name:(.+)} $file match name]} {
     346            set op "new"
     347            continue
     348        }
    300349        mol $op $file waitfor all
    301         set op "addfile"
     350
     351        if {$op eq "new"} {
     352            set newnum [lindex [molinfo list] end]
     353            set MolInfo($name) $newnum
     354            set MolInfo($slot) $newnum
     355            incr slot
     356            set op "addfile"
     357        }
    302358    }
    303359
     
    325381# ----------------------------------------------------------------------
    326382proc cmd_scene {option args} {
    327     global Scenes Views DisplayProps parser
     383    global Scenes Views MolInfo DisplayProps parser
    328384
    329385    switch -- $option {
     
    369425                $parser eval [list catch [list unset $val]]
    370426            }
     427            $parser eval [list array set mol [array get MolInfo]]
     428
    371429            if {[catch {$parser eval $Scenes($name)} result]} {
    372430                error "$result\nwhile loading scene \"$name\""
     
    374432
    375433            # capture display characteristics in case we ever need to reset
    376             set DisplayProps(rendermode) [display get rendermode]
     434            set DisplayProps(rendermode) "Normal"
    377435            set DisplayProps(shadows) [display get shadows]
    378436
Note: See TracChangeset for help on using the changeset viewer.