Ignore:
Timestamp:
May 30, 2005 9:33:49 PM (19 years ago)
Author:
mmc
Message:

Major reorganization of the entire package. The config.xml file
is now irrelevant. All the action is in the tool.xml file. The
main program now organizes all input into 1) side-by-side pages,
2) input/result (wizard-style) pages, or 3) a series of wizard-
style pages. The <input> can have <phase> parts representing
the various pages.

Added a new ContourResult? widget based on Swaroop's vtk plotting
code.

Also, added easymesh and showmesh to the "tools" directory.
We need these for Eric Polizzi's code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/moleculeViewer.tcl

    r8 r11  
    77# ======================================================================
    88#  AUTHOR:  Michael McLennan, Purdue University
    9 #  Copyright (c) 2004  Purdue Research Foundation, West Lafayette, IN
     9#  Copyright (c) 2004-2005
     10#  Purdue Research Foundation, West Lafayette, IN
    1011# ======================================================================
    1112package require Itk
     
    2223    itk_option define -backdrop backdrop Backdrop "black"
    2324    itk_option define -device device Device ""
    24     itk_option define -library library Library ""
    25 
    26     constructor {args} { # defined below }
     25
     26    constructor {tool args} { # defined below }
    2727    destructor { # defined below }
    2828
     
    3030    protected method _color2rgb {color}
    3131
     32    private variable _tool ""    ;# tool containing this viewer
    3233    private variable _actors ""  ;# list of actors in renderer
    3334}
     
    3940# CONSTRUCTOR
    4041# ----------------------------------------------------------------------
    41 itcl::body Rappture::MoleculeViewer::constructor {args} {
     42itcl::body Rappture::MoleculeViewer::constructor {tool args} {
     43    set _tool $tool
     44
    4245    itk_option add hull.width hull.height
    4346    pack propagate $itk_component(hull) no
     
    9396    if {$itk_option(-device) != ""} {
    9497        set dev $itk_option(-device)
     98        set lib [Rappture::library standard]
     99
    95100        set counter 0
    96101        foreach atom [$dev children -type atom components.molecule] {
     
    105110            $this-ren AddActor $aname
    106111
    107             if {$itk_option(-library) != ""} {
    108                 set sfac 0.7
    109                 set scale [$itk_option(-library) get elements.($symbol).scale]
    110                 if {$scale != ""} {
    111                     $aname SetScale [expr {$sfac*$scale}]
    112                 }
    113                 set color [$itk_option(-library) get elements.($symbol).color]
    114                 if {$color != ""} {
    115                     eval [$aname GetProperty] SetColor [_color2rgb $color]
    116                 }
     112            set sfac 0.7
     113            set scale [$lib get elements.($symbol).scale]
     114            if {$scale != ""} {
     115                $aname SetScale [expr {$sfac*$scale}]
     116            }
     117            set color [$lib get elements.($symbol).color]
     118            if {$color != ""} {
     119                eval [$aname GetProperty] SetColor [_color2rgb $color]
    117120            }
    118121
     
    157160}
    158161
    159 # ----------------------------------------------------------------------
    160 # OPTION: -library
    161 # ----------------------------------------------------------------------
    162 itcl::configbody Rappture::MoleculeViewer::library {
    163     _render
    164 }
    165 
    166162#package require Rappture
    167 #Rappture::MoleculeViewer .e -library [Rappture::library -std library.xml]
     163#Rappture::MoleculeViewer .e
    168164#pack .e -expand yes -fill both
    169165#
Note: See TracChangeset for help on using the changeset viewer.