Ignore:
Timestamp:
Jun 10, 2014 10:49:12 PM (7 years ago)
Author:
ldelgass
Message:

opacity style setting fixes for VTK viewers (expect vtkvolumeviewer which does
not yet support the style setting). Also note that nanovisviewer (and
flowvisviewer?) have a regression which changes the -opacity style to [0,100]
instead of [0,1]

File:
1 edited

Legend:

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

    r4352 r4381  
    120120    private variable _currentColormap ""
    121121    private variable _currentNumContours -1
    122     private variable _currentOpacity ""
    123122
    124123    private variable _dataset2style    ;# maps dataobj-component to transfunc
     
    238237        -isosurfacelighting             1
    239238        -isosurfaceopacity              60
    240         -isosurfaceoutline              0
    241239        -isosurfacevisible              1
    242240        -isosurfacewireframe            0
    243241        -legendvisible                  1
    244242        -numcontours                    10
     243        -outline                        0
    245244        -xaxisgrid                      0
    246245        -xcutplaneposition              50
     
    341340    $itk_component(contour) select
    342341    Rappture::Tooltip::for $itk_component(contour) \
    343         "Don't display the isosurface"
     342        "Hide the isosurface"
    344343    pack $itk_component(contour) -padx 2 -pady 2
    345344
     
    352351    }
    353352    Rappture::Tooltip::for $itk_component(cutplane) \
    354         "Show/Hide cutplanes"
     353        "Show the cutplanes"
    355354    pack $itk_component(cutplane) -padx 2 -pady 2
    356355
     
    969968    }
    970969    set _first ""
    971     SendCmd "contour3d visible 0"
     970    SendCmd "dataset visible 0"
    972971    foreach dataobj [get -objects] {
    973972        if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
     
    10031002            lappend _obj2datasets($dataobj) $tag
    10041003            if { [info exists _obj2ovride($dataobj-raise)] } {
    1005                 # Setting dataset visible enables outline
    1006                 # and contour3d
    10071004                SendCmd "contour3d visible 1 $tag"
    10081005            }
     
    10391036        $itk_component(field) value $_curFldLabel
    10401037    }
    1041     InitSettings -cutplanesvisible -isosurfacevisible -isosurfaceoutline
     1038    InitSettings -cutplanesvisible -isosurfacevisible -outline
    10421039    if { $_reset } {
    10431040        # These are settings that rely on a dataset being loaded.
     
    14421439            SendCmd "contour3d edges $bool"
    14431440        }
    1444         "-isosurfaceoutline" {
     1441        "-outline" {
    14451442            set bool $_settings($what)
    14461443            SendCmd "outline visible $bool"
     
    16131610    checkbutton $inner.outline \
    16141611        -text "Outline" \
    1615         -variable [itcl::scope _settings(-isosurfaceoutline)] \
    1616         -command [itcl::code $this AdjustSetting -isosurfaceoutline] \
     1612        -variable [itcl::scope _settings(-outline)] \
     1613        -command [itcl::code $this AdjustSetting -outline] \
    16171614        -font "Arial 9"
    16181615
     
    21292126
    21302127    if { $_changed(-isosurfaceopacity) } {
    2131         set style(-opacity) $_settings(-isosurfaceopacity)
     2128        set style(-opacity) [expr $_settings(-isosurfaceopacity) * 0.01]
    21322129    }
    21332130    if { $_changed(-numcontours) } {
     
    21412138        $itk_component(colormap) value $style(-color)
    21422139    }
    2143     set _currentOpacity $style(-opacity)
    21442140    if { $_currentNumContours != $style(-levels) } {
    21452141        set _currentNumContours $style(-levels)
     
    21632159    SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag"
    21642160    SendCmd "outline visible $style(-outline) $tag"
    2165     set _settings(-isosurfaceoutline) $style(-outline)
     2161    set _settings(-outline) $style(-outline)
    21662162    set _settings(-isosurfaceedges) $style(-edges)
    21672163    #SendCmd "contour3d color [Color2RGB $settings(-color)] $tag"
     
    21702166    SendCmd "contour3d linecolor [Color2RGB $style(-edgecolor)] $tag"
    21712167    SendCmd "contour3d linewidth $style(-linewidth) $tag"
    2172     SendCmd "contour3d opacity $_currentOpacity $tag"
    2173     set _settings(-isosurfaceopacity) $style(-opacity)
     2168    SendCmd "contour3d opacity $style(-opacity) $tag"
     2169    set _settings(-isosurfaceopacity) [expr $style(-opacity) * 100.0]
    21742170    SetCurrentColormap $style(-color)
    21752171    SendCmd "contour3d wireframe $style(-wireframe) $tag"
    21762172    set _settings(-isosurfacewireframe) $style(-wireframe)
    2177     set _settings(-isosurfaceopacity) [expr $style(-opacity) * 100.0]
    21782173}
    21792174
Note: See TracChangeset for help on using the changeset viewer.