Ignore:
Timestamp:
Mar 4, 2014, 12:13:02 PM (11 years ago)
Author:
ldelgass
Message:

merge isosurface viewer setting changes from trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3/gui/scripts/vtkisosurfaceviewer.tcl

    r4186 r4201  
    188188    $_dispatcher register !xcutplane
    189189    $_dispatcher dispatch $this !xcutplane \
    190         "[itcl::code $this AdjustSetting cutplaneXPosition]; list"
     190        "[itcl::code $this AdjustSetting -xcutplaneposition]; list"
    191191
    192192    # Y-Cutplane event
    193193    $_dispatcher register !ycutplane
    194194    $_dispatcher dispatch $this !ycutplane \
    195         "[itcl::code $this AdjustSetting cutplaneYPosition]; list"
     195        "[itcl::code $this AdjustSetting -ycutplaneposition]; list"
    196196
    197197    # Z-Cutplane event
    198198    $_dispatcher register !zcutplane
    199199    $_dispatcher dispatch $this !zcutplane \
    200         "[itcl::code $this AdjustSetting cutplaneZPosition]; list"
     200        "[itcl::code $this AdjustSetting -zcutplaneposition]; list"
    201201
    202202    #
     
    222222    $_arcball quaternion $q
    223223
    224     array set _settings [subst {
    225         background              black
    226         colormap                BCGYR
    227         colormapVisible         1
    228         field                   "Default"
    229         isolineColor            white
    230         axesVisible             1
    231         axisLabelsVisible       1
    232         axisXGrid               0
    233         axisYGrid               0
    234         axisZGrid               0
    235         cutplaneEdges           0
    236         cutplaneLighting        1
    237         cutplanePreinterp       1
    238         cutplaneOpacity         100
    239         cutplaneVisible         0
    240         cutplaneWireframe       0
    241         cutplaneXPosition       50
    242         cutplaneXVisible        1
    243         cutplaneYPosition       50
    244         cutplaneYVisible        1
    245         cutplaneZPosition       50
    246         cutplaneZVisible        1
    247         isosurfaceEdges         0
    248         isosurfaceLighting      1
    249         isosurfaceOpacity       60
    250         saveIsosurfaceOpacity   60
    251         isosurfaceOutline       0
    252         isosurfaceVisible       1
    253         isosurfaceWireframe     0
    254         legendVisible           1
    255         numContours             10
    256     }]
     224    array set _settings {
     225        -background                     black
     226        -colormap                       BCGYR
     227        -colormapvisible                1
     228        -field                          "Default"
     229        -isolinecolor                   white
     230        -axesvisible                    1
     231        -axislabelsvisible              1
     232        -cutplaneedges                  0
     233        -cutplanelighting               1
     234        -cutplaneopacity                100
     235        -cutplanepreinterp              1
     236        -cutplanesvisible               0
     237        -cutplanewireframe              0
     238        -isosurfaceedges                0
     239        -isosurfacelighting             1
     240        -isosurfaceopacity              60
     241        -isosurfaceoutline              0
     242        -isosurfacevisible              1
     243        -isosurfacewireframe            0
     244        -legendvisible                  1
     245        -numcontours                    10
     246        -xaxisgrid                      0
     247        -xcutplaneposition              50
     248        -xcutplanevisible               1
     249        -yaxisgrid                      0
     250        -ycutplaneposition              50
     251        -ycutplanevisible               1
     252        -zaxisgrid                      0
     253        -zcutplaneposition              50
     254        -zcutplanevisible               1
     255    }
    257256    array set _changed {
    258         isosurfaceOpacity       0
    259         colormap                0
    260         numContours             0
     257        -isosurfaceopacity       0
     258        -colormap                0
     259        -numcontours             0
    261260    }
    262261
     
    271270    itk_component add fieldmenu {
    272271        menu $itk_component(plotarea).menu -bg black -fg white -relief flat \
    273             -tearoff no
     272            -tearoff 0
    274273    } {
    275274        usual
     
    338337            -onimage [Rappture::icon volume-on] \
    339338            -offimage [Rappture::icon volume-off] \
    340             -variable [itcl::scope _settings(isosurfaceVisible)] \
    341             -command [itcl::code $this AdjustSetting isosurfaceVisible]
     339            -variable [itcl::scope _settings(-isosurfacevisible)] \
     340            -command [itcl::code $this AdjustSetting -isosurfacevisible]
    342341    }
    343342    $itk_component(contour) select
     
    350349            -onimage [Rappture::icon cutbutton] \
    351350            -offimage [Rappture::icon cutbutton] \
    352             -variable [itcl::scope _settings(cutplaneVisible)] \
    353             -command [itcl::code $this AdjustSetting cutplaneVisible]
     351            -variable [itcl::scope _settings(-cutplanesvisible)] \
     352            -command [itcl::code $this AdjustSetting -cutplanesvisible]
    354353    }
    355354    Rappture::Tooltip::for $itk_component(cutplane) \
     
    865864        }
    866865        $_image(plot) configure -data $bytes
    867         set time [clock seconds]
    868         set date [clock format $time]
    869         #puts stderr "$date: received image [image width $_image(plot)]x[image height $_image(plot)] image>"       
     866        #set time [clock seconds]
     867        #set date [clock format $time]
     868        #set w [image width $_image(plot)]
     869        #set h [image height $_image(plot)]
     870        #puts stderr "$date: received image ${w}x${h} image"       
    870871        if { $_start > 0 } {
    871872            set finish [clock clicks -milliseconds]
     
    959960        PanCamera
    960961        set _first ""
    961         InitSettings axisXGrid axisYGrid axisZGrid axisMode \
    962             axesVisible axisLabelsVisible
     962        InitSettings -xaxisgrid -yaxisgrid -zaxisgrid -axismode \
     963            -axesvisible -axislabelsvisible
    963964        foreach axis { x y z } {
    964965            SendCmd "axis lformat $axis %g"
     
    10391040        $itk_component(field) value $_curFldLabel
    10401041    }
    1041     InitSettings cutplaneVisible isosurfaceOutline
     1042    InitSettings -cutplanesvisible -isosurfacevisible -isosurfaceoutline
    10421043    if { $_reset } {
    10431044        # These are settings that rely on a dataset being loaded.
    10441045        InitSettings \
    1045             isosurfaceLighting \
    1046             field \
    1047             isosurfaceEdges isosurfaceLighting isosurfaceOpacity \
    1048             isosurfaceWireframe \
    1049             cutplaneXPosition cutplaneYPosition cutplaneZPosition \
    1050             cutplaneXVisible cutplaneYVisible cutplaneZVisible \
    1051             cutplanePreinterp numContours
     1046            -isosurfacelighting \
     1047            -field \
     1048            -isosurfacevisible \
     1049            -isosurfaceedges -isosurfacelighting -isosurfaceopacity \
     1050            -isosurfacewireframe \
     1051            -cutplanesvisible \
     1052            -xcutplaneposition -ycutplaneposition -zcutplaneposition \
     1053            -xcutplanevisible -ycutplanevisible -zcutplanevisible \
     1054            -cutplanepreinterp -numcontours
    10521055
    10531056        Zoom reset
     
    13211324            DrawLegend
    13221325        }
    1323         "axesVisible" {
    1324             set bool $_settings(axesVisible)
     1326        "-axesvisible" {
     1327            set bool $_settings(-axesvisible)
    13251328            SendCmd "axis visible all $bool"
    13261329        }
    1327         "axisLabelsVisible" {
    1328             set bool $_settings(axisLabelsVisible)
     1330        "-axislabelsvisible" {
     1331            set bool $_settings(-axislabelsvisible)
    13291332            SendCmd "axis labels all $bool"
    13301333        }
    1331         "axisXGrid" - "axisYGrid" - "axisZGrid" {
    1332             set axis [string tolower [string range $what 4 4]]
     1334        "-xaxisgrid" - "-yaxisgrid" - "-zaxisgrid" {
     1335            set axis [string tolower [string range $what 1 1]]
    13331336            set bool $_settings($what)
    13341337            SendCmd "axis grid $axis $bool"
    13351338        }
    1336         "axisMode" {
     1339        "-axismode" {
    13371340            set mode [$itk_component(axisMode) value]
    13381341            set mode [$itk_component(axisMode) translate $mode]
     
    13401343            SendCmd "axis flymode $mode"
    13411344        }
    1342         "cutplaneEdges" {
     1345        "-cutplaneedges" {
    13431346            set bool $_settings($what)
    13441347            SendCmd "cutplane edges $bool"
    13451348        }
    1346         "cutplaneVisible" {
     1349        "-cutplanesvisible" {
    13471350            set bool $_settings($what)
    13481351            SendCmd "cutplane visible $bool"
    13491352        }
    1350         "cutplaneWireframe" {
     1353        "-cutplanewireframe" {
    13511354            set bool $_settings($what)
    13521355            SendCmd "cutplane wireframe $bool"
    13531356        }
    1354         "cutplaneLighting" {
     1357        "-cutplanelighting" {
    13551358            set bool $_settings($what)
    13561359            SendCmd "cutplane lighting $bool"
    13571360        }
    1358         "cutplaneOpacity" {
     1361        "-cutplaneopacity" {
    13591362            set val $_settings($what)
    13601363            set sval [expr { 0.01 * double($val) }]
    13611364            SendCmd "cutplane opacity $sval"
    13621365        }
    1363         "cutplanePreinterp" {
     1366        "-cutplanepreinterp" {
    13641367            set bool $_settings($what)
    13651368            SendCmd "cutplane preinterp $bool"
    13661369        }
    1367         "cutplaneXVisible" - "cutplaneYVisible" - "cutplaneZVisible" {
    1368             set axis [string tolower [string range $what 8 8]]
     1370        "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" {
     1371            set axis [string tolower [string range $what 1 1]]
    13691372            set bool $_settings($what)
    13701373            if { $bool } {
     
    13771380            SendCmd "cutplane axis $axis $bool"
    13781381        }
    1379         "cutplaneXPosition" - "cutplaneYPosition" - "cutplaneZPosition" {
    1380             set axis [string tolower [string range $what 8 8]]
     1382        "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" {
     1383            set axis [string tolower [string range $what 1 1]]
    13811384            set pos [expr $_settings($what) * 0.01]
    13821385            SendCmd "cutplane slice ${axis} ${pos}"
    13831386            set _cutplanePending 0
    13841387        }
    1385         "colormap" {
    1386             set _changed(colormap) 1
     1388        "-colormap" {
     1389            set _changed(-colormap) 1
    13871390            StartBufferingCommands
    13881391            set color [$itk_component(colormap) value]
    1389             set _settings(colormap) $color
     1392            set _settings(-colormap) $color
    13901393            if { $color == "none" } {
    1391                 if { $_settings(colormapVisible) } {
     1394                if { $_settings(-colormapvisible) } {
    13921395                    SendCmd "contour3d colormode constant {}"
    1393                     set _settings(colormapVisible) 0
     1396                    set _settings(-colormapvisible) 0
    13941397                }
    13951398            } else {
    1396                 if { !$_settings(colormapVisible) } {
     1399                if { !$_settings(-colormapvisible) } {
    13971400                    SendCmd "contour3d colormode $_colorMode $_curFldName"
    1398                     set _settings(colormapVisible) 1
     1401                    set _settings(-colormapvisible) 1
    13991402                }
    14001403                SetCurrentColormap $color
     
    14031406            EventuallyRequestLegend
    14041407        }
    1405         "numContours" {
    1406             set _settings(numContours) [$itk_component(numcontours) value]
    1407             set _currentNumContours $_settings(numContours)
     1408        "-numcontours" {
     1409            set _settings($what) [$itk_component(numcontours) value]
     1410            set _currentNumContours $_settings($what)
    14081411            UpdateContourList
    1409             set _changed(numContours) 1
     1412            set _changed($what) 1
    14101413            SendCmd "contour3d contourlist [list $_contourList]"
    14111414            DrawLegend
    14121415        }
    1413         "isosurfaceWireframe" {
    1414             set bool $_settings(isosurfaceWireframe)
     1416        "-isosurfacewireframe" {
     1417            set bool $_settings($what)
    14151418            SendCmd "contour3d wireframe $bool"
    14161419        }
    1417         "isosurfaceVisible" {
    1418             set bool $_settings(isosurfaceVisible)
     1420        "-isosurfacevisible" {
     1421            set bool $_settings($what)
    14191422            SendCmd "contour3d visible $bool"
    14201423            if { $bool } {
     
    14271430            DrawLegend
    14281431        }
    1429         "isosurfaceLighting" {
    1430             set bool $_settings(isosurfaceLighting)
     1432        "-isosurfacelighting" {
     1433            set bool $_settings($what)
    14311434            SendCmd "contour3d lighting $bool"
    14321435        }
    1433         "isosurfaceEdges" {
    1434             set bool $_settings(isosurfaceEdges)
     1436        "-isosurfaceedges" {
     1437            set bool $_settings($what)
    14351438            SendCmd "contour3d edges $bool"
    14361439        }
    1437         "isosurfaceOutline" {
    1438             set bool $_settings(isosurfaceOutline)
     1440        "-isosurfaceoutline" {
     1441            set bool $_settings($what)
    14391442            SendCmd "outline visible $bool"
    14401443        }
    1441         "isolineColor" {
     1444        "-isolinecolor" {
    14421445            set color [$itk_component(isolineColor) value]
    1443             set _settings(isolineColor) $color
     1446            set _settings($what) $color
    14441447            DrawLegend
    14451448        }
    1446         "isosurfaceOpacity" {
    1447             set val $_settings(isosurfaceOpacity)
     1449        "-isosurfaceopacity" {
     1450            set val $_settings($what)
    14481451            set sval [expr { 0.01 * double($val) }]
    14491452            SendCmd "contour3d opacity $sval"
    14501453        }
    1451         "field" {
     1454        "-field" {
    14521455            set label [$itk_component(field) value]
    14531456            set fname [$itk_component(field) translate $label]
    1454             set _settings(field) $fname
     1457            set _settings($what) $fname
    14551458            if { [info exists _fields($fname)] } {
    14561459                foreach { label units components } $_fields($fname) break
     
    14741477            DrawLegend
    14751478        }
    1476         "legendVisible" {
    1477             if { !$_settings(legendVisible) } {
     1479        "-legendvisible" {
     1480            if { !$_settings($what) } {
    14781481                $itk_component(view) delete legend
    14791482            }
     
    15781581    checkbutton $inner.contour \
    15791582        -text "Isosurfaces" \
    1580         -variable [itcl::scope _settings(isosurfaceVisible)] \
    1581         -command [itcl::code $this AdjustSetting isosurfaceVisible] \
     1583        -variable [itcl::scope _settings(-isosurfacevisible)] \
     1584        -command [itcl::code $this AdjustSetting -isosurfacevisible] \
    15821585        -font "Arial 9"
    15831586
    15841587    checkbutton $inner.wireframe \
    15851588        -text "Wireframe" \
    1586         -variable [itcl::scope _settings(isosurfaceWireframe)] \
    1587         -command [itcl::code $this AdjustSetting isosurfaceWireframe] \
     1589        -variable [itcl::scope _settings(-isosurfacewireframe)] \
     1590        -command [itcl::code $this AdjustSetting -isosurfacewireframe] \
    15881591        -font "Arial 9"
    15891592
    15901593    checkbutton $inner.lighting \
    15911594        -text "Enable Lighting" \
    1592         -variable [itcl::scope _settings(isosurfaceLighting)] \
    1593         -command [itcl::code $this AdjustSetting isosurfaceLighting] \
     1595        -variable [itcl::scope _settings(-isosurfacelighting)] \
     1596        -command [itcl::code $this AdjustSetting -isosurfacelighting] \
    15941597        -font "Arial 9"
    15951598
    15961599    checkbutton $inner.edges \
    15971600        -text "Edges" \
    1598         -variable [itcl::scope _settings(isosurfaceEdges)] \
    1599         -command [itcl::code $this AdjustSetting isosurfaceEdges] \
     1601        -variable [itcl::scope _settings(-isosurfaceedges)] \
     1602        -command [itcl::code $this AdjustSetting -isosurfaceedges] \
    16001603        -font "Arial 9"
    16011604
    16021605    checkbutton $inner.outline \
    16031606        -text "Outline" \
    1604         -variable [itcl::scope _settings(isosurfaceOutline)] \
    1605         -command [itcl::code $this AdjustSetting isosurfaceOutline] \
     1607        -variable [itcl::scope _settings(-isosurfaceoutline)] \
     1608        -command [itcl::code $this AdjustSetting -isosurfaceoutline] \
    16061609        -font "Arial 9"
    16071610
    16081611    checkbutton $inner.legend \
    16091612        -text "Legend" \
    1610         -variable [itcl::scope _settings(legendVisible)] \
    1611         -command [itcl::code $this AdjustSetting legendVisible] \
     1613        -variable [itcl::scope _settings(-legendvisible)] \
     1614        -command [itcl::code $this AdjustSetting -legendvisible] \
    16121615        -font "Arial 9"
    16131616
    16141617    label $inner.linecolor_l -text "Isolines" -font "Arial 9"
    16151618    itk_component add isolineColor {
    1616         Rappture::Combobox $inner.linecolor -width 10 -editable no
     1619        Rappture::Combobox $inner.linecolor -width 10 -editable 0
    16171620    }
    16181621    $inner.linecolor choices insert end \
     
    16341637    label $inner.background_l -text "Background" -font "Arial 9"
    16351638    itk_component add background {
    1636         Rappture::Combobox $inner.background -width 10 -editable no
     1639        Rappture::Combobox $inner.background -width 10 -editable 0
    16371640    }
    16381641    $inner.background choices insert end \
     
    16411644        "grey"               "grey"             
    16421645
    1643     $itk_component(background) value $_settings(background)
    1644     bind $inner.background <<Value>> [itcl::code $this AdjustSetting background]
     1646    $itk_component(background) value $_settings(-background)
     1647    bind $inner.background <<Value>> \
     1648        [itcl::code $this AdjustSetting -background]
    16451649
    16461650    label $inner.opacity_l -text "Opacity" -font "Arial 9"
    16471651    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1648         -variable [itcl::scope _settings(isosurfaceOpacity)] \
     1652        -variable [itcl::scope _settings(-isosurfaceopacity)] \
    16491653        -width 10 \
    16501654        -showvalue off \
    1651         -command [itcl::code $this AdjustSetting isosurfaceOpacity]
     1655        -command [itcl::code $this AdjustSetting -isosurfaceopacity]
    16521656
    16531657    label $inner.scale_l -text "Scale" -font "Arial 9"
    16541658    ::scale $inner.scale -from 1 -to 100 -orient horizontal \
    1655         -variable [itcl::scope _settings(contour-scale)] \
     1659        -variable [itcl::scope _settings(-contourscale)] \
    16561660        -width 10 \
    16571661        -showvalue off \
    1658         -command [itcl::code $this AdjustSetting contour-scale]
     1662        -command [itcl::code $this AdjustSetting -contourscale]
    16591663
    16601664    itk_component add field_l {
     
    16641668    }
    16651669    itk_component add field {
    1666         Rappture::Combobox $inner.field -width 10 -editable no
     1670        Rappture::Combobox $inner.field -width 10 -editable 0
    16671671    }
    16681672    bind $inner.field <<Value>> \
    1669         [itcl::code $this AdjustSetting field]
     1673        [itcl::code $this AdjustSetting -field]
    16701674
    16711675    label $inner.colormap_l -text "Colormap" -font "Arial 9"
    16721676    itk_component add colormap {
    1673         Rappture::Combobox $inner.colormap -width 10 -editable no
     1677        Rappture::Combobox $inner.colormap -width 10 -editable 0
    16741678    }
    16751679    $inner.colormap choices insert end \
     
    16931697    $itk_component(colormap) value "BCGYR"
    16941698    bind $inner.colormap <<Value>> \
    1695         [itcl::code $this AdjustSetting colormap]
     1699        [itcl::code $this AdjustSetting -colormap]
    16961700
    16971701    label $inner.numcontours_l -text "Number of Isosurfaces" -font "Arial 9"
     
    17001704            -min 0 -max 50 -font "arial 9"
    17011705    }
    1702     $itk_component(numcontours) value $_settings(numContours)
     1706    $itk_component(numcontours) value $_settings(-numcontours)
    17031707    bind $itk_component(numcontours) <<Value>> \
    1704         [itcl::code $this AdjustSetting numContours]
     1708        [itcl::code $this AdjustSetting -numcontours]
    17051709
    17061710    blt::table $inner \
     
    17391743    checkbutton $inner.visible \
    17401744        -text "Show Axes" \
    1741         -variable [itcl::scope _settings(axesVisible)] \
    1742         -command [itcl::code $this AdjustSetting axesVisible] \
     1745        -variable [itcl::scope _settings(-axesvisible)] \
     1746        -command [itcl::code $this AdjustSetting -axesvisible] \
    17431747        -font "Arial 9"
    17441748
    17451749    checkbutton $inner.labels \
    17461750        -text "Show Axis Labels" \
    1747         -variable [itcl::scope _settings(axisLabelsVisible)] \
    1748         -command [itcl::code $this AdjustSetting axisLabelsVisible] \
     1751        -variable [itcl::scope _settings(-axislabelsvisible)] \
     1752        -command [itcl::code $this AdjustSetting -axislabelsvisible] \
    17491753        -font "Arial 9"
    17501754
    17511755    checkbutton $inner.gridx \
    17521756        -text "Show X Grid" \
    1753         -variable [itcl::scope _settings(axisXGrid)] \
    1754         -command [itcl::code $this AdjustSetting axisXGrid] \
     1757        -variable [itcl::scope _settings(-xaxisgrid)] \
     1758        -command [itcl::code $this AdjustSetting -xaxisgrid] \
    17551759        -font "Arial 9"
    17561760    checkbutton $inner.gridy \
    17571761        -text "Show Y Grid" \
    1758         -variable [itcl::scope _settings(axisYGrid)] \
    1759         -command [itcl::code $this AdjustSetting axisYGrid] \
     1762        -variable [itcl::scope _settings(-yaxisgrid)] \
     1763        -command [itcl::code $this AdjustSetting -yaxisgrid] \
    17601764        -font "Arial 9"
    17611765    checkbutton $inner.gridz \
    17621766        -text "Show Z Grid" \
    1763         -variable [itcl::scope _settings(axisZGrid)] \
    1764         -command [itcl::code $this AdjustSetting axisZGrid] \
     1767        -variable [itcl::scope _settings(-zaxisgrid)] \
     1768        -command [itcl::code $this AdjustSetting -zaxisgrid] \
    17651769        -font "Arial 9"
    17661770
     
    17681772
    17691773    itk_component add axisMode {
    1770         Rappture::Combobox $inner.mode -width 10 -editable no
     1774        Rappture::Combobox $inner.mode -width 10 -editable 0
    17711775    }
    17721776    $inner.mode choices insert end \
     
    17761780        "outer_edges"     "outer"         
    17771781    $itk_component(axisMode) value "static"
    1778     bind $inner.mode <<Value>> [itcl::code $this AdjustSetting axisMode]
     1782    bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axismode]
    17791783
    17801784    blt::table $inner \
     
    18521856    checkbutton $inner.visible \
    18531857        -text "Cutplanes" \
    1854         -variable [itcl::scope _settings(cutplaneVisible)] \
    1855         -command [itcl::code $this AdjustSetting cutplaneVisible] \
     1858        -variable [itcl::scope _settings(-cutplanesvisible)] \
     1859        -command [itcl::code $this AdjustSetting -cutplanesvisible] \
    18561860        -font "Arial 9"
    18571861
    18581862    checkbutton $inner.wireframe \
    18591863        -text "Wireframe" \
    1860         -variable [itcl::scope _settings(cutplaneWireframe)] \
    1861         -command [itcl::code $this AdjustSetting cutplaneWireframe] \
     1864        -variable [itcl::scope _settings(-cutplanewireframe)] \
     1865        -command [itcl::code $this AdjustSetting -cutplanewireframe] \
    18621866        -font "Arial 9"
    18631867
    18641868    checkbutton $inner.lighting \
    18651869        -text "Enable Lighting" \
    1866         -variable [itcl::scope _settings(cutplaneLighting)] \
    1867         -command [itcl::code $this AdjustSetting cutplaneLighting] \
     1870        -variable [itcl::scope _settings(-cutplanelighting)] \
     1871        -command [itcl::code $this AdjustSetting -cutplanelighting] \
    18681872        -font "Arial 9"
    18691873
    18701874    checkbutton $inner.edges \
    18711875        -text "Edges" \
    1872         -variable [itcl::scope _settings(cutplaneEdges)] \
    1873         -command [itcl::code $this AdjustSetting cutplaneEdges] \
     1876        -variable [itcl::scope _settings(-cutplaneedges)] \
     1877        -command [itcl::code $this AdjustSetting -cutplaneedges] \
    18741878        -font "Arial 9"
    18751879
    18761880    checkbutton $inner.preinterp \
    18771881        -text "Interpolate Scalars" \
    1878         -variable [itcl::scope _settings(cutplanePreinterp)] \
    1879         -command [itcl::code $this AdjustSetting cutplanePreinterp] \
     1882        -variable [itcl::scope _settings(-cutplanepreinterp)] \
     1883        -command [itcl::code $this AdjustSetting -cutplanepreinterp] \
    18801884        -font "Arial 9"
    18811885
    18821886    label $inner.opacity_l -text "Opacity" -font "Arial 9"
    18831887    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1884         -variable [itcl::scope _settings(cutplaneOpacity)] \
     1888        -variable [itcl::scope _settings(-cutplaneopacity)] \
    18851889        -width 10 \
    18861890        -showvalue off \
    1887         -command [itcl::code $this AdjustSetting cutplaneOpacity]
    1888     $inner.opacity set $_settings(cutplaneOpacity)
     1891        -command [itcl::code $this AdjustSetting -cutplaneopacity]
     1892    $inner.opacity set $_settings(-cutplaneopacity)
    18891893
    18901894    # X-value slicer...
     
    18931897            -onimage [Rappture::icon x-cutplane-red] \
    18941898            -offimage [Rappture::icon x-cutplane-red] \
    1895             -command [itcl::code $this AdjustSetting cutplaneXVisible] \
    1896             -variable [itcl::scope _settings(cutplaneXVisible)] \
     1899            -command [itcl::code $this AdjustSetting -xcutplanevisible] \
     1900            -variable [itcl::scope _settings(-xcutplanevisible)] \
    18971901    }
    18981902    Rappture::Tooltip::for $itk_component(xbutton) \
     
    19011905    itk_component add xposition {
    19021906        ::scale $inner.xval -from 100 -to 0 \
    1903             -width 10 -orient vertical -showvalue yes \
     1907            -width 10 -orient vertical -showvalue 1 \
    19041908            -borderwidth 1 -highlightthickness 0 \
    19051909            -command [itcl::code $this EventuallySetCutplane x] \
    1906             -variable [itcl::scope _settings(cutplaneXPosition)] \
     1910            -variable [itcl::scope _settings(-xcutplaneposition)] \
    19071911            -foreground red2 -font "Arial 9 bold"
    19081912    } {
     
    19211925            -onimage [Rappture::icon y-cutplane-green] \
    19221926            -offimage [Rappture::icon y-cutplane-green] \
    1923             -command [itcl::code $this AdjustSetting cutplaneYVisible] \
    1924             -variable [itcl::scope _settings(cutplaneYVisible)] \
     1927            -command [itcl::code $this AdjustSetting -ycutplanevisible] \
     1928            -variable [itcl::scope _settings(-ycutplanevisible)] \
    19251929    }
    19261930    Rappture::Tooltip::for $itk_component(ybutton) \
     
    19301934    itk_component add yposition {
    19311935        ::scale $inner.yval -from 100 -to 0 \
    1932             -width 10 -orient vertical -showvalue yes \
     1936            -width 10 -orient vertical -showvalue 1 \
    19331937            -borderwidth 1 -highlightthickness 0 \
    19341938            -command [itcl::code $this EventuallySetCutplane y] \
    1935             -variable [itcl::scope _settings(cutplaneYPosition)] \
     1939            -variable [itcl::scope _settings(-ycutplaneposition)] \
    19361940            -foreground green3 -font "Arial 9 bold"
    19371941    } {
     
    19501954            -onimage [Rappture::icon z-cutplane-blue] \
    19511955            -offimage [Rappture::icon z-cutplane-blue] \
    1952             -command [itcl::code $this AdjustSetting cutplaneZVisible] \
    1953             -variable [itcl::scope _settings(cutplaneZVisible)] \
     1956            -command [itcl::code $this AdjustSetting -zcutplanevisible] \
     1957            -variable [itcl::scope _settings(-zcutplanevisible)] \
    19541958    } {
    19551959        usual
     
    19621966    itk_component add zposition {
    19631967        ::scale $inner.zval -from 100 -to 0 \
    1964             -width 10 -orient vertical -showvalue yes \
     1968            -width 10 -orient vertical -showvalue 1 \
    19651969            -borderwidth 1 -highlightthickness 0 \
    19661970            -command [itcl::code $this EventuallySetCutplane z] \
    1967             -variable [itcl::scope _settings(cutplaneZPosition)] \
     1971            -variable [itcl::scope _settings(-zcutplaneposition)] \
    19681972            -foreground blue3 -font "Arial 9 bold"
    19691973    } {
     
    21142118        -outline 0
    21152119        -levels 10
     2120        -cutplanesvisible 0
     2121        -xcutplanevisible 1
     2122        -ycutplanevisible 1
     2123        -zcutplanevisible 1
     2124        -xcutplaneposition 50
     2125        -ycutplaneposition 50
     2126        -zcutplaneposition 50
     2127        -isosurfacevisible 1
    21162128    }
    21172129    array set style [$dataobj style $comp]
     
    21312143    # the code to handle aberrant cases.
    21322144
    2133     if { $_changed(isosurfaceOpacity) } {
    2134         set style(-opacity) $_settings(isosurfaceOpacity)
    2135     }
    2136     if { $_changed(numContours) } {
    2137         set style(-levels) $_settings(numContours)
    2138     }
    2139     if { $_changed(colormap) } {
    2140         set style(-color) $_settings(colormap)
     2145    if { $_changed(-isosurfaceopacity) } {
     2146        set style(-opacity) $_settings(-isosurfaceopacity)
     2147    }
     2148    if { $_changed(-numcontours) } {
     2149        set style(-levels) $_settings(-numcontours)
     2150    }
     2151    if { $_changed(-colormap) } {
     2152        set style(-color) $_settings(-colormap)
    21412153    }
    21422154    if { $_currentColormap == "" } {
     
    21472159    if { $_currentNumContours != $style(-levels) } {
    21482160        set _currentNumContours $style(-levels)
    2149         set _settings(numContours) $_currentNumContours
     2161        set _settings(-numcontours) $_currentNumContours
    21502162        $itk_component(numcontours) value $_currentNumContours
    21512163        UpdateContourList
    21522164        DrawLegend
    21532165    }
     2166    set _settings(-isosurfacevisible) $style(-isosurfacevisible)
     2167    set _settings(-cutplanesvisible)  $style(-cutplanesvisible)
     2168    set _settings(-xcutplanevisible)  $style(-xcutplanevisible)
     2169    set _settings(-ycutplanevisible)  $style(-ycutplanevisible)
     2170    set _settings(-zcutplanevisible)  $style(-zcutplanevisible)
     2171    set _settings(-xcutplaneposition) $style(-xcutplaneposition)
     2172    set _settings(-ycutplaneposition) $style(-ycutplaneposition)
     2173    set _settings(-zcutplaneposition) $style(-zcutplaneposition)
     2174 
    21542175    SendCmd [list contour3d add contourlist $_contourList $tag]
    21552176    SendCmd "contour3d edges $style(-edges) $tag"
     
    21572178    SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag"
    21582179    SendCmd "outline visible $style(-outline) $tag"
    2159     set _settings(isosurfaceOutline) $style(-outline)
    2160     set _settings(isosurfaceEdges) $style(-edges)
     2180    set _settings(-isosurfaceoutline) $style(-outline)
     2181    set _settings(-isosurfaceedges) $style(-edges)
    21612182    #SendCmd "contour3d color [Color2RGB $settings(-color)] $tag"
    21622183    SendCmd "contour3d lighting $style(-lighting) $tag"
    2163     set _settings(isosurfaceLighting) $style(-lighting)
     2184    set _settings(-isosurfacelighting) $style(-lighting)
    21642185    SendCmd "contour3d linecolor [Color2RGB $style(-edgecolor)] $tag"
    21652186    SendCmd "contour3d linewidth $style(-linewidth) $tag"
    21662187    SendCmd "contour3d opacity $_currentOpacity $tag"
    2167     set _settings(isosurfaceOpacity) $style(-opacity)
     2188    set _settings(-isosurfaceopacity) $style(-opacity)
    21682189    SetCurrentColormap $style(-color)
    21692190    SendCmd "contour3d wireframe $style(-wireframe) $tag"
    2170     set _settings(isosurfaceWireframe) $style(-wireframe)
    2171     set _settings(isosurfaceOpacity) [expr $style(-opacity) * 100.0]
     2191    set _settings(-isosurfacewireframe) $style(-wireframe)
     2192    set _settings(-isosurfaceopacity) [expr $style(-opacity) * 100.0]
    21722193}
    21732194
     
    23502371    }
    23512372    set x [expr $w - 2]
    2352     if { !$_settings(legendVisible) } {
     2373    if { !$_settings(-legendvisible) } {
    23532374        $c delete legend
    23542375        return
     
    23852406    set ih [image height $_image(legend)]
    23862407    set x1 [expr $x2 - ($iw*12)/10]
    2387     set color $_settings(isolineColor)
     2408    set color $_settings(-isolinecolor)
    23882409    # Draw the isolines on the legend.
    23892410    array unset _isolines
    23902411    if { $color != "none"  && [info exists _limits($_curFldName)] &&
    2391          $_settings(numContours) > 0 } {
     2412         $_settings(-numcontours) > 0 } {
    23922413
    23932414        foreach { vmin vmax } $_limits($_curFldName) break
     
    24692490        invoke {
    24702491            $itk_component(field) value $_curFldLabel
    2471             AdjustSetting field
     2492            AdjustSetting -field
    24722493        }
    24732494        default {
     
    25412562    blt::vector destroy $v
    25422563}
     2564
Note: See TracChangeset for help on using the changeset viewer.