Changeset 4512 for branches/1.3/gui/scripts/vtkmeshviewer.tcl
- Timestamp:
- Jul 16, 2014, 4:24:32 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3/gui/scripts/vtkmeshviewer.tcl
r4507 r4512 86 86 private method EventuallyResize { w h } 87 87 private method EventuallyRotate { q } 88 private method EventuallySetPolydataOpacity { args}88 private method EventuallySetPolydataOpacity {} 89 89 private method GetImage { args } 90 90 private method GetVtkData { args } … … 111 111 private variable _view; # view params for 3D view 112 112 private variable _settings 113 private variable _widget 113 114 private variable _style; # Array of current component styles. 114 115 private variable _initialStyle; # Array of initial component styles. … … 128 129 private variable _polydataOpacityPending 0 129 130 private variable _rotateDelay 150 131 private variable _opacityDelay 150 130 132 } 131 133 … … 188 190 -polydataedges 0 189 191 -polydatalighting 1 190 -polydataopacity 100192 -polydataopacity 0.6 191 193 -polydatavisible 1 192 194 -polydatawireframe 0 … … 204 206 -zposition 0 205 207 } 208 array set _widget { 209 -polydataopacity 0.6 210 } 206 211 itk_component add view { 207 212 canvas $itk_component(plotarea).view \ … … 404 409 set _polydataOpacityPending 0 405 410 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 414 itcl::body Rappture::VtkMeshViewer::EventuallySetPolydataOpacity {} { 412 415 if { !$_polydataOpacityPending } { 413 416 set _polydataOpacityPending 1 414 $_dispatcher event -after $_ scaleDelay !polydataOpacity417 $_dispatcher event -after $_opacityDelay !polydataOpacity 415 418 } 416 419 } … … 868 871 } 869 872 lappend _obj2datasets($dataobj) $tag 870 if { [info exists _obj2ovride($dataobj-raise)] && 871 $_obj2ovride($dataobj-raise) } { 873 if { [info exists _obj2ovride($dataobj-raise)] } { 872 874 SendCmd "dataset visible 1 $tag" 873 SetOpacity $tag875 EventuallySetPolydataOpacity 874 876 } 875 877 } … … 897 899 -polydatavisible -polydatawireframe 898 900 901 SendCmd "axis lformat all %g" 902 # Too many major ticks, so turn off minor ticks 903 SendCmd "axis minticks all 0" 904 899 905 set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)] 900 906 $_arcball quaternion $q … … 1350 1356 label $inner.opacity_l -text "Opacity" -font "Arial 9" -anchor w 1351 1357 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1352 -variable [itcl::scope _ settings(-polydataopacity)] \1358 -variable [itcl::scope _widget(-polydataopacity)] \ 1353 1359 -width 10 \ 1354 1360 -showvalue off \ 1355 1361 -command [itcl::code $this AdjustSetting -polydataopacity] 1356 $inner.opacity set $_settings(-polydataopacity)1362 $inner.opacity set [expr $_settings(-polydataopacity) * 100.0] 1357 1363 1358 1364 blt::table $inner \ … … 1735 1741 -color white 1736 1742 -edgecolor black 1737 -lighting 11738 1743 -linewidth 1.0 1739 1744 -outline 0 1740 1745 -polydataedges 1 1741 -polydataopacity 1.0 1746 -polydatalighting 1 1747 -polydataopacity 0.6 1742 1748 -polydatavisible 1 1743 1749 -polydatawireframe 0 … … 1770 1776 SendCmd "polydata linewidth $settings(-linewidth) $tag" 1771 1777 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)] 1773 1780 SendCmd "polydata wireframe $settings(-polydatawireframe) $tag" 1774 1781 set _settings(-polydatawireframe) $settings(-polydatawireframe)
Note: See TracChangeset
for help on using the changeset viewer.