Ignore:
Timestamp:
Jul 16, 2014, 4:24:32 PM (10 years ago)
Author:
gah
Message:

test and fixes for meshviewer, add rappture (non-viewer) bug fixes and features

File:
1 edited

Legend:

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

    r4507 r4512  
    8686    private method EventuallyResize { w h }
    8787    private method EventuallyRotate { q }
    88     private method EventuallySetPolydataOpacity { args }
     88    private method EventuallySetPolydataOpacity {}
    8989    private method GetImage { args }
    9090    private method GetVtkData { args }
     
    111111    private variable _view;             # view params for 3D view
    112112    private variable _settings
     113    private variable _widget
    113114    private variable _style;            # Array of current component styles.
    114115    private variable _initialStyle;     # Array of initial component styles.
     
    128129    private variable _polydataOpacityPending 0
    129130    private variable _rotateDelay 150
     131    private variable _opacityDelay 150
    130132}
    131133
     
    188190        -polydataedges          0
    189191        -polydatalighting       1
    190         -polydataopacity        100
     192        -polydataopacity        0.6
    191193        -polydatavisible        1
    192194        -polydatawireframe      0
     
    204206        -zposition              0
    205207    }
     208    array set _widget {
     209        -polydataopacity        0.6
     210    }       
    206211    itk_component add view {
    207212        canvas $itk_component(plotarea).view \
     
    404409    set _polydataOpacityPending 0
    405410    set val $_settings(-polydataopacity)
    406     set sval [expr { 0.01 * double($val) }]
    407     SendCmd "polydata opacity $sval"
    408 }
    409 
    410 itcl::body Rappture::VtkMeshViewer::EventuallySetPolydataOpacity { val } {
    411     set _settings(-polydataopacity) $val
     411    SendCmd "polydata opacity $val"
     412}
     413
     414itcl::body Rappture::VtkMeshViewer::EventuallySetPolydataOpacity {} {
    412415    if { !$_polydataOpacityPending } {
    413416        set _polydataOpacityPending 1
    414         $_dispatcher event -after $_scaleDelay !polydataOpacity
     417        $_dispatcher event -after $_opacityDelay !polydataOpacity
    415418    }
    416419}
     
    868871        }
    869872        lappend _obj2datasets($dataobj) $tag
    870         if { [info exists _obj2ovride($dataobj-raise)] &&
    871              $_obj2ovride($dataobj-raise) } {
     873        if { [info exists _obj2ovride($dataobj-raise)] } {
    872874            SendCmd "dataset visible 1 $tag"
    873             SetOpacity $tag
     875            EventuallySetPolydataOpacity
    874876        }
    875877    }
     
    897899            -polydatavisible -polydatawireframe
    898900 
     901        SendCmd "axis lformat all %g"
     902        # Too many major ticks, so turn off minor ticks
     903        SendCmd "axis minticks all 0"
     904
    899905        set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
    900906        $_arcball quaternion $q
     
    13501356    label $inner.opacity_l -text "Opacity" -font "Arial 9" -anchor w
    13511357    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1352         -variable [itcl::scope _settings(-polydataopacity)] \
     1358        -variable [itcl::scope _widget(-polydataopacity)] \
    13531359        -width 10 \
    13541360        -showvalue off \
    13551361        -command [itcl::code $this AdjustSetting -polydataopacity]
    1356     $inner.opacity set $_settings(-polydataopacity)
     1362    $inner.opacity set [expr $_settings(-polydataopacity) * 100.0]
    13571363
    13581364    blt::table $inner \
     
    17351741        -color white
    17361742        -edgecolor black
    1737         -lighting 1
    17381743        -linewidth 1.0
    17391744        -outline 0
    17401745        -polydataedges 1
    1741         -polydataopacity 1.0
     1746        -polydatalighting 1
     1747        -polydataopacity 0.6
    17421748        -polydatavisible 1
    17431749        -polydatawireframe 0
     
    17701776    SendCmd "polydata linewidth $settings(-linewidth) $tag"
    17711777    SendCmd "polydata opacity $settings(-polydataopacity) $tag"
    1772     set _settings(-polydataopacity) [expr 100.0 * $settings(-polydataopacity)]
     1778    set _settings(-polydataopacity) $settings(-polydataopacity)
     1779    set _widget(-polydataopacity) [expr 100.0 * $settings(-polydataopacity)]
    17731780    SendCmd "polydata wireframe $settings(-polydatawireframe) $tag"
    17741781    set _settings(-polydatawireframe) $settings(-polydatawireframe)
Note: See TracChangeset for help on using the changeset viewer.