Changeset 7 for trunk


Ignore:
Timestamp:
Mar 25, 2005, 8:22:06 AM (19 years ago)
Author:
mmc
Message:

Created an initial EnergyLevels? viewer and MoleculeViewer?. The
MoleculeViewer? is integrated into the driver, but the EnergyLevels?
is not. The material library file contains some new properties
for the appearance of atoms, and the MoleculeViewer? uses this.
Both energyLevels.tcl and moleculeViewer.tcl still have some
driver code at the bottom of the files, so you can run them as
a single file, by themselves, for testing. This code should be
removed when we get further along.

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/apps/driver

    r6 r7  
    150150set dfirst ""
    151151set dlist [$config children -type structure controls]
     152puts "device: $dlist"
    152153if {"" != $dlist} {
    153154    foreach dname $dlist {
    154155        set obj [$config element -flavor object controls.$dname]
    155156        set name [$obj get label]
     157puts " => $name = $obj"
    156158        set devs($name) $obj
    157159    }
     
    175177    set first [lindex $devlist 0]
    176178    set dfirst $devs($first)
    177     Rappture::DeviceViewer1D $w.device -device $devs($first) \
    178         -tool $tool -library $lib
     179    set tags [$dfirst children]
     180    set i [lsearch $tags label]
     181    if {$i >= 0} {set tags [lreplace $tags $i $i]}
     182
     183puts "first device: tags = $tags"
     184    if {$tags == "molecule"} {
     185        Rappture::MoleculeViewer $w.device -device $devs($first) \
     186            -library $lib
     187    } else {
     188        Rappture::DeviceViewer1D $w.device -device $devs($first) \
     189            -tool $tool -library $lib
     190    }
    179191    pack $w.device -expand yes -fill both
    180192
     
    198210    switch -glob -- $name {
    199211        parameters.ambient* - structure* {
    200             $win.input.device controls add $name
    201         }
    202     }
    203 }
     212##            $win.input.device controls add $name
     213        }
     214    }
     215}
  • trunk/lib/library.xml

    r6 r7  
    2828  </group>
    2929</parameters>
     30<elements>
     31  <atom id="H">
     32    <color>white</color>
     33    <scale>0.7</scale>
     34  </atom>
     35  <atom id="C">
     36    <color>green</color>
     37    <scale>1.0</scale>
     38  </atom>
     39  <atom id="O">
     40    <color>red</color>
     41    <scale>1.0</scale>
     42  </atom>
     43  <atom id="N">
     44    <color>blue</color>
     45    <scale>1.0</scale>
     46  </atom>
     47  <atom id="S">
     48    <color>yellow</color>
     49    <scale>1.0</scale>
     50  </atom>
     51</elements>
    3052<materials>
    3153  <material name="GaAs">
  • trunk/tcl/scripts/library.tcl

    r6 r7  
    5757    }
    5858
    59     # otherwise, try to open the file and create its LibraryObj
    60     set fid [::open $fname r]
    61     set info [read $fid]
    62     close $fid
     59    if {[regexp {^<\?[Xx][Mm][Ll]} $fname]} {
     60        set info $fname
     61    } else {
     62        # otherwise, try to open the file and create its LibraryObj
     63        set fid [::open $fname r]
     64        set info [read $fid]
     65        close $fid
     66    }
    6367
    6468    set obj [Rappture::LibraryObj ::#auto $info]
Note: See TracChangeset for help on using the changeset viewer.