Changeset 4664


Ignore:
Timestamp:
Nov 8, 2014, 5:32:52 AM (10 years ago)
Author:
gah
Message:

fix global opacity

Location:
branches/1.3/gui/scripts
Files:
2 edited

Legend:

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

    r4520 r4664  
    427427    set min ""
    428428    set max ""
    429     blt::vector tmp zero
    430429
    431430    foreach cname [array names _comp2dims] {
     431        puts stderr "cname=$cname dims=$_comp2dims($cname)"
    432432        switch -- $_comp2dims($cname) {
    433433            1D {
     
    453453
    454454                if {$log} {
     455                    blt::vector tmp zero
    455456                    # on a log scale, use abs value and ignore 0's
    456457                    $vname dup tmp
     
    461462                    set axisMin [blt::vector expr min(tmp)]
    462463                    set axisMax [blt::vector expr max(tmp)]
     464                    blt::vector destroy tmp zero
    463465                } else {
    464466                    set axisMin [$vname min]
     
    477479                }
    478480            }
    479             2D - 3D {
     481            default {
    480482                if {[info exists _comp2limits($cname)]} {
    481483                    array set limits $_comp2limits($cname)
     
    519521        }
    520522    }
    521     blt::vector destroy tmp zero
    522523    set val [$_field get "${axis}axis.min"]
    523524    if {"" != $val && "" != $min} {
     
    919920                continue;               # Ignore this component
    920921            }
    921             if 0 {
     922            if 1 {
    922923                set f [open /tmp/$_path.$cname.dx "w"]
    923924                puts -nonewline $f $contents
  • branches/1.3/gui/scripts/nanovisviewer.tcl

    r4662 r4664  
    238238        -thickness              350
    239239        -volume                 1
    240         -volumeopacity          0.5
     240        -volumeopacity          1.0
    241241        -volumevisible          1
    242242        -xcutplaneposition      50
     
    251251    }
    252252    array set _widget {
    253         -volumeopacity          0.5
     253        -volumeopacity          100
    254254    }
    255255    itk_component add 3dview {
     
    13141314            set _settings($what) [expr $_widget($what) * 0.01]
    13151315            set _settings($_current${what}) $_settings($what)
    1316             foreach tag [GetDatasetsWithComponent $_current] {
    1317                 SendCmd "volume shading opacity $_settings($what) $tag"
    1318             }
     1316       
     1317            foreach {cmap wmap} $_cname2transferFunction($_current) break
     1318            set wmap [ComputeAlphamap $_current]
     1319            set _cname2transferFunction($_current) [list $cmap $wmap]
     1320            SendCmd [list transfunc define $_current $cmap $wmap]
    13191321        }
    13201322        "-volumevisible" {
     
    21032105        -light2side        1
    21042106        -thickness         350
    2105         -volumeopacity     0.5
     2107        -volumeopacity     1.0
    21062108        -volumevisible     1
    21072109    } {
     
    22442246
    22452247    # Currently using volume shading opacity to scale opacity in
    2246     # the volume shader. The transfer function always sets full
    2247     # opacity
    2248     set max 1.0
     2248    # the volume shader.
     2249    set max $_settings($cname-volumeopacity)
    22492250
    22502251    # Use the component-wise thickness setting from the slider
     
    24682469itcl::body Rappture::NanovisViewer::SetObjectStyle { dataobj cname } {
    24692470    array set styles {
    2470         -opacity  0.6
    2471     }
    2472     array set styles [lindex [$dataobj components -style $cname] 0]
    2473     set _settings($cname-volumeopacity) $styles(-opacity)
    2474     NameTransferFunction $dataobj $cname
    2475 }
    2476 
    2477 
    2478 
    2479 
     2471-opacity  0.6
     2472}
     2473array set styles [lindex [$dataobj components -style $cname] 0]
     2474set _settings($cname-volumeopacity) $styles(-opacity)
     2475NameTransferFunction $dataobj $cname
     2476}
     2477
     2478
     2479
     2480
Note: See TracChangeset for help on using the changeset viewer.