Changeset 5299 for branches/1.4
- Timestamp:
- Apr 23, 2015, 3:46:41 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.4/gui/scripts/nanovisviewer.tcl
r5295 r5299 143 143 private variable _transferFunctionEditors 144 144 private variable _settings 145 private variable _widget146 145 147 146 private variable _first "" ;# This is the topmost volume. … … 222 221 -light 40 223 222 -light2side 1 223 -opacity 50 224 224 -outlinevisible 0 225 225 -qw 0.853553 … … 229 229 -thickness 350 230 230 -volume 1 231 -volumeopacity 0.5232 231 -volumevisible 1 233 232 -xcutplaneposition 50 … … 240 239 -zcutplanevisible 1 241 240 -zoom 1.0 242 }243 array set _widget {244 -volumeopacity 50245 241 } 246 242 itk_component add 3dview { … … 962 958 } 963 959 964 InitSettings -light2side -light - volumeopacity \960 InitSettings -light2side -light -opacity \ 965 961 -isosurfaceshading -gridvisible -axesvisible \ 966 962 -xcutplanevisible -ycutplanevisible -zcutplanevisible … … 1279 1275 } 1280 1276 } 1277 "-opacity" { 1278 set _settings($_current${what}) $_settings($what) 1279 set val $_settings($what) 1280 set sval [expr { 0.01 * double($val) }] 1281 foreach tag [GetDatasetsWithComponent $_current] { 1282 SendCmd "volume shading opacity $sval $tag" 1283 } 1284 } 1281 1285 "-outlinevisible" { 1282 1286 SendCmd "volume outline state $_settings($what)" … … 1299 1303 } 1300 1304 set _settings(-volumevisible) $bool 1301 }1302 "-volumeopacity" {1303 set _settings($what) [expr $_widget($what) * 0.01]1304 set _settings($_current${what}) $_settings($what)1305 foreach tag [GetDatasetsWithComponent $_current] {1306 SendCmd "volume shading opacity $_settings($what) $tag"1307 }1308 1305 } 1309 1306 "-volumevisible" { … … 1661 1658 label $inner.opacity_l -text "Opacity" -font $fg 1662 1659 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 1663 -variable [itcl::scope _widget(-volumeopacity)] \ 1664 -showvalue off \ 1665 -command [itcl::code $this AdjustSetting -volumeopacity] \ 1660 -variable [itcl::scope _settings(-opacity)] \ 1661 -showvalue off -command [itcl::code $this AdjustSetting -opacity] \ 1666 1662 -troughcolor grey92 1667 1663 … … 2006 2002 -light 40 2007 2003 -light2side 1 2004 -opacity 50 2008 2005 -thickness 350 2009 -volumeopacity 1.02010 2006 -volumevisible 1 2011 2007 } { … … 2035 2031 set _settings(-light) $_settings($cname-light) 2036 2032 set _settings(-light2side) $_settings($cname-light2side) 2037 set _settings(- volumeopacity) $_settings($cname-volumeopacity)2033 set _settings(-opacity) $_settings($cname-opacity) 2038 2034 set _settings(-thickness) $_settings($cname-thickness) 2039 2035 set _settings(-volumevisible) $_settings($cname-volumevisible) 2040 2036 $itk_component(colormap) value $_settings($cname-colormap) 2041 2042 set _widget(-volumeopacity) [expr $_settings(-volumeopacity) * 100.0]2043 2044 2037 set _current $cname; # Reset the current component 2045 2038 } … … 2195 2188 itcl::body Rappture::NanovisViewer::SetObjectStyle { dataobj cname } { 2196 2189 array set style { 2197 -opacity 2190 -opacity 0.5 2198 2191 } 2199 2192 array set style [lindex [$dataobj components -style $cname] 0] … … 2201 2194 # override the requested opacity for now 2202 2195 set style(-opacity) 0.5 2203 set _settings($cname- volumeopacity) $style(-opacity)2196 set _settings($cname-opacity) [expr $style(-opacity) * 100.0] 2204 2197 set tag $dataobj-$cname 2205 SendCmd "volume shading opacity $ _settings($cname-volumeopacity) $tag"2198 SendCmd "volume shading opacity $style(-opacity) $tag" 2206 2199 NameTransferFunction $dataobj $cname 2207 2200 }
Note: See TracChangeset
for help on using the changeset viewer.