Changeset 849 for trunk/addcmds.tcl


Ignore:
Timestamp:
Dec 4, 2009 5:13:06 PM (11 years ago)
Author:
toby
Message:

# on 2005/09/12 23:34:05, toby did:
add missing proc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/addcmds.tcl

    • Property rcs:date changed from 2005/09/07 21:30:07 to 2005/09/12 23:34:05
    • Property rcs:lines changed from +42 -1 to +31 -1
    • Property rcs:rev changed from 1.36 to 1.37
    r847 r849  
    23372337}
    23382338
     2339proc XformAtoms2Origin2 {phase numberList w1 shift} {
     2340    global expgui expmap
     2341    set parent [winfo toplevel $w1]
     2342    if {[llength $numberList] != [llength $expmap(atomlist_$phase)]} {
     2343        # not all atoms were selected in phase -- do a sanity check
     2344        set msg {You have selected only some atoms to be shifted. Do you want to shift all atoms or only the selected atoms?}
     2345        set val [MyMessageBox -parent $parent -icon warning \
     2346                     -type "{Use all} {Use Selection}" -default "use all" \
     2347                     -title "Shift all" -message $msg]
     2348        puts "$phase $numberList $w1 $shift"
     2349        if {$val == "use all"} {set numberList $expmap(atomlist_$phase)}
     2350    }
     2351    if {[lindex $expmap(phasetype) [expr {$phase - 1}]] == 4} {
     2352        set cmd mmatominfo
     2353    } else {
     2354        set cmd atominfo
     2355    }
     2356    foreach atom $numberList {
     2357        foreach v {x y z} vs $shift {
     2358            set c [$cmd $phase $atom $v]
     2359            $cmd $phase $atom $v set [expr {$c + $vs}]
     2360        }
     2361        incr expgui(changed)
     2362    }
     2363
     2364    MyMessageBox -parent $parent -type OK -default ok -title "Shift applied" \
     2365        -message "A shift of \"$shift\" has been applied to atoms [CompressList $numberList]"
     2366    UpdateAtomLine $numberList $phase
     2367    destroy $parent
     2368}
    23392369# default
    23402370set newhist(insttype) {}
Note: See TracChangeset for help on using the changeset viewer.