Changeset 5369 for branches/1.4
- Timestamp:
- Apr 30, 2015, 1:08:16 AM (10 years ago)
- Location:
- branches/1.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.4
- Property svn:mergeinfo changed
/trunk merged: 5365-5366,5368
- Property svn:mergeinfo changed
-
branches/1.4/gui/scripts/flowvisviewer.tcl
r5296 r5369 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 -arrows 0 226 -axes 0 227 -colormap BCGYR 228 -currenttime 0 229 -cutplanesVisible 0 230 -duration 1:00 231 -grid 0 232 -isosurface 0 233 -legend 1 234 -lic 1 235 -light 40 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 -speed 500 247 -step 0 248 -streams 0 249 -thickness 350 250 -volume 1 251 -xcutplane 1 252 -xcutposition 0 253 -xpan $_view(-xpan) 254 -ycutplane 1 255 -ycutposition 0 256 -ypan $_view(-ypan) 257 -zcutplane 1 258 -zcutposition 0 230 259 -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-light 40243 $this-light2side 1244 $this-opacity 50245 $this-thickness 350246 $this-cutplaneVisible 0247 $this-xcutplane 1248 $this-xcutposition 0249 $this-ycutplane 1250 $this-ycutposition 0251 $this-zcutplane 1252 $this-zcutposition 0253 260 }] 254 261 … … 303 310 -onimage [Rappture::icon volume-on] \ 304 311 -offimage [Rappture::icon volume-off] \ 305 -command [itcl::code $this AdjustSetting volume] \306 -variable [itcl::scope _settings( $this-volume)]312 -command [itcl::code $this AdjustSetting -volume] \ 313 -variable [itcl::scope _settings(-volume)] 307 314 } 308 315 $itk_component(volume) select … … 315 322 -onimage [Rappture::icon cutbutton] \ 316 323 -offimage [Rappture::icon cutbutton] \ 317 -variable [itcl::scope _settings( $this-cutplaneVisible)] \318 -command [itcl::code $this AdjustSetting cutplaneVisible]324 -variable [itcl::scope _settings(-cutplanesVisible)] \ 325 -command [itcl::code $this AdjustSetting -cutplanesVisible] 319 326 } 320 327 Rappture::Tooltip::for $itk_component(cutplane) \ … … 405 412 -onimage [Rappture::icon flow-pause] \ 406 413 -offimage [Rappture::icon flow-play] \ 407 -variable [itcl::scope _settings( $this-play)] \414 -variable [itcl::scope _settings(-play)] \ 408 415 -command [itcl::code $this flow toggle] 409 416 } … … 417 424 -onimage [Rappture::icon flow-loop] \ 418 425 -offimage [Rappture::icon flow-loop] \ 419 -variable [itcl::scope _settings( $this-loop)]426 -variable [itcl::scope _settings(-loop)] 420 427 } 421 428 Rappture::Tooltip::for $itk_component(loop) \ … … 427 434 -linecolor "" -activelinecolor "" \ 428 435 -min 0.0 -max 1.0 \ 429 -variable [itcl::scope _settings( $this-currenttime)] \436 -variable [itcl::scope _settings(-currenttime)] \ 430 437 -knobimage [Rappture::icon knob2] -knobposition center@middle 431 438 } { … … 439 446 itk_component add duration { 440 447 entry $itk_component(flowcontrols).duration \ 441 -textvariable [itcl::scope _settings( $this-duration)] \448 -textvariable [itcl::scope _settings(-duration)] \ 442 449 -bg white -width 6 -font "arial 9" 443 450 } { … … 568 575 image delete $_image(download) 569 576 catch { blt::arcball destroy $_arcball } 570 array unset _settings $this-*577 array unset _settings 571 578 } 572 579 … … 954 961 # _settings varible. 955 962 956 set value $_settings( $this-thickness)963 set value $_settings(-thickness) 957 964 # Scale values between 0.00001 and 0.01000 958 965 set thickness [expr {double($value) * 0.0001}] 959 set _settings($t his-$tf-thickness) $thickness966 set _settings($tf-thickness) $thickness 960 967 961 968 foreach key [array names _dataset2style $_first-*] { … … 1185 1192 1186 1193 # Reset the camera and other view parameters 1187 InitSettings light2sidelight \1188 opacity isosurface grid axes volumeoutline \1189 cutplaneVisible xcutplane ycutplanezcutplane1194 InitSettings -light2side -light \ 1195 -opacity -isosurface -grid -axes -volume -outline \ 1196 -cutplanesVisible -xcutplane -ycutplane -zcutplane 1190 1197 1191 1198 # nothing to send -- activate the proper volume … … 1239 1246 set vols [CurrentVolumeIds -cutplanes] 1240 1247 foreach axis {x y z} { 1241 set pos [expr {0.01*$_settings( $this-${axis}cutposition)}]1248 set pos [expr {0.01*$_settings(-${axis}cutposition)}] 1242 1249 SendCmd "cutplane position $pos $axis $vols" 1243 1250 } 1244 SendCmd "volume data state $_settings( $this-volume)"1251 SendCmd "volume data state $_settings(-volume)" 1245 1252 EventuallyResizeLegend 1246 1253 … … 1458 1465 itcl::body Rappture::FlowvisViewer::AdjustSetting {what {value ""}} { 1459 1466 switch -- $what { 1460 colormap{1467 "-colormap" { 1461 1468 set color [$itk_component(colormap) value] 1462 set _settings( colormap) $color1469 set _settings($what) $color 1463 1470 #ResetColormap $color 1464 1471 } 1465 light{1472 "-light" { 1466 1473 if { $_first != "" } { 1467 1474 set comp [lindex [$_first components] 0] 1468 1475 set tag $_first-$comp 1469 set diffuse [expr {0.01*$_settings($ this-light)}]1476 set diffuse [expr {0.01*$_settings($what)}] 1470 1477 set ambient [expr {1.0 - $diffuse}] 1471 1478 set specularLevel 0.3 … … 1474 1481 } 1475 1482 } 1476 light2side{1483 "-light2side" { 1477 1484 if { $_first != "" } { 1478 1485 set comp [lindex [$_first components] 0] 1479 1486 set tag $_first-$comp 1480 set val $_settings($ this-light2side)1487 set val $_settings($what) 1481 1488 SendCmd "$tag configure -light2side $val" 1482 1489 } 1483 1490 } 1484 opacity{1491 "-opacity" { 1485 1492 if { $_first != "" } { 1486 1493 set comp [lindex [$_first components] 0] 1487 1494 set tag $_first-$comp 1488 set opacity [expr { 0.01 * double($_settings($ this-opacity)) }]1495 set opacity [expr { 0.01 * double($_settings($what)) }] 1489 1496 SendCmd "$tag configure -opacity $opacity" 1490 1497 } 1491 1498 } 1492 thickness{1499 "-thickness" { 1493 1500 if { $_first != "" && $_activeTf != "" } { 1494 set val $_settings($ this-thickness)1501 set val $_settings($what) 1495 1502 # Scale values between 0.00001 and 0.01000 1496 1503 set sval [expr {0.0001*double($val)}] 1497 1504 set tf $_activeTf 1498 set _settings($t his-$tf-thickness) $sval1505 set _settings($tf${what}) $sval 1499 1506 updateTransferFunctions 1500 1507 } 1501 1508 } 1502 " outline" {1509 "-outline" { 1503 1510 if { $_first != "" } { 1504 1511 set comp [lindex [$_first components] 0] 1505 1512 set tag $_first-$comp 1506 SendCmd "$tag configure -outline $_settings($ this-outline)"1507 } 1508 } 1509 " isosurface" {1513 SendCmd "$tag configure -outline $_settings($what)" 1514 } 1515 } 1516 "-isosurface" { 1510 1517 if { [isconnected] } { 1511 SendCmd "volume shading isosurface $_settings($ this-isosurface)"1512 } 1513 } 1514 " grid" {1518 SendCmd "volume shading isosurface $_settings($what)" 1519 } 1520 } 1521 "-grid" { 1515 1522 if { [isconnected] } { 1516 SendCmd "grid visible $_settings($ this-grid)"1517 } 1518 } 1519 " axes" {1523 SendCmd "grid visible $_settings($what)" 1524 } 1525 } 1526 "-axes" { 1520 1527 if { [isconnected] } { 1521 SendCmd "axis visible $_settings($ this-axes)"1522 } 1523 } 1524 " legend" {1525 if { $_settings($ this-legend) } {1528 SendCmd "axis visible $_settings($what)" 1529 } 1530 } 1531 "-legend" { 1532 if { $_settings($what) } { 1526 1533 blt::table $itk_component(plotarea) \ 1527 1534 0,0 $itk_component(3dview) -fill both \ … … 1532 1539 } 1533 1540 } 1534 " volume" {1541 "-volume" { 1535 1542 if { $_first != "" } { 1536 1543 set comp [lindex [$_first components] 0] 1537 1544 set tag $_first-$comp 1538 SendCmd "$tag configure -volume $_settings($ this-volume)"1539 } 1540 } 1541 " cutplaneVisible" {1542 set bool $_settings($ this-$what)1545 SendCmd "$tag configure -volume $_settings($what)" 1546 } 1547 } 1548 "-cutplanesVisible" { 1549 set bool $_settings($what) 1543 1550 set datasets [CurrentVolumeIds -cutplanes] 1544 1551 set tag [lindex $datasets 0] 1545 1552 SendCmd "cutplane visible $bool $tag" 1546 1553 } 1547 " xcutplane" - "ycutplane" - "zcutplane" {1548 set axis [string range $what 0 0]1549 set bool $_settings($ this-$what)1554 "-xcutplane" - "-ycutplane" - "-zcutplane" { 1555 set axis [string range $what 1 1] 1556 set bool $_settings($what) 1550 1557 if { [isconnected] } { 1551 1558 set vols [CurrentVolumeIds -cutplanes] … … 1618 1625 } 1619 1626 array set style [lindex [$dataobj components -style $cname] 0] 1620 set _settings( $this-opacity) [expr $style(-opacity) * 100]1627 set _settings(-opacity) [expr $style(-opacity) * 100] 1621 1628 set _dataset2style($dataobj-$cname) $cname 1622 1629 lappend _style2datasets($cname) $dataobj $cname … … 1676 1683 } 1677 1684 1678 if { ![info exists _settings( $this-opacity)] } {1679 set _settings( $this-opacity) [expr $style(-opacity) * 100]1685 if { ![info exists _settings(-opacity)] } { 1686 set _settings(-opacity) [expr $style(-opacity) * 100] 1680 1687 } 1681 1688 … … 1692 1699 set isovalues [lsort -real $isovalues] 1693 1700 1694 set tag $t his-$tf1701 set tag $tf 1695 1702 if { ![info exists _settings($tag-thickness)]} { 1696 1703 set _settings($tag-thickness) 0.005 … … 1941 1948 1942 1949 itcl::body Rappture::FlowvisViewer::BuildViewTab {} { 1943 foreach { key value } {1944 grid 01945 axes 01946 outline 11947 volume 11948 legend 11949 particles 11950 lic 11951 } {1952 set _settings($this-$key) $value1953 }1954 1955 1950 set fg [option get $itk_component(hull) font Font] 1956 1951 #set bfg [option get $itk_component(hull) boldFont Font] … … 1961 1956 $inner configure -borderwidth 4 1962 1957 1963 set ::Rappture::FlowvisViewer::_settings($this-isosurface) 01964 1958 checkbutton $inner.isosurface \ 1965 1959 -text "Isosurface shading" \ 1966 -variable [itcl::scope _settings( $this-isosurface)] \1967 -command [itcl::code $this AdjustSetting isosurface] \1960 -variable [itcl::scope _settings(-isosurface)] \ 1961 -command [itcl::code $this AdjustSetting -isosurface] \ 1968 1962 -font "Arial 9" 1969 1963 1970 1964 checkbutton $inner.axes \ 1971 1965 -text "Axes" \ 1972 -variable [itcl::scope _settings( $this-axes)] \1973 -command [itcl::code $this AdjustSetting axes] \1966 -variable [itcl::scope _settings(-axes)] \ 1967 -command [itcl::code $this AdjustSetting -axes] \ 1974 1968 -font "Arial 9" 1975 1969 1976 1970 checkbutton $inner.grid \ 1977 1971 -text "Grid" \ 1978 -variable [itcl::scope _settings( $this-grid)] \1979 -command [itcl::code $this AdjustSetting grid] \1972 -variable [itcl::scope _settings(-grid)] \ 1973 -command [itcl::code $this AdjustSetting -grid] \ 1980 1974 -font "Arial 9" 1981 1975 1982 1976 checkbutton $inner.outline \ 1983 1977 -text "Outline" \ 1984 -variable [itcl::scope _settings( $this-outline)] \1985 -command [itcl::code $this AdjustSetting outline] \1978 -variable [itcl::scope _settings(-outline)] \ 1979 -command [itcl::code $this AdjustSetting -outline] \ 1986 1980 -font "Arial 9" 1987 1981 1988 1982 checkbutton $inner.legend \ 1989 1983 -text "Legend" \ 1990 -variable [itcl::scope _settings( $this-legend)] \1991 -command [itcl::code $this AdjustSetting legend] \1984 -variable [itcl::scope _settings(-legend)] \ 1985 -command [itcl::code $this AdjustSetting -legend] \ 1992 1986 -font "Arial 9" 1993 1987 1994 1988 checkbutton $inner.volume \ 1995 1989 -text "Volume" \ 1996 -variable [itcl::scope _settings( $this-volume)] \1997 -command [itcl::code $this AdjustSetting volume] \1990 -variable [itcl::scope _settings(-volume)] \ 1991 -command [itcl::code $this AdjustSetting -volume] \ 1998 1992 -font "Arial 9" 1999 1993 2000 1994 checkbutton $inner.particles \ 2001 1995 -text "Particles" \ 2002 -variable [itcl::scope _settings( $this-particles)] \2003 -command [itcl::code $this AdjustSetting particles] \1996 -variable [itcl::scope _settings(-particles)] \ 1997 -command [itcl::code $this AdjustSetting -particles] \ 2004 1998 -font "Arial 9" 2005 1999 2006 2000 checkbutton $inner.lic \ 2007 2001 -text "Lic" \ 2008 -variable [itcl::scope _settings( $this-lic)] \2009 -command [itcl::code $this AdjustSetting lic] \2002 -variable [itcl::scope _settings(-lic)] \ 2003 -command [itcl::code $this AdjustSetting -lic] \ 2010 2004 -font "Arial 9" 2011 2005 … … 2036 2030 checkbutton $inner.vol -text "Show volume" -font $fg \ 2037 2031 -text "Volume" \ 2038 -variable [itcl::scope _settings( $this-volume)] \2039 -command [itcl::code $this AdjustSetting volume] \2032 -variable [itcl::scope _settings(-volume)] \ 2033 -command [itcl::code $this AdjustSetting -volume] \ 2040 2034 -font "Arial 9" 2041 2035 … … 2043 2037 2044 2038 checkbutton $inner.light2side -text "Two-sided lighting" -font $fg \ 2045 -variable [itcl::scope _settings( $this-light2side)] \2046 -command [itcl::code $this AdjustSetting light2side]2039 -variable [itcl::scope _settings(-light2side)] \ 2040 -command [itcl::code $this AdjustSetting -light2side] 2047 2041 2048 2042 label $inner.dim -text "Glow" -font $fg 2049 2043 ::scale $inner.light -from 0 -to 100 -orient horizontal \ 2050 -variable [itcl::scope _settings( $this-light)] \2044 -variable [itcl::scope _settings(-light)] \ 2051 2045 -width 10 \ 2052 -showvalue off -command [itcl::code $this AdjustSetting light]2046 -showvalue off -command [itcl::code $this AdjustSetting -light] 2053 2047 label $inner.bright -text "Surface" -font $fg 2054 2048 2055 2049 label $inner.clear -text "Clear" -font $fg 2056 2050 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 2057 -variable [itcl::scope _settings( $this-opacity)] \2051 -variable [itcl::scope _settings(-opacity)] \ 2058 2052 -width 10 \ 2059 -showvalue off -command [itcl::code $this AdjustSetting opacity]2053 -showvalue off -command [itcl::code $this AdjustSetting -opacity] 2060 2054 label $inner.opaque -text "Opaque" -font $fg 2061 2055 2062 2056 label $inner.thin -text "Thin" -font $fg 2063 2057 ::scale $inner.thickness -from 0 -to 1000 -orient horizontal \ 2064 -variable [itcl::scope _settings( $this-thickness)] \2058 -variable [itcl::scope _settings(-thickness)] \ 2065 2059 -width 10 \ 2066 -showvalue off -command [itcl::code $this AdjustSetting thickness]2060 -showvalue off -command [itcl::code $this AdjustSetting -thickness] 2067 2061 label $inner.thick -text "Thick" -font $fg 2068 2062 … … 2075 2069 $itk_component(colormap) value "BCGYR" 2076 2070 bind $inner.colormap <<Value>> \ 2077 [itcl::code $this AdjustSetting colormap]2071 [itcl::code $this AdjustSetting -colormap] 2078 2072 2079 2073 blt::table $inner \ … … 2106 2100 -onimage [Rappture::icon x-cutplane] \ 2107 2101 -offimage [Rappture::icon x-cutplane] \ 2108 -command [itcl::code $this AdjustSetting xcutplane] \2109 -variable [itcl::scope _settings( $this-xcutplane)]2102 -command [itcl::code $this AdjustSetting -xcutplane] \ 2103 -variable [itcl::scope _settings(-xcutplane)] 2110 2104 } 2111 2105 Rappture::Tooltip::for $itk_component(xCutButton) \ … … 2118 2112 -borderwidth 1 -highlightthickness 0 \ 2119 2113 -command [itcl::code $this Slice move x] \ 2120 -variable [itcl::scope _settings( $this-xcutposition)]2114 -variable [itcl::scope _settings(-xcutposition)] 2121 2115 } { 2122 2116 usual … … 2134 2128 -onimage [Rappture::icon y-cutplane] \ 2135 2129 -offimage [Rappture::icon y-cutplane] \ 2136 -command [itcl::code $this AdjustSetting ycutplane] \2137 -variable [itcl::scope _settings( $this-ycutplane)]2130 -command [itcl::code $this AdjustSetting -ycutplane] \ 2131 -variable [itcl::scope _settings(-ycutplane)] 2138 2132 } 2139 2133 Rappture::Tooltip::for $itk_component(yCutButton) \ … … 2146 2140 -borderwidth 1 -highlightthickness 0 \ 2147 2141 -command [itcl::code $this Slice move y] \ 2148 -variable [itcl::scope _settings( $this-ycutposition)]2142 -variable [itcl::scope _settings(-ycutposition)] 2149 2143 } { 2150 2144 usual … … 2162 2156 -onimage [Rappture::icon z-cutplane] \ 2163 2157 -offimage [Rappture::icon z-cutplane] \ 2164 -command [itcl::code $this AdjustSetting zcutplane] \2165 -variable [itcl::scope _settings( $this-zcutplane)]2158 -command [itcl::code $this AdjustSetting -zcutplane] \ 2159 -variable [itcl::scope _settings(-zcutplane)] 2166 2160 } 2167 2161 Rappture::Tooltip::for $itk_component(zCutButton) \ … … 2174 2168 -borderwidth 1 -highlightthickness 0 \ 2175 2169 -command [itcl::code $this Slice move z] \ 2176 -variable [itcl::scope _settings( $this-zcutposition)]2170 -variable [itcl::scope _settings(-zcutposition)] 2177 2171 } { 2178 2172 usual … … 2258 2252 array set hints [$flowobj hints] 2259 2253 checkbutton $inner.showstreams -text "Streams Plane" \ 2260 -variable [itcl::scope _settings( $this-streams)] \2254 -variable [itcl::scope _settings(-streams)] \ 2261 2255 -command [itcl::code $this streams $key $hints(name)] \ 2262 2256 -font "Arial 9" … … 2264 2258 2265 2259 checkbutton $inner.showarrows -text "Arrows" \ 2266 -variable [itcl::scope _settings( $this-arrows)] \2260 -variable [itcl::scope _settings(-arrows)] \ 2267 2261 -command [itcl::code $this arrows $key $hints(name)] \ 2268 2262 -font "Arial 9" 2269 2263 2270 label $inner.particles -text "Particles" 2271 label $inner.boxes -text "Boxes" 2264 label $inner.particles -text "Particles" -font "Arial 9 bold" 2265 label $inner.boxes -text "Boxes" -font "Arial 9 bold" 2272 2266 2273 2267 blt::table $inner \ … … 2287 2281 array set info $part 2288 2282 set name $info(name) 2289 if { ![info exists _settings( $this-particles-$name)] } {2290 set _settings( $this-particles-$name) $info(hide)2283 if { ![info exists _settings(-particles-$name)] } { 2284 set _settings(-particles-$name) $info(hide) 2291 2285 } 2292 2286 checkbutton $inner.part$row -text $info(label) \ 2293 -variable [itcl::scope _settings( $this-particles-$name)] \2287 -variable [itcl::scope _settings(-particles-$name)] \ 2294 2288 -onvalue 0 -offvalue 1 \ 2295 2289 -command [itcl::code $this particles $key $name] \ … … 2297 2291 Rappture::Tooltip::for $inner.part$row $info(description) 2298 2292 blt::table $inner $row,0 $inner.part$row -anchor w 2299 if { !$_settings( $this-particles-$name) } {2293 if { !$_settings(-particles-$name) } { 2300 2294 $inner.part$row select 2301 2295 } … … 2311 2305 array set info $box 2312 2306 set name $info(name) 2313 if { ![info exists _settings( $this-box-$name)] } {2314 set _settings( $this-box-$name) $info(hide)2307 if { ![info exists _settings(-box-$name)] } { 2308 set _settings(-box-$name) $info(hide) 2315 2309 } 2316 2310 checkbutton $inner.box$row -text $info(label) \ 2317 -variable [itcl::scope _settings( $this-box-$name)] \2311 -variable [itcl::scope _settings(-box-$name)] \ 2318 2312 -onvalue 0 -offvalue 1 \ 2319 2313 -command [itcl::code $this box $key $name] \ … … 2321 2315 Rappture::Tooltip::for $inner.box$row $info(description) 2322 2316 blt::table $inner $row,0 $inner.box$row -anchor w 2323 if { !$_settings( $this-box-$name) } {2317 if { !$_settings(-box-$name) } { 2324 2318 $inner.box$row select 2325 2319 } … … 2333 2327 2334 2328 itcl::body Rappture::FlowvisViewer::particles { tag name } { 2335 set bool $_settings( $this-particles-$name)2329 set bool $_settings(-particles-$name) 2336 2330 SendCmd "$tag particles configure {$name} -hide $bool" 2337 2331 } 2338 2332 2339 2333 itcl::body Rappture::FlowvisViewer::box { tag name } { 2340 set bool $_settings( $this-box-$name)2334 set bool $_settings(-box-$name) 2341 2335 SendCmd "$tag box configure {$name} -hide $bool" 2342 2336 } 2343 2337 2344 2338 itcl::body Rappture::FlowvisViewer::streams { tag name } { 2345 set bool $_settings( $this-streams)2339 set bool $_settings(-streams) 2346 2340 SendCmd "$tag configure -slice $bool" 2347 2341 } 2348 2342 2349 2343 itcl::body Rappture::FlowvisViewer::arrows { tag name } { 2350 set bool $_settings( $this-arrows)2344 set bool $_settings(-arrows) 2351 2345 SendCmd "$tag configure -arrows $bool" 2352 2346 } … … 2471 2465 SendCmd "if {\[flow exists $tag\]} {flow delete $tag}" 2472 2466 array set info [$flowobj hints] 2473 set _settings( $this-volume) $info(volume)2474 set _settings( $this-outline) $info(outline)2475 set _settings( $this-arrows) $info(arrows)2476 set _settings( $this-duration) $info(duration)2467 set _settings(-volume) $info(volume) 2468 set _settings(-outline) $info(outline) 2469 set _settings(-arrows) $info(arrows) 2470 set _settings(-duration) $info(duration) 2477 2471 $itk_component(speed) value $info(speed) 2478 2472 set cmd {} … … 2542 2536 } 2543 2537 "goto" { 2544 puts stderr "flow goto to $_settings( $this-currenttime)"2538 puts stderr "flow goto to $_settings(-currenttime)" 2545 2539 # Figure out how many steps to the current time based upon 2546 2540 # the speed and duration. 2547 set current $_settings( $this-currenttime)2541 set current $_settings(-currenttime) 2548 2542 set speed [$itk_component(speed) value] 2549 set time [str2millisecs $_settings( $this-duration)]2543 set time [str2millisecs $_settings(-duration)] 2550 2544 $itk_component(dial) configure -max $time 2551 2545 set delay [expr int(round(500.0/$speed))] … … 2559 2553 } 2560 2554 "duration" { 2561 set max [str2millisecs $_settings( $this-duration)]2555 set max [str2millisecs $_settings(-duration)] 2562 2556 if { $max < 0 } { 2563 2557 bell … … 2565 2559 } 2566 2560 set _flow(duration) $max 2567 set _settings( $this-duration) [millisecs2str $max]2561 set _settings(-duration) [millisecs2str $max] 2568 2562 $itk_component(dial) configure -max $max 2569 2563 } … … 2577 2571 flow duration 2578 2572 set _flow(state) 1 2579 set _settings( $this-currenttime) 02573 set _settings(-currenttime) 0 2580 2574 $itk_component(play) select 2581 2575 } … … 2596 2590 flow on 2597 2591 # If we're at the end of the flow, reset the flow. 2598 set _settings( $this-currenttime) \2599 [expr {$_settings( $this-currenttime) + $_flow(delay)}]2600 if { $_settings( $this-currenttime) >= $_flow(duration) } {2601 set _settings( $this-step) 12592 set _settings(-currenttime) \ 2593 [expr {$_settings(-currenttime) + $_flow(delay)}] 2594 if { $_settings(-currenttime) >= $_flow(duration) } { 2595 set _settings(-step) 1 2602 2596 SendCmd "flow reset" 2603 2597 } … … 2606 2600 } 2607 2601 "toggle" { 2608 if { $_settings( $this-play) } {2602 if { $_settings(-play) } { 2609 2603 flow play 2610 2604 } else { … … 2613 2607 } 2614 2608 "reset" { 2615 set _settings( $this-currenttime) 02609 set _settings(-currenttime) 0 2616 2610 SendCmd "flow reset" 2617 2611 } … … 2621 2615 return 2622 2616 } 2623 set _settings( $this-currenttime) \2624 [expr {$_settings( $this-currenttime) + $_flow(delay)}]2625 if { $_settings( $this-currenttime) >= $_flow(duration) } {2626 if { !$_settings( $this-loop) } {2617 set _settings(-currenttime) \ 2618 [expr {$_settings(-currenttime) + $_flow(delay)}] 2619 if { $_settings(-currenttime) >= $_flow(duration) } { 2620 if { !$_settings(-loop) } { 2627 2621 flow off 2628 2622 return
Note: See TracChangeset
for help on using the changeset viewer.