Changeset 4727


Ignore:
Timestamp:
Nov 13, 2014 7:47:56 PM (10 years ago)
Author:
ldelgass
Message:

Merge opacity fixes for flowvisviewer from trunk

Location:
branches/1.3
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3

    • Property svn:mergeinfo changed
      /trunkmerged: 4726
  • branches/1.3/examples/flow/flowtest.tcl

    r4228 r4727  
    3939    $f1.component.flow.particles(right).color khaki
    4040    $f1.component.flow.particles(right).position 90%
    41     $f1.component.style  "-color blue:red -levels 6 -opacity 1"
     41    $f1.component.style  "-color blue:red -levels 6"
    4242    $f1.component.flow.box(one).label "Region 1"
    4343    $f1.component.flow.box(one).color cyan
     
    7575    $f2.component.flow.particles(right).color pink
    7676    $f2.component.flow.particles(right).position 90%
    77     $f2.component.style  "-color rainbow -levels 6 -opacity 1"
     77    $f2.component.style  "-color rainbow -levels 6"
    7878    $f2.camera.position {
    7979        qw 1 qx 0 qy 0 qz 0 pan-x 0 pan-y 0 zoom 1.0
     
    100100    $f3.component.flow.particles(right).color khaki
    101101    $f3.component.flow.particles(right).position 90%
    102     $f3.component.style  "-color blue:red -levels 6 -opacity 1"
     102    $f3.component.style  "-color blue:red -levels 6"
    103103    $f3.component.elemtype vectors
    104104    $f3.component.elemsize 3
  • branches/1.3/gui/scripts/flowvisviewer.tcl

    r4670 r4727  
    250250        $this-streams           0
    251251        $this-volume            1
     252        $this-light             40
     253        $this-light2side        1
     254        $this-opacity           50
     255        $this-thickness         350
    252256        $this-xcutplane         0
    253257        $this-xcutposition      0
     
    720724        -levels 6
    721725        -markers ""
    722         -opacity 1.0
     726        -opacity 0.5
    723727    }
    724728    array unset _limits
     
    945949    }
    946950
    947     # Ensure that the global opacity and thickness settings (in the slider
    948     # settings widgets) are used for the active transfer-function.  Update the
    949     # values in the _settings varible.
    950     set value $_settings($this-opacity)
    951     set opacity [expr { double($value) * 0.01 }]
    952     set _settings($this-$tf-opacity) $opacity
     951    # Ensure that the global thickness setting (in the slider settings widget)
     952    # is used for the active transfer-function. Update the values in the
     953    # _settings varible.
     954
    953955    set value $_settings($this-thickness)
    954956    # Scale values between 0.00001 and 0.01000
     
    11741176
    11751177    # Reset the camera and other view parameters
    1176     InitSettings light2side light transp isosurface grid axes volume outline
    1177    
     1178    InitSettings light2side light opacity isosurface grid axes volume outline
     1179
    11781180    # nothing to send -- activate the proper volume
    11791181    if {"" != $_first} {
    1180         AdjustSetting light
    1181         AdjustSetting transp
    11821182        set axis [$_first hints updir]
    11831183        if {"" != $axis} {
     
    15741574            }
    15751575        }
    1576         transp {
     1576        opacity {
    15771577            if { $_first != "" } {
    15781578                set comp [lindex [$_first components] 0]
    15791579                set tag $_first-$comp
    1580                 set opacity [expr { 0.01 * double($_settings($this-transp)) }]
     1580                set opacity [expr { 0.01 * double($_settings($this-opacity)) }]
    15811581                SendCmd "$tag configure -opacity $opacity"
    15821582            }
    15831583        }
    1584         opacity {
    1585             if { $_first != "" && $_activeTf != "" } {
    1586                 set opacity [expr { 0.01 * double($_settings($this-opacity)) }]
    1587                 set tf $_activeTf
    1588                 set _settings($this-$tf-opacity) $opacity
    1589                 updateTransferFunctions
    1590             }
    1591         }
    1592 
    15931584        thickness {
    15941585            if { $_first != "" && $_activeTf != "" } {
     
    17101701        -color BCGYR
    17111702        -levels 6
    1712         -light 40
    1713         -opacity 1.0
    1714         -transp 50
     1703        -opacity 0.5
    17151704    }
    17161705    array set styles [lindex [$dataobj components -style $cname] 0]
    1717     set _settings($this-light) $styles(-light)
    1718     set _settings($this-transp) $styles(-transp)
    17191706    set _settings($this-opacity) [expr $styles(-opacity) * 100]
    17201707    set _obj2style($dataobj-$cname) $cname
     
    17361723        -color BCGYR
    17371724        -levels 6
    1738         -opacity 1.0
    1739         -light 40
    1740         -transp 50
     1725        -opacity 0.5
    17411726    }
    17421727    set dataobj ""; set comp ""
     
    17461731    }
    17471732    array set styles [lindex [$dataobj components -style $comp] 0]
    1748 
    17491733
    17501734    # We have to parse the style attributes for a volume using this
     
    17771761        set cmap [ColorsToColormap $styles(-color)]
    17781762    }
    1779     set tag $this-$tf
    1780     if { ![info exists _settings($tag-opacity)] } {
    1781         set _settings($tag-opacity) $styles(-opacity)
    1782     }
    1783     set max 1.0 ;#$_settings($tag-opacity)
    1784    
     1763
     1764    if { ![info exists _settings($this-opacity)] } {
     1765        set _settings($this-opacity) [expr $styles(-opacity) * 100]
     1766    }
     1767
     1768    # Transfer function should be normalized with [0,1] range
     1769    # The volume shading opacity setting is used to scale opacity
     1770    # in the volume shader.
     1771    set max 1.0
     1772
    17851773    set isovalues {}
    17861774    foreach m $_isomarkers($tf) {
     
    17901778    set isovalues [lsort -real $isovalues]
    17911779
     1780    set tag $this-$tf
    17921781    if { ![info exists _settings($tag-thickness)]} {
    17931782        set _settings($tag-thickness) 0.005
     
    21232112
    21242113itcl::body Rappture::FlowvisViewer::BuildVolumeTab {} {
    2125     foreach { key value } {
    2126         light2side      1
    2127         light           40
    2128         transp          50
    2129         opacity         100
    2130         thickness       350
    2131     } {
    2132         set _settings($this-$key) $value
    2133     }
    2134 
    21352114    set inner [$itk_component(main) insert end \
    21362115        -title "Volume Settings" \
     
    21592138        -showvalue off -command [itcl::code $this AdjustSetting light]
    21602139    label $inner.bright -text "Surface" -font $fg
    2161 
    2162     label $inner.fog -text "Clear" -font $fg
    2163     ::scale $inner.transp -from 0 -to 100 -orient horizontal \
    2164         -variable [itcl::scope _settings($this-transp)] \
    2165         -width 10 \
    2166         -showvalue off -command [itcl::code $this AdjustSetting transp]
    2167     label $inner.plastic -text "Opaque" -font $fg
    21682140
    21692141    label $inner.clear -text "Clear" -font $fg
     
    21982170        3,1 $inner.light -cspan 2 -pady 2 -fill x \
    21992171        3,3 $inner.bright -anchor w -pady 2 \
    2200         4,0 $inner.fog -anchor e -pady 2 \
    2201         4,1 $inner.transp -cspan 2 -pady 2 -fill x \
    2202         4,3 $inner.plastic -anchor w -pady 2 \
     2172        4,0 $inner.clear -anchor e -pady 2 \
     2173        4,1 $inner.opacity -cspan 2 -pady 2 -fill x \
     2174        4,3 $inner.opaque -anchor w -pady 2 \
    22032175        5,0 $inner.thin -anchor e -pady 2 \
    22042176        5,1 $inner.thickness -cspan 2 -pady 2 -fill x\
  • branches/1.3/gui/scripts/nanovisviewer.tcl

    r4712 r4727  
    22502250    # Transfer function should be normalized with [0,1] range
    22512251    # The volume shading opacity setting is used to scale opacity
    2252     # in the volume shader. 
     2252    # in the volume shader.
    22532253    set max 1.0
    22542254
Note: See TracChangeset for help on using the changeset viewer.