Changeset 5187 for branches/1.4
- Timestamp:
- Apr 2, 2015, 9:28:24 AM (10 years ago)
- Location:
- branches/1.4/gui/scripts
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.4/gui/scripts/flowvisviewer.tcl
r5183 r5187 717 717 # ---------------------------------------------------------------------- 718 718 itcl::body Rappture::FlowvisViewer::scale {args} { 719 array set style s{719 array set style { 720 720 -color BCGYR 721 721 -levels 6 … … 732 732 if { ![info exists _volcomponents($cname)] } { 733 733 lappend _componentsList $cname 734 array set style s[lindex [$dataobj components -style $cname] 0]735 set cmap [ColorsToColormap $style s(-color)]734 array set style [lindex [$dataobj components -style $cname] 0] 735 set cmap [ColorsToColormap $style(-color)] 736 736 set _cname2defaultcolormap($cname) $cmap 737 set _settings($cname-colormap) $style s(-color)737 set _settings($cname-colormap) $style(-color) 738 738 } 739 739 lappend _volcomponents($cname) $dataobj-$cname … … 1255 1255 foreach key [array names _serverObjs *-*] { 1256 1256 if {[string match $_first-* $key]} { 1257 array set style s{1257 array set style { 1258 1258 -cutplanes 1 1259 1259 } 1260 1260 foreach {dataobj comp} [split $key -] break 1261 array set style s[lindex [$dataobj components -style $comp] 0]1262 if {$what != "-cutplanes" || $style s(-cutplanes)} {1261 array set style [lindex [$dataobj components -style $comp] 0] 1262 if {$what != "-cutplanes" || $style(-cutplanes)} { 1263 1263 lappend rlist $_serverObjs($key) 1264 1264 } … … 1694 1694 # 1695 1695 itcl::body Rappture::FlowvisViewer::NameTransferFunc { dataobj cname } { 1696 array set style s{1696 array set style { 1697 1697 -color BCGYR 1698 1698 -levels 6 1699 1699 -opacity 0.5 1700 1700 } 1701 array set style s[lindex [$dataobj components -style $cname] 0]1702 set _settings($this-opacity) [expr $style s(-opacity) * 100]1701 array set style [lindex [$dataobj components -style $cname] 0] 1702 set _settings($this-opacity) [expr $style(-opacity) * 100] 1703 1703 set _obj2style($dataobj-$cname) $cname 1704 1704 lappend _style2objs($cname) $dataobj $cname … … 1716 1716 # 1717 1717 itcl::body Rappture::FlowvisViewer::ComputeTransferFunc { tf } { 1718 array set style s{1718 array set style { 1719 1719 -color BCGYR 1720 1720 -levels 6 … … 1726 1726 return 0 1727 1727 } 1728 array set style s[lindex [$dataobj components -style $comp] 0]1728 array set style [lindex [$dataobj components -style $comp] 0] 1729 1729 1730 1730 # We have to parse the style attributes for a volume using this … … 1743 1743 if { ![info exists _isomarkers($tf)] } { 1744 1744 # Have to defer creation of isomarkers until we have data limits 1745 if { [info exists style s(-markers)] &&1746 [llength $style s(-markers)] > 0 } {1747 ParseMarkersOption $tf $style s(-markers)1745 if { [info exists style(-markers)] && 1746 [llength $style(-markers)] > 0 } { 1747 ParseMarkersOption $tf $style(-markers) 1748 1748 } else { 1749 ParseLevelsOption $tf $style s(-levels)1750 } 1751 } 1752 if { [info exists style s(-nonuniformcolors)] } {1753 foreach { value color } $style s(-nonuniformcolors) {1749 ParseLevelsOption $tf $style(-levels) 1750 } 1751 } 1752 if { [info exists style(-nonuniformcolors)] } { 1753 foreach { value color } $style(-nonuniformcolors) { 1754 1754 append cmap "$value [Color2RGB $color] " 1755 1755 } 1756 1756 } else { 1757 set cmap [ColorsToColormap $style s(-color)]1757 set cmap [ColorsToColormap $style(-color)] 1758 1758 } 1759 1759 1760 1760 if { ![info exists _settings($this-opacity)] } { 1761 set _settings($this-opacity) [expr $style s(-opacity) * 100]1761 set _settings($this-opacity) [expr $style(-opacity) * 100] 1762 1762 } 1763 1763 -
branches/1.4/gui/scripts/nanovisviewer.tcl
r5183 r5187 562 562 # ---------------------------------------------------------------------- 563 563 itcl::body Rappture::NanovisViewer::scale {args} { 564 array set style s{564 array set style { 565 565 -color BCGYR 566 566 -levels 6 … … 576 576 if { ![info exists _volcomponents($cname)] } { 577 577 lappend _componentsList $cname 578 array set style s[lindex [$dataobj components -style $cname] 0]579 set cmap [ColorsToColormap $style s(-color)]578 array set style [lindex [$dataobj components -style $cname] 0] 579 set cmap [ColorsToColormap $style(-color)] 580 580 set _cname2defaultcolormap($cname) $cmap 581 set _settings($cname-colormap) $style s(-color)581 set _settings($cname-colormap) $style(-color) 582 582 } 583 583 lappend _volcomponents($cname) $dataobj-$cname … … 1028 1028 set tag $_first-$cname 1029 1029 if { [info exists _serverDatasets($tag)] && $_serverDatasets($tag) } { 1030 array set style s{1030 array set style { 1031 1031 -cutplanes 1 1032 1032 } 1033 array set style s[lindex [$_first components -style $cname] 0]1034 if { $what != "-cutplanes" || $style s(-cutplanes) } {1033 array set style [lindex [$_first components -style $cname] 0] 1034 if { $what != "-cutplanes" || $style(-cutplanes) } { 1035 1035 lappend rlist $tag 1036 1036 } … … 1388 1388 # 1389 1389 itcl::body Rappture::NanovisViewer::NameTransferFunction { dataobj cname } { 1390 array set style s{1390 array set style { 1391 1391 -color BCGYR 1392 1392 -levels 6 … … 1394 1394 } 1395 1395 set tag $dataobj-$cname 1396 array set style s[lindex [$dataobj components -style $cname] 0]1396 array set style [lindex [$dataobj components -style $cname] 0] 1397 1397 if { ![info exists _cname2transferFunction($cname)] } { 1398 1398 # Get the colormap right now, since it doesn't change with marker 1399 1399 # changes. 1400 set cmap [ColorsToColormap $style s(-color)]1400 set cmap [ColorsToColormap $style(-color)] 1401 1401 set amap [list 0.0 0.0 1.0 1.0] 1402 1402 set _cname2transferFunction($cname) [list $cmap $amap] … … 1434 1434 # reference. 1435 1435 if { ![info exists _parsedFunction($cname)] } { 1436 array set style s{1436 array set style { 1437 1437 -color BCGYR 1438 1438 -levels 6 … … 1442 1442 foreach tag [GetDatasetsWithComponent $cname] { 1443 1443 foreach {dataobj cname} [split [lindex $tag 0] -] break 1444 array set style s[lindex [$dataobj components -style $cname] 0]1444 array set style [lindex [$dataobj components -style $cname] 0] 1445 1445 } 1446 1446 eval $_transferFunctionEditors($cname) limits $_limits($cname) 1447 1447 # Have to defer creation of isomarkers until we have data limits 1448 if { [info exists style s(-markers)] &&1449 [llength $style s(-markers)] > 0 } {1450 ParseMarkersOption $cname $style s(-markers)1448 if { [info exists style(-markers)] && 1449 [llength $style(-markers)] > 0 } { 1450 ParseMarkersOption $cname $style(-markers) 1451 1451 } else { 1452 ParseLevelsOption $cname $style s(-levels)1452 ParseLevelsOption $cname $style(-levels) 1453 1453 } 1454 1454 … … 2478 2478 2479 2479 itcl::body Rappture::NanovisViewer::SetObjectStyle { dataobj cname } { 2480 array set style s{2480 array set style { 2481 2481 -opacity 0.5 2482 2482 } 2483 array set style s[lindex [$dataobj components -style $cname] 0]2484 set _settings($cname-volumeopacity) $style s(-opacity)2483 array set style [lindex [$dataobj components -style $cname] 0] 2484 set _settings($cname-volumeopacity) $style(-opacity) 2485 2485 set tag $dataobj-$cname 2486 2486 SendCmd "volume shading opacity $_settings($cname-volumeopacity) $tag" -
branches/1.4/gui/scripts/vtkglyphviewer.tcl
r5183 r5187 129 129 private variable _view ; # view params for 3D view 130 130 private variable _settings 131 private variable _style; # Array of current component styles.132 131 private variable _changed 133 private variable _initialStyle; # Array of initial component styles.134 132 private variable _reset 1; # Connection to server has been reset. 135 133 -
branches/1.4/gui/scripts/vtkheightmapviewer.tcl
r5183 r5187 138 138 private variable _settings 139 139 private variable _changed 140 private variable _initialStyle ""; # First found style in dataobjects.141 140 private variable _reset 1; # Connection to server has been reset. 142 141 -
branches/1.4/gui/scripts/vtkimageviewer.tcl
r5183 r5187 133 133 private variable _settings 134 134 private variable _changed 135 private variable _initialStyle ""; # First found style in dataobjects.136 135 private variable _reset 1; # Connection to server has been reset. 137 136 -
branches/1.4/gui/scripts/vtkisosurfaceviewer.tcl
r5183 r5187 146 146 private variable _view ; # view params for 3D view 147 147 private variable _settings 148 private variable _style; # Array of current component styles.149 148 private variable _changed 150 private variable _initialStyle; # Array of initial component styles.151 149 private variable _reset 1; # Connection to server has been reset. 152 150 -
branches/1.4/gui/scripts/vtkmeshviewer.tcl
r5172 r5187 113 113 private variable _settings 114 114 private variable _widget 115 private variable _style; # Array of current component styles.116 private variable _initialStyle; # Array of initial component styles.117 115 private variable _reset 1; # Connection to server has been reset. 118 116 -
branches/1.4/gui/scripts/vtksurfaceviewer.tcl
r5183 r5187 129 129 private variable _view ; # view params for 3D view 130 130 private variable _settings 131 private variable _style; # Array of current component styles.132 131 private variable _changed 133 private variable _initialStyle; # Array of initial component styles.134 132 private variable _reset 1; # Connection to server has been reset. 135 133 -
branches/1.4/gui/scripts/vtkvolumeviewer.tcl
r5185 r5187 2128 2128 # Parse style string. 2129 2129 set tag $dataobj-$cname 2130 array set style s{2130 array set style { 2131 2131 -lighting 1 2132 2132 -opacity 0.5 … … 2134 2134 -visible 1 2135 2135 } 2136 array set style s[$dataobj style $cname]2137 set _settings(-volumelighting) $style s(-lighting)2138 set _settings(-volumeopacity) [expr $style s(-opacity) * 100.0]2139 set _settings(-volumeoutline) $style s(-outline)2140 set _settings(-volumevisible) $style s(-visible)2136 array set style [$dataobj style $cname] 2137 set _settings(-volumelighting) $style(-lighting) 2138 set _settings(-volumeopacity) [expr $style(-opacity) * 100.0] 2139 set _settings(-volumeoutline) $style(-outline) 2140 set _settings(-volumevisible) $style(-visible) 2141 2141 2142 2142 SendCmd "outline add $tag" 2143 2143 SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag" 2144 SendCmd "outline visible $style s(-outline) $tag"2144 SendCmd "outline visible $style(-outline) $tag" 2145 2145 2146 2146 SendCmd "$_cutplaneCmd add $tag" … … 2149 2149 2150 2150 SendCmd "volume add $tag" 2151 SendCmd "volume lighting $style s(-lighting) $tag"2152 SendCmd "volume opacity $style s(-opacity) $tag"2153 SendCmd "volume visible $style s(-visible) $tag"2151 SendCmd "volume lighting $style(-lighting) $tag" 2152 SendCmd "volume opacity $style(-opacity) $tag" 2153 SendCmd "volume visible $style(-visible) $tag" 2154 2154 SetColormap $dataobj $cname 2155 2155 }
Note: See TracChangeset
for help on using the changeset viewer.