Changeset 6363 for branches/1.6/gui


Ignore:
Timestamp:
May 24, 2016 8:18:10 AM (8 years ago)
Author:
ldelgass
Message:

merge viewer fixes from trunk

Location:
branches/1.6
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • branches/1.6

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

    r6358 r6363  
    11191119        DoResize
    11201120    }
    1121 
     1121    if { $_reset } {
     1122        InitSettings -background -axesvisible -gridvisible
     1123    }
    11221124    set _first ""
    11231125    foreach dataobj [get] {
     
    11651167
    11661168    # Reset the camera and other view parameters
    1167     InitSettings -axesvisible -gridvisible \
    1168         -opacity -light2side -isosurfaceshading \
     1169    InitSettings -opacity -light2side -isosurfaceshading \
    11691170        -light \
    11701171        -volume -outlinevisible -cutplanesvisible \
  • branches/1.6/gui/scripts/nanovisviewer.tcl

    r6358 r6363  
    940940        DoResize
    941941    }
    942 
     942    if { $_reset } {
     943        InitSettings -background -axesvisible -gridvisible
     944    }
    943945    foreach dataobj [get] {
    944946        foreach cname [$dataobj components] {
     
    10051007        }
    10061008
    1007         InitSettings -axesvisible -gridvisible \
    1008             -light2side -isosurfaceshading -opacity \
     1009        InitSettings -opacity -light2side -isosurfaceshading \
    10091010            -light \
    10101011            -xcutplanevisible -ycutplanevisible -zcutplanevisible
  • branches/1.6/gui/scripts/vtkglyphviewer.tcl

    r6340 r6363  
    144144    private variable _rotatePending 0
    145145    private variable _cutplanePending 0
    146     private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar)
    147146    private variable _fields
    148147    private variable _curFldName ""
    149148    private variable _curFldLabel ""
     149    private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar)
    150150
    151151    private common _downloadPopup;      # download options from popup
     
    597597        set _dlist [lreplace $_dlist $pos $pos]
    598598        array unset _obj2ovride $dataobj-*
    599         array unset _settings $dataobj-*
    600599        set changed 1
    601600    }
     
    12781277itcl::body Rappture::VtkGlyphViewer::InitSettings { args } {
    12791278    foreach spec $args {
    1280         if { [info exists _settings($_first${spec})] } {
    1281             # Reset global setting with dataobj specific setting
    1282             set _settings($spec) $_settings($_first${spec})
    1283         }
    12841279        AdjustSetting $spec
    12851280    }
  • branches/1.6/gui/scripts/vtkheightmapviewer.tcl

    r6340 r6363  
    103103    private method Rotate {option x y}
    104104    private method SetCurrentColormap { color }
     105    private method SetCurrentFieldName { dataobj }
    105106    private method SetLegendTip { x y }
    106107    private method SetObjectStyle { dataobj comp }
     
    261262
    262263    itk_component add fieldmenu {
    263         menu $itk_component(plotarea).menu \
    264             -relief flat \
    265             -tearoff 0
     264        menu $itk_component(plotarea).menu -relief flat -tearoff 0
    266265    } {
    267266        usual
     
    292291    }
    293292    pack $itk_component(reset) -side top -padx 2 -pady { 2 0 }
    294     Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level"
     293    Rappture::Tooltip::for $itk_component(reset) \
     294        "Reset the view to the default zoom level"
    295295
    296296    itk_component add zoomin {
     
    526526        set _dlist [lreplace $_dlist $pos $pos]
    527527        array unset _obj2ovride $dataobj-*
    528         array unset _settings $dataobj-*
    529528        set changed 1
    530529    }
     
    923922        # Reset the camera and other view parameters
    924923        #
    925         InitSettings -isheightmap -background
     924        InitSettings -isheightmap -background \
     925            -xgrid -ygrid -zgrid -axismode \
     926            -axesvisible -axislabels -axisminorticks
    926927
    927928        # Setting a custom exponent and label format for axes is causing
     
    936937        #SendCmd "axis exp 0 0 0 1"
    937938
     939        SendCmd "axis tickpos outside"
    938940        SendCmd "axis lrot z 90"
    939941        $_arcball quaternion [ViewToQuaternion]
     
    960962        if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
    961963            set _first $dataobj
     964            SetCurrentFieldName $dataobj
    962965        }
    963966        foreach comp [$dataobj components] {
     
    10011004        }
    10021005    }
    1003     if { $_first != "" } {
    1004         $itk_component(field) choices delete 0 end
    1005         $itk_component(fieldmenu) delete 0 end
    1006         array unset _fields
    1007         set _curFldName ""
    1008         foreach cname [$_first components] {
    1009             foreach fname [$_first fieldnames $cname] {
    1010                 if { [info exists _fields($fname)] } {
    1011                     continue
    1012                 }
    1013                 foreach { label units components } \
    1014                     [$_first fieldinfo $fname] break
    1015                 $itk_component(field) choices insert end "$fname" "$label"
    1016                 $itk_component(fieldmenu) add radiobutton -label "$label" \
    1017                     -value $label -variable [itcl::scope _curFldLabel] \
    1018                     -selectcolor red \
    1019                     -activebackground $itk_option(-plotbackground) \
    1020                     -activeforeground $itk_option(-plotforeground) \
    1021                     -font "Arial 8" \
    1022                     -command [itcl::code $this LegendTitleAction save]
    1023                 set _fields($fname) [list $label $units $components]
    1024                 if { $_curFldName == "" } {
    1025                     set _curFldName $fname
    1026                     set _curFldLabel $label
    1027                 }
    1028             }
    1029         }
    1030         $itk_component(field) value $_curFldLabel
    1031     }
     1006
    10321007    InitSettings -stretchtofit -outline
    1033 
    10341008    if { $_reset } {
    1035         SendCmd "axis tickpos outside"
    1036         #SendCmd "axis lformat all %g"
    1037 
    10381009        foreach axis { x y z } {
    10391010            set label ""
     
    10921063        }
    10931064        PanCamera
    1094         InitSettings -xgrid -ygrid -zgrid \
    1095             -axesvisible -axislabels -heightmapscale -field -isheightmap \
    1096             -numisolines
     1065        InitSettings -heightmapscale -field -isheightmap -numisolines
    10971066        if { [array size _fields] < 2 } {
    10981067            catch {blt::table forget $itk_component(field) $itk_component(field_l)}
     
    13341303itcl::body Rappture::VtkHeightmapViewer::InitSettings { args } {
    13351304    foreach spec $args {
    1336         if { [info exists _settings($_first${spec})] } {
    1337             # Reset global setting with dataobj specific setting
    1338             set _settings($spec) $_settings($_first${spec})
    1339         }
    13401305        AdjustSetting $spec
    13411306    }
     
    16041569            set _changed($what) 1
    16051570            set bool $_settings($what)
    1606             if { $bool } {
     1571            set color [$itk_component(isolinecolor) value]
     1572            if { $bool && $color != $_settings(-isolinecolor)} {
    16071573                $itk_component(isolinecolor) value $_settings(-isolinecolor)
    16081574            }
     
    22762242    set tag $dataobj-$comp
    22772243    array set style {
    2278         -color           BCGYR
    2279         -colormapvisible 1
    2280         -edgecolor       black
    2281         -edges           0
    2282         -isolinecolor    black
    2283         -isolinesvisible 1
    2284         -isolinewidth    1.0
    2285         -levels          10
    2286         -linewidth       1.0
    2287         -opacity         1.0
    2288         -outline         0
    2289         -wireframe       0
     2244        -color            BCGYR
     2245        -colormapdiscrete 0
     2246        -colormapvisible  1
     2247        -edgecolor        black
     2248        -edges            0
     2249        -isolinecolor     black
     2250        -isolinesvisible  1
     2251        -isolinewidth     1.0
     2252        -levels           10
     2253        -linewidth        1.0
     2254        -opacity          1.0
     2255        -outline          0
     2256        -wireframe        0
    22902257    }
    22912258    set stylelist [$dataobj style $comp]
     
    23252292        DrawLegend
    23262293    }
    2327     foreach setting {-edges -outline -wireframe \
     2294    foreach setting {-edges -outline -wireframe -colormapdiscrete \
    23282295                     -colormapvisible -isolinecolor -isolinesvisible} {
    23292296        if {$_changed($setting)} {
     
    23482315    SendCmd "heightmap wireframe $style(-wireframe) $tag"
    23492316    SetCurrentColormap $style(-color)
     2317    if {$style(-colormapdiscrete)} {
     2318        SendCmd "heightmap preinterp 1 $tag"
     2319        set numColors [expr $style(-levels) + 1]
     2320        SendCmd "colormap res $numColors $style(-color)"
     2321    }
    23502322    SendCmd "heightmap isolinecolor [Color2RGB $style(-isolinecolor)] $tag"
    23512323    $itk_component(isolinecolor) value $style(-isolinecolor)
     
    23912363# DrawLegend --
    23922364#
    2393 # Draws the legend in the own canvas on the right side of the plot area.
     2365# Draws the legend in its own canvas on the right side of the plot area.
    23942366#
    23952367itcl::body Rappture::VtkHeightmapViewer::DrawLegend {} {
     
    26782650    blt::vector destroy $v
    26792651}
     2652
     2653itcl::body Rappture::VtkHeightmapViewer::SetCurrentFieldName { dataobj } {
     2654    set _first $dataobj
     2655    $itk_component(field) choices delete 0 end
     2656    $itk_component(fieldmenu) delete 0 end
     2657    array unset _fields
     2658    set _curFldName ""
     2659    foreach cname [$_first components] {
     2660        foreach fname [$_first fieldnames $cname] {
     2661            if { [info exists _fields($fname)] } {
     2662                continue
     2663            }
     2664            foreach { label units components } \
     2665                [$_first fieldinfo $fname] break
     2666            $itk_component(field) choices insert end "$fname" "$label"
     2667            $itk_component(fieldmenu) add radiobutton -label "$label" \
     2668                -value $label -variable [itcl::scope _curFldLabel] \
     2669                -selectcolor red \
     2670                -activebackground $itk_option(-plotbackground) \
     2671                -activeforeground $itk_option(-plotforeground) \
     2672                -font "Arial 8" \
     2673                -command [itcl::code $this LegendTitleAction save]
     2674            set _fields($fname) [list $label $units $components]
     2675            if { $_curFldName == "" } {
     2676                set _curFldName $fname
     2677                set _curFldLabel $label
     2678            }
     2679        }
     2680    }
     2681    $itk_component(field) value $_curFldLabel
     2682}
  • branches/1.6/gui/scripts/vtkimageviewer.tcl

    r6340 r6363  
    100100    private method Rotate {option x y}
    101101    private method SetCurrentColormap { color }
     102    private method SetCurrentFieldName { dataobj }
    102103    private method SetLegendTip { x y }
    103104    private method SetObjectStyle { dataobj comp }
     
    243244
    244245    itk_component add fieldmenu {
    245         menu $itk_component(plotarea).menu \
    246             -relief flat \
    247             -tearoff 0
     246        menu $itk_component(plotarea).menu -relief flat -tearoff 0
    248247    } {
    249248        usual
     
    274273    }
    275274    pack $itk_component(reset) -side top -padx 2 -pady { 2 0 }
    276     Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level"
     275    Rappture::Tooltip::for $itk_component(reset) \
     276        "Reset the view to the default zoom level"
    277277
    278278    itk_component add zoomin {
     
    510510        set _dlist [lreplace $_dlist $pos $pos]
    511511        array unset _obj2ovride $dataobj-*
    512         array unset _settings $dataobj-*
    513512        set changed 1
    514513    }
     
    604603        }
    605604        foreach axis { x y } {
     605            set units [$dataobj hints ${axis}units]
     606            set found($units) 1
    606607            set lim [$dataobj limits $axis]
    607608            if { ![info exists _limits($axis)] } {
     
    618619            }
    619620            set _limits($axis) [list $amin $amax]
    620             set units [$dataobj hints ${axis}units]
    621             set found($units) 1
    622621        }
    623622        foreach { fname lim } [$dataobj fieldlimits] {
     
    900899        DoResize
    901900        if { $_settings(-stretchtofit) } {
    902             AdjustSetting -stretchToFit
     901            AdjustSetting -stretchtofit
    903902        }
    904903    }
     
    907906        # Reset the camera and other view parameters
    908907        #
    909         InitSettings -view3d -background
    910 
     908        InitSettings -view3d -background \
     909            -xgrid -ygrid -zgrid -axismode \
     910            -axesvisible -axislabels -axisminorticks
     911
     912        SendCmd "axis tickpos outside"
    911913        SendCmd "axis lrot z 90"
    912914        $_arcball quaternion [ViewToQuaternion]
     
    932934        if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
    933935            set _first $dataobj
     936            SetCurrentFieldName $dataobj
    934937        }
    935938        foreach comp [$dataobj components] {
     
    968971        }
    969972    }
    970     if { $_first != ""  } {
    971         $itk_component(field) choices delete 0 end
    972         $itk_component(fieldmenu) delete 0 end
    973         array unset _fields
    974         set _curFldName ""
    975         foreach cname [$_first components] {
    976             foreach fname [$_first fieldnames $cname] {
    977                 if { [info exists _fields($fname)] } {
    978                     continue
    979                 }
    980                 foreach { label units components } \
    981                     [$_first fieldinfo $fname] break
    982                 $itk_component(field) choices insert end "$fname" "$label"
    983                 $itk_component(fieldmenu) add radiobutton -label "$label" \
    984                     -value $label -variable [itcl::scope _curFldLabel] \
    985                     -selectcolor red \
    986                     -activebackground $itk_option(-plotbackground) \
    987                     -activeforeground $itk_option(-plotforeground) \
    988                     -font "Arial 8" \
    989                     -command [itcl::code $this LegendTitleAction save]
    990                 set _fields($fname) [list $label $units $components]
    991                 if { $_curFldName == "" } {
    992                     set _curFldName $fname
    993                     set _curFldLabel $label
    994                 }
    995             }
    996         }
    997         $itk_component(field) value $_curFldLabel
    998     }
     973
    999974    InitSettings -stretchtofit -outline
    1000 
    1001975    if { $_reset } {
    1002         SendCmd "axis tickpos outside"
    1003         #SendCmd "axis lformat all %g"
    1004 
    1005976        foreach axis { x y z } {
    1006977            set label ""
     
    10431014        }
    10441015        PanCamera
    1045         InitSettings -xgrid -ygrid -zgrid \
    1046             -axesvisible -axislabels -field -view3d
     1016        InitSettings -field -view3d
    10471017        if { [array size _fields] < 2 } {
    10481018            catch {blt::table forget $itk_component(field) $itk_component(field_l)}
     
    12751245itcl::body Rappture::VtkImageViewer::InitSettings { args } {
    12761246    foreach spec $args {
    1277         if { [info exists _settings($_first${spec})] } {
    1278             # Reset global setting with dataobj specific setting
    1279             set _settings($spec) $_settings($_first${spec})
    1280         }
    12811247        AdjustSetting $spec
    12821248    }
     
    20462012    if { [info exists style(-stretchtofit)] } {
    20472013        set _settings(-stretchtofit) $style(-stretchtofit)
    2048         AdjustSetting -stretchToFit
     2014        AdjustSetting -stretchtofit
    20492015    }
    20502016    SendCmd "outline add $tag"
     
    20922058# DrawLegend --
    20932059#
    2094 #       Draws the legend in the own canvas on the right side of the plot area.
     2060# Draws the legend in its own canvas on the right side of the plot area.
    20952061#
    20962062itcl::body Rappture::VtkImageViewer::DrawLegend {} {
     
    23272293    set _view(-zoom) 1.0
    23282294}
     2295
     2296itcl::body Rappture::VtkImageViewer::SetCurrentFieldName { dataobj } {
     2297    set _first $dataobj
     2298    $itk_component(field) choices delete 0 end
     2299    $itk_component(fieldmenu) delete 0 end
     2300    array unset _fields
     2301    set _curFldName ""
     2302    foreach cname [$_first components] {
     2303        foreach fname [$_first fieldnames $cname] {
     2304            if { [info exists _fields($fname)] } {
     2305                continue
     2306            }
     2307            foreach { label units components } \
     2308                [$_first fieldinfo $fname] break
     2309            $itk_component(field) choices insert end "$fname" "$label"
     2310            $itk_component(fieldmenu) add radiobutton -label "$label" \
     2311                -value $label -variable [itcl::scope _curFldLabel] \
     2312                -selectcolor red \
     2313                -activebackground $itk_option(-plotbackground) \
     2314                -activeforeground $itk_option(-plotforeground) \
     2315                -font "Arial 8" \
     2316                -command [itcl::code $this LegendTitleAction save]
     2317            set _fields($fname) [list $label $units $components]
     2318            if { $_curFldName == "" } {
     2319                set _curFldName $fname
     2320                set _curFldLabel $label
     2321            }
     2322        }
     2323    }
     2324    $itk_component(field) value $_curFldLabel
     2325}
  • branches/1.6/gui/scripts/vtkisosurfaceviewer.tcl

    r6340 r6363  
    160160    private variable _rotatePending 0
    161161    private variable _cutplanePending 0
    162     private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar)
    163162    private variable _fields
    164163    private variable _curFldName ""
    165164    private variable _curFldLabel ""
     165    private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar)
    166166    private variable _mouseOver "";     # what called LegendRangeAction:
    167167                                        # vmin or vmax
     
    653653        set _dlist [lreplace $_dlist $pos $pos]
    654654        array unset _obj2ovride $dataobj-*
    655         array unset _settings $dataobj-*
    656655        set changed 1
    657656    }
     
    13461345itcl::body Rappture::VtkIsosurfaceViewer::InitSettings { args } {
    13471346    foreach spec $args {
    1348         if { [info exists _settings($_first${spec})] } {
    1349             # Reset global setting with dataobj specific setting
    1350             set _settings($spec) $_settings($_first${spec})
    1351         }
    13521347        AdjustSetting $spec
    13531348    }
  • branches/1.6/gui/scripts/vtkstreamlinesviewer.tcl

    r6340 r6363  
    105105    private method Rotate {option x y}
    106106    private method SetCurrentColormap { color }
     107    private method SetCurrentFieldName { dataobj }
    107108    private method SetLegendTip { x y }
    108109    private method SetObjectStyle { dataobj comp }
     
    145146    private variable _curFldName ""
    146147    private variable _curFldLabel ""
     148    private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar)
    147149    private variable _streamlinesLength 0
    148150    private variable _numSeeds 200
    149     private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar)
    150151
    151152    private common _downloadPopup;      # download options from popup
     
    300301    }
    301302    pack $itk_component(reset) -side top -padx 2 -pady 2
    302     Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level"
     303    Rappture::Tooltip::for $itk_component(reset) \
     304        "Reset the view to the default zoom level"
    303305
    304306    itk_component add zoomin {
     
    588590        set _dlist [lreplace $_dlist $pos $pos]
    589591        array unset _obj2ovride $dataobj-*
    590         array unset _settings $dataobj-*
    591592        set changed 1
    592593    }
     
    978979        if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
    979980            set _first $dataobj
     981            SetCurrentFieldName $dataobj
    980982        }
    981983        foreach comp [$dataobj components] {
     
    10231025            }
    10241026        }
    1025         $itk_component(field) choices delete 0 end
    1026         $itk_component(fieldmenu) delete 0 end
    1027         array unset _fields
    1028         set _curFldName ""
    1029         set _curFldLabel ""
    1030         foreach cname [$_first components] {
    1031             foreach fname [$_first fieldnames $cname] {
    1032                 if { [info exists _fields($fname)] } {
    1033                     continue
    1034                 }
    1035                 foreach { label units components } \
    1036                     [$_first fieldinfo $fname] break
    1037                 $itk_component(field) choices insert end "$fname" "$label"
    1038                 $itk_component(fieldmenu) add radiobutton -label "$label" \
    1039                     -value $label -variable [itcl::scope _curFldLabel] \
    1040                     -selectcolor red \
    1041                     -activebackground $itk_option(-plotbackground) \
    1042                     -activeforeground $itk_option(-plotforeground) \
    1043                     -font "Arial 8" \
    1044                     -command [itcl::code $this LegendTitleAction save]
    1045                 set _fields($fname) [list $label $units $components]
    1046                 if { $_curFldName == "" && $components == 3 } {
    1047                     set _curFldName $fname
    1048                     set _curFldLabel $label
    1049                 }
    1050             }
    1051         }
    1052         $itk_component(field) value $_curFldLabel
    10531027    }
    10541028
     
    12951269itcl::body Rappture::VtkStreamlinesViewer::InitSettings { args } {
    12961270    foreach spec $args {
    1297         if { [info exists _settings($_first${spec})] } {
    1298             # Reset global setting with dataobj specific setting
    1299             set _settings($spec) $_settings($_first${spec})
    1300         }
    13011271        AdjustSetting $spec
    13021272    }
     
    24342404    set _view(-zoom) 1.0
    24352405}
     2406
     2407itcl::body Rappture::VtkStreamlinesViewer::SetCurrentFieldName { dataobj } {
     2408    set _first $dataobj
     2409    $itk_component(field) choices delete 0 end
     2410    $itk_component(fieldmenu) delete 0 end
     2411    array unset _fields
     2412    set _curFldName ""
     2413    set _curFldLabel ""
     2414    foreach cname [$_first components] {
     2415        foreach fname [$_first fieldnames $cname] {
     2416            if { [info exists _fields($fname)] } {
     2417                continue
     2418            }
     2419            foreach { label units components } \
     2420                [$_first fieldinfo $fname] break
     2421            $itk_component(field) choices insert end "$fname" "$label"
     2422            $itk_component(fieldmenu) add radiobutton -label "$label" \
     2423                -value $label -variable [itcl::scope _curFldLabel] \
     2424                -selectcolor red \
     2425                -activebackground $itk_option(-plotbackground) \
     2426                -activeforeground $itk_option(-plotforeground) \
     2427                -font "Arial 8" \
     2428                -command [itcl::code $this LegendTitleAction save]
     2429            set _fields($fname) [list $label $units $components]
     2430            if { $_curFldName == "" && $components == 3 } {
     2431                set _curFldName $fname
     2432                set _curFldLabel $label
     2433            }
     2434        }
     2435    }
     2436    $itk_component(field) value $_curFldLabel
     2437}
  • branches/1.6/gui/scripts/vtksurfaceviewer.tcl

    r6340 r6363  
    139139    private variable _legendPending 0
    140140    private variable _rotatePending 0
    141     private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar)
    142141    private variable _fields
    143142    private variable _curFldName ""
    144143    private variable _curFldLabel ""
     144    private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar)
    145145
    146146    private common _downloadPopup;      # download options from popup
     
    509509        set _dlist [lreplace $_dlist $pos $pos]
    510510        array unset _obj2ovride $dataobj-*
    511         array unset _settings $dataobj-*
    512511        set changed 1
    513512    }
     
    11901189itcl::body Rappture::VtkSurfaceViewer::InitSettings { args } {
    11911190    foreach spec $args {
    1192         if { [info exists _settings($_first${spec})] } {
    1193             # Reset global setting with dataobj specific setting
    1194             set _settings($spec) $_settings($_first${spec})
    1195         }
    11961191        AdjustSetting $spec
    11971192    }
     
    13151310            set _changed($what) 1
    13161311            set color [$itk_component(isolinecolor) value]
    1317             set _settings($what) $color
    1318             SendCmd "contour2d linecolor [Color2RGB $color]"
     1312            if { $color == "none" } {
     1313                if { $_settings(-isolinesvisible) } {
     1314                    set _changed(-isolinesvisible) 1
     1315                    foreach tag [CurrentDatasets -visible] {
     1316                        SendCmd "contour2d visible 0 $tag"
     1317                    }
     1318                    set _settings(-isolinesvisible) 0
     1319                }
     1320            } else {
     1321                set _settings($what) $color
     1322                if { !$_settings(-isolinesvisible) } {
     1323                    set _changed(-isolinesvisible) 1
     1324                    foreach tag [CurrentDatasets -visible] {
     1325                        SendCmd "contour2d visible 1 $tag"
     1326                    }
     1327                    set _settings(-isolinesvisible) 1
     1328                }
     1329                SendCmd "contour2d linecolor [Color2RGB $color]"
     1330            }
    13191331            DrawLegend
    13201332        }
     
    13241336            SendCmd "contour2d visible 0"
    13251337            if { $bool } {
     1338                if { [$itk_component(isolinecolor) value] != $_settings(-isolinecolor)} {
     1339                    $itk_component(isolinecolor) value $_settings(-isolinecolor)
     1340                }
    13261341                foreach tag [CurrentDatasets -visible] {
    13271342                    SendCmd "contour2d visible $bool $tag"
  • branches/1.6/gui/scripts/vtkviewer.tcl

    r6340 r6363  
    631631        set _dlist [lreplace $_dlist $pos $pos]
    632632        array unset _obj2ovride $dataobj-*
    633         array unset _settings $dataobj-*
    634633        set changed 1
    635634    }
  • branches/1.6/gui/scripts/vtkvolumeviewer.tcl

    r6342 r6363  
    105105    private method Rotate {option x y}
    106106    private method SetColormap { dataobj comp }
     107    private method SetCurrentFieldName { dataobj }
    107108    private method SetLegendTip { x y }
    108109    private method SetObjectStyle { dataobj cname }
     
    548549        set _dlist [lreplace $_dlist $pos $pos]
    549550        array unset _obj2ovride $dataobj-*
    550         array unset _settings $dataobj-*
    551551        set changed 1
    552552    }
     
    986986        if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
    987987            set _first $dataobj
     988            SetCurrentFieldName $dataobj
    988989        }
    989990        foreach cname [$dataobj components] {
     
    10321033            }
    10331034        }
    1034         $itk_component(field) choices delete 0 end
    1035         $itk_component(fieldmenu) delete 0 end
    1036         array unset _fields
    1037         set _curFldName ""
    1038         foreach cname [$_first components] {
    1039             foreach fname [$_first fieldnames $cname] {
    1040                 if { [info exists _fields($fname)] } {
    1041                     continue
    1042                 }
    1043                 foreach { label units components } \
    1044                     [$_first fieldinfo $fname] break
    1045                 # Only scalar fields are valid
    1046                 if {$_allowMultiComponent || $components == 1} {
    1047                     $itk_component(field) choices insert end "$fname" "$label"
    1048                     $itk_component(fieldmenu) add radiobutton -label "$label" \
    1049                         -value $label -variable [itcl::scope _curFldLabel] \
    1050                         -selectcolor red \
    1051                         -activebackground $itk_option(-plotbackground) \
    1052                         -activeforeground $itk_option(-plotforeground) \
    1053                         -font "Arial 8" \
    1054                         -command [itcl::code $this LegendTitleAction save]
    1055                     set _fields($fname) [list $label $units $components]
    1056                     if { $_curFldName == "" } {
    1057                         set _curFldName $fname
    1058                         set _curFldLabel $label
    1059                     }
    1060                 }
    1061             }
    1062         }
    1063         $itk_component(field) value $_curFldLabel
    10641035    }
    10651036
     
    12961267itcl::body Rappture::VtkVolumeViewer::InitSettings { args } {
    12971268    foreach spec $args {
    1298         if { [info exists _settings($_first${spec})] } {
    1299             # Reset global setting with dataobj specific setting
    1300             set _settings($spec) $_settings($_first${spec})
    1301         }
    13021269        AdjustSetting $spec
    13031270    }
     
    24142381    return $_volcomponents($cname)
    24152382}
     2383
     2384itcl::body Rappture::VtkVolumeViewer::SetCurrentFieldName { dataobj } {
     2385    set _first $dataobj
     2386    $itk_component(field) choices delete 0 end
     2387    $itk_component(fieldmenu) delete 0 end
     2388    array unset _fields
     2389    set _curFldName ""
     2390    foreach cname [$_first components] {
     2391        foreach fname [$_first fieldnames $cname] {
     2392            if { [info exists _fields($fname)] } {
     2393                continue
     2394            }
     2395            foreach { label units components } \
     2396                [$_first fieldinfo $fname] break
     2397            # Only scalar fields are valid
     2398            if {$_allowMultiComponent || $components == 1} {
     2399                $itk_component(field) choices insert end "$fname" "$label"
     2400                $itk_component(fieldmenu) add radiobutton -label "$label" \
     2401                    -value $label -variable [itcl::scope _curFldLabel] \
     2402                    -selectcolor red \
     2403                    -activebackground $itk_option(-plotbackground) \
     2404                    -activeforeground $itk_option(-plotforeground) \
     2405                    -font "Arial 8" \
     2406                    -command [itcl::code $this LegendTitleAction save]
     2407                set _fields($fname) [list $label $units $components]
     2408                if { $_curFldName == "" } {
     2409                    set _curFldName $fname
     2410                    set _curFldLabel $label
     2411                }
     2412            }
     2413        }
     2414    }
     2415    $itk_component(field) value $_curFldLabel
     2416}
Note: See TracChangeset for help on using the changeset viewer.