Changeset 2742 for branches/blt4/gui/scripts/nanovisviewer.tcl
- Timestamp:
- Dec 27, 2011 12:41:24 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/gui/scripts/nanovisviewer.tcl
r2048 r2742 156 156 private variable _first "" ;# This is the topmost volume. 157 157 private variable _buffering 0 158 158 159 159 # This 160 160 # indicates which isomarkers and transfer … … 181 181 # ---------------------------------------------------------------------- 182 182 itcl::body Rappture::NanovisViewer::constructor {hostlist args} { 183 set _serverType "nanovis" 183 184 184 185 # Draw legend event … … 237 238 238 239 itk_component add 3dview { 239 label $itk_component(plotarea).v ol-image $_image(plot) \240 label $itk_component(plotarea).view -image $_image(plot) \ 240 241 -highlightthickness 0 -borderwidth 0 241 242 } { … … 749 750 if { ![info exists _vol2style($vol)] } { 750 751 puts stderr "unknown volume $vol" 751 continue; 752 continue; # How does this happen? 752 753 } 753 754 set tf $_vol2style($vol) … … 843 844 } 844 845 } 846 847 # The colormap may have changed. Resync the slicers with the colormap. 848 set vols [CurrentVolumes -cutplanes] 849 SendCmd "volume data state $_settings($this-volume) $vols" 850 851 # Adjust the cutplane for only the first component in the topmost volume 852 # (i.e. the first volume designated in the field). 853 set vol [lindex $vols 0] 854 foreach axis {x y z} { 855 # Turn off cutplanes for all volumes 856 SendCmd "cutplane state 0 $axis" 857 if { $_settings($this-${axis}cutplane) } { 858 # Turn on cutplane for this particular volume and set the position 859 SendCmd "cutplane state 1 $axis $vol" 860 set pos [expr {0.01*$_settings($this-${axis}cutposition)}] 861 SendCmd "cutplane position $pos $axis $vol" 862 } 863 } 845 864 } 846 865 … … 985 1004 updatetransferfuncs 986 1005 } 987 988 # Sync the state of slicers989 set vols [CurrentVolumes -cutplanes]990 1006 foreach axis {x y z} { 991 SendCmd "cutplane state $_settings($this-${axis}cutplane) $axis $vols" 992 set pos [expr {0.01*$_settings($this-${axis}cutposition)}] 993 SendCmd "cutplane position $pos $axis $vols" 994 } 995 SendCmd "volume data state $_settings($this-volume) $vols" 996 set _buffering 0; # Turn off buffering. 1007 # Turn off cutplanes for all volumes 1008 SendCmd "cutplane state 0 $axis" 1009 } 1010 set _buffering 0; # Turn off buffering. 997 1011 # Actually write the commands to the server socket. If it fails, we don't 998 1012 # care. We're finished here. 999 1013 blt::busy hold $itk_component(hull) 1000 SendBytes $_outbuf; 1014 SendBytes $_outbuf; 1001 1015 blt::busy release $itk_component(hull) 1002 set _outbuf ""; # Clear the buffer.1016 set _outbuf ""; # Clear the buffer. 1003 1017 } 1004 1018 … … 1022 1036 } 1023 1037 array set style [lindex [$_first components -style $comp] 0] 1024 if { $what != "-cutplanes" || $style(-cutplanes)} {1038 if { $what != "-cutplanes" || $style(-cutplanes) } { 1025 1039 lappend rlist $vol 1026 1040 } … … 1300 1314 if { [isconnected] } { 1301 1315 set vols [CurrentVolumes -cutplanes] 1302 SendCmd "cutplane state $bool $axis $vols" 1316 set vol [lindex $vols 0] 1317 SendCmd "cutplane state $bool $axis $vol" 1303 1318 } 1304 1319 if { $bool } { … … 1992 2007 set newpos [expr {0.01*$newval}] 1993 2008 set vols [CurrentVolumes -cutplanes] 1994 SendCmd "cutplane position $newpos $axis $vols" 2009 set vol [lindex $vols 0] 2010 SendCmd "cutplane position $newpos $axis $vol" 1995 2011 } 1996 2012 default {
Note: See TracChangeset
for help on using the changeset viewer.