Changeset 847 for trunk/addcmds.tcl


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

# on 2005/09/07 21:30:07, toby did:
Add origin 1 --> origin 2 xform option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/addcmds.tcl

    • Property rcs:date changed from 2004/04/27 14:07:03 to 2005/09/07 21:30:07
    • Property rcs:lines changed from +2 -2 to +42 -1
    • Property rcs:rev changed from 1.35 to 1.36
    r779 r847  
    16011601            ] -row [incr row] -column 0 -columnspan 10
    16021602
     1603    set shift [GetOrigin1Shift $phase]
     1604    grid [button $w1.d1 -text "Xform Origin 1 to Origin 2" \
     1605              -command "XformAtoms2Origin2 $phase [list $numberList] $w1 [list $shift]" \
     1606             ] -row [incr row] -column 0 -columnspan 10 -sticky e
     1607    if {$shift == ""} {$w1.d1 config -state disabled}
     1608
     1609
    16031610    grid rowconfigure $w 3 -minsize 5
    16041611    grid [TitleFrame $w.4 -bd 6 -relief groove -text "Modify occupanc${suffixy}"] \
     
    22962303}
    22972304
     2305# load a list of Origin 1/2 space groups
     2306proc GetOrigin12List {} {
     2307    # don't need to read the file twice
     2308    if {[array names ::Origin1list] != ""} return
     2309    set line {}
     2310    set fp1 [open [file join $::expgui(scriptdir) spacegrp.ref] r]
     2311    while {[lindex $line 1] != 230} {
     2312        if {[gets $fp1 line] < 0} break
     2313    }
     2314    while {[gets $fp1 line] >= 0} {
     2315        set key [lindex $line 8]
     2316        regsub -all " " $key "" key
     2317        regsub -- "-3" $key "3" key
     2318        if {$key != ""} {
     2319        puts "$key -- [lindex $line 1] [lindex $line 8] [lindex $line 9]"
     2320            set ::Origin1list($key) [lindex $line 9]
     2321        }
     2322    }
     2323    close $fp1
     2324}
     2325
     2326# get the shift to be added to origin 1 coordinates to obtain origin 2 settings
     2327proc GetOrigin1Shift {phase} {
     2328    GetOrigin12List
     2329    set spg [phaseinfo $phase spacegroup]
     2330    regsub -all " " $spg "" spg
     2331    regsub -- "-3" $spg "3" spg
     2332    if {[catch {set shift $::Origin1list($spg)}]} {
     2333        return ""
     2334    } else {
     2335        return $shift
     2336    }
     2337}
     2338
    22982339# default
    22992340set newhist(insttype) {}
Note: See TracChangeset for help on using the changeset viewer.