Changeset 4399


Ignore:
Timestamp:
Jun 19, 2014 10:16:58 AM (10 years ago)
Author:
gah
Message:

fix builder path, update isosurfaceviewer

Location:
branches/1.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3/builder/scripts/main.tcl

    r3177 r4399  
    868868
    869869                # /apps/rappture/current for 32-bit systems
    870                 # /apps/share64/rappture/current for 64-bit systems
    871                 if {$tcl_platform(wordSize) == 8
    872                       && [file isdirectory /apps/share64/rappture/current]} {
    873                     set dir /apps/share64/rappture/current
     870                if {$tcl_platform(wordSize) == 8 } {
     871                     if { [file isdirectory /apps/share64/debian7/rappture/current]} {
     872                        set dir /apps/share64/debian7/rappture/current
     873                     } elseif { [file isdirectory /apps/share64/debian6/rappture/current]} {
     874                        set dir /apps/share64/debian6/rappture/current
     875                     } else {
     876                        set dir /apps/rappture/current
     877                     }
    874878                } else {
    875879                    set dir /apps/rappture/current
  • branches/1.3/gui/scripts/nanovisviewer.tcl

    r4218 r4399  
    145145    private variable _activeTfs
    146146    private variable _first ""     ;# This is the topmost volume.
     147    private variable _alphamap
    147148
    148149    # This
     
    745746    $_image(legend) configure -data $bytes
    746747    ReceiveEcho <<line "<read $size bytes for [image width $_image(legend)]x[image height $_image(legend)] legend>"
    747 
     748puts stderr "vmin=$vmin vmax=$vmax"
    748749    set c $itk_component(legend)
    749750    set w [winfo width $c]
     
    765766
    766767    array set limits [limits $tf]
    767     $c itemconfigure vmin -text [format %.2g $limits(min)]
     768    $c itemconfigure vmin -text [format %g $limits(min)]
    768769    $c coords vmin $lx $ly
    769770
    770     $c itemconfigure vmax -text [format %.2g $limits(max)]
     771    $c itemconfigure vmax -text [format %g $limits(max)]
    771772    $c coords vmax [expr {$w-$lx}] $ly
    772773
     
    998999        set tag $_first-$cname
    9991000        if { [info exists _serverDatasets($tag)] && $_serverDatasets($tag) } {
    1000             array set style {
     1001            array set styles {
    10011002                -cutplanes 1
    10021003            }
    1003             array set style [lindex [$_first components -style $cname] 0]
    1004             if { $what != "-cutplanes" || $style(-cutplanes) } {
     1004            array set styles [lindex [$_first components -style $cname] 0]
     1005            if { $what != "-cutplanes" || $styles(-cutplanes) } {
    10051006                lappend rlist $tag
    10061007            }
     
    13281329#
    13291330itcl::body Rappture::NanovisViewer::NameTransferFunc { dataobj cname } {
    1330     array set style {
     1331    array set styles {
    13311332        -color BCGYR
    13321333        -levels 6
     
    13351336    }
    13361337    set tag $dataobj-$cname
    1337     array set style [lindex [$dataobj components -style $cname] 0]
    1338     set tf "$style(-color):$style(-levels):$style(-opacity)"
     1338    array set styles [lindex [$dataobj components -style $cname] 0]
     1339    set tf "$styles(-color):$styles(-levels):$styles(-opacity)"
    13391340    set _dataset2style($tag) $tf
    13401341    lappend _style2datasets($tf) $tag
     
    13521353#
    13531354itcl::body Rappture::NanovisViewer::ComputeTransferFunc { tf } {
    1354     array set style {
     1355    array set styles {
    13551356        -color BCGYR
    13561357        -levels 6
    13571358        -opacity 1.0
    13581359        -markers ""
     1360        -alphamap ""
    13591361    }
    13601362
    13611363    foreach {dataobj cname} [split [lindex $_style2datasets($tf) 0] -] break
    1362     array set style [lindex [$dataobj components -style $cname] 0]
     1364    array set styles [lindex [$dataobj components -style $cname] 0]
    13631365
    13641366    # We have to parse the style attributes for a volume using this
     
    13771379    if { ![info exists _isomarkers($tf)] } {
    13781380        # Have to defer creation of isomarkers until we have data limits
    1379         if { [info exists style(-markers)] &&
    1380              [llength $style(-markers)] > 0 } {
    1381             ParseMarkersOption $tf $style(-markers)
     1381        if { [info exists styles(-markers)] &&
     1382             [llength $styles(-markers)] > 0 } {
     1383            ParseMarkersOption $tf $styles(-markers)
    13821384        } else {
    1383             ParseLevelsOption $tf $style(-levels)
    1384         }
    1385     }
    1386     set cmap [ColorsToColormap $style(-color)]
     1385            ParseLevelsOption $tf $styles(-levels)
     1386        }
     1387        if { $styles(-alphamap) != "" } {
     1388            set _alphamap($cname) $styles(-alphamap)
     1389        }
     1390    }
     1391    set cmap [ColorsToColormap $styles(-color)]
    13871392    set tag $this-$tf
    13881393    if { ![info exists _settings($tag-opacity)] } {
    1389         set _settings($tag-opacity) $style(-opacity)
     1394        set _settings($tag-opacity) $styles(-opacity)
    13901395    }
    13911396    set max 1.0 ;#$_settings($tag-opacity)
     
    14431448        lappend wmap 1.0 0.0
    14441449    }
    1445     SendCmd "transfunc define $tf { $cmap } { $wmap }"
     1450    if { [info exists _alphamap($cname)] } {
     1451        set wmap $_alphamap($cname)
     1452    }
     1453    puts stderr wmap=$wmap
     1454    SendCmd [list transfunc define $tf $cmap $wmap]
    14461455}
    14471456
  • branches/1.3/gui/scripts/vtkheightmapviewer.tcl

    r4208 r4399  
    123123    private variable _currentColormap ""
    124124    private variable _currentNumIsolines -1
    125     private variable _currentOpacity ""
     125    private variable _currentOpacity 100.0; # Widget opacity setting
     126                                        #   between 0 and 100
     127   
    126128
    127129    private variable _maxScale 100;     # This is the # of times the x-axis
     
    217219
    218220    array set _settings {
    219         axisFlymode             "static"
    220         axisMinorTicks          1
    221         stretchToFit            0
    222         axisLabels              1
    223         axisVisible             1
    224         axisXGrid               0
    225         axisYGrid               0
    226         axisZGrid               0
    227         colormapVisible         1
    228         colormapDiscrete        0
    229         edges                   0
    230         field                   "Default"
    231         heightmapScale          50
    232         isHeightmap             0
    233         isolineColor            black
    234         isolinesVisible         1
    235         legendVisible           1
    236         lighting                1
    237         saveLighting            1
    238         numIsolines             10
    239         opacity                 100
    240         outline                 0
    241         wireframe               0
    242         saveOpacity             100
    243         saveOutline             0
     221        -axisflymode            "static"
     222        -axisminorticks         1
     223        -stretchtofit           0
     224        -axislabels             1
     225        -axisvisible            1
     226        -xaxisgrid              0
     227        -yaxisgrid              0
     228        -zaxisgrid              0
     229        -colormapvisible        1
     230        -colormapdiscrete       0
     231        -edges                  0
     232        -field                  "Default"
     233        -heightmapscale         50
     234        -isheightmap            0
     235        -isolinecolor           black
     236        -isolinesVisible        1
     237        -legendvisible          1
     238        -lighting               1
     239        -savelighting           1
     240        -numisolines            10
     241        -opacity                1.0
     242        -outline                0
     243        -wireframe              0
     244        -saveopacity            1.0
     245        -saveoutline            0
    244246    }
    245247    array set _changed {
    246         opacity                 0
    247         colormap                0
    248         numIsolines             0
     248        -opacity                 0.0
     249        -colormap                0
     250        -numisolines             0
    249251    }
    250252    itk_component add view {
     
    325327            -onimage [Rappture::icon surface] \
    326328            -offimage [Rappture::icon surface] \
    327             -variable [itcl::scope _settings(isHeightmap)] \
    328             -command [itcl::code $this AdjustSetting isHeightmap] \
     329            -variable [itcl::scope _settings(-isheightmap)] \
     330            -command [itcl::code $this AdjustSetting -isheightmap] \
    329331    }
    330332    Rappture::Tooltip::for $itk_component(mode) \
     
    336338            -onimage [Rappture::icon stretchtofit] \
    337339            -offimage [Rappture::icon stretchtofit] \
    338             -variable [itcl::scope _settings(stretchToFit)] \
    339             -command [itcl::code $this AdjustSetting stretchToFit] \
     340            -variable [itcl::scope _settings(-stretchtofit)] \
     341            -command [itcl::code $this AdjustSetting -stretchtofit] \
    340342    }
    341343    Rappture::Tooltip::for $itk_component(stretchtofit) \
     
    666668    }
    667669    if { [array size found] > 1 } {
    668         set _settings(stretchToFit) 1
     670        set _settings(-stretchtofit) 1
    669671    } else {
    670672        # Check if the range of the x and y axes requires that we stretch
     
    675677        if { (($xmax - $xmin) > (($ymax -$ymin) * $_maxScale)) ||
    676678             ((($xmax - $xmin) * $_maxScale) < ($ymax -$ymin)) } {
    677             set _settings(stretchToFit) 1
     679            set _settings(-stretchtofit) 1
    678680        }
    679681    }
     
    924926        $_arcball resize $w $h
    925927        DoResize
    926         if { $_settings(stretchToFit) } {
    927             AdjustSetting stretchToFit
     928        if { $_settings(-stretchtofit) } {
     929            AdjustSetting -stretchtofit
    928930        }
    929931    }
     
    932934        # Reset the camera and other view parameters
    933935        #
    934         InitSettings isHeightmap background
     936        InitSettings -isheightmap -background
    935937
    936938        # Let's see how this goes.  I think it's preferable to overloading the
     
    941943        set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
    942944        $_arcball quaternion $q
    943         if {$_settings(isHeightmap) } {
     945        if {$_settings(-isheightmap) } {
    944946            if { $_view(ortho)} {
    945947                SendCmd "camera mode ortho"
     
    10331035        $itk_component(field) value $_curFldLabel
    10341036    }
    1035     InitSettings stretchToFit outline
     1037    InitSettings -stretchtofit -outline
    10361038
    10371039    if { $_reset } {
     
    10771079        set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
    10781080        $_arcball quaternion $q
    1079         if {$_settings(isHeightmap) } {
     1081        if {$_settings(-isheightmap) } {
    10801082            if { $_view(ortho)} {
    10811083                SendCmd "camera mode ortho"
     
    10871089        }
    10881090        PanCamera
    1089         InitSettings axisXGrid axisYGrid axisZGrid \
    1090             axisVisible axisLabels heightmapScale field isHeightmap \
    1091             numIsolines
     1091        InitSettings -xgrid -ygrid -zgrid \
     1092            -axisvisible -axislabels -heightmapscale -field -isheightmap \
     1093            -numisolines
    10921094        if { [array size _fields] < 2 } {
    10931095            blt::table forget $itk_component(field) $itk_component(field_l)
     
    11691171    set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
    11701172    $_arcball quaternion $q
    1171     if {$_settings(isHeightmap) } {
     1173    if {$_settings(-isheightmap) } {
    11721174        DoRotate
    11731175    }
     
    13301332itcl::body Rappture::VtkHeightmapViewer::InitSettings { args } {
    13311333    foreach spec $args {
    1332         if { [info exists _settings($_first-$spec)] } {
     1334        if { [info exists _settings($_first${spec})] } {
    13331335            # Reset global setting with dataobj specific setting
    1334             set _settings($spec) $_settings($_first-$spec)
     1336            set _settings($spec) $_settings($_first${spec})
    13351337        }
    13361338        AdjustSetting $spec
     
    13501352    }
    13511353    switch -- $what {
    1352         "axisFlymode" {
     1354        "-axisflymode" {
    13531355            set mode [$itk_component(axisflymode) value]
    13541356            set mode [$itk_component(axisflymode) translate $mode]
     
    13561358            SendCmd "axis flymode $mode"
    13571359        }
    1358         "axisLabels" {
    1359             set bool $_settings(axisLabels)
     1360        "-axislabels" {
     1361            set bool $_settings($what)
    13601362            SendCmd "axis labels all $bool"
    13611363        }
    1362         "axisMinorTicks" {
    1363             set bool $_settings(axisMinorTicks)
     1364        "-axisminorticks" {
     1365            set bool $_settings($what)
    13641366            foreach axis { x y z } {
    13651367                SendCmd "axis minticks ${axis} $bool"
    13661368            }
    13671369        }
    1368         "axisVisible" {
    1369             set bool $_settings(axisVisible)
     1370        "-axisvisible" {
     1371            set bool $_settings($what)
    13701372            SendCmd "axis visible all $bool"
    13711373        }
    1372         "axisXGrid" - "axisYGrid" - "axisZGrid" {
    1373             set axis [string tolower [string range $what 4 4]]
     1374        "-xgrid" - "-ygrid" - "-zgrid" {
     1375            set axis [string tolower [string range $what 1 1]]
    13741376            set bool $_settings($what)
    13751377            SendCmd "axis grid $axis $bool"
    13761378        }
    1377         "background" {
     1379        "-background" {
    13781380            set bg [$itk_component(background) value]
    13791381            array set fgcolors {
     
    13901392            DrawLegend
    13911393        }
    1392         "colormap" {
    1393             set _changed(colormap) 1
     1394        "-colormap" {
     1395            set _changed($what) 1
    13941396            StartBufferingCommands
    13951397            set color [$itk_component(colormap) value]
    1396             set _settings(colormap) $color
     1398            set _settings($what) $color
    13971399            if { $color == "none" } {
    1398                 if { $_settings(colormapVisible) } {
     1400                if { $_settings(-colormapvisible) } {
    13991401                    SendCmd "heightmap surface 0"
    1400                     set _settings(colormapVisible) 0
     1402                    set _settings(-colormapvisible) 0
    14011403                }
    14021404            } else {
    1403                 if { !$_settings(colormapVisible) } {
     1405                if { !$_settings(-colormapvisible) } {
    14041406                    SendCmd "heightmap surface 1"
    1405                     set _settings(colormapVisible) 1
     1407                    set _settings(-colormapvisible) 1
    14061408                }
    14071409                SetCurrentColormap $color
    1408                 if {$_settings(colormapDiscrete)} {
    1409                     set numColors [expr $_settings(numIsolines) + 1]
     1410                if {$_settings(-colormapdiscrete)} {
     1411                    set numColors [expr $_settings(-numisolines) + 1]
    14101412                    SendCmd "colormap res $numColors $color"
    14111413                }
     
    14141416            EventuallyRequestLegend
    14151417        }
    1416         "colormapVisible" {
     1418        "-colormapvisible" {
    14171419            set bool $_settings($what)
    14181420            SendCmd "heightmap surface $bool"
    14191421        }
    1420         "colormapDiscrete" {
     1422        "-colormapdiscrete" {
    14211423            set bool $_settings($what)
    1422             set numColors [expr $_settings(numIsolines) + 1]
     1424            set numColors [expr $_settings(-numisolines) + 1]
     1425            # FIXME: don't use StartBufferingCommands
    14231426            StartBufferingCommands
    14241427            if {$bool} {
     
    14341437            EventuallyRequestLegend
    14351438        }
    1436         "edges" {
    1437             set bool $_settings(edges)
     1439        "-edges" {
     1440            set bool $_settings($what)
    14381441            SendCmd "heightmap edges $bool"
    14391442        }
    1440         "field" {
     1443        "-field" {
    14411444            set label [$itk_component(field) value]
    14421445            set fname [$itk_component(field) translate $label]
    1443             set _settings(field) $fname
     1446            set _settings($what) $fname
    14441447            if { [info exists _fields($fname)] } {
    14451448                foreach { label units components } $_fields($fname) break
     
    14831486            DrawLegend
    14841487        }
    1485         "heightmapScale" {
    1486             if { $_settings(isHeightmap) } {
     1488        "-heightmapscale" {
     1489            if { $_settings(-isheightmap) } {
    14871490                set scale [GetHeightmapScale]
    14881491                # Have to set the datasets individually because we are
     
    14951498            }
    14961499        }
    1497         "isHeightmap" {
    1498             set bool $_settings(isHeightmap)
     1500        "-isheightmap" {
     1501            set bool $_settings($what)
    14991502            set c $itk_component(view)
    15001503            StartBufferingCommands
    15011504            # Fix heightmap scale: 0 for contours, 1 for heightmaps.
    15021505            if { $bool } {
    1503                 set _settings(heightmapScale) 50
    1504                 set _settings(opacity) $_settings(saveOpacity)
    1505                 set _settings(lighting) $_settings(saveLighting)
    1506                 set _settings(outline) 0
     1506                set _settings(-heightmapscale) 50
     1507                set _settings(-opacity) $_settings(-saveopacity)
     1508                set _settings(-lighting) $_settings(-savelighting)
     1509                set _settings(-outline) 0
    15071510            } else {
    1508                 set _settings(heightmapScale) 0
    1509                 set _settings(lighting) 0
    1510                 set _settings(opacity) 100
    1511                 set _settings(outline)  $_settings(saveOutline)
    1512             }
    1513             AdjustSetting lighting
    1514             AdjustSetting opacity
    1515             AdjustSetting outline
     1511                set _settings(-heightmapscale) 0
     1512                set _settings(-lighting) 0
     1513                set _settings(-opacity) 1.0
     1514                set _settings(-outline)  $_settings(-saveoutline)
     1515            }
     1516            InitSettings -lighting -opacity -outline
    15161517            set scale [GetHeightmapScale]
    15171518            # Have to set the datasets individually because we are
     
    15421543                SendCmd "camera mode image"
    15431544            }
    1544             if {$_settings(stretchToFit)} {
     1545            if {$_settings(-stretchtofit)} {
    15451546                if {$scale == 0} {
    15461547                    SendCmd "camera aspect window"
     
    15731574            StopBufferingCommands
    15741575        }
    1575         "isolineColor" {
     1576        "-isolinecolor" {
    15761577            set color [$itk_component(isolinecolor) value]
    15771578            if { $color == "none" } {
    1578                 if { $_settings(isolinesVisible) } {
     1579                if { $_settings(-isolinesvisible) } {
    15791580                    SendCmd "heightmap isolines 0"
    1580                     set _settings(isolinesVisible) 0
     1581                    set _settings(-isolinesvisible) 0
    15811582                }
    15821583            } else {
    1583                 if { !$_settings(isolinesVisible) } {
     1584                if { !$_settings(-isolinesvisible) } {
    15841585                    SendCmd "heightmap isolines 1"
    1585                     set _settings(isolinesVisible) 1
     1586                    set _settings(-isolinesvisible) 1
    15861587                }
    15871588                SendCmd "heightmap isolinecolor [Color2RGB $color]"
     
    15891590            DrawLegend
    15901591        }
    1591         "isolinesVisible" {
     1592        "-isolinesvisible" {
    15921593            set bool $_settings($what)
    15931594            SendCmd "heightmap isolines $bool"
    15941595            DrawLegend
    15951596        }
    1596         "legendVisible" {
     1597        "-legendvisible" {
    15971598            if { !$_settings($what) } {
    15981599                $itk_component(view) delete legend
     
    16001601            DrawLegend
    16011602        }
    1602         "lighting" {
    1603             if { $_settings(isHeightmap) } {
    1604                 set _settings(saveLighting) $_settings(lighting)
     1603        "-lighting" {
     1604            if { $_settings(-isheightmap) } {
     1605                set _settings(-savelighting) $_settings(-lighting)
    16051606                set bool $_settings($what)
    16061607                SendCmd "heightmap lighting $bool"
     
    16091610            }
    16101611        }
    1611         "numIsolines" {
    1612             set _settings(numIsolines) [$itk_component(numisolines) value]
    1613             set _currentNumIsolines $_settings(numIsolines)
     1612        "-numisolines" {
     1613            set _settings($what) [$itk_component(numisolines) value]
     1614            set _currentNumIsolines $_settings($what)
    16141615            UpdateContourList
    1615             set _changed(numIsolines) 1
     1616            set _changed($what) 1
    16161617            SendCmd "heightmap contourlist [list $_contourList]"
    1617             if {$_settings(colormapDiscrete)} {
    1618                 set numColors [expr $_settings(numIsolines) + 1]
     1618            if {$_settings(-colormapdiscrete)} {
     1619                set numColors [expr $_settings($what) + 1]
    16191620                SendCmd "colormap res $numColors"
    16201621                EventuallyRequestLegend
     
    16231624            }
    16241625        }
    1625         "opacity" {
    1626             set _changed(opacity) 1
    1627             if { $_settings(isHeightmap) } {
    1628                 set _settings(saveOpacity) $_settings(opacity)
    1629                 set val $_settings(opacity)
    1630                 set sval [expr { 0.01 * double($val) }]
    1631                 SendCmd "heightmap opacity $sval"
     1626        "-opacity" {
     1627            set _changed($what) 1
     1628            set _settings($what)  [expr double($_currentOpacity) * 0.01]
     1629            if { $_settings(-isheightmap) } {
     1630                set _settings(-saveopacity) $_settings($what)
     1631                SendCmd "heightmap opacity $_settings($what)"
    16321632            } else {
    1633                 SendCmd "heightmap opacity 1"
    1634             }
    1635         }
    1636         "outline" {
    1637             if { $_settings(isHeightmap) } {
     1633                SendCmd "heightmap opacity 1.0"
     1634            }
     1635        }
     1636        "-outline" {
     1637            if { $_settings(-isheightmap) } {
    16381638                SendCmd "outline visible 0"
    16391639            } else {
    1640                 set _settings(saveOutline) $_settings(outline)
    1641                 set bool $_settings(outline)
     1640                set _settings(-saveoutline) $_settings($what)
     1641                set bool $_settings($what)
    16421642                SendCmd "outline visible $bool"
    16431643            }
    16441644        }
    1645         "stretchToFit" {
     1645        "-stretchtofit" {
    16461646            set bool $_settings($what)
    16471647            if { $bool } {
     
    16571657            Zoom reset
    16581658        }
    1659         "wireframe" {
     1659        "-wireframe" {
    16601660            set bool $_settings($what)
    16611661            SendCmd "heightmap wireframe $bool"
     
    17931793    switch -- $itk_option(-mode) {
    17941794        "heightmap" {
    1795             set _settings(isHeightmap) 1
     1795            set _settings(-isheightmap) 1
    17961796        }
    17971797        "contour" {
    1798             set _settings(isHeightmap) 0
     1798            set _settings(-isheightmap) 0
    17991799        }
    18001800        default {
     
    18031803    }
    18041804    if { !$_reset } {
    1805         AdjustSetting isHeightmap
     1805        AdjustSetting -isheightmap
    18061806    }
    18071807}
     
    18551855    checkbutton $inner.legend \
    18561856        -text "Legend" \
    1857         -variable [itcl::scope _settings(legendVisible)] \
    1858         -command [itcl::code $this AdjustSetting legendVisible] \
     1857        -variable [itcl::scope _settings(-legendvisible)] \
     1858        -command [itcl::code $this AdjustSetting -legendvisible] \
    18591859        -font "Arial 9"
    18601860
    18611861    checkbutton $inner.wireframe \
    18621862        -text "Wireframe" \
    1863         -variable [itcl::scope _settings(wireframe)] \
    1864         -command [itcl::code $this AdjustSetting wireframe] \
     1863        -variable [itcl::scope _settings(-wireframe)] \
     1864        -command [itcl::code $this AdjustSetting -wireframe] \
    18651865        -font "Arial 9"
    18661866
     
    18681868        checkbutton $inner.lighting \
    18691869            -text "Enable Lighting" \
    1870             -variable [itcl::scope _settings(lighting)] \
    1871             -command [itcl::code $this AdjustSetting lighting] \
     1870            -variable [itcl::scope _settings(-lighting)] \
     1871            -command [itcl::code $this AdjustSetting -lighting] \
    18721872            -font "Arial 9"
    18731873    } {
     
    18761876    checkbutton $inner.edges \
    18771877        -text "Edges" \
    1878         -variable [itcl::scope _settings(edges)] \
    1879         -command [itcl::code $this AdjustSetting edges] \
     1878        -variable [itcl::scope _settings(-edges)] \
     1879        -command [itcl::code $this AdjustSetting -edges] \
    18801880        -font "Arial 9"
    18811881
     
    18831883        checkbutton $inner.outline \
    18841884            -text "Outline" \
    1885             -variable [itcl::scope _settings(outline)] \
    1886             -command [itcl::code $this AdjustSetting outline] \
     1885            -variable [itcl::scope _settings(-outline)] \
     1886            -command [itcl::code $this AdjustSetting -outline] \
    18871887            -font "Arial 9"
    18881888    } {
     
    18911891    checkbutton $inner.stretch \
    18921892        -text "Stretch to fit" \
    1893         -variable [itcl::scope _settings(stretchToFit)] \
    1894         -command [itcl::code $this AdjustSetting stretchToFit] \
     1893        -variable [itcl::scope _settings(-stretchtofit)] \
     1894        -command [itcl::code $this AdjustSetting -stretchtofit] \
    18951895        -font "Arial 9"
    18961896
    18971897    checkbutton $inner.isolines \
    18981898        -text "Isolines" \
    1899         -variable [itcl::scope _settings(isolinesVisible)] \
    1900         -command [itcl::code $this AdjustSetting isolinesVisible] \
     1899        -variable [itcl::scope _settings(-isolinesvisible)] \
     1900        -command [itcl::code $this AdjustSetting -isolinesvisible] \
    19011901        -font "Arial 9"
    19021902
    19031903    checkbutton $inner.colormapDiscrete \
    19041904        -text "Discrete Colormap" \
    1905         -variable [itcl::scope _settings(colormapDiscrete)] \
    1906         -command [itcl::code $this AdjustSetting colormapDiscrete] \
     1905        -variable [itcl::scope _settings(-colormapdiscrete)] \
     1906        -command [itcl::code $this AdjustSetting -colormapdiscrete] \
    19071907        -font "Arial 9"
    19081908
     
    19161916    }
    19171917    bind $inner.field <<Value>> \
    1918         [itcl::code $this AdjustSetting field]
     1918        [itcl::code $this AdjustSetting -field]
    19191919
    19201920    label $inner.colormap_l -text "Colormap" -font "Arial 9"
     
    19431943    $itk_component(colormap) value "BCGYR"
    19441944    bind $inner.colormap <<Value>> \
    1945         [itcl::code $this AdjustSetting colormap]
     1945        [itcl::code $this AdjustSetting -colormap]
    19461946
    19471947    label $inner.isolinecolor_l -text "Isolines Color" -font "Arial 9"
     
    19631963    $itk_component(isolinecolor) value "black"
    19641964    bind $inner.isolinecolor <<Value>> \
    1965         [itcl::code $this AdjustSetting isolineColor]
     1965        [itcl::code $this AdjustSetting -isolinecolor]
    19661966
    19671967    label $inner.background_l -text "Background Color" -font "Arial 9"
     
    19751975
    19761976    $itk_component(background) value "white"
    1977     bind $inner.background <<Value>> [itcl::code $this AdjustSetting background]
     1977    bind $inner.background <<Value>> \
     1978        [itcl::code $this AdjustSetting -background]
    19781979
    19791980    itk_component add opacity_l {
     
    19841985    itk_component add opacity {
    19851986        ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1986             -variable [itcl::scope _settings(opacity)] \
     1987            -variable [itcl::scope _currentOpacity] \
    19871988            -showvalue off \
    1988             -command [itcl::code $this AdjustSetting opacity]
     1989            -command [itcl::code $this AdjustSetting -opacity]
    19891990    }
    19901991    itk_component add scale_l {
     
    19951996    itk_component add scale {
    19961997        ::scale $inner.scale -from 0 -to 100 -orient horizontal \
    1997             -variable [itcl::scope _settings(heightmapScale)] \
     1998            -variable [itcl::scope _settings(-heightmapscale)] \
    19981999            -showvalue off \
    1999             -command [itcl::code $this AdjustSetting heightmapScale]
     2000            -command [itcl::code $this AdjustSetting -heightmapscale]
    20002001    }
    20012002    label $inner.numisolines_l -text "Number of Isolines" -font "Arial 9"
     
    20042005            -min 0 -max 50 -font "arial 9"
    20052006    }
    2006     $itk_component(numisolines) value $_settings(numIsolines)
     2007    $itk_component(numisolines) value $_settings(-numisolines)
    20072008    bind $itk_component(numisolines) <<Value>> \
    2008         [itcl::code $this AdjustSetting numIsolines]
     2009        [itcl::code $this AdjustSetting -numisolines]
    20092010
    20102011    frame $inner.separator1 -height 2 -relief sunken -bd 1
     
    20532054    checkbutton $inner.visible \
    20542055        -text "Axes" \
    2055         -variable [itcl::scope _settings(axisVisible)] \
    2056         -command [itcl::code $this AdjustSetting axisVisible] \
     2056        -variable [itcl::scope _settings(-axisvisible)] \
     2057        -command [itcl::code $this AdjustSetting -axisvisible] \
    20572058        -font "Arial 9"
    20582059    checkbutton $inner.labels \
    20592060        -text "Axis Labels" \
    2060         -variable [itcl::scope _settings(axisLabels)] \
    2061         -command [itcl::code $this AdjustSetting axisLabels] \
     2061        -variable [itcl::scope _settings(-axislabels)] \
     2062        -command [itcl::code $this AdjustSetting -axislabels] \
    20622063        -font "Arial 9"
    20632064    label $inner.grid_l -text "Grid" -font "Arial 9"
    20642065    checkbutton $inner.xgrid \
    20652066        -text "X" \
    2066         -variable [itcl::scope _settings(axisXGrid)] \
    2067         -command [itcl::code $this AdjustSetting axisXGrid] \
     2067        -variable [itcl::scope _settings(-xgrid)] \
     2068        -command [itcl::code $this AdjustSetting -xgrid] \
    20682069        -font "Arial 9"
    20692070    checkbutton $inner.ygrid \
    20702071        -text "Y" \
    2071         -variable [itcl::scope _settings(axisYGrid)] \
    2072         -command [itcl::code $this AdjustSetting axisYGrid] \
     2072        -variable [itcl::scope _settings(-ygrid)] \
     2073        -command [itcl::code $this AdjustSetting -ygrid] \
    20732074        -font "Arial 9"
    20742075    checkbutton $inner.zgrid \
    20752076        -text "Z" \
    2076         -variable [itcl::scope _settings(axisZGrid)] \
    2077         -command [itcl::code $this AdjustSetting axisZGrid] \
     2077        -variable [itcl::scope _settings(-zgrid)] \
     2078        -command [itcl::code $this AdjustSetting -zgrid] \
    20782079        -font "Arial 9"
    20792080    checkbutton $inner.minorticks \
    20802081        -text "Minor Ticks" \
    2081         -variable [itcl::scope _settings(axisMinorTicks)] \
    2082         -command [itcl::code $this AdjustSetting axisMinorTicks] \
     2082        -variable [itcl::scope _settings(-axisminorticks)] \
     2083        -command [itcl::code $this AdjustSetting -axisminorticks] \
    20832084        -font "Arial 9"
    20842085
     
    20952096        "outer_edges"     "outer"         
    20962097    $itk_component(axisflymode) value "static"
    2097     bind $inner.mode <<Value>> [itcl::code $this AdjustSetting axisFlymode]
     2098    bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axisflymode]
    20982099
    20992100    blt::table $inner \
     
    22802281    array set style {
    22812282        -color BCGYR
    2282         -opacity 100
     2283        -opacity 1.0
    22832284        -levels 10
    22842285    }
     
    22962297    # the code to handle aberrant cases.
    22972298
    2298     if { $_changed(opacity) } {
    2299         set style(-opacity) $_settings(opacity)
    2300     }
    2301     if { $_changed(numIsolines) } {
    2302         set style(-levels) $_settings(numIsolines)
    2303     }
    2304     if { $_changed(colormap) } {
    2305         set style(-color) $_settings(colormap)
     2299    if { $_changed(-opacity) } {
     2300        set style(-opacity) $_settings(-opacity)
     2301    }
     2302    if { $_changed(-numisolines) } {
     2303        set style(-levels) $_settings-(numisolines)
     2304    }
     2305    if { $_changed(-colormap) } {
     2306        set style(-color) $_settings(-colormap)
    23062307    }
    23072308    if { $_currentColormap == "" } {
     
    23092310    }
    23102311    if { [info exists style(-stretchtofit)] } {
    2311         set _settings(stretchToFit) $style(-stretchtofit)
    2312         AdjustSetting stretchToFit
    2313     }
    2314     set _currentOpacity $style(-opacity)
     2312        set _settings(-stretchtofit) $style(-stretchtofit)
     2313        AdjustSetting -stretchtofit
     2314    }
     2315    set _currentOpacity [expr $style(-opacity) * 100.0]
     2316
    23152317    if { $_currentNumIsolines != $style(-levels) } {
    23162318        set _currentNumIsolines $style(-levels)
    2317         set _settings(numIsolines) $_currentNumIsolines
     2319        set _settings(-numisolines) $_currentNumIsolines
    23182320        $itk_component(numisolines) value $_currentNumIsolines
    23192321        UpdateContourList
     
    23222324    SendCmd "outline add $tag"
    23232325    SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag"
    2324     SendCmd "outline visible $_settings(outline) $tag"
     2326    SendCmd "outline visible $_settings(-outline) $tag"
    23252327    set scale [GetHeightmapScale]
    23262328    SendCmd "[list heightmap add contourlist $_contourList $scale $tag]"
    2327     set _comp2scale($tag) $_settings(heightmapScale)
    2328     SendCmd "heightmap edges $_settings(edges) $tag"
    2329     SendCmd "heightmap wireframe $_settings(wireframe) $tag"
     2329    set _comp2scale($tag) $_settings(-heightmapscale)
     2330    SendCmd "heightmap edges $_settings(-edges) $tag"
     2331    SendCmd "heightmap wireframe $_settings(-wireframe) $tag"
    23302332    SetCurrentColormap $style(-color)
    23312333    set color [$itk_component(isolinecolor) value]
    23322334    SendCmd "heightmap isolinecolor [Color2RGB $color] $tag"
    2333     SendCmd "heightmap lighting $_settings(isHeightmap) $tag"
    2334     SendCmd "heightmap isolines $_settings(isolinesVisible) $tag"
    2335     SendCmd "heightmap surface $_settings(colormapVisible) $tag"
     2335    SendCmd "heightmap lighting $_settings(-isheightmap) $tag"
     2336    SendCmd "heightmap isolines $_settings(-isolinesvisible) $tag"
     2337    SendCmd "heightmap surface $_settings(-colormapvisible) $tag"
    23362338}
    23372339
     
    23922394    }
    23932395    set x [expr $w - 2]
    2394     if { !$_settings(legendVisible) } {
     2396    if { !$_settings(-legendvisible) } {
    23952397        $c delete legend
    23962398        return
     
    24312433    array unset _isolines
    24322434    if { $color != "none"  && [info exists _limits($_curFldName)] &&
    2433          $_settings(isolinesVisible) && $_currentNumIsolines > 0 } {
     2435         $_settings(-isolinesvisible) && $_currentNumIsolines > 0 } {
    24342436
    24352437        foreach { vmin vmax } $_limits($_curFldName) break
     
    25982600        invoke {
    25992601            $itk_component(field) value $_curFldLabel
    2600             AdjustSetting field
     2602            AdjustSetting -field
    26012603        }
    26022604        default {
     
    26072609
    26082610itcl::body Rappture::VtkHeightmapViewer::GetHeightmapScale {} {
    2609     if {  $_settings(isHeightmap) } {
    2610         set val $_settings(heightmapScale)
     2611    if {  $_settings(-isheightmap) } {
     2612        set val $_settings(-heightmapscale)
    26112613        set sval [expr { $val >= 50 ? double($val)/50.0 : 1.0/(2.0-(double($val)/50.0)) }]
    26122614        return $sval
  • branches/1.3/gui/scripts/vtkisosurfaceviewer.tcl

    r4397 r4399  
    243243        -legendvisible                  1
    244244        -numcontours                    10
    245         -xaxisgrid                      0
     245        -xgrid                          0
    246246        -xcutplaneposition              50
    247247        -xcutplanevisible               1
    248         -yaxisgrid                      0
     248        -ygrid                          0
    249249        -ycutplaneposition              50
    250250        -ycutplanevisible               1
    251         -zaxisgrid                      0
     251        -zgrid                          0
    252252        -zcutplaneposition              50
    253253        -zcutplanevisible               1
     
    959959        PanCamera
    960960        set _first ""
    961         InitSettings -xaxisgrid -yaxisgrid -zaxisgrid -axismode \
     961        InitSettings -xgrid -ygrid -zgrid -axismode \
    962962            -axesvisible -axislabelsvisible
    963963        foreach axis { x y z } {
     
    13321332            SendCmd "axis labels all $bool"
    13331333        }
    1334         "-xaxisgrid" - "-yaxisgrid" - "-zaxisgrid" {
     1334        "-xgrid" - "-ygrid" - "-zgrid" {
    13351335            set axis [string tolower [string range $what 1 1]]
    13361336            set bool $_settings($what)
     
    17801780    checkbutton $inner.gridx \
    17811781        -text "Show X Grid" \
    1782         -variable [itcl::scope _settings(-xaxisgrid)] \
    1783         -command [itcl::code $this AdjustSetting -xaxisgrid] \
     1782        -variable [itcl::scope _settings(-xgrid)] \
     1783        -command [itcl::code $this AdjustSetting -xgrid] \
    17841784        -font "Arial 9"
    17851785    checkbutton $inner.gridy \
    17861786        -text "Show Y Grid" \
    1787         -variable [itcl::scope _settings(-yaxisgrid)] \
    1788         -command [itcl::code $this AdjustSetting -yaxisgrid] \
     1787        -variable [itcl::scope _settings(-ygrid)] \
     1788        -command [itcl::code $this AdjustSetting -ygrid] \
    17891789        -font "Arial 9"
    17901790    checkbutton $inner.gridz \
    17911791        -text "Show Z Grid" \
    1792         -variable [itcl::scope _settings(-zaxisgrid)] \
    1793         -command [itcl::code $this AdjustSetting -zaxisgrid] \
     1792        -variable [itcl::scope _settings(-zgrid)] \
     1793        -command [itcl::code $this AdjustSetting -zgrid] \
    17941794        -font "Arial 9"
    17951795
Note: See TracChangeset for help on using the changeset viewer.