Changeset 6373 for vmdshow


Ignore:
Timestamp:
Jun 6, 2016 1:10:48 PM (8 years ago)
Author:
ldelgass
Message:

Update from render07, whitespace

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vmdshow/trunk/vmdserver.tcl

    r6185 r6373  
     1# -*- mode: tcl; indent-tabs-mode: nil -*-
    12# ----------------------------------------------------------------------
    23#  HUBZERO: server for VMD
     
    103104    translate
    104105    user
    105 
    106106    vecadd
    107107    veccross
     
    120120    vecsum
    121121    veczero
    122    
    123122    vmdcollab
    124123    vmdcon
     
    280279        switch -- $key {
    281280            -rotate {
    282                 molinfo top set rotate_matrix [list $val]
     281                foreach mol [molinfo list] {
     282                    molinfo $mol set rotate_matrix [list $val]
     283                }
    283284            }
    284285            -scale {
    285                 molinfo top set scale_matrix [list $val]
     286                foreach mol [molinfo list] {
     287                    molinfo $mol set scale_matrix [list $val]
     288                }
    286289            }
    287290            -center {
    288                 molinfo top set center_matrix [list $val]
     291                foreach mol [molinfo list] {
     292                    molinfo $mol set center_matrix [list $val]
     293                }
    289294            }
    290295            -global {
    291                 molinfo top set global_matrix [list $val]
     296                foreach mol [molinfo list] {
     297                    molinfo $mol set global_matrix [list $val]
     298                }
    292299            }
    293300            default {
     
    317324            display shadows off
    318325
    319             if 0 {
     326            # gah: turn off rep change
     327            if 0 {
    320328            foreach nmol [molinfo list] {
    321329                set max [molinfo $nmol get numreps]
     
    324332                }
    325333            }
    326             }
     334            }
    327335        }
    328336        end {
     
    332340            display shadows $DisplayProps(shadows)
    333341
    334             if 0 {
     342            # gah: turn off rep change
     343            if 0 {
    335344            # restore rendering methods for all representations
    336345            foreach nmol [molinfo list] {
     
    340349                }
    341350            }
    342             }
     351            }
    343352        }
    344353        default {
     
    457466            continue
    458467        }
    459         if { $tmpDir != "" } {
    460             set tmpFile [file join $tmpDir [file tail $file]]
    461             if { [file exists $tmpFile] } {
    462                 set file $tmpFile
    463             }
    464         }
     468        if { $tmpDir != "" } {
     469            set tmpFile [file join $tmpDir [file tail $file]]
     470            if { [file exists $tmpFile] } {
     471                set file $tmpFile
     472            }
     473        }
    465474        mol $op $file waitfor all
    466         if { ![info exists name] } {
    467             puts stderr "can't find name file=$file"
    468         }
     475        if { ![info exists name] } {
     476            puts stderr "can't find name file=$file"
     477        }
    469478        if {$op eq "new"} {
    470479            set newnum [lindex [molinfo list] end]
     
    777786      }
    778787      max {
    779         set nmol [lindex [molinfo list] 0]
    780         if {$nmol ne ""} {
    781             return [molinfo $nmol get numframes]
    782         }
    783         return 0
     788          set maxFrames 0
     789          foreach mol [molinfo list] {
     790              set n [molinfo $mol get numframes]
     791              if { $n > $maxFrames } {
     792                  set maxFrames $n
     793              }
     794          }
     795          return $maxFrames
     796          # gah: fix to return max correct max frames.
     797          if 0 {
     798              set nmol [lindex [molinfo list] 0]
     799              if {$nmol ne ""} {
     800                  return [molinfo $nmol get numframes]
     801              }
     802              return 0
     803          }
    784804      }
    785805      default {
     
    804824
    805825    if { [llength [molinfo list]] == 0 } {
    806         return ""
     826        return ""
    807827    }
    808828    if { $Scenes(@CURRENT) eq "" } {
    809         return ""
     829        return ""
    810830    }
    811831
     
    825845   
    826846    foreach arg $args {
    827         if { $arg == "writepdb" } {
    828             error "autoselect \"writepdb\" option is disallowed"
    829         }
     847        if { $arg == "writepdb" } {
     848            error "autoselect \"writepdb\" option is disallowed"
     849        }
    830850    }
    831851    set cmd [eval atomselect $args]
     
    890910            } else {
    891911                server_oops $cout $result
    892                 if { [string match "invalid command*" $result] } {
     912                if { [string match "invalid command*" $result] } {
    893913                    bgerror "server received invalid command: $result"
    894                     server_exit $cin $cout 1
    895                 }
     914                    server_exit $cin $cout 1
     915                }
    896916            }
    897917        }
     
    9801000            animate goto $item(frame)
    9811001        } elseif {[info exists item(rotate)]} {
    982             molinfo top set rotate_matrix [list $item(rotate)]
     1002            foreach mol [molinfo list] {
     1003                molinfo $mol set rotate_matrix [list $item(rotate)]
     1004            }
    9831005            # send rotation matrix back to the client so we can pause later
    9841006            server_send_latest $client [list nv>rotatemtx $item(num) $item(rotate)]
     
    9901012        if {[info exists item(defview)] && $item(defview)} {
    9911013            if {[info exists Views($item(frame))]} {
    992                 eval molinfo top set $Views($item(frame))
     1014                foreach mol [molinfo list] {
     1015                    eval molinfo $mol set $Views($item(frame))
     1016                }
    9931017            }
    9941018        }
Note: See TracChangeset for help on using the changeset viewer.