Changeset 5365


Ignore:
Timestamp:
Apr 29, 2015, 9:04:09 PM (9 years ago)
Author:
ldelgass
Message:

Refactor _settings array in flowvisviewer: make it an obj. member variable,
remove $this from settings names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/flowvisviewer.tcl

    r5297 r5365  
    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        -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
    226242        -qw                     $_view(-qw)
    227243        -qx                     $_view(-qx)
    228244        -qy                     $_view(-qy)
    229245        -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
    230261        -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-ambient           60
    243         $this-diffuse           40
    244         $this-light2side        1
    245         $this-opacity           50
    246         $this-specularLevel     30
    247         $this-specularExponent  90
    248         $this-thickness         350
    249         $this-cutplaneVisible   0
    250         $this-xcutplane         1
    251         $this-xcutposition      0
    252         $this-ycutplane         1
    253         $this-ycutposition      0
    254         $this-zcutplane         1
    255         $this-zcutposition      0
    256262    }]
    257263
     
    306312            -onimage [Rappture::icon volume-on] \
    307313            -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)]
    310316    }
    311317    $itk_component(volume) select
     
    318324            -onimage [Rappture::icon cutbutton] \
    319325            -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]
    322328    }
    323329    Rappture::Tooltip::for $itk_component(cutplane) \
     
    408414            -onimage [Rappture::icon flow-pause] \
    409415            -offimage [Rappture::icon flow-play] \
    410             -variable [itcl::scope _settings($this-play)] \
     416            -variable [itcl::scope _settings(-play)] \
    411417            -command [itcl::code $this flow toggle]
    412418    }
     
    420426            -onimage [Rappture::icon flow-loop] \
    421427            -offimage [Rappture::icon flow-loop] \
    422             -variable [itcl::scope _settings($this-loop)]
     428            -variable [itcl::scope _settings(-loop)]
    423429    }
    424430    Rappture::Tooltip::for $itk_component(loop) \
     
    430436            -linecolor "" -activelinecolor "" \
    431437            -min 0.0 -max 1.0 \
    432             -variable [itcl::scope _settings($this-currenttime)] \
     438            -variable [itcl::scope _settings(-currenttime)] \
    433439            -knobimage [Rappture::icon knob2] -knobposition center@middle
    434440    } {
     
    442448    itk_component add duration {
    443449        entry $itk_component(flowcontrols).duration \
    444             -textvariable [itcl::scope _settings($this-duration)] \
     450            -textvariable [itcl::scope _settings(-duration)] \
    445451            -bg white -width 6 -font "arial 9"
    446452    } {
     
    571577    image delete $_image(download)
    572578    catch { blt::arcball destroy $_arcball }
    573     array unset _settings $this-*
     579    array unset _settings
    574580}
    575581
     
    957963    # _settings varible.
    958964
    959     set value $_settings($this-thickness)
     965    set value $_settings(-thickness)
    960966    # Scale values between 0.00001 and 0.01000
    961967    set thickness [expr {double($value) * 0.0001}]
    962     set _settings($this-$tf-thickness) $thickness
     968    set _settings($tf-thickness) $thickness
    963969
    964970    foreach key [array names _dataset2style $_first-*] {
     
    11881194
    11891195    # 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
    11931200
    11941201    # nothing to send -- activate the proper volume
     
    12421249    set vols [CurrentVolumeIds -cutplanes]
    12431250    foreach axis {x y z} {
    1244         set pos [expr {0.01*$_settings($this-${axis}cutposition)}]
     1251        set pos [expr {0.01*$_settings(-${axis}cutposition)}]
    12451252        SendCmd "cutplane position $pos $axis $vols"
    12461253    }
    1247     SendCmd "volume data state $_settings($this-volume)"
     1254    SendCmd "volume data state $_settings(-volume)"
    12481255    EventuallyResizeLegend
    12491256
     
    14611468itcl::body Rappture::FlowvisViewer::AdjustSetting {what {value ""}} {
    14621469    switch -- $what {
    1463         colormap {
     1470        "-colormap" {
    14641471            set color [$itk_component(colormap) value]
    1465             set _settings(colormap) $color
     1472            set _settings($what) $color
    14661473            #ResetColormap $color
    14671474        }
    1468         ambient {
     1475        "-ambient" {
    14691476            if { $_first != "" } {
    14701477                set comp [lindex [$_first components] 0]
    14711478                set tag $_first-$comp
    1472                 set val $_settings($this-ambient)
     1479                set val $_settings($what)
    14731480                set val [expr {0.01*$val}]
    14741481                SendCmd "$tag configure -ambient $val"
    14751482            }
    14761483        }
    1477         diffuse {
     1484        "-diffuse" {
    14781485            if { $_first != "" } {
    14791486                set comp [lindex [$_first components] 0]
    14801487                set tag $_first-$comp
    1481                 set val $_settings($this-diffuse)
     1488                set val $_settings($what)
    14821489                set val [expr {0.01*$val}]
    14831490                SendCmd "$tag configure -diffuse $val"
    14841491            }
    14851492        }
    1486         specularLevel {
     1493        "-specularLevel" {
    14871494            if { $_first != "" } {
    14881495                set comp [lindex [$_first components] 0]
    14891496                set tag $_first-$comp
    1490                 set val $_settings($this-specularLevel)
     1497                set val $_settings($what)
    14911498                set val [expr {0.01*$val}]
    14921499                SendCmd "$tag configure -specularLevel $val"
    14931500            }
    14941501        }
    1495         specularExponent {
     1502        "-specularExponent" {
    14961503            if { $_first != "" } {
    14971504                set comp [lindex [$_first components] 0]
    14981505                set tag $_first-$comp
    1499                 set val $_settings($this-specularExponent)
     1506                set val $_settings($what)
    15001507                SendCmd "$tag configure -specularExp $val"
    15011508            }
    15021509        }
    1503         light2side {
     1510        "-light2side" {
    15041511            if { $_first != "" } {
    15051512                set comp [lindex [$_first components] 0]
    15061513                set tag $_first-$comp
    1507                 set val $_settings($this-light2side)
     1514                set val $_settings($what)
    15081515                SendCmd "$tag configure -light2side $val"
    15091516            }
    15101517        }
    1511         opacity {
     1518        "-opacity" {
    15121519            if { $_first != "" } {
    15131520                set comp [lindex [$_first components] 0]
    15141521                set tag $_first-$comp
    1515                 set opacity [expr { 0.01 * double($_settings($this-opacity)) }]
     1522                set opacity [expr { 0.01 * double($_settings($what)) }]
    15161523                SendCmd "$tag configure -opacity $opacity"
    15171524            }
    15181525        }
    1519         thickness {
     1526        "-thickness" {
    15201527            if { $_first != "" && $_activeTf != "" } {
    1521                 set val $_settings($this-thickness)
     1528                set val $_settings($what)
    15221529                # Scale values between 0.00001 and 0.01000
    15231530                set sval [expr {0.0001*double($val)}]
    15241531                set tf $_activeTf
    1525                 set _settings($this-$tf-thickness) $sval
     1532                set _settings($tf${what}) $sval
    15261533                updateTransferFunctions
    15271534            }
    15281535        }
    1529         "outline" {
     1536        "-outline" {
    15301537            if { $_first != "" } {
    15311538                set comp [lindex [$_first components] 0]
    15321539                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" {
    15371544            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" {
    15421549            if { [isconnected] } {
    1543                 SendCmd "grid visible $_settings($this-grid)"
    1544             }
    1545         }
    1546         "axes" {
     1550                SendCmd "grid visible $_settings($what)"
     1551            }
     1552        }
     1553        "-axes" {
    15471554            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) } {
    15531560                blt::table $itk_component(plotarea) \
    15541561                    0,0 $itk_component(3dview) -fill both \
     
    15591566            }
    15601567        }
    1561         "volume" {
     1568        "-volume" {
    15621569            if { $_first != "" } {
    15631570                set comp [lindex [$_first components] 0]
    15641571                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)
    15701577            set datasets [CurrentVolumeIds -cutplanes]
    15711578            set tag [lindex $datasets 0]
    15721579            SendCmd "cutplane visible $bool $tag"
    15731580        }
    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)
    15771584            if { [isconnected] } {
    15781585                set vols [CurrentVolumeIds -cutplanes]
     
    16451652    }
    16461653    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]
    16481655    set _dataset2style($dataobj-$cname) $cname
    16491656    lappend _style2datasets($cname) $dataobj $cname
     
    17031710    }
    17041711
    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]
    17071714    }
    17081715
     
    17191726    set isovalues [lsort -real $isovalues]
    17201727
    1721     set tag $this-$tf
     1728    set tag $tf
    17221729    if { ![info exists _settings($tag-thickness)]} {
    17231730        set _settings($tag-thickness) 0.005
     
    19681975
    19691976itcl::body Rappture::FlowvisViewer::BuildViewTab {} {
    1970     foreach { key value } {
    1971         grid            0
    1972         axes            0
    1973         outline         1
    1974         volume          1
    1975         legend          1
    1976         particles       1
    1977         lic             1
    1978     } {
    1979         set _settings($this-$key) $value
    1980     }
    1981 
    19821977    set fg [option get $itk_component(hull) font Font]
    19831978    #set bfg [option get $itk_component(hull) boldFont Font]
     
    19881983    $inner configure -borderwidth 4
    19891984
    1990     set ::Rappture::FlowvisViewer::_settings($this-isosurface) 0
    19911985    checkbutton $inner.isosurface \
    19921986        -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] \
    19951989        -font "Arial 9"
    19961990
    19971991    checkbutton $inner.axes \
    19981992        -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] \
    20011995        -font "Arial 9"
    20021996
    20031997    checkbutton $inner.grid \
    20041998        -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] \
    20072001        -font "Arial 9"
    20082002
    20092003    checkbutton $inner.outline \
    20102004        -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] \
    20132007        -font "Arial 9"
    20142008
    20152009    checkbutton $inner.legend \
    20162010        -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] \
    20192013        -font "Arial 9"
    20202014
    20212015    checkbutton $inner.volume \
    20222016        -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] \
    20252019        -font "Arial 9"
    20262020
    20272021    checkbutton $inner.particles \
    20282022        -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] \
    20312025        -font "Arial 9"
    20322026
    20332027    checkbutton $inner.lic \
    20342028        -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] \
    20372031        -font "Arial 9"
    20382032
     
    20632057    checkbutton $inner.vol -text "Show volume" -font $fg \
    20642058        -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] \
    20672061        -font "Arial 9"
    20682062
     
    20702064
    20712065    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]
    20742068
    20752069    label $inner.ambient_l -text "Ambient" -font $fg
    20762070    ::scale $inner.ambient -from 0 -to 100 -orient horizontal \
    2077         -variable [itcl::scope _settings($this-ambient)] \
     2071        -variable [itcl::scope _settings(-ambient)] \
    20782072        -width 10 \
    2079         -showvalue off -command [itcl::code $this AdjustSetting ambient]
     2073        -showvalue off -command [itcl::code $this AdjustSetting -ambient]
    20802074
    20812075    label $inner.diffuse_l -text "Diffuse" -font $fg
    20822076    ::scale $inner.diffuse -from 0 -to 100 -orient horizontal \
    2083         -variable [itcl::scope _settings($this-diffuse)] \
     2077        -variable [itcl::scope _settings(-diffuse)] \
    20842078        -width 10 \
    2085         -showvalue off -command [itcl::code $this AdjustSetting diffuse]
     2079        -showvalue off -command [itcl::code $this AdjustSetting -diffuse]
    20862080
    20872081    label $inner.specularLevel_l -text "Specular" -font $fg
    20882082    ::scale $inner.specularLevel -from 0 -to 100 -orient horizontal \
    2089         -variable [itcl::scope _settings($this-specularLevel)] \
     2083        -variable [itcl::scope _settings(-specularLevel)] \
    20902084        -width 10 \
    2091         -showvalue off -command [itcl::code $this AdjustSetting specularLevel]
     2085        -showvalue off -command [itcl::code $this AdjustSetting -specularLevel]
    20922086
    20932087    label $inner.specularExponent_l -text "Shininess" -font $fg
    20942088    ::scale $inner.specularExponent -from 10 -to 128 -orient horizontal \
    2095         -variable [itcl::scope _settings($this-specularExponent)] \
     2089        -variable [itcl::scope _settings(-specularExponent)] \
    20962090        -width 10 \
    2097         -showvalue off -command [itcl::code $this AdjustSetting specularExponent]
     2091        -showvalue off -command [itcl::code $this AdjustSetting -specularExponent]
    20982092
    20992093    label $inner.clear -text "Clear" -font $fg
    21002094    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    2101         -variable [itcl::scope _settings($this-opacity)] \
     2095        -variable [itcl::scope _settings(-opacity)] \
    21022096        -width 10 \
    2103         -showvalue off -command [itcl::code $this AdjustSetting opacity]
     2097        -showvalue off -command [itcl::code $this AdjustSetting -opacity]
    21042098    label $inner.opaque -text "Opaque" -font $fg
    21052099
    21062100    label $inner.thin -text "Thin" -font $fg
    21072101    ::scale $inner.thickness -from 0 -to 1000 -orient horizontal \
    2108         -variable [itcl::scope _settings($this-thickness)] \
     2102        -variable [itcl::scope _settings(-thickness)] \
    21092103        -width 10 \
    2110         -showvalue off -command [itcl::code $this AdjustSetting thickness]
     2104        -showvalue off -command [itcl::code $this AdjustSetting -thickness]
    21112105    label $inner.thick -text "Thick" -font $fg
    21122106
     
    21182112    $itk_component(colormap) value "BCGYR"
    21192113    bind $inner.colormap <<Value>> \
    2120         [itcl::code $this AdjustSetting colormap]
     2114        [itcl::code $this AdjustSetting -colormap]
    21212115
    21222116    blt::table $inner \
     
    21542148            -onimage [Rappture::icon x-cutplane] \
    21552149            -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)]
    21582152    }
    21592153    Rappture::Tooltip::for $itk_component(xCutButton) \
     
    21662160            -borderwidth 1 -highlightthickness 0 \
    21672161            -command [itcl::code $this Slice move x] \
    2168             -variable [itcl::scope _settings($this-xcutposition)]
     2162            -variable [itcl::scope _settings(-xcutposition)]
    21692163    } {
    21702164        usual
     
    21822176            -onimage [Rappture::icon y-cutplane] \
    21832177            -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)]
    21862180    }
    21872181    Rappture::Tooltip::for $itk_component(yCutButton) \
     
    21942188            -borderwidth 1 -highlightthickness 0 \
    21952189            -command [itcl::code $this Slice move y] \
    2196             -variable [itcl::scope _settings($this-ycutposition)]
     2190            -variable [itcl::scope _settings(-ycutposition)]
    21972191    } {
    21982192        usual
     
    22102204            -onimage [Rappture::icon z-cutplane] \
    22112205            -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)]
    22142208    }
    22152209    Rappture::Tooltip::for $itk_component(zCutButton) \
     
    22222216            -borderwidth 1 -highlightthickness 0 \
    22232217            -command [itcl::code $this Slice move z] \
    2224             -variable [itcl::scope _settings($this-zcutposition)]
     2218            -variable [itcl::scope _settings(-zcutposition)]
    22252219    } {
    22262220        usual
     
    23062300    array set hints [$flowobj hints]
    23072301    checkbutton $inner.showstreams -text "Streams Plane" \
    2308         -variable [itcl::scope _settings($this-streams)] \
     2302        -variable [itcl::scope _settings(-streams)] \
    23092303        -command  [itcl::code $this streams $key $hints(name)]  \
    23102304        -font "Arial 9"
     
    23122306
    23132307    checkbutton $inner.showarrows -text "Arrows" \
    2314         -variable [itcl::scope _settings($this-arrows)] \
     2308        -variable [itcl::scope _settings(-arrows)] \
    23152309        -command  [itcl::code $this arrows $key $hints(name)]  \
    23162310        -font "Arial 9"
    23172311
    2318     label $inner.particles -text "Particles"         -font "Arial 9 bold"
    2319     label $inner.boxes -text "Boxes"         -font "Arial 9 bold"
     2312    label $inner.particles -text "Particles" -font "Arial 9 bold"
     2313    label $inner.boxes -text "Boxes" -font "Arial 9 bold"
    23202314
    23212315    blt::table $inner \
     
    23352329        array set info $part
    23362330        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)
    23392333        }
    23402334        checkbutton $inner.part$row -text $info(label) \
    2341             -variable [itcl::scope _settings($this-particles-$name)] \
     2335            -variable [itcl::scope _settings(-particles-$name)] \
    23422336            -onvalue 0 -offvalue 1 \
    23432337            -command [itcl::code $this particles $key $name] \
     
    23452339        Rappture::Tooltip::for $inner.part$row $info(description)
    23462340        blt::table $inner $row,0 $inner.part$row -anchor w
    2347         if { !$_settings($this-particles-$name) } {
     2341        if { !$_settings(-particles-$name) } {
    23482342            $inner.part$row select
    23492343        }
     
    23592353        array set info $box
    23602354        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)
    23632357        }
    23642358        checkbutton $inner.box$row -text $info(label) \
    2365             -variable [itcl::scope _settings($this-box-$name)] \
     2359            -variable [itcl::scope _settings(-box-$name)] \
    23662360            -onvalue 0 -offvalue 1 \
    23672361            -command [itcl::code $this box $key $name] \
     
    23692363        Rappture::Tooltip::for $inner.box$row $info(description)
    23702364        blt::table $inner $row,0 $inner.box$row -anchor w
    2371         if { !$_settings($this-box-$name) } {
     2365        if { !$_settings(-box-$name) } {
    23722366            $inner.box$row select
    23732367        }
     
    23812375
    23822376itcl::body Rappture::FlowvisViewer::particles { tag name } {
    2383     set bool $_settings($this-particles-$name)
     2377    set bool $_settings(-particles-$name)
    23842378    SendCmd "$tag particles configure {$name} -hide $bool"
    23852379}
    23862380
    23872381itcl::body Rappture::FlowvisViewer::box { tag name } {
    2388     set bool $_settings($this-box-$name)
     2382    set bool $_settings(-box-$name)
    23892383    SendCmd "$tag box configure {$name} -hide $bool"
    23902384}
    23912385
    23922386itcl::body Rappture::FlowvisViewer::streams { tag name } {
    2393     set bool $_settings($this-streams)
     2387    set bool $_settings(-streams)
    23942388    SendCmd "$tag configure -slice $bool"
    23952389}
    23962390
    23972391itcl::body Rappture::FlowvisViewer::arrows { tag name } {
    2398     set bool $_settings($this-arrows)
     2392    set bool $_settings(-arrows)
    23992393    SendCmd "$tag configure -arrows $bool"
    24002394}
     
    25902584        }
    25912585        "goto" {
    2592             puts stderr "flow goto to $_settings($this-currenttime)"
     2586            puts stderr "flow goto to $_settings(-currenttime)"
    25932587            # Figure out how many steps to the current time based upon
    25942588            # the speed and duration.
    2595             set current $_settings($this-currenttime)
     2589            set current $_settings(-currenttime)
    25962590            set speed [$itk_component(speed) value]
    2597             set time [str2millisecs $_settings($this-duration)]
     2591            set time [str2millisecs $_settings(-duration)]
    25982592            $itk_component(dial) configure -max $time
    25992593            set delay [expr int(round(500.0/$speed))]
     
    26072601        }
    26082602        "duration" {
    2609             set max [str2millisecs $_settings($this-duration)]
     2603            set max [str2millisecs $_settings(-duration)]
    26102604            if { $max < 0 } {
    26112605                bell
     
    26132607            }
    26142608            set _flow(duration) $max
    2615             set _settings($this-duration) [millisecs2str $max]
     2609            set _settings(-duration) [millisecs2str $max]
    26162610            $itk_component(dial) configure -max $max
    26172611        }
     
    26252619            flow duration
    26262620            set _flow(state) 1
    2627             set _settings($this-currenttime) 0
     2621            set _settings(-currenttime) 0
    26282622            $itk_component(play) select
    26292623        }
     
    26442638                flow on
    26452639                # 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) 1
     2640                set _settings(-currenttime) \
     2641                    [expr {$_settings(-currenttime) + $_flow(delay)}]
     2642                if { $_settings(-currenttime) >= $_flow(duration) } {
     2643                    set _settings(-step) 1
    26502644                    SendCmd "flow reset"
    26512645                }
     
    26542648        }
    26552649        "toggle" {
    2656             if { $_settings($this-play) } {
     2650            if { $_settings(-play) } {
    26572651                flow play
    26582652            } else {
     
    26612655        }
    26622656        "reset" {
    2663             set _settings($this-currenttime) 0
     2657            set _settings(-currenttime) 0
    26642658            SendCmd "flow reset"
    26652659        }
     
    26692663                return
    26702664            }
    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) } {
    26752669                    flow off
    26762670                    return
Note: See TracChangeset for help on using the changeset viewer.