Changeset 5299


Ignore:
Timestamp:
Apr 23, 2015, 6:46:41 PM (4 years ago)
Author:
ldelgass
Message:

Roll back widget/settings partial refactor in nanovis viewer. We can do a more
complete refactor in the trunk.

File:
1 edited

Legend:

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

    r5295 r5299  
    143143    private variable _transferFunctionEditors
    144144    private variable _settings
    145     private variable _widget
    146145
    147146    private variable _first ""         ;# This is the topmost volume.
     
    222221        -light                  40
    223222        -light2side             1
     223        -opacity                50
    224224        -outlinevisible         0
    225225        -qw                     0.853553
     
    229229        -thickness              350
    230230        -volume                 1
    231         -volumeopacity          0.5
    232231        -volumevisible          1
    233232        -xcutplaneposition      50
     
    240239        -zcutplanevisible       1
    241240        -zoom                   1.0
    242     }
    243     array set _widget {
    244         -volumeopacity          50
    245241    }
    246242    itk_component add 3dview {
     
    962958        }
    963959
    964         InitSettings -light2side -light -volumeopacity \
     960        InitSettings -light2side -light -opacity \
    965961            -isosurfaceshading -gridvisible -axesvisible \
    966962            -xcutplanevisible -ycutplanevisible -zcutplanevisible       
     
    12791275            }
    12801276        }
     1277        "-opacity" {
     1278            set _settings($_current${what}) $_settings($what)
     1279            set val $_settings($what)
     1280            set sval [expr { 0.01 * double($val) }]
     1281            foreach tag [GetDatasetsWithComponent $_current] {
     1282                SendCmd "volume shading opacity $sval $tag"
     1283            }
     1284        }
    12811285        "-outlinevisible" {
    12821286            SendCmd "volume outline state $_settings($what)"
     
    12991303            }
    13001304            set _settings(-volumevisible) $bool
    1301         }
    1302         "-volumeopacity" {
    1303             set _settings($what) [expr $_widget($what) * 0.01]
    1304             set _settings($_current${what}) $_settings($what)
    1305             foreach tag [GetDatasetsWithComponent $_current] {
    1306                 SendCmd "volume shading opacity $_settings($what) $tag"
    1307             }
    13081305        }
    13091306        "-volumevisible" {
     
    16611658    label $inner.opacity_l -text "Opacity" -font $fg
    16621659    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1663         -variable [itcl::scope _widget(-volumeopacity)] \
    1664         -showvalue off \
    1665         -command [itcl::code $this AdjustSetting -volumeopacity] \
     1660        -variable [itcl::scope _settings(-opacity)] \
     1661        -showvalue off -command [itcl::code $this AdjustSetting -opacity] \
    16661662        -troughcolor grey92
    16671663
     
    20062002        -light             40
    20072003        -light2side        1
     2004        -opacity           50
    20082005        -thickness         350
    2009         -volumeopacity     1.0
    20102006        -volumevisible     1
    20112007    } {
     
    20352031    set _settings(-light)            $_settings($cname-light)
    20362032    set _settings(-light2side)       $_settings($cname-light2side)
    2037     set _settings(-volumeopacity)    $_settings($cname-volumeopacity)
     2033    set _settings(-opacity)          $_settings($cname-opacity)
    20382034    set _settings(-thickness)        $_settings($cname-thickness)
    20392035    set _settings(-volumevisible)    $_settings($cname-volumevisible)
    20402036    $itk_component(colormap) value   $_settings($cname-colormap)
    2041 
    2042     set _widget(-volumeopacity) [expr $_settings(-volumeopacity) * 100.0]
    2043 
    20442037    set _current $cname;                # Reset the current component
    20452038}
     
    21952188itcl::body Rappture::NanovisViewer::SetObjectStyle { dataobj cname } {
    21962189    array set style {
    2197         -opacity  0.5
     2190        -opacity 0.5
    21982191    }
    21992192    array set style [lindex [$dataobj components -style $cname] 0]
     
    22012194    # override the requested opacity for now
    22022195    set style(-opacity) 0.5
    2203     set _settings($cname-volumeopacity) $style(-opacity)
     2196    set _settings($cname-opacity) [expr $style(-opacity) * 100.0]
    22042197    set tag $dataobj-$cname
    2205     SendCmd "volume shading opacity $_settings($cname-volumeopacity) $tag"
     2198    SendCmd "volume shading opacity $style(-opacity) $tag"
    22062199    NameTransferFunction $dataobj $cname
    22072200}
Note: See TracChangeset for help on using the changeset viewer.