Changeset 4432 for branches/1.3


Ignore:
Timestamp:
Jun 25, 2014 2:44:46 PM (6 years ago)
Author:
ldelgass
Message:

Fix heightmap viewer to match trunk and other viewers: _settings(-opacity) is
the widget [0,100] value, style and protocol is [0,1], conversions where
necessary. Remove _currentOpacity, as it is not needed.

File:
1 edited

Legend:

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

    r4399 r4432  
    123123    private variable _currentColormap ""
    124124    private variable _currentNumIsolines -1
    125     private variable _currentOpacity 100.0; # Widget opacity setting
    126                                         #   between 0 and 100
    127    
    128125
    129126    private variable _maxScale 100;     # This is the # of times the x-axis
     
    239236        -savelighting           1
    240237        -numisolines            10
    241         -opacity                1.0
     238        -opacity                100
    242239        -outline                0
    243240        -wireframe              0
    244         -saveopacity            1.0
     241        -saveopacity            100
    245242        -saveoutline            0
    246243    }
    247244    array set _changed {
    248         -opacity                 0.0
     245        -opacity                 0
    249246        -colormap                0
    250247        -numisolines             0
     
    15111508                set _settings(-heightmapscale) 0
    15121509                set _settings(-lighting) 0
    1513                 set _settings(-opacity) 1.0
     1510                set _settings(-opacity) 100
    15141511                set _settings(-outline)  $_settings(-saveoutline)
    15151512            }
     
    16261623        "-opacity" {
    16271624            set _changed($what) 1
    1628             set _settings($what)  [expr double($_currentOpacity) * 0.01]
     1625            set val [expr $_settings($what) * 0.01]
    16291626            if { $_settings(-isheightmap) } {
    16301627                set _settings(-saveopacity) $_settings($what)
    1631                 SendCmd "heightmap opacity $_settings($what)"
     1628                SendCmd "heightmap opacity $val"
    16321629            } else {
    16331630                SendCmd "heightmap opacity 1.0"
     
    19851982    itk_component add opacity {
    19861983        ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1987             -variable [itcl::scope _currentOpacity] \
     1984            -variable [itcl::scope _settings(-opacity)] \
    19881985            -showvalue off \
    19891986            -command [itcl::code $this AdjustSetting -opacity]
     
    22982295
    22992296    if { $_changed(-opacity) } {
    2300         set style(-opacity) $_settings(-opacity)
     2297        set style(-opacity) [expr $_settings(-opacity) * 0.01]
    23012298    }
    23022299    if { $_changed(-numisolines) } {
     
    23132310        AdjustSetting -stretchtofit
    23142311    }
    2315     set _currentOpacity [expr $style(-opacity) * 100.0]
    23162312
    23172313    if { $_currentNumIsolines != $style(-levels) } {
     
    23362332    SendCmd "heightmap isolines $_settings(-isolinesvisible) $tag"
    23372333    SendCmd "heightmap surface $_settings(-colormapvisible) $tag"
     2334    SendCmd "heightmap opacity $style(-opacity) $tag"
     2335    set _settings(-opacity) [expr $style(-opacity) * 100.0]
    23382336}
    23392337
Note: See TracChangeset for help on using the changeset viewer.