Changeset 3794
- Timestamp:
- Jul 12, 2013 11:18:58 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkviewer.tcl
r3793 r3794 259 259 array set _settings [subst { 260 260 legend 1 261 glyphs-opacity 100 262 glyphs-wireframe 0 261 263 polydata-edges 0 262 264 polydata-lighting 1 263 polydata-opacity 40265 polydata-opacity 100 264 266 polydata-palette rainbow 265 267 polydata-visible 1 266 268 polydata-wireframe 0 267 molecule-atomscale 1.0268 molecule-bondscale 1.0269 molecule-atomscale 0.3 270 molecule-bondscale 0.075 269 271 molecule-atoms-visible 1 270 272 molecule-bonds-visible 1 … … 275 277 molecule-palette elementDefault 276 278 molecule-representation "Ball and Stick" 279 molecule-rscale "covalent" 277 280 molecule-visible 1 278 281 molecule-wireframe 0 … … 1446 1449 switch -- $value { 1447 1450 "ballandstick" { 1448 set rscalecovalent1451 set _settings(molecule-rscale) covalent 1449 1452 set _settings(molecule-atoms-visible) 1 1450 1453 set _settings(molecule-bonds-visible) 1 … … 1454 1457 } 1455 1458 "balls" - "spheres" { 1456 set rscalecovalent1459 set _settings(molecule-rscale) covalent 1457 1460 set _settings(molecule-atoms-visible) 1 1458 1461 set _settings(molecule-bonds-visible) 0 … … 1462 1465 } 1463 1466 "sticks" { 1464 set rscalenone1467 set _settings(molecule-rscale) none 1465 1468 set _settings(molecule-atoms-visible) 1 1466 1469 set _settings(molecule-bonds-visible) 1 … … 1470 1473 } 1471 1474 "spacefilling" { 1472 set rscalevan_der_waals1475 set _settings(molecule-rscale) van_der_waals 1473 1476 set _settings(molecule-atoms-visible) 1 1474 1477 set _settings(molecule-bonds-visible) 0 … … 1478 1481 } 1479 1482 "rods" { 1480 set rscalenone1483 set _settings(molecule-rscale) none 1481 1484 set _settings(molecule-atoms-visible) 1 1482 1485 set _settings(molecule-bonds-visible) 1 … … 1486 1489 } 1487 1490 "wireframe" - "lines" { 1488 set rscalenone1491 set _settings(molecule-rscale) none 1489 1492 set _settings(molecule-atoms-visible) 0 1490 1493 set _settings(molecule-bonds-visible) 1 … … 1497 1500 } 1498 1501 } 1502 $itk_component(rscale) value [$itk_component(rscale) label $_settings(molecule-rscale)] 1503 switch -- $value { 1504 "ballandstick" - "balls" - "spheres" { 1505 $itk_component(rscale) configure -state normal 1506 } 1507 default { 1508 $itk_component(rscale) configure -state disabled 1509 } 1510 } 1499 1511 foreach dataset [CurrentDatasets -visible $_first] { 1500 1512 foreach {dataobj comp} [split $dataset -] break 1501 1513 set type [$dataobj type $comp] 1502 1514 if { $type == "molecule" } { 1503 SendCmd [subst {molecule rscale $ rscale$dataset1515 SendCmd [subst {molecule rscale $_settings(molecule-rscale) $dataset 1504 1516 molecule ascale $_settings(molecule-atomscale) $dataset 1505 1517 molecule bscale $_settings(molecule-bondscale) $dataset … … 1507 1519 molecule atoms $_settings(molecule-atoms-visible) $dataset 1508 1520 molecule bonds $_settings(molecule-bonds-visible) $dataset}] 1521 } 1522 } 1523 } 1524 "molecule-rscale" { 1525 set value [$itk_component(rscale) value] 1526 set value [$itk_component(rscale) translate $value] 1527 set _settings(molecule-rscale) $value 1528 foreach dataset [CurrentDatasets -visible $_first] { 1529 foreach {dataobj comp} [split $dataset -] break 1530 set type [$dataobj type $comp] 1531 if { $type == "molecule" } { 1532 SendCmd [subst {molecule rscale $_settings(molecule-rscale) $dataset}] 1509 1533 } 1510 1534 } … … 1865 1889 -showvalue off \ 1866 1890 -command [itcl::code $this AdjustSetting polydata-opacity] 1891 $inner.opacity set $_settings(polydata-opacity) 1867 1892 1868 1893 blt::table $inner \ … … 2189 2214 [itcl::code $this AdjustSetting molecule-representation] 2190 2215 $inner.rep value "Ball and Stick" 2216 2217 label $inner.rscale_l -text "Atom Radii" \ 2218 -font "Arial 9" 2219 2220 itk_component add rscale { 2221 Rappture::Combobox $inner.rscale -width 20 -editable no 2222 } 2223 $inner.rscale choices insert end \ 2224 "atomic" "Atomic" \ 2225 "covalent" "Covalent" \ 2226 "van_der_waals" "VDW" \ 2227 "none" "Constant" 2228 2229 bind $inner.rscale <<Value>> \ 2230 [itcl::code $this AdjustSetting molecule-rscale] 2231 $inner.rscale value "Covalent" 2191 2232 2192 2233 label $inner.palette_l -text "Palette" -font "Arial 9" … … 2236 2277 label $inner.atomscale_l -text "Atom Scale" -font "Arial 9" 2237 2278 ::scale $inner.atomscale -width 15 -font "Arial 7" \ 2238 -from 0.0 -to 2.0 -resolution 0.05 -label "" \2279 -from 0.025 -to 2.0 -resolution 0.025 -label "" \ 2239 2280 -showvalue true -orient horizontal \ 2240 2281 -command [itcl::code $this EventuallySetAtomScale] \ … … 2242 2283 $inner.atomscale set $_settings(molecule-atomscale) 2243 2284 Rappture::Tooltip::for $inner.atomscale \ 2244 "Adjust scale of atoms (spheres or balls). 1.0 is the default radius."2285 "Adjust relative scale of atoms (spheres or balls)." 2245 2286 2246 2287 label $inner.bondscale_l -text "Bond Scale" -font "Arial 9" 2247 2288 ::scale $inner.bondscale -width 15 -font "Arial 7" \ 2248 -from 0.0 -to 1.0 -resolution 0.025 -label "" \2289 -from 0.005 -to 0.3 -resolution 0.005 -label "" \ 2249 2290 -showvalue true -orient horizontal \ 2250 2291 -command [itcl::code $this EventuallySetBondScale] \ … … 2262 2303 2263 2304 blt::table $inner \ 2264 0,0 $inner.molecule -anchor w -pady {1 0} \ 2265 1,0 $inner.label -anchor w -pady {1 0} \ 2266 2,0 $inner.edges -anchor w -pady {1 0} \ 2267 3,0 $inner.rep_l -anchor w -pady { 2 0 } \ 2268 4,0 $inner.rep -fill x -pady 2 \ 2269 5,0 $inner.palette_l -anchor w -pady 0 \ 2270 6,0 $inner.palette -fill x -padx 2 \ 2271 7,0 $inner.atomscale_l -anchor w -pady {3 0} \ 2272 8,0 $inner.atomscale -fill x -padx 2 \ 2273 9,0 $inner.bondscale_l -anchor w -pady {3 0} \ 2274 10,0 $inner.bondscale -fill x -padx 2 \ 2275 11,0 $inner.opacity_l -anchor w -pady {3 0} \ 2276 12,0 $inner.opacity -fill x -padx 2 2305 0,0 $inner.molecule -anchor w -pady {1 0} \ 2306 1,0 $inner.label -anchor w -pady {1 0} \ 2307 2,0 $inner.edges -anchor w -pady {1 0} \ 2308 3,0 $inner.rep_l -anchor w -pady { 2 0 } \ 2309 4,0 $inner.rep -fill x -pady 2 \ 2310 5,0 $inner.rscale_l -anchor w -pady { 2 0 } \ 2311 6,0 $inner.rscale -fill x -pady 2 \ 2312 7,0 $inner.palette_l -anchor w -pady 0 \ 2313 8,0 $inner.palette -fill x -padx 2 \ 2314 9,0 $inner.atomscale_l -anchor w -pady {3 0} \ 2315 10,0 $inner.atomscale -fill x -padx 2 \ 2316 11,0 $inner.bondscale_l -anchor w -pady {3 0} \ 2317 12,0 $inner.bondscale -fill x -padx 2 \ 2318 13,0 $inner.opacity_l -anchor w -pady {3 0} \ 2319 14,0 $inner.opacity -fill x -padx 2 2277 2320 2278 2321 blt::table configure $inner r* -resize none 2279 blt::table configure $inner r1 3-resize expand2322 blt::table configure $inner r15 -resize expand 2280 2323 } 2281 2324 … … 2444 2487 SendCmd "polydata linewidth $settings(-linewidth) $tag" 2445 2488 SendCmd "polydata opacity $settings(-opacity) $tag" 2446 set _settings(polydata-opacity) $settings(-opacity)2489 set _settings(polydata-opacity) [expr 100.0 * $settings(-opacity)] 2447 2490 SendCmd "polydata wireframe $settings(-wireframe) $tag" 2448 2491 set _settings(polydata-wireframe) $settings(-wireframe)
Note: See TracChangeset
for help on using the changeset viewer.