Changeset 11 for trunk/gui/scripts/moleculeViewer.tcl
- Timestamp:
- May 30, 2005 9:33:49 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/moleculeViewer.tcl
r8 r11 7 7 # ====================================================================== 8 8 # 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 10 11 # ====================================================================== 11 12 package require Itk … … 22 23 itk_option define -backdrop backdrop Backdrop "black" 23 24 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 } 27 27 destructor { # defined below } 28 28 … … 30 30 protected method _color2rgb {color} 31 31 32 private variable _tool "" ;# tool containing this viewer 32 33 private variable _actors "" ;# list of actors in renderer 33 34 } … … 39 40 # CONSTRUCTOR 40 41 # ---------------------------------------------------------------------- 41 itcl::body Rappture::MoleculeViewer::constructor {args} { 42 itcl::body Rappture::MoleculeViewer::constructor {tool args} { 43 set _tool $tool 44 42 45 itk_option add hull.width hull.height 43 46 pack propagate $itk_component(hull) no … … 93 96 if {$itk_option(-device) != ""} { 94 97 set dev $itk_option(-device) 98 set lib [Rappture::library standard] 99 95 100 set counter 0 96 101 foreach atom [$dev children -type atom components.molecule] { … … 105 110 $this-ren AddActor $aname 106 111 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] 117 120 } 118 121 … … 157 160 } 158 161 159 # ----------------------------------------------------------------------160 # OPTION: -library161 # ----------------------------------------------------------------------162 itcl::configbody Rappture::MoleculeViewer::library {163 _render164 }165 166 162 #package require Rappture 167 #Rappture::MoleculeViewer .e -library [Rappture::library -std library.xml]163 #Rappture::MoleculeViewer .e 168 164 #pack .e -expand yes -fill both 169 165 #
Note: See TracChangeset
for help on using the changeset viewer.