Changeset 5365
- Timestamp:
- Apr 29, 2015, 9:04:09 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/flowvisviewer.tcl
r5297 r5365 139 139 private variable _view ;# View params for 3D view 140 140 private variable _isomarkers ;# array of isosurface level values 0..1 141 private common_settings141 private variable _settings 142 142 private variable _activeTf "" ;# The currently active transfer function 143 143 private variable _first "" ;# This is the topmost volume. … … 147 147 private variable _icon 0 148 148 private variable _flow 149 150 private common _downloadPopup ;# download options from popup151 private common _hardcopy152 149 private variable _width 0 153 150 private variable _height 0 … … 155 152 private variable _resizeLegendPending 0 156 153 private variable _gotoPending 0 154 155 private common _downloadPopup ;# download options from popup 156 private common _hardcopy 157 157 } 158 158 … … 188 188 $_dispatcher dispatch $this !play "[itcl::code $this flow next]; list" 189 189 190 # Draw legend event191 190 $_dispatcher register !goto 192 191 $_dispatcher dispatch $this !goto "[itcl::code $this flow goto2]; list" … … 224 223 225 224 array set _settings [subst { 225 -ambient 60 226 -arrows 0 227 -axes 0 228 -currenttime 0 229 -cutplanesVisible 0 230 -diffuse 40 231 -duration 1:00 232 -grid 0 233 -isosurface 0 234 -legend 1 235 -lic 1 236 -light2side 1 237 -loop 0 238 -opacity 50 239 -outline 1 240 -particles 1 241 -play 0 226 242 -qw $_view(-qw) 227 243 -qx $_view(-qx) 228 244 -qy $_view(-qy) 229 245 -qz $_view(-qz) 246 -specularLevel 30 247 -specularExponent 90 248 -speed 500 249 -step 0 250 -streams 0 251 -thickness 350 252 -volume 1 253 -xcutplane 1 254 -xcutposition 0 255 -xpan $_view(-xpan) 256 -ycutplane 1 257 -ycutposition 0 258 -ypan $_view(-ypan) 259 -zcutplane 1 260 -zcutposition 0 230 261 -zoom $_view(-zoom) 231 -xpan $_view(-xpan)232 -ypan $_view(-ypan)233 $this-arrows 0234 $this-currenttime 0235 $this-duration 1:00236 $this-loop 0237 $this-play 0238 $this-speed 500239 $this-step 0240 $this-streams 0241 $this-volume 1242 $this-ambient 60243 $this-diffuse 40244 $this-light2side 1245 $this-opacity 50246 $this-specularLevel 30247 $this-specularExponent 90248 $this-thickness 350249 $this-cutplaneVisible 0250 $this-xcutplane 1251 $this-xcutposition 0252 $this-ycutplane 1253 $this-ycutposition 0254 $this-zcutplane 1255 $this-zcutposition 0256 262 }] 257 263 … … 306 312 -onimage [Rappture::icon volume-on] \ 307 313 -offimage [Rappture::icon volume-off] \ 308 -command [itcl::code $this AdjustSetting volume] \309 -variable [itcl::scope _settings( $this-volume)]314 -command [itcl::code $this AdjustSetting -volume] \ 315 -variable [itcl::scope _settings(-volume)] 310 316 } 311 317 $itk_component(volume) select … … 318 324 -onimage [Rappture::icon cutbutton] \ 319 325 -offimage [Rappture::icon cutbutton] \ 320 -variable [itcl::scope _settings( $this-cutplaneVisible)] \321 -command [itcl::code $this AdjustSetting cutplaneVisible]326 -variable [itcl::scope _settings(-cutplanesVisible)] \ 327 -command [itcl::code $this AdjustSetting -cutplanesVisible] 322 328 } 323 329 Rappture::Tooltip::for $itk_component(cutplane) \ … … 408 414 -onimage [Rappture::icon flow-pause] \ 409 415 -offimage [Rappture::icon flow-play] \ 410 -variable [itcl::scope _settings( $this-play)] \416 -variable [itcl::scope _settings(-play)] \ 411 417 -command [itcl::code $this flow toggle] 412 418 } … … 420 426 -onimage [Rappture::icon flow-loop] \ 421 427 -offimage [Rappture::icon flow-loop] \ 422 -variable [itcl::scope _settings( $this-loop)]428 -variable [itcl::scope _settings(-loop)] 423 429 } 424 430 Rappture::Tooltip::for $itk_component(loop) \ … … 430 436 -linecolor "" -activelinecolor "" \ 431 437 -min 0.0 -max 1.0 \ 432 -variable [itcl::scope _settings( $this-currenttime)] \438 -variable [itcl::scope _settings(-currenttime)] \ 433 439 -knobimage [Rappture::icon knob2] -knobposition center@middle 434 440 } { … … 442 448 itk_component add duration { 443 449 entry $itk_component(flowcontrols).duration \ 444 -textvariable [itcl::scope _settings( $this-duration)] \450 -textvariable [itcl::scope _settings(-duration)] \ 445 451 -bg white -width 6 -font "arial 9" 446 452 } { … … 571 577 image delete $_image(download) 572 578 catch { blt::arcball destroy $_arcball } 573 array unset _settings $this-*579 array unset _settings 574 580 } 575 581 … … 957 963 # _settings varible. 958 964 959 set value $_settings( $this-thickness)965 set value $_settings(-thickness) 960 966 # Scale values between 0.00001 and 0.01000 961 967 set thickness [expr {double($value) * 0.0001}] 962 set _settings($t his-$tf-thickness) $thickness968 set _settings($tf-thickness) $thickness 963 969 964 970 foreach key [array names _dataset2style $_first-*] { … … 1188 1194 1189 1195 # Reset the camera and other view parameters 1190 InitSettings light2side ambient diffuse specularLevel specularExponent \ 1191 opacity isosurface grid axes volume outline \ 1192 cutplaneVisible xcutplane ycutplane zcutplane 1196 InitSettings -light2side \ 1197 -ambient -diffuse -specularLevel -specularExponent \ 1198 -opacity -isosurface -grid -axes -volume -outline \ 1199 -cutplanesVisible -xcutplane -ycutplane -zcutplane 1193 1200 1194 1201 # nothing to send -- activate the proper volume … … 1242 1249 set vols [CurrentVolumeIds -cutplanes] 1243 1250 foreach axis {x y z} { 1244 set pos [expr {0.01*$_settings( $this-${axis}cutposition)}]1251 set pos [expr {0.01*$_settings(-${axis}cutposition)}] 1245 1252 SendCmd "cutplane position $pos $axis $vols" 1246 1253 } 1247 SendCmd "volume data state $_settings( $this-volume)"1254 SendCmd "volume data state $_settings(-volume)" 1248 1255 EventuallyResizeLegend 1249 1256 … … 1461 1468 itcl::body Rappture::FlowvisViewer::AdjustSetting {what {value ""}} { 1462 1469 switch -- $what { 1463 colormap{1470 "-colormap" { 1464 1471 set color [$itk_component(colormap) value] 1465 set _settings( colormap) $color1472 set _settings($what) $color 1466 1473 #ResetColormap $color 1467 1474 } 1468 ambient{1475 "-ambient" { 1469 1476 if { $_first != "" } { 1470 1477 set comp [lindex [$_first components] 0] 1471 1478 set tag $_first-$comp 1472 set val $_settings($ this-ambient)1479 set val $_settings($what) 1473 1480 set val [expr {0.01*$val}] 1474 1481 SendCmd "$tag configure -ambient $val" 1475 1482 } 1476 1483 } 1477 diffuse{1484 "-diffuse" { 1478 1485 if { $_first != "" } { 1479 1486 set comp [lindex [$_first components] 0] 1480 1487 set tag $_first-$comp 1481 set val $_settings($ this-diffuse)1488 set val $_settings($what) 1482 1489 set val [expr {0.01*$val}] 1483 1490 SendCmd "$tag configure -diffuse $val" 1484 1491 } 1485 1492 } 1486 specularLevel{1493 "-specularLevel" { 1487 1494 if { $_first != "" } { 1488 1495 set comp [lindex [$_first components] 0] 1489 1496 set tag $_first-$comp 1490 set val $_settings($ this-specularLevel)1497 set val $_settings($what) 1491 1498 set val [expr {0.01*$val}] 1492 1499 SendCmd "$tag configure -specularLevel $val" 1493 1500 } 1494 1501 } 1495 specularExponent{1502 "-specularExponent" { 1496 1503 if { $_first != "" } { 1497 1504 set comp [lindex [$_first components] 0] 1498 1505 set tag $_first-$comp 1499 set val $_settings($ this-specularExponent)1506 set val $_settings($what) 1500 1507 SendCmd "$tag configure -specularExp $val" 1501 1508 } 1502 1509 } 1503 light2side{1510 "-light2side" { 1504 1511 if { $_first != "" } { 1505 1512 set comp [lindex [$_first components] 0] 1506 1513 set tag $_first-$comp 1507 set val $_settings($ this-light2side)1514 set val $_settings($what) 1508 1515 SendCmd "$tag configure -light2side $val" 1509 1516 } 1510 1517 } 1511 opacity{1518 "-opacity" { 1512 1519 if { $_first != "" } { 1513 1520 set comp [lindex [$_first components] 0] 1514 1521 set tag $_first-$comp 1515 set opacity [expr { 0.01 * double($_settings($ this-opacity)) }]1522 set opacity [expr { 0.01 * double($_settings($what)) }] 1516 1523 SendCmd "$tag configure -opacity $opacity" 1517 1524 } 1518 1525 } 1519 thickness{1526 "-thickness" { 1520 1527 if { $_first != "" && $_activeTf != "" } { 1521 set val $_settings($ this-thickness)1528 set val $_settings($what) 1522 1529 # Scale values between 0.00001 and 0.01000 1523 1530 set sval [expr {0.0001*double($val)}] 1524 1531 set tf $_activeTf 1525 set _settings($t his-$tf-thickness) $sval1532 set _settings($tf${what}) $sval 1526 1533 updateTransferFunctions 1527 1534 } 1528 1535 } 1529 " outline" {1536 "-outline" { 1530 1537 if { $_first != "" } { 1531 1538 set comp [lindex [$_first components] 0] 1532 1539 set tag $_first-$comp 1533 SendCmd "$tag configure -outline $_settings($ this-outline)"1534 } 1535 } 1536 " isosurface" {1540 SendCmd "$tag configure -outline $_settings($what)" 1541 } 1542 } 1543 "-isosurface" { 1537 1544 if { [isconnected] } { 1538 SendCmd "volume shading isosurface $_settings($ this-isosurface)"1539 } 1540 } 1541 " grid" {1545 SendCmd "volume shading isosurface $_settings($what)" 1546 } 1547 } 1548 "-grid" { 1542 1549 if { [isconnected] } { 1543 SendCmd "grid visible $_settings($ this-grid)"1544 } 1545 } 1546 " axes" {1550 SendCmd "grid visible $_settings($what)" 1551 } 1552 } 1553 "-axes" { 1547 1554 if { [isconnected] } { 1548 SendCmd "axis visible $_settings($ this-axes)"1549 } 1550 } 1551 " legend" {1552 if { $_settings($ this-legend) } {1555 SendCmd "axis visible $_settings($what)" 1556 } 1557 } 1558 "-legend" { 1559 if { $_settings($what) } { 1553 1560 blt::table $itk_component(plotarea) \ 1554 1561 0,0 $itk_component(3dview) -fill both \ … … 1559 1566 } 1560 1567 } 1561 " volume" {1568 "-volume" { 1562 1569 if { $_first != "" } { 1563 1570 set comp [lindex [$_first components] 0] 1564 1571 set tag $_first-$comp 1565 SendCmd "$tag configure -volume $_settings($ this-volume)"1566 } 1567 } 1568 " cutplaneVisible" {1569 set bool $_settings($ this-$what)1572 SendCmd "$tag configure -volume $_settings($what)" 1573 } 1574 } 1575 "-cutplanesVisible" { 1576 set bool $_settings($what) 1570 1577 set datasets [CurrentVolumeIds -cutplanes] 1571 1578 set tag [lindex $datasets 0] 1572 1579 SendCmd "cutplane visible $bool $tag" 1573 1580 } 1574 " xcutplane" - "ycutplane" - "zcutplane" {1575 set axis [string range $what 0 0]1576 set bool $_settings($ this-$what)1581 "-xcutplane" - "-ycutplane" - "-zcutplane" { 1582 set axis [string range $what 1 1] 1583 set bool $_settings($what) 1577 1584 if { [isconnected] } { 1578 1585 set vols [CurrentVolumeIds -cutplanes] … … 1645 1652 } 1646 1653 array set style [lindex [$dataobj components -style $cname] 0] 1647 set _settings( $this-opacity) [expr $style(-opacity) * 100]1654 set _settings(-opacity) [expr $style(-opacity) * 100] 1648 1655 set _dataset2style($dataobj-$cname) $cname 1649 1656 lappend _style2datasets($cname) $dataobj $cname … … 1703 1710 } 1704 1711 1705 if { ![info exists _settings( $this-opacity)] } {1706 set _settings( $this-opacity) [expr $style(-opacity) * 100]1712 if { ![info exists _settings(-opacity)] } { 1713 set _settings(-opacity) [expr $style(-opacity) * 100] 1707 1714 } 1708 1715 … … 1719 1726 set isovalues [lsort -real $isovalues] 1720 1727 1721 set tag $t his-$tf1728 set tag $tf 1722 1729 if { ![info exists _settings($tag-thickness)]} { 1723 1730 set _settings($tag-thickness) 0.005 … … 1968 1975 1969 1976 itcl::body Rappture::FlowvisViewer::BuildViewTab {} { 1970 foreach { key value } {1971 grid 01972 axes 01973 outline 11974 volume 11975 legend 11976 particles 11977 lic 11978 } {1979 set _settings($this-$key) $value1980 }1981 1982 1977 set fg [option get $itk_component(hull) font Font] 1983 1978 #set bfg [option get $itk_component(hull) boldFont Font] … … 1988 1983 $inner configure -borderwidth 4 1989 1984 1990 set ::Rappture::FlowvisViewer::_settings($this-isosurface) 01991 1985 checkbutton $inner.isosurface \ 1992 1986 -text "Isosurface shading" \ 1993 -variable [itcl::scope _settings( $this-isosurface)] \1994 -command [itcl::code $this AdjustSetting isosurface] \1987 -variable [itcl::scope _settings(-isosurface)] \ 1988 -command [itcl::code $this AdjustSetting -isosurface] \ 1995 1989 -font "Arial 9" 1996 1990 1997 1991 checkbutton $inner.axes \ 1998 1992 -text "Axes" \ 1999 -variable [itcl::scope _settings( $this-axes)] \2000 -command [itcl::code $this AdjustSetting axes] \1993 -variable [itcl::scope _settings(-axes)] \ 1994 -command [itcl::code $this AdjustSetting -axes] \ 2001 1995 -font "Arial 9" 2002 1996 2003 1997 checkbutton $inner.grid \ 2004 1998 -text "Grid" \ 2005 -variable [itcl::scope _settings( $this-grid)] \2006 -command [itcl::code $this AdjustSetting grid] \1999 -variable [itcl::scope _settings(-grid)] \ 2000 -command [itcl::code $this AdjustSetting -grid] \ 2007 2001 -font "Arial 9" 2008 2002 2009 2003 checkbutton $inner.outline \ 2010 2004 -text "Outline" \ 2011 -variable [itcl::scope _settings( $this-outline)] \2012 -command [itcl::code $this AdjustSetting outline] \2005 -variable [itcl::scope _settings(-outline)] \ 2006 -command [itcl::code $this AdjustSetting -outline] \ 2013 2007 -font "Arial 9" 2014 2008 2015 2009 checkbutton $inner.legend \ 2016 2010 -text "Legend" \ 2017 -variable [itcl::scope _settings( $this-legend)] \2018 -command [itcl::code $this AdjustSetting legend] \2011 -variable [itcl::scope _settings(-legend)] \ 2012 -command [itcl::code $this AdjustSetting -legend] \ 2019 2013 -font "Arial 9" 2020 2014 2021 2015 checkbutton $inner.volume \ 2022 2016 -text "Volume" \ 2023 -variable [itcl::scope _settings( $this-volume)] \2024 -command [itcl::code $this AdjustSetting volume] \2017 -variable [itcl::scope _settings(-volume)] \ 2018 -command [itcl::code $this AdjustSetting -volume] \ 2025 2019 -font "Arial 9" 2026 2020 2027 2021 checkbutton $inner.particles \ 2028 2022 -text "Particles" \ 2029 -variable [itcl::scope _settings( $this-particles)] \2030 -command [itcl::code $this AdjustSetting particles] \2023 -variable [itcl::scope _settings(-particles)] \ 2024 -command [itcl::code $this AdjustSetting -particles] \ 2031 2025 -font "Arial 9" 2032 2026 2033 2027 checkbutton $inner.lic \ 2034 2028 -text "Lic" \ 2035 -variable [itcl::scope _settings( $this-lic)] \2036 -command [itcl::code $this AdjustSetting lic] \2029 -variable [itcl::scope _settings(-lic)] \ 2030 -command [itcl::code $this AdjustSetting -lic] \ 2037 2031 -font "Arial 9" 2038 2032 … … 2063 2057 checkbutton $inner.vol -text "Show volume" -font $fg \ 2064 2058 -text "Volume" \ 2065 -variable [itcl::scope _settings( $this-volume)] \2066 -command [itcl::code $this AdjustSetting volume] \2059 -variable [itcl::scope _settings(-volume)] \ 2060 -command [itcl::code $this AdjustSetting -volume] \ 2067 2061 -font "Arial 9" 2068 2062 … … 2070 2064 2071 2065 checkbutton $inner.light2side -text "Two-sided lighting" -font $fg \ 2072 -variable [itcl::scope _settings( $this-light2side)] \2073 -command [itcl::code $this AdjustSetting light2side]2066 -variable [itcl::scope _settings(-light2side)] \ 2067 -command [itcl::code $this AdjustSetting -light2side] 2074 2068 2075 2069 label $inner.ambient_l -text "Ambient" -font $fg 2076 2070 ::scale $inner.ambient -from 0 -to 100 -orient horizontal \ 2077 -variable [itcl::scope _settings( $this-ambient)] \2071 -variable [itcl::scope _settings(-ambient)] \ 2078 2072 -width 10 \ 2079 -showvalue off -command [itcl::code $this AdjustSetting ambient]2073 -showvalue off -command [itcl::code $this AdjustSetting -ambient] 2080 2074 2081 2075 label $inner.diffuse_l -text "Diffuse" -font $fg 2082 2076 ::scale $inner.diffuse -from 0 -to 100 -orient horizontal \ 2083 -variable [itcl::scope _settings( $this-diffuse)] \2077 -variable [itcl::scope _settings(-diffuse)] \ 2084 2078 -width 10 \ 2085 -showvalue off -command [itcl::code $this AdjustSetting diffuse]2079 -showvalue off -command [itcl::code $this AdjustSetting -diffuse] 2086 2080 2087 2081 label $inner.specularLevel_l -text "Specular" -font $fg 2088 2082 ::scale $inner.specularLevel -from 0 -to 100 -orient horizontal \ 2089 -variable [itcl::scope _settings( $this-specularLevel)] \2083 -variable [itcl::scope _settings(-specularLevel)] \ 2090 2084 -width 10 \ 2091 -showvalue off -command [itcl::code $this AdjustSetting specularLevel]2085 -showvalue off -command [itcl::code $this AdjustSetting -specularLevel] 2092 2086 2093 2087 label $inner.specularExponent_l -text "Shininess" -font $fg 2094 2088 ::scale $inner.specularExponent -from 10 -to 128 -orient horizontal \ 2095 -variable [itcl::scope _settings( $this-specularExponent)] \2089 -variable [itcl::scope _settings(-specularExponent)] \ 2096 2090 -width 10 \ 2097 -showvalue off -command [itcl::code $this AdjustSetting specularExponent]2091 -showvalue off -command [itcl::code $this AdjustSetting -specularExponent] 2098 2092 2099 2093 label $inner.clear -text "Clear" -font $fg 2100 2094 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 2101 -variable [itcl::scope _settings( $this-opacity)] \2095 -variable [itcl::scope _settings(-opacity)] \ 2102 2096 -width 10 \ 2103 -showvalue off -command [itcl::code $this AdjustSetting opacity]2097 -showvalue off -command [itcl::code $this AdjustSetting -opacity] 2104 2098 label $inner.opaque -text "Opaque" -font $fg 2105 2099 2106 2100 label $inner.thin -text "Thin" -font $fg 2107 2101 ::scale $inner.thickness -from 0 -to 1000 -orient horizontal \ 2108 -variable [itcl::scope _settings( $this-thickness)] \2102 -variable [itcl::scope _settings(-thickness)] \ 2109 2103 -width 10 \ 2110 -showvalue off -command [itcl::code $this AdjustSetting thickness]2104 -showvalue off -command [itcl::code $this AdjustSetting -thickness] 2111 2105 label $inner.thick -text "Thick" -font $fg 2112 2106 … … 2118 2112 $itk_component(colormap) value "BCGYR" 2119 2113 bind $inner.colormap <<Value>> \ 2120 [itcl::code $this AdjustSetting colormap]2114 [itcl::code $this AdjustSetting -colormap] 2121 2115 2122 2116 blt::table $inner \ … … 2154 2148 -onimage [Rappture::icon x-cutplane] \ 2155 2149 -offimage [Rappture::icon x-cutplane] \ 2156 -command [itcl::code $this AdjustSetting xcutplane] \2157 -variable [itcl::scope _settings( $this-xcutplane)]2150 -command [itcl::code $this AdjustSetting -xcutplane] \ 2151 -variable [itcl::scope _settings(-xcutplane)] 2158 2152 } 2159 2153 Rappture::Tooltip::for $itk_component(xCutButton) \ … … 2166 2160 -borderwidth 1 -highlightthickness 0 \ 2167 2161 -command [itcl::code $this Slice move x] \ 2168 -variable [itcl::scope _settings( $this-xcutposition)]2162 -variable [itcl::scope _settings(-xcutposition)] 2169 2163 } { 2170 2164 usual … … 2182 2176 -onimage [Rappture::icon y-cutplane] \ 2183 2177 -offimage [Rappture::icon y-cutplane] \ 2184 -command [itcl::code $this AdjustSetting ycutplane] \2185 -variable [itcl::scope _settings( $this-ycutplane)]2178 -command [itcl::code $this AdjustSetting -ycutplane] \ 2179 -variable [itcl::scope _settings(-ycutplane)] 2186 2180 } 2187 2181 Rappture::Tooltip::for $itk_component(yCutButton) \ … … 2194 2188 -borderwidth 1 -highlightthickness 0 \ 2195 2189 -command [itcl::code $this Slice move y] \ 2196 -variable [itcl::scope _settings( $this-ycutposition)]2190 -variable [itcl::scope _settings(-ycutposition)] 2197 2191 } { 2198 2192 usual … … 2210 2204 -onimage [Rappture::icon z-cutplane] \ 2211 2205 -offimage [Rappture::icon z-cutplane] \ 2212 -command [itcl::code $this AdjustSetting zcutplane] \2213 -variable [itcl::scope _settings( $this-zcutplane)]2206 -command [itcl::code $this AdjustSetting -zcutplane] \ 2207 -variable [itcl::scope _settings(-zcutplane)] 2214 2208 } 2215 2209 Rappture::Tooltip::for $itk_component(zCutButton) \ … … 2222 2216 -borderwidth 1 -highlightthickness 0 \ 2223 2217 -command [itcl::code $this Slice move z] \ 2224 -variable [itcl::scope _settings( $this-zcutposition)]2218 -variable [itcl::scope _settings(-zcutposition)] 2225 2219 } { 2226 2220 usual … … 2306 2300 array set hints [$flowobj hints] 2307 2301 checkbutton $inner.showstreams -text "Streams Plane" \ 2308 -variable [itcl::scope _settings( $this-streams)] \2302 -variable [itcl::scope _settings(-streams)] \ 2309 2303 -command [itcl::code $this streams $key $hints(name)] \ 2310 2304 -font "Arial 9" … … 2312 2306 2313 2307 checkbutton $inner.showarrows -text "Arrows" \ 2314 -variable [itcl::scope _settings( $this-arrows)] \2308 -variable [itcl::scope _settings(-arrows)] \ 2315 2309 -command [itcl::code $this arrows $key $hints(name)] \ 2316 2310 -font "Arial 9" 2317 2311 2318 label $inner.particles -text "Particles" 2319 label $inner.boxes -text "Boxes" 2312 label $inner.particles -text "Particles" -font "Arial 9 bold" 2313 label $inner.boxes -text "Boxes" -font "Arial 9 bold" 2320 2314 2321 2315 blt::table $inner \ … … 2335 2329 array set info $part 2336 2330 set name $info(name) 2337 if { ![info exists _settings( $this-particles-$name)] } {2338 set _settings( $this-particles-$name) $info(hide)2331 if { ![info exists _settings(-particles-$name)] } { 2332 set _settings(-particles-$name) $info(hide) 2339 2333 } 2340 2334 checkbutton $inner.part$row -text $info(label) \ 2341 -variable [itcl::scope _settings( $this-particles-$name)] \2335 -variable [itcl::scope _settings(-particles-$name)] \ 2342 2336 -onvalue 0 -offvalue 1 \ 2343 2337 -command [itcl::code $this particles $key $name] \ … … 2345 2339 Rappture::Tooltip::for $inner.part$row $info(description) 2346 2340 blt::table $inner $row,0 $inner.part$row -anchor w 2347 if { !$_settings( $this-particles-$name) } {2341 if { !$_settings(-particles-$name) } { 2348 2342 $inner.part$row select 2349 2343 } … … 2359 2353 array set info $box 2360 2354 set name $info(name) 2361 if { ![info exists _settings( $this-box-$name)] } {2362 set _settings( $this-box-$name) $info(hide)2355 if { ![info exists _settings(-box-$name)] } { 2356 set _settings(-box-$name) $info(hide) 2363 2357 } 2364 2358 checkbutton $inner.box$row -text $info(label) \ 2365 -variable [itcl::scope _settings( $this-box-$name)] \2359 -variable [itcl::scope _settings(-box-$name)] \ 2366 2360 -onvalue 0 -offvalue 1 \ 2367 2361 -command [itcl::code $this box $key $name] \ … … 2369 2363 Rappture::Tooltip::for $inner.box$row $info(description) 2370 2364 blt::table $inner $row,0 $inner.box$row -anchor w 2371 if { !$_settings( $this-box-$name) } {2365 if { !$_settings(-box-$name) } { 2372 2366 $inner.box$row select 2373 2367 } … … 2381 2375 2382 2376 itcl::body Rappture::FlowvisViewer::particles { tag name } { 2383 set bool $_settings( $this-particles-$name)2377 set bool $_settings(-particles-$name) 2384 2378 SendCmd "$tag particles configure {$name} -hide $bool" 2385 2379 } 2386 2380 2387 2381 itcl::body Rappture::FlowvisViewer::box { tag name } { 2388 set bool $_settings( $this-box-$name)2382 set bool $_settings(-box-$name) 2389 2383 SendCmd "$tag box configure {$name} -hide $bool" 2390 2384 } 2391 2385 2392 2386 itcl::body Rappture::FlowvisViewer::streams { tag name } { 2393 set bool $_settings( $this-streams)2387 set bool $_settings(-streams) 2394 2388 SendCmd "$tag configure -slice $bool" 2395 2389 } 2396 2390 2397 2391 itcl::body Rappture::FlowvisViewer::arrows { tag name } { 2398 set bool $_settings( $this-arrows)2392 set bool $_settings(-arrows) 2399 2393 SendCmd "$tag configure -arrows $bool" 2400 2394 } … … 2590 2584 } 2591 2585 "goto" { 2592 puts stderr "flow goto to $_settings( $this-currenttime)"2586 puts stderr "flow goto to $_settings(-currenttime)" 2593 2587 # Figure out how many steps to the current time based upon 2594 2588 # the speed and duration. 2595 set current $_settings( $this-currenttime)2589 set current $_settings(-currenttime) 2596 2590 set speed [$itk_component(speed) value] 2597 set time [str2millisecs $_settings( $this-duration)]2591 set time [str2millisecs $_settings(-duration)] 2598 2592 $itk_component(dial) configure -max $time 2599 2593 set delay [expr int(round(500.0/$speed))] … … 2607 2601 } 2608 2602 "duration" { 2609 set max [str2millisecs $_settings( $this-duration)]2603 set max [str2millisecs $_settings(-duration)] 2610 2604 if { $max < 0 } { 2611 2605 bell … … 2613 2607 } 2614 2608 set _flow(duration) $max 2615 set _settings( $this-duration) [millisecs2str $max]2609 set _settings(-duration) [millisecs2str $max] 2616 2610 $itk_component(dial) configure -max $max 2617 2611 } … … 2625 2619 flow duration 2626 2620 set _flow(state) 1 2627 set _settings( $this-currenttime) 02621 set _settings(-currenttime) 0 2628 2622 $itk_component(play) select 2629 2623 } … … 2644 2638 flow on 2645 2639 # If we're at the end of the flow, reset the flow. 2646 set _settings( $this-currenttime) \2647 [expr {$_settings( $this-currenttime) + $_flow(delay)}]2648 if { $_settings( $this-currenttime) >= $_flow(duration) } {2649 set _settings( $this-step) 12640 set _settings(-currenttime) \ 2641 [expr {$_settings(-currenttime) + $_flow(delay)}] 2642 if { $_settings(-currenttime) >= $_flow(duration) } { 2643 set _settings(-step) 1 2650 2644 SendCmd "flow reset" 2651 2645 } … … 2654 2648 } 2655 2649 "toggle" { 2656 if { $_settings( $this-play) } {2650 if { $_settings(-play) } { 2657 2651 flow play 2658 2652 } else { … … 2661 2655 } 2662 2656 "reset" { 2663 set _settings( $this-currenttime) 02657 set _settings(-currenttime) 0 2664 2658 SendCmd "flow reset" 2665 2659 } … … 2669 2663 return 2670 2664 } 2671 set _settings( $this-currenttime) \2672 [expr {$_settings( $this-currenttime) + $_flow(delay)}]2673 if { $_settings( $this-currenttime) >= $_flow(duration) } {2674 if { !$_settings( $this-loop) } {2665 set _settings(-currenttime) \ 2666 [expr {$_settings(-currenttime) + $_flow(delay)}] 2667 if { $_settings(-currenttime) >= $_flow(duration) } { 2668 if { !$_settings(-loop) } { 2675 2669 flow off 2676 2670 return
Note: See TracChangeset
for help on using the changeset viewer.