Changeset 4725


Ignore:
Timestamp:
Nov 13, 2014 7:26:24 PM (6 years ago)
Author:
ldelgass
Message:

Collapse redundant transp/opacity settings in flowvisviewer in place of single
opacity setting.

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r4669 r4725  
    253253        $this-diffuse           40
    254254        $this-light2side        1
    255         $this-opacity           100
     255        $this-opacity           50
    256256        $this-specularLevel     30
    257257        $this-specularExponent  90
    258258        $this-thickness         350
    259         $this-transp            50
    260259        $this-cutplaneVisible   0
    261260        $this-xcutplane         1
     
    740739        -levels 6
    741740        -markers ""
    742         -opacity 1.0
     741        -opacity 0.5
    743742    }
    744743    array unset _limits
     
    965964    }
    966965
    967     # Ensure that the global opacity and thickness settings (in the slider
    968     # settings widgets) are used for the active transfer-function.  Update the
    969     # values in the _settings varible.
    970     set value $_settings($this-opacity)
    971     set opacity [expr { double($value) * 0.01 }]
    972     set _settings($this-$tf-opacity) $opacity
     966    # Ensure that the global thickness setting (in the slider settings widget)
     967    # is used for the active transfer-function. Update the values in the
     968    # _settings varible.
     969
    973970    set value $_settings($this-thickness)
    974971    # Scale values between 0.00001 and 0.01000
     
    12001197    # Reset the camera and other view parameters
    12011198    InitSettings light2side ambient diffuse specularLevel specularExponent \
    1202         transp isosurface grid axes volume outline \
     1199        opacity isosurface grid axes volume outline \
    12031200        cutplaneVisible xcutplane ycutplane zcutplane
    12041201
     
    16221619            }
    16231620        }
    1624         transp {
     1621        opacity {
    16251622            if { $_first != "" } {
    16261623                set comp [lindex [$_first components] 0]
    16271624                set tag $_first-$comp
    1628                 set opacity [expr { 0.01 * double($_settings($this-transp)) }]
     1625                set opacity [expr { 0.01 * double($_settings($this-opacity)) }]
    16291626                SendCmd "$tag configure -opacity $opacity"
    16301627            }
    16311628        }
    1632         opacity {
    1633             if { $_first != "" && $_activeTf != "" } {
    1634                 set opacity [expr { 0.01 * double($_settings($this-opacity)) }]
    1635                 set tf $_activeTf
    1636                 set _settings($this-$tf-opacity) $opacity
    1637                 updateTransferFunctions
    1638             }
    1639         }
    1640 
    16411629        thickness {
    16421630            if { $_first != "" && $_activeTf != "" } {
     
    17641752        -color BCGYR
    17651753        -levels 6
    1766         -light 40
    1767         -opacity 1.0
    1768         -transp 50
     1754        -opacity 0.5
    17691755    }
    17701756    array set styles [lindex [$dataobj components -style $cname] 0]
    1771     set _settings($this-light) $styles(-light)
    1772     set _settings($this-transp) $styles(-transp)
    17731757    set _settings($this-opacity) [expr $styles(-opacity) * 100]
    17741758    set _obj2style($dataobj-$cname) $cname
     
    17901774        -color BCGYR
    17911775        -levels 6
    1792         -opacity 1.0
    1793         -light 40
    1794         -transp 50
     1776        -opacity 0.5
    17951777    }
    17961778    set dataobj ""; set comp ""
     
    18001782    }
    18011783    array set styles [lindex [$dataobj components -style $comp] 0]
    1802 
    18031784
    18041785    # We have to parse the style attributes for a volume using this
     
    18311812        set cmap [ColorsToColormap $styles(-color)]
    18321813    }
    1833     set tag $this-$tf
    1834     if { ![info exists _settings($tag-opacity)] } {
    1835         set _settings($tag-opacity) $styles(-opacity)
    1836     }
    1837     set max 1.0 ;#$_settings($tag-opacity)
    1838    
     1814
     1815    if { ![info exists _settings($this-opacity)] } {
     1816        set _settings($this-opacity) [expr $styles(-opacity) * 100]
     1817    }
     1818
     1819    # Transfer function should be normalized with [0,1] range
     1820    # The volume shading opacity setting is used to scale opacity
     1821    # in the volume shader.
     1822    set max 1.0
     1823
    18391824    set isovalues {}
    18401825    foreach m $_isomarkers($tf) {
     
    18441829    set isovalues [lsort -real $isovalues]
    18451830
     1831    set tag $this-$tf
    18461832    if { ![info exists _settings($tag-thickness)]} {
    18471833        set _settings($tag-thickness) 0.005
     
    22222208
    22232209    label $inner.clear -text "Clear" -font $fg
    2224     ::scale $inner.transp -from 0 -to 100 -orient horizontal \
    2225         -variable [itcl::scope _settings($this-transp)] \
     2210    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
     2211        -variable [itcl::scope _settings($this-opacity)] \
    22262212        -width 10 \
    2227         -showvalue off -command [itcl::code $this AdjustSetting transp]
     2213        -showvalue off -command [itcl::code $this AdjustSetting opacity]
    22282214    label $inner.opaque -text "Opaque" -font $fg
    22292215
     
    22572243        6,1 $inner.specularExponent -cspan 3 -pady 2 -fill x \
    22582244        7,0 $inner.clear -anchor e -pady 2 \
    2259         7,1 $inner.transp -cspan 2 -pady 2 -fill x \
     2245        7,1 $inner.opacity -cspan 2 -pady 2 -fill x \
    22602246        7,3 $inner.opaque -anchor w -pady 2 \
    22612247        8,0 $inner.thin -anchor e -pady 2 \
  • trunk/gui/scripts/nanovisviewer.tcl

    r4713 r4725  
    23002300    set isovalues [$_transferFunctionEditors($cname) values]
    23012301
    2302     # Currently using volume shading opacity to scale opacity in
    2303     # the volume shader. The transfer function always sets full
    2304     # opacity
     2302    # Transfer function should be normalized with [0,1] range
     2303    # The volume shading opacity setting is used to scale opacity
     2304    # in the volume shader.
    23052305    set max 1.0
    23062306
Note: See TracChangeset for help on using the changeset viewer.