Changeset 3537 for trunk/gui


Ignore:
Timestamp:
Mar 19, 2013 9:05:28 AM (11 years ago)
Author:
gah
Message:

make outline work only for contours, not heightmaps

File:
1 edited

Legend:

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

    r3536 r3537  
    231231        wireframe               0
    232232        saveOpacity             100
     233        saveOutline             0
    233234    }
    234235    array set _changed {
     
    14361437            if { $_settings(isHeightmap) } {
    14371438                set scale [GetHeightmapScale]
    1438                 foreach dataset [CurrentDatasets -all] {
     1439                # Have to set the datasets individually because we are
     1440                # tracking them in _comp2scale.
     1441                foreach dataset [CurrentDatasets -all] {
    14391442                    SendCmd "heightmap heightscale $scale $dataset"
    14401443                    set _comp2scale($dataset) $scale
     
    14521455                set _settings(opacity) $_settings(saveOpacity)
    14531456                set _settings(lighting) $_settings(saveLighting)
     1457                set _settings(outline) 0
    14541458            } else {
    14551459                set _settings(heightmapScale) 0
    14561460                set _settings(lighting) 0
    14571461                set _settings(opacity) 100
     1462                set _settings(outline)  $_settings(saveOutline)
    14581463            }
    14591464            AdjustSetting lighting
    14601465            AdjustSetting opacity
     1466            AdjustSetting outline
    14611467            set scale [GetHeightmapScale]
     1468            # Have to set the datasets individually because we are
     1469            # tracking them in _comp2scale.
    14621470            foreach dataset [CurrentDatasets -all] {
    14631471                SendCmd "heightmap heightscale $scale $dataset"
     
    14701478                $itk_component(opacity_l) configure -state normal
    14711479                $itk_component(scale_l) configure -state normal
     1480                $itk_component(outline) configure -state disabled
    14721481                if {$_view(ortho)} {
    14731482                    SendCmd "camera mode ortho"
     
    14811490                $itk_component(opacity_l) configure -state disabled
    14821491                $itk_component(scale_l) configure -state disabled
     1492                $itk_component(outline) configure -state normal
    14831493                SendCmd "camera mode image"
    14841494            }
     
    15751585        }
    15761586        "outline" {
    1577             set bool $_settings($what)
    1578             SendCmd "dataset outline $bool"
     1587            if { $_settings(isHeightmap) } {
     1588                SendCmd "dataset outline 0"
     1589            } else {
     1590                set _settings(saveOutline) $_settings(outline)
     1591                set bool $_settings(outline)
     1592                SendCmd "dataset outline $bool"
     1593            }
    15791594        }
    15801595        "stretchToFit" {
     
    18021817        -font "Arial 9"
    18031818
    1804     checkbutton $inner.outline \
    1805         -text "Outline" \
    1806         -variable [itcl::scope _settings(outline)] \
    1807         -command [itcl::code $this AdjustSetting outline] \
    1808         -font "Arial 9"
    1809 
     1819    itk_component add outline {
     1820        checkbutton $inner.outline \
     1821            -text "Outline" \
     1822            -variable [itcl::scope _settings(outline)] \
     1823            -command [itcl::code $this AdjustSetting outline] \
     1824            -font "Arial 9"
     1825    } {
     1826        ignore -font
     1827    }
    18101828    checkbutton $inner.stretch \
    18111829        -text "Stretch to fit" \
     
    19271945        [itcl::code $this AdjustSetting numIsolines]
    19281946
    1929     frame $inner.separator -height 2 -relief sunken -bd 1
     1947    frame $inner.separator1 -height 2 -relief sunken -bd 1
     1948    frame $inner.separator2 -height 2 -relief sunken -bd 1
     1949
    19301950    blt::table $inner \
    19311951        0,0 $inner.field_l -anchor w -pady 2 \
     
    19441964        8,0 $inner.colormapDiscrete -anchor w -pady 2 -cspan 2 \
    19451965        9,0 $inner.wireframe  -anchor w -pady 2 -cspan 2\
    1946         10,0 $inner.outline    -anchor w -pady 2 -cspan 2 \
    1947         11,0 $inner.isolines   -anchor w -pady 2 -cspan 2 \
    1948         12,0 $inner.separator -padx 2 -fill x -cspan 2 \
    1949         13,0 $inner.lighting   -anchor w -pady 2 -cspan 2 \
    1950         14,0 $inner.opacity_l -anchor w -pady 2 \
    1951         14,1 $inner.opacity   -fill x   -pady 2 \
    1952         15,0 $inner.scale_l   -anchor w -pady 2 -cspan 2 \
    1953         15,1 $inner.scale     -fill x   -pady 2 -cspan 2 \
     1966        10,0 $inner.isolines   -anchor w -pady 2 -cspan 2 \
     1967        11,0 $inner.separator1 -padx 2 -fill x -cspan 2 \
     1968        12,0 $inner.outline    -anchor w -pady 2 -cspan 2 \
     1969        13,0 $inner.separator2 -padx 2 -fill x -cspan 2 \
     1970        14,0 $inner.lighting   -anchor w -pady 2 -cspan 2 \
     1971        15,0 $inner.opacity_l -anchor w -pady 2 \
     1972        15,1 $inner.opacity   -fill x   -pady 2 \
     1973        16,0 $inner.scale_l   -anchor w -pady 2 -cspan 2 \
     1974        16,1 $inner.scale     -fill x   -pady 2 -cspan 2 \
    19541975
    19551976    blt::table configure $inner r* c* -resize none
    1956     blt::table configure $inner r16 c1 -resize expand
     1977    blt::table configure $inner r17 c1 -resize expand
    19571978}
    19581979
Note: See TracChangeset for help on using the changeset viewer.