Changeset 5369


Ignore:
Timestamp:
Apr 30, 2015 1:08:16 AM (9 years ago)
Author:
ldelgass
Message:

Merge r5365:5366,r5368 from trunk

Location:
branches/1.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.4

  • branches/1.4/gui/scripts/flowvisviewer.tcl

    r5296 r5369  
    139139    private variable _view             ;# View params for 3D view
    140140    private variable _isomarkers       ;# array of isosurface level values 0..1
    141     private common  _settings
     141    private variable _settings
    142142    private variable _activeTf ""      ;# The currently active transfer function
    143143    private variable _first ""         ;# This is the topmost volume.
     
    147147    private variable _icon 0
    148148    private variable _flow
    149 
    150     private common _downloadPopup      ;# download options from popup
    151     private common _hardcopy
    152149    private variable _width 0
    153150    private variable _height 0
     
    155152    private variable _resizeLegendPending 0
    156153    private variable _gotoPending 0
     154
     155    private common _downloadPopup      ;# download options from popup
     156    private common _hardcopy
    157157}
    158158
     
    188188    $_dispatcher dispatch $this !play "[itcl::code $this flow next]; list"
    189189
    190     # Draw legend event
    191190    $_dispatcher register !goto
    192191    $_dispatcher dispatch $this !goto "[itcl::code $this flow goto2]; list"
     
    224223
    225224    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
    226242        -qw                     $_view(-qw)
    227243        -qx                     $_view(-qx)
    228244        -qy                     $_view(-qy)
    229245        -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
    230259        -zoom                   $_view(-zoom)
    231         -xpan                   $_view(-xpan)
    232         -ypan                   $_view(-ypan)
    233         $this-arrows            0
    234         $this-currenttime       0
    235         $this-duration          1:00
    236         $this-loop              0
    237         $this-play              0
    238         $this-speed             500
    239         $this-step              0
    240         $this-streams           0
    241         $this-volume            1
    242         $this-light             40
    243         $this-light2side        1
    244         $this-opacity           50
    245         $this-thickness         350
    246         $this-cutplaneVisible   0
    247         $this-xcutplane         1
    248         $this-xcutposition      0
    249         $this-ycutplane         1
    250         $this-ycutposition      0
    251         $this-zcutplane         1
    252         $this-zcutposition      0
    253260    }]
    254261
     
    303310            -onimage [Rappture::icon volume-on] \
    304311            -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)]
    307314    }
    308315    $itk_component(volume) select
     
    315322            -onimage [Rappture::icon cutbutton] \
    316323            -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]
    319326    }
    320327    Rappture::Tooltip::for $itk_component(cutplane) \
     
    405412            -onimage [Rappture::icon flow-pause] \
    406413            -offimage [Rappture::icon flow-play] \
    407             -variable [itcl::scope _settings($this-play)] \
     414            -variable [itcl::scope _settings(-play)] \
    408415            -command [itcl::code $this flow toggle]
    409416    }
     
    417424            -onimage [Rappture::icon flow-loop] \
    418425            -offimage [Rappture::icon flow-loop] \
    419             -variable [itcl::scope _settings($this-loop)]
     426            -variable [itcl::scope _settings(-loop)]
    420427    }
    421428    Rappture::Tooltip::for $itk_component(loop) \
     
    427434            -linecolor "" -activelinecolor "" \
    428435            -min 0.0 -max 1.0 \
    429             -variable [itcl::scope _settings($this-currenttime)] \
     436            -variable [itcl::scope _settings(-currenttime)] \
    430437            -knobimage [Rappture::icon knob2] -knobposition center@middle
    431438    } {
     
    439446    itk_component add duration {
    440447        entry $itk_component(flowcontrols).duration \
    441             -textvariable [itcl::scope _settings($this-duration)] \
     448            -textvariable [itcl::scope _settings(-duration)] \
    442449            -bg white -width 6 -font "arial 9"
    443450    } {
     
    568575    image delete $_image(download)
    569576    catch { blt::arcball destroy $_arcball }
    570     array unset _settings $this-*
     577    array unset _settings
    571578}
    572579
     
    954961    # _settings varible.
    955962
    956     set value $_settings($this-thickness)
     963    set value $_settings(-thickness)
    957964    # Scale values between 0.00001 and 0.01000
    958965    set thickness [expr {double($value) * 0.0001}]
    959     set _settings($this-$tf-thickness) $thickness
     966    set _settings($tf-thickness) $thickness
    960967
    961968    foreach key [array names _dataset2style $_first-*] {
     
    11851192
    11861193    # Reset the camera and other view parameters
    1187     InitSettings light2side light \
    1188         opacity isosurface grid axes volume outline \
    1189         cutplaneVisible xcutplane ycutplane zcutplane
     1194    InitSettings -light2side -light \
     1195        -opacity -isosurface -grid -axes -volume -outline \
     1196        -cutplanesVisible -xcutplane -ycutplane -zcutplane
    11901197
    11911198    # nothing to send -- activate the proper volume
     
    12391246    set vols [CurrentVolumeIds -cutplanes]
    12401247    foreach axis {x y z} {
    1241         set pos [expr {0.01*$_settings($this-${axis}cutposition)}]
     1248        set pos [expr {0.01*$_settings(-${axis}cutposition)}]
    12421249        SendCmd "cutplane position $pos $axis $vols"
    12431250    }
    1244     SendCmd "volume data state $_settings($this-volume)"
     1251    SendCmd "volume data state $_settings(-volume)"
    12451252    EventuallyResizeLegend
    12461253
     
    14581465itcl::body Rappture::FlowvisViewer::AdjustSetting {what {value ""}} {
    14591466    switch -- $what {
    1460         colormap {
     1467        "-colormap" {
    14611468            set color [$itk_component(colormap) value]
    1462             set _settings(colormap) $color
     1469            set _settings($what) $color
    14631470            #ResetColormap $color
    14641471        }
    1465         light {
     1472        "-light" {
    14661473            if { $_first != "" } {
    14671474                set comp [lindex [$_first components] 0]
    14681475                set tag $_first-$comp
    1469                 set diffuse [expr {0.01*$_settings($this-light)}]
     1476                set diffuse [expr {0.01*$_settings($what)}]
    14701477                set ambient [expr {1.0 - $diffuse}]
    14711478                set specularLevel 0.3
     
    14741481            }
    14751482        }
    1476         light2side {
     1483        "-light2side" {
    14771484            if { $_first != "" } {
    14781485                set comp [lindex [$_first components] 0]
    14791486                set tag $_first-$comp
    1480                 set val $_settings($this-light2side)
     1487                set val $_settings($what)
    14811488                SendCmd "$tag configure -light2side $val"
    14821489            }
    14831490        }
    1484         opacity {
     1491        "-opacity" {
    14851492            if { $_first != "" } {
    14861493                set comp [lindex [$_first components] 0]
    14871494                set tag $_first-$comp
    1488                 set opacity [expr { 0.01 * double($_settings($this-opacity)) }]
     1495                set opacity [expr { 0.01 * double($_settings($what)) }]
    14891496                SendCmd "$tag configure -opacity $opacity"
    14901497            }
    14911498        }
    1492         thickness {
     1499        "-thickness" {
    14931500            if { $_first != "" && $_activeTf != "" } {
    1494                 set val $_settings($this-thickness)
     1501                set val $_settings($what)
    14951502                # Scale values between 0.00001 and 0.01000
    14961503                set sval [expr {0.0001*double($val)}]
    14971504                set tf $_activeTf
    1498                 set _settings($this-$tf-thickness) $sval
     1505                set _settings($tf${what}) $sval
    14991506                updateTransferFunctions
    15001507            }
    15011508        }
    1502         "outline" {
     1509        "-outline" {
    15031510            if { $_first != "" } {
    15041511                set comp [lindex [$_first components] 0]
    15051512                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" {
    15101517            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" {
    15151522            if { [isconnected] } {
    1516                 SendCmd "grid visible $_settings($this-grid)"
    1517             }
    1518         }
    1519         "axes" {
     1523                SendCmd "grid visible $_settings($what)"
     1524            }
     1525        }
     1526        "-axes" {
    15201527            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) } {
    15261533                blt::table $itk_component(plotarea) \
    15271534                    0,0 $itk_component(3dview) -fill both \
     
    15321539            }
    15331540        }
    1534         "volume" {
     1541        "-volume" {
    15351542            if { $_first != "" } {
    15361543                set comp [lindex [$_first components] 0]
    15371544                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)
    15431550            set datasets [CurrentVolumeIds -cutplanes]
    15441551            set tag [lindex $datasets 0]
    15451552            SendCmd "cutplane visible $bool $tag"
    15461553        }
    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)
    15501557            if { [isconnected] } {
    15511558                set vols [CurrentVolumeIds -cutplanes]
     
    16181625    }
    16191626    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]
    16211628    set _dataset2style($dataobj-$cname) $cname
    16221629    lappend _style2datasets($cname) $dataobj $cname
     
    16761683    }
    16771684
    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]
    16801687    }
    16811688
     
    16921699    set isovalues [lsort -real $isovalues]
    16931700
    1694     set tag $this-$tf
     1701    set tag $tf
    16951702    if { ![info exists _settings($tag-thickness)]} {
    16961703        set _settings($tag-thickness) 0.005
     
    19411948
    19421949itcl::body Rappture::FlowvisViewer::BuildViewTab {} {
    1943     foreach { key value } {
    1944         grid            0
    1945         axes            0
    1946         outline         1
    1947         volume          1
    1948         legend          1
    1949         particles       1
    1950         lic             1
    1951     } {
    1952         set _settings($this-$key) $value
    1953     }
    1954 
    19551950    set fg [option get $itk_component(hull) font Font]
    19561951    #set bfg [option get $itk_component(hull) boldFont Font]
     
    19611956    $inner configure -borderwidth 4
    19621957
    1963     set ::Rappture::FlowvisViewer::_settings($this-isosurface) 0
    19641958    checkbutton $inner.isosurface \
    19651959        -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] \
    19681962        -font "Arial 9"
    19691963
    19701964    checkbutton $inner.axes \
    19711965        -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] \
    19741968        -font "Arial 9"
    19751969
    19761970    checkbutton $inner.grid \
    19771971        -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] \
    19801974        -font "Arial 9"
    19811975
    19821976    checkbutton $inner.outline \
    19831977        -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] \
    19861980        -font "Arial 9"
    19871981
    19881982    checkbutton $inner.legend \
    19891983        -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] \
    19921986        -font "Arial 9"
    19931987
    19941988    checkbutton $inner.volume \
    19951989        -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] \
    19981992        -font "Arial 9"
    19991993
    20001994    checkbutton $inner.particles \
    20011995        -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] \
    20041998        -font "Arial 9"
    20051999
    20062000    checkbutton $inner.lic \
    20072001        -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] \
    20102004        -font "Arial 9"
    20112005
     
    20362030    checkbutton $inner.vol -text "Show volume" -font $fg \
    20372031        -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] \
    20402034        -font "Arial 9"
    20412035
     
    20432037
    20442038    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]
    20472041
    20482042    label $inner.dim -text "Glow" -font $fg
    20492043    ::scale $inner.light -from 0 -to 100 -orient horizontal \
    2050         -variable [itcl::scope _settings($this-light)] \
     2044        -variable [itcl::scope _settings(-light)] \
    20512045        -width 10 \
    2052         -showvalue off -command [itcl::code $this AdjustSetting light]
     2046        -showvalue off -command [itcl::code $this AdjustSetting -light]
    20532047    label $inner.bright -text "Surface" -font $fg
    20542048
    20552049    label $inner.clear -text "Clear" -font $fg
    20562050    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    2057         -variable [itcl::scope _settings($this-opacity)] \
     2051        -variable [itcl::scope _settings(-opacity)] \
    20582052        -width 10 \
    2059         -showvalue off -command [itcl::code $this AdjustSetting opacity]
     2053        -showvalue off -command [itcl::code $this AdjustSetting -opacity]
    20602054    label $inner.opaque -text "Opaque" -font $fg
    20612055
    20622056    label $inner.thin -text "Thin" -font $fg
    20632057    ::scale $inner.thickness -from 0 -to 1000 -orient horizontal \
    2064         -variable [itcl::scope _settings($this-thickness)] \
     2058        -variable [itcl::scope _settings(-thickness)] \
    20652059        -width 10 \
    2066         -showvalue off -command [itcl::code $this AdjustSetting thickness]
     2060        -showvalue off -command [itcl::code $this AdjustSetting -thickness]
    20672061    label $inner.thick -text "Thick" -font $fg
    20682062
     
    20752069    $itk_component(colormap) value "BCGYR"
    20762070    bind $inner.colormap <<Value>> \
    2077         [itcl::code $this AdjustSetting colormap]
     2071        [itcl::code $this AdjustSetting -colormap]
    20782072
    20792073    blt::table $inner \
     
    21062100            -onimage [Rappture::icon x-cutplane] \
    21072101            -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)]
    21102104    }
    21112105    Rappture::Tooltip::for $itk_component(xCutButton) \
     
    21182112            -borderwidth 1 -highlightthickness 0 \
    21192113            -command [itcl::code $this Slice move x] \
    2120             -variable [itcl::scope _settings($this-xcutposition)]
     2114            -variable [itcl::scope _settings(-xcutposition)]
    21212115    } {
    21222116        usual
     
    21342128            -onimage [Rappture::icon y-cutplane] \
    21352129            -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)]
    21382132    }
    21392133    Rappture::Tooltip::for $itk_component(yCutButton) \
     
    21462140            -borderwidth 1 -highlightthickness 0 \
    21472141            -command [itcl::code $this Slice move y] \
    2148             -variable [itcl::scope _settings($this-ycutposition)]
     2142            -variable [itcl::scope _settings(-ycutposition)]
    21492143    } {
    21502144        usual
     
    21622156            -onimage [Rappture::icon z-cutplane] \
    21632157            -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)]
    21662160    }
    21672161    Rappture::Tooltip::for $itk_component(zCutButton) \
     
    21742168            -borderwidth 1 -highlightthickness 0 \
    21752169            -command [itcl::code $this Slice move z] \
    2176             -variable [itcl::scope _settings($this-zcutposition)]
     2170            -variable [itcl::scope _settings(-zcutposition)]
    21772171    } {
    21782172        usual
     
    22582252    array set hints [$flowobj hints]
    22592253    checkbutton $inner.showstreams -text "Streams Plane" \
    2260         -variable [itcl::scope _settings($this-streams)] \
     2254        -variable [itcl::scope _settings(-streams)] \
    22612255        -command  [itcl::code $this streams $key $hints(name)]  \
    22622256        -font "Arial 9"
     
    22642258
    22652259    checkbutton $inner.showarrows -text "Arrows" \
    2266         -variable [itcl::scope _settings($this-arrows)] \
     2260        -variable [itcl::scope _settings(-arrows)] \
    22672261        -command  [itcl::code $this arrows $key $hints(name)]  \
    22682262        -font "Arial 9"
    22692263
    2270     label $inner.particles -text "Particles"         -font "Arial 9 bold"
    2271     label $inner.boxes -text "Boxes"         -font "Arial 9 bold"
     2264    label $inner.particles -text "Particles" -font "Arial 9 bold"
     2265    label $inner.boxes -text "Boxes" -font "Arial 9 bold"
    22722266
    22732267    blt::table $inner \
     
    22872281        array set info $part
    22882282        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)
    22912285        }
    22922286        checkbutton $inner.part$row -text $info(label) \
    2293             -variable [itcl::scope _settings($this-particles-$name)] \
     2287            -variable [itcl::scope _settings(-particles-$name)] \
    22942288            -onvalue 0 -offvalue 1 \
    22952289            -command [itcl::code $this particles $key $name] \
     
    22972291        Rappture::Tooltip::for $inner.part$row $info(description)
    22982292        blt::table $inner $row,0 $inner.part$row -anchor w
    2299         if { !$_settings($this-particles-$name) } {
     2293        if { !$_settings(-particles-$name) } {
    23002294            $inner.part$row select
    23012295        }
     
    23112305        array set info $box
    23122306        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)
    23152309        }
    23162310        checkbutton $inner.box$row -text $info(label) \
    2317             -variable [itcl::scope _settings($this-box-$name)] \
     2311            -variable [itcl::scope _settings(-box-$name)] \
    23182312            -onvalue 0 -offvalue 1 \
    23192313            -command [itcl::code $this box $key $name] \
     
    23212315        Rappture::Tooltip::for $inner.box$row $info(description)
    23222316        blt::table $inner $row,0 $inner.box$row -anchor w
    2323         if { !$_settings($this-box-$name) } {
     2317        if { !$_settings(-box-$name) } {
    23242318            $inner.box$row select
    23252319        }
     
    23332327
    23342328itcl::body Rappture::FlowvisViewer::particles { tag name } {
    2335     set bool $_settings($this-particles-$name)
     2329    set bool $_settings(-particles-$name)
    23362330    SendCmd "$tag particles configure {$name} -hide $bool"
    23372331}
    23382332
    23392333itcl::body Rappture::FlowvisViewer::box { tag name } {
    2340     set bool $_settings($this-box-$name)
     2334    set bool $_settings(-box-$name)
    23412335    SendCmd "$tag box configure {$name} -hide $bool"
    23422336}
    23432337
    23442338itcl::body Rappture::FlowvisViewer::streams { tag name } {
    2345     set bool $_settings($this-streams)
     2339    set bool $_settings(-streams)
    23462340    SendCmd "$tag configure -slice $bool"
    23472341}
    23482342
    23492343itcl::body Rappture::FlowvisViewer::arrows { tag name } {
    2350     set bool $_settings($this-arrows)
     2344    set bool $_settings(-arrows)
    23512345    SendCmd "$tag configure -arrows $bool"
    23522346}
     
    24712465    SendCmd "if {\[flow exists $tag\]} {flow delete $tag}"
    24722466    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)
    24772471    $itk_component(speed) value $info(speed)
    24782472    set cmd {}
     
    25422536        }
    25432537        "goto" {
    2544             puts stderr "flow goto to $_settings($this-currenttime)"
     2538            puts stderr "flow goto to $_settings(-currenttime)"
    25452539            # Figure out how many steps to the current time based upon
    25462540            # the speed and duration.
    2547             set current $_settings($this-currenttime)
     2541            set current $_settings(-currenttime)
    25482542            set speed [$itk_component(speed) value]
    2549             set time [str2millisecs $_settings($this-duration)]
     2543            set time [str2millisecs $_settings(-duration)]
    25502544            $itk_component(dial) configure -max $time
    25512545            set delay [expr int(round(500.0/$speed))]
     
    25592553        }
    25602554        "duration" {
    2561             set max [str2millisecs $_settings($this-duration)]
     2555            set max [str2millisecs $_settings(-duration)]
    25622556            if { $max < 0 } {
    25632557                bell
     
    25652559            }
    25662560            set _flow(duration) $max
    2567             set _settings($this-duration) [millisecs2str $max]
     2561            set _settings(-duration) [millisecs2str $max]
    25682562            $itk_component(dial) configure -max $max
    25692563        }
     
    25772571            flow duration
    25782572            set _flow(state) 1
    2579             set _settings($this-currenttime) 0
     2573            set _settings(-currenttime) 0
    25802574            $itk_component(play) select
    25812575        }
     
    25962590                flow on
    25972591                # 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) 1
     2592                set _settings(-currenttime) \
     2593                    [expr {$_settings(-currenttime) + $_flow(delay)}]
     2594                if { $_settings(-currenttime) >= $_flow(duration) } {
     2595                    set _settings(-step) 1
    26022596                    SendCmd "flow reset"
    26032597                }
     
    26062600        }
    26072601        "toggle" {
    2608             if { $_settings($this-play) } {
     2602            if { $_settings(-play) } {
    26092603                flow play
    26102604            } else {
     
    26132607        }
    26142608        "reset" {
    2615             set _settings($this-currenttime) 0
     2609            set _settings(-currenttime) 0
    26162610            SendCmd "flow reset"
    26172611        }
     
    26212615                return
    26222616            }
    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) } {
    26272621                    flow off
    26282622                    return
Note: See TracChangeset for help on using the changeset viewer.