Changeset 5187


Ignore:
Timestamp:
Apr 2, 2015 9:28:24 AM (9 years ago)
Author:
ldelgass
Message:

s/styles/style/ (for code consistency), remove unused member variables

Location:
branches/1.4/gui/scripts
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • branches/1.4/gui/scripts/flowvisviewer.tcl

    r5183 r5187  
    717717# ----------------------------------------------------------------------
    718718itcl::body Rappture::FlowvisViewer::scale {args} {
    719     array set styles {
     719    array set style {
    720720        -color BCGYR
    721721        -levels 6
     
    732732            if { ![info exists _volcomponents($cname)] } {
    733733                lappend _componentsList $cname
    734                 array set styles [lindex [$dataobj components -style $cname] 0]
    735                 set cmap [ColorsToColormap $styles(-color)]
     734                array set style [lindex [$dataobj components -style $cname] 0]
     735                set cmap [ColorsToColormap $style(-color)]
    736736                set _cname2defaultcolormap($cname) $cmap
    737                 set _settings($cname-colormap) $styles(-color)
     737                set _settings($cname-colormap) $style(-color)
    738738            }
    739739            lappend _volcomponents($cname) $dataobj-$cname
     
    12551255    foreach key [array names _serverObjs *-*] {
    12561256        if {[string match $_first-* $key]} {
    1257             array set styles {
     1257            array set style {
    12581258                -cutplanes 1
    12591259            }
    12601260            foreach {dataobj comp} [split $key -] break
    1261             array set styles [lindex [$dataobj components -style $comp] 0]
    1262             if {$what != "-cutplanes" || $styles(-cutplanes)} {
     1261            array set style [lindex [$dataobj components -style $comp] 0]
     1262            if {$what != "-cutplanes" || $style(-cutplanes)} {
    12631263                lappend rlist $_serverObjs($key)
    12641264            }
     
    16941694#
    16951695itcl::body Rappture::FlowvisViewer::NameTransferFunc { dataobj cname } {
    1696     array set styles {
     1696    array set style {
    16971697        -color BCGYR
    16981698        -levels 6
    16991699        -opacity 0.5
    17001700    }
    1701     array set styles [lindex [$dataobj components -style $cname] 0]
    1702     set _settings($this-opacity) [expr $styles(-opacity) * 100]
     1701    array set style [lindex [$dataobj components -style $cname] 0]
     1702    set _settings($this-opacity) [expr $style(-opacity) * 100]
    17031703    set _obj2style($dataobj-$cname) $cname
    17041704    lappend _style2objs($cname) $dataobj $cname
     
    17161716#
    17171717itcl::body Rappture::FlowvisViewer::ComputeTransferFunc { tf } {
    1718     array set styles {
     1718    array set style {
    17191719        -color BCGYR
    17201720        -levels 6
     
    17261726        return 0
    17271727    }
    1728     array set styles [lindex [$dataobj components -style $comp] 0]
     1728    array set style [lindex [$dataobj components -style $comp] 0]
    17291729
    17301730    # We have to parse the style attributes for a volume using this
     
    17431743    if { ![info exists _isomarkers($tf)] } {
    17441744        # Have to defer creation of isomarkers until we have data limits
    1745         if { [info exists styles(-markers)] &&
    1746              [llength $styles(-markers)] > 0  } {
    1747             ParseMarkersOption $tf $styles(-markers)
     1745        if { [info exists style(-markers)] &&
     1746             [llength $style(-markers)] > 0  } {
     1747            ParseMarkersOption $tf $style(-markers)
    17481748        } else {
    1749             ParseLevelsOption $tf $styles(-levels)
    1750         }
    1751     }
    1752     if { [info exists styles(-nonuniformcolors)] } {
    1753         foreach { value color } $styles(-nonuniformcolors) {
     1749            ParseLevelsOption $tf $style(-levels)
     1750        }
     1751    }
     1752    if { [info exists style(-nonuniformcolors)] } {
     1753        foreach { value color } $style(-nonuniformcolors) {
    17541754            append cmap "$value [Color2RGB $color] "
    17551755        }
    17561756    } else {
    1757         set cmap [ColorsToColormap $styles(-color)]
     1757        set cmap [ColorsToColormap $style(-color)]
    17581758    }
    17591759
    17601760    if { ![info exists _settings($this-opacity)] } {
    1761         set _settings($this-opacity) [expr $styles(-opacity) * 100]
     1761        set _settings($this-opacity) [expr $style(-opacity) * 100]
    17621762    }
    17631763
  • branches/1.4/gui/scripts/nanovisviewer.tcl

    r5183 r5187  
    562562# ----------------------------------------------------------------------
    563563itcl::body Rappture::NanovisViewer::scale {args} {
    564     array set styles {
     564    array set style {
    565565        -color    BCGYR
    566566        -levels   6
     
    576576            if { ![info exists _volcomponents($cname)] } {
    577577                lappend _componentsList $cname
    578                 array set styles [lindex [$dataobj components -style $cname] 0]
    579                 set cmap [ColorsToColormap $styles(-color)]
     578                array set style [lindex [$dataobj components -style $cname] 0]
     579                set cmap [ColorsToColormap $style(-color)]
    580580                set _cname2defaultcolormap($cname) $cmap
    581                 set _settings($cname-colormap) $styles(-color)
     581                set _settings($cname-colormap) $style(-color)
    582582            }
    583583            lappend _volcomponents($cname) $dataobj-$cname
     
    10281028        set tag $_first-$cname
    10291029        if { [info exists _serverDatasets($tag)] && $_serverDatasets($tag) } {
    1030             array set styles {
     1030            array set style {
    10311031                -cutplanes 1
    10321032            }
    1033             array set styles [lindex [$_first components -style $cname] 0]
    1034             if { $what != "-cutplanes" || $styles(-cutplanes) } {
     1033            array set style [lindex [$_first components -style $cname] 0]
     1034            if { $what != "-cutplanes" || $style(-cutplanes) } {
    10351035                lappend rlist $tag
    10361036            }
     
    13881388#
    13891389itcl::body Rappture::NanovisViewer::NameTransferFunction { dataobj cname } {
    1390     array set styles {
     1390    array set style {
    13911391        -color BCGYR
    13921392        -levels 6
     
    13941394    }
    13951395    set tag $dataobj-$cname
    1396     array set styles [lindex [$dataobj components -style $cname] 0]
     1396    array set style [lindex [$dataobj components -style $cname] 0]
    13971397    if { ![info exists _cname2transferFunction($cname)] } {
    13981398        # Get the colormap right now, since it doesn't change with marker
    13991399        # changes.
    1400         set cmap [ColorsToColormap $styles(-color)]
     1400        set cmap [ColorsToColormap $style(-color)]
    14011401        set amap [list 0.0 0.0 1.0 1.0]
    14021402        set _cname2transferFunction($cname) [list $cmap $amap]
     
    14341434    # reference.
    14351435    if { ![info exists _parsedFunction($cname)] } {
    1436         array set styles {
     1436        array set style {
    14371437            -color BCGYR
    14381438            -levels 6
     
    14421442        foreach tag [GetDatasetsWithComponent $cname] {
    14431443            foreach {dataobj cname} [split [lindex $tag 0] -] break
    1444             array set styles [lindex [$dataobj components -style $cname] 0]
     1444            array set style [lindex [$dataobj components -style $cname] 0]
    14451445        }
    14461446        eval $_transferFunctionEditors($cname) limits $_limits($cname)
    14471447        # Have to defer creation of isomarkers until we have data limits
    1448         if { [info exists styles(-markers)] &&
    1449              [llength $styles(-markers)] > 0 } {
    1450             ParseMarkersOption $cname $styles(-markers)
     1448        if { [info exists style(-markers)] &&
     1449             [llength $style(-markers)] > 0 } {
     1450            ParseMarkersOption $cname $style(-markers)
    14511451        } else {
    1452             ParseLevelsOption $cname $styles(-levels)
     1452            ParseLevelsOption $cname $style(-levels)
    14531453        }
    14541454
     
    24782478
    24792479itcl::body Rappture::NanovisViewer::SetObjectStyle { dataobj cname } {
    2480     array set styles {
     2480    array set style {
    24812481        -opacity  0.5
    24822482    }
    2483     array set styles [lindex [$dataobj components -style $cname] 0]
    2484     set _settings($cname-volumeopacity) $styles(-opacity)
     2483    array set style [lindex [$dataobj components -style $cname] 0]
     2484    set _settings($cname-volumeopacity) $style(-opacity)
    24852485    set tag $dataobj-$cname
    24862486    SendCmd "volume shading opacity $_settings($cname-volumeopacity) $tag"
  • branches/1.4/gui/scripts/vtkglyphviewer.tcl

    r5183 r5187  
    129129    private variable _view         ;    # view params for 3D view
    130130    private variable _settings
    131     private variable _style;            # Array of current component styles.
    132131    private variable _changed
    133     private variable _initialStyle;     # Array of initial component styles.
    134132    private variable _reset 1;          # Connection to server has been reset.
    135133
  • branches/1.4/gui/scripts/vtkheightmapviewer.tcl

    r5183 r5187  
    138138    private variable _settings
    139139    private variable _changed
    140     private variable _initialStyle "";  # First found style in dataobjects.
    141140    private variable _reset 1;          # Connection to server has been reset.
    142141
  • branches/1.4/gui/scripts/vtkimageviewer.tcl

    r5183 r5187  
    133133    private variable _settings
    134134    private variable _changed
    135     private variable _initialStyle "";  # First found style in dataobjects.
    136135    private variable _reset 1;          # Connection to server has been reset.
    137136
  • branches/1.4/gui/scripts/vtkisosurfaceviewer.tcl

    r5183 r5187  
    146146    private variable _view         ;    # view params for 3D view
    147147    private variable _settings
    148     private variable _style;            # Array of current component styles.
    149148    private variable _changed
    150     private variable _initialStyle;     # Array of initial component styles.
    151149    private variable _reset 1;          # Connection to server has been reset.
    152150
  • branches/1.4/gui/scripts/vtkmeshviewer.tcl

    r5172 r5187  
    113113    private variable _settings
    114114    private variable _widget
    115     private variable _style;            # Array of current component styles.
    116     private variable _initialStyle;     # Array of initial component styles.
    117115    private variable _reset 1;          # Connection to server has been reset.
    118116
  • branches/1.4/gui/scripts/vtksurfaceviewer.tcl

    r5183 r5187  
    129129    private variable _view         ;    # view params for 3D view
    130130    private variable _settings
    131     private variable _style;            # Array of current component styles.
    132131    private variable _changed
    133     private variable _initialStyle;     # Array of initial component styles.
    134132    private variable _reset 1;          # Connection to server has been reset.
    135133
  • branches/1.4/gui/scripts/vtkvolumeviewer.tcl

    r5185 r5187  
    21282128    # Parse style string.
    21292129    set tag $dataobj-$cname
    2130     array set styles {
     2130    array set style {
    21312131        -lighting   1
    21322132        -opacity    0.5
     
    21342134        -visible    1
    21352135    }
    2136     array set styles [$dataobj style $cname]
    2137     set _settings(-volumelighting) $styles(-lighting)
    2138     set _settings(-volumeopacity) [expr $styles(-opacity) * 100.0]
    2139     set _settings(-volumeoutline) $styles(-outline)
    2140     set _settings(-volumevisible) $styles(-visible)
     2136    array set style [$dataobj style $cname]
     2137    set _settings(-volumelighting) $style(-lighting)
     2138    set _settings(-volumeopacity) [expr $style(-opacity) * 100.0]
     2139    set _settings(-volumeoutline) $style(-outline)
     2140    set _settings(-volumevisible) $style(-visible)
    21412141
    21422142    SendCmd "outline add $tag"
    21432143    SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag"
    2144     SendCmd "outline visible $styles(-outline) $tag"
     2144    SendCmd "outline visible $style(-outline) $tag"
    21452145
    21462146    SendCmd "$_cutplaneCmd add $tag"
     
    21492149
    21502150    SendCmd "volume add $tag"
    2151     SendCmd "volume lighting $styles(-lighting) $tag"
    2152     SendCmd "volume opacity $styles(-opacity) $tag"
    2153     SendCmd "volume visible $styles(-visible) $tag"
     2151    SendCmd "volume lighting $style(-lighting) $tag"
     2152    SendCmd "volume opacity $style(-opacity) $tag"
     2153    SendCmd "volume visible $style(-visible) $tag"
    21542154    SetColormap $dataobj $cname
    21552155}
Note: See TracChangeset for help on using the changeset viewer.