Ignore:
Timestamp:
Jul 17, 2014, 10:59:23 PM (10 years ago)
Author:
ldelgass
Message:

Fix component-specific opacity setting. _widget was preventing the widget from
actually being updated. Just minimize diff with trunk for now. Refactoring
can be done on the trunk later.

File:
1 edited

Legend:

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

    r4562 r4563  
    150150    private variable _settings
    151151    private variable _alphamap
    152     private variable _widget
    153152
    154153    private variable _first "" ;        # This is the topmost volume.
     
    230229        -light                  40
    231230        -light2side             1
     231        -opacity                50
    232232        -outlinevisible         0
    233233        -qw                     0.853553
     
    237237        -thickness              350
    238238        -volume                 1
    239         -volumeopacity          0.5
    240239        -volumevisible          1
    241240        -xcutplaneposition      50
     
    248247        -zcutplanevisible       1
    249248        -zoom                   1.0
    250     }
    251     array set _widget {
    252         -volumeopacity     50
    253249    }
    254250    itk_component add 3dview {
     
    960956        }
    961957
    962         InitSettings -light2side -light -volumeopacity \
     958        InitSettings -light2side -light -opacity \
    963959            -isosurfaceshading -gridvisible -axesvisible \
    964960            -current
     
    12911287            }
    12921288        }
    1293         "-volumeopacity" {
    1294             set _settings($what) [expr $_widget($what) * 0.01]
     1289        "-opacity" {
    12951290            set _settings($_current${what}) $_settings($what)
    12961291            foreach tag [GetDatasetsWithComponent $_current] {
     
    17081703    label $inner.fog -text "Clear" -font $fg
    17091704    ::scale $inner.transp -from 0 -to 100 -orient horizontal \
    1710         -variable [itcl::scope _widget(-volumeopacity)] \
     1705        -variable [itcl::scope _settings(-opacity)] \
    17111706        -width 10 \
    1712         -showvalue off -command [itcl::code $this AdjustSetting -volumeopacity]
     1707        -showvalue off -command [itcl::code $this AdjustSetting -opacity]
    17131708    label $inner.plastic -text "Opaque" -font $fg
    17141709
     
    21062101        $cname-light             40
    21072102        $cname-light2side        1
    2108         $cname-volumeopacity     0.5
     2103        $cname-opacity           50
    21092104        $cname-thickness         350
    21102105        $cname-volumevisible     1
     
    21272122    set _settings(-light)            $_settings($cname-light)
    21282123    set _settings(-light2side)       $_settings($cname-light2side)
     2124    set _settings(-opacity)          $_settings($cname-opacity)
    21292125    set _settings(-thickness)        $_settings($cname-thickness)
    2130     set _settings(-volumeopacity)    $_settings($cname-volumeopacity)
    21312126    set _settings(-volumevisible)    $_settings($cname-volumevisible)
    21322127    $itk_component(colormap) value   $_settings($cname-colormap)
Note: See TracChangeset for help on using the changeset viewer.