Changeset 4776 for trunk/gui/scripts/vtkvolumeviewer.tcl
- Timestamp:
- Nov 23, 2014, 9:06:09 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkvolumeviewer.tcl
r4767 r4776 82 82 private variable _current ""; # Currently selected component 83 83 private variable _volcomponents ; # Array of components found 84 private variable _componentsList ; # Array of components found84 private variable _componentsList ; # List of component names 85 85 private variable _cname2style 86 86 private variable _cname2transferFunction … … 173 173 private variable _curFldName "" 174 174 private variable _curFldLabel "" 175 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 175 176 private variable _cutplaneCmd "imgcutplane" 176 177 private variable _allowMultiComponent 0 … … 250 251 -axisminorticks 1 251 252 -background black 253 -color "default" 252 254 -cutplanelighting 1 253 255 -cutplaneopacity 100 … … 679 681 # ---------------------------------------------------------------------- 680 682 itcl::body Rappture::VtkVolumeViewer::scale {args} { 681 array unset _limits 682 array unset _volcomponents 683 array unset _limits 684 array unset _volcomponents 685 set _componentsList "" 683 686 684 687 foreach dataobj $args { … … 688 691 # Determine limits for each axis. 689 692 foreach axis { x y z } { 690 foreach { min max } [$dataobj limits $axis] break 691 if {"" != $min && "" != $max} { 692 if { ![info exists _limits($axis)] } { 693 set _limits($axis) [list $min $max] 694 } else { 695 foreach {amin amax} $_limits($axis) break 696 if {$min < $amin} { 697 set amin $min 698 } 699 if {$max > $amax} { 700 set amax $max 701 } 702 set _limits($axis) [list $amin $amax] 703 } 704 } 693 set lim [$dataobj limits $axis] 694 if { ![info exists _limits($axis)] } { 695 set _limits($axis) $lim 696 continue 697 } 698 foreach {min max} $lim break 699 foreach {amin amax} $_limits($axis) break 700 if { $amin > $min } { 701 set amin $min 702 } 703 if { $amax < $max } { 704 set amax $max 705 } 706 set _limits($axis) [list $amin $amax] 705 707 } 706 708 # Determine limits for each field. … … 728 730 array unset limits 729 731 array set limits [$dataobj valueLimits $cname] 732 if { ![info exists _limits($cname)] } { 733 set _limits($cname) $limits(v) 734 continue 735 } 730 736 foreach {min max} $limits(v) break 731 if { ![info exists _limits($cname)] } { 732 set _limits($cname) [list $min $max] 733 } else { 734 foreach {vmin vmax} $_limits($cname) break 735 if { $min < $vmin } { 736 set vmin $min 737 } 738 if { $max > $vmax } { 739 set vmax $max 740 } 741 set _limits($cname) [list $vmin $vmax] 742 } 737 foreach {vmin vmax} $_limits($cname) break 738 if { $vmin > $min } { 739 set vmin $min 740 } 741 if { $vmax < $max } { 742 set vmax $max 743 } 744 set _limits($cname) [list $vmin $vmax] 743 745 } 744 746 } … … 1593 1595 puts stderr "Can't use a vector field in a volume" 1594 1596 return 1597 } else { 1598 if { $components > 1 } { 1599 set _colorMode vmag 1600 } else { 1601 set _colorMode scalar 1602 } 1595 1603 } 1596 1604 set _curFldName $fname … … 1601 1609 } 1602 1610 foreach dataset [CurrentDatasets -visible $_first] { 1611 #SendCmd "$_cutplaneCmd colormode $_colorMode $_curFldName $dataset" 1603 1612 SendCmd "dataset scalar $_curFldName $dataset" 1604 1613 } … … 1633 1642 SendCmdNoWait \ 1634 1643 "legend2 $_dataset2style($dataset) $w $h" 1635 #"legend $_dataset2style($dataset) scalar$_curFldName {} $w $h 0"1644 #"legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0" 1636 1645 break; 1637 1646 } … … 1828 1837 bind $inner.colormap <<Value>> \ 1829 1838 [itcl::code $this AdjustSetting -color] 1830 $itk_component(colormap) value "default" 1831 set _settings(-color) "default" 1839 $itk_component(colormap) value $_settings(-color) 1832 1840 1833 1841 label $inner.blendmode_l -text "Blend Mode" -font $font
Note: See TracChangeset
for help on using the changeset viewer.