- Timestamp:
- Jul 21, 2015, 1:06:22 PM (9 years ago)
- Location:
- branches/1.4
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.4
-
branches/1.4/gui/scripts/vtkglyphviewer.tcl
r5666 r5773 132 132 private variable _start 0 133 133 private variable _title "" 134 135 private common _downloadPopup; # download options from popup136 private common _hardcopy137 134 private variable _width 0 138 135 private variable _height 0 … … 143 140 private variable _field "" 144 141 private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar) 145 private variable _fieldNames {}146 142 private variable _fields 147 143 private variable _curFldName "" 148 144 private variable _curFldLabel "" 145 146 private common _downloadPopup; # download options from popup 147 private common _hardcopy 149 148 } 150 149 … … 1552 1551 } 1553 1552 # Set the legend on the first heightmap dataset. 1554 if { $_currentColormap != "" 1553 if { $_currentColormap != "" } { 1555 1554 set cmap $_currentColormap 1556 1555 if { ![info exists _colormaps($cmap)] } { -
branches/1.4/gui/scripts/vtkheightmapviewer.tcl
r5756 r5773 143 143 private variable _isolines 144 144 private variable _contourList "" 145 146 private common _downloadPopup; # download options from popup147 private common _hardcopy148 145 private variable _width 0 149 146 private variable _height 0 … … 153 150 private variable _rotatePending 0 154 151 private variable _legendPending 0 155 private variable _fieldNames {}156 152 private variable _fields 157 153 private variable _curFldName "" 158 154 private variable _curFldLabel "" 159 155 private variable _colorMode "scalar";# Mode of colormap (vmag or scalar) 156 157 private common _downloadPopup; # download options from popup 158 private common _hardcopy 160 159 } 161 160 … … 1724 1723 } 1725 1724 # Set the legend on the first heightmap dataset. 1726 if { $_currentColormap != "" 1725 if { $_currentColormap != "" } { 1727 1726 set cmap $_currentColormap 1728 1727 if { ![info exists _colormaps($cmap)] } { -
branches/1.4/gui/scripts/vtkimageviewer.tcl
r5349 r5773 138 138 private variable _isolines 139 139 private variable _contourList "" 140 141 private common _downloadPopup; # download options from popup142 private common _hardcopy143 140 private variable _width 0 144 141 private variable _height 0 … … 148 145 private variable _rotatePending 0 149 146 private variable _legendPending 0 150 private variable _fieldNames {}151 147 private variable _fields 152 148 private variable _curFldName "" 153 149 private variable _curFldLabel "" 154 150 private variable _colorMode "scalar";# Mode of colormap (vmag or scalar) 151 152 private common _downloadPopup; # download options from popup 153 private common _hardcopy 155 154 } 156 155 -
branches/1.4/gui/scripts/vtkisosurfaceviewer.tcl
r5388 r5773 153 153 private variable _currentLimits "" 154 154 private variable _widget 155 156 private common _downloadPopup; # download options from popup157 private common _hardcopy158 155 private variable _width 0 159 156 private variable _height 0 … … 164 161 private variable _field "" 165 162 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 166 private variable _fieldNames {}167 163 private variable _fields 168 164 private variable _curFldName "" 169 165 private variable _curFldLabel "" 170 171 166 private variable _mouseOver ""; # what called LegendRangeAction, vmin or vmax 172 167 private variable _customRangeClick 1; # what called ToggleCustomRange 168 169 private common _downloadPopup; # download options from popup 170 private common _hardcopy 173 171 } 174 172 … … 1670 1668 } 1671 1669 # Set the legend on the first isosurface dataset. 1672 if { $_currentColormap != "" 1670 if { $_currentColormap != "" } { 1673 1671 set cmap $_currentColormap 1674 1672 if { ![info exists _colormaps($cmap)] } { -
branches/1.4/gui/scripts/vtkmeshviewer.tcl
r5660 r5773 113 113 private variable _start 0 114 114 private variable _title "" 115 116 private common _downloadPopup; # download options from popup117 private common _hardcopy118 115 private variable _width 0 119 116 private variable _height 0 … … 123 120 private variable _rotateDelay 150 124 121 private variable _opacityDelay 150 122 123 private common _downloadPopup; # download options from popup 124 private common _hardcopy 125 125 } 126 126 … … 860 860 } 861 861 if {"" != $_first} { 862 set location [$_first hints camera]863 if { $location != "" } {864 array set view $location865 }866 867 862 foreach axis { x y z } { 868 863 set label [$_first label ${axis}] -
branches/1.4/gui/scripts/vtkstreamlinesviewer.tcl
r5766 r5773 66 66 private method BuildAxisTab {} 67 67 private method BuildCameraTab {} 68 private method BuildColormap { name colors}68 private method BuildColormap { name } 69 69 private method BuildCutplaneTab {} 70 70 private method BuildDownloadPopup { widget command } … … 102 102 private method RequestLegend {} 103 103 private method Rotate {option x y} 104 private method SetColormap { dataobj comp } 105 private method ChangeColormap { dataobj comp color } 104 private method SetCurrentColormap { color } 106 105 private method SetLegendTip { x y } 107 106 private method SetObjectStyle { dataobj comp } … … 121 120 private variable _colormaps ; # contains all the colormaps 122 121 ; # in the server. 123 private variable _ dataset2style ;# maps dataobj-component to transfunc122 private variable _currentColormap "" 124 123 125 124 private variable _click ; # info used for rotate operations … … 127 126 private variable _view ; # view params for 3D view 128 127 private variable _settings 129 private variable _style; # Array of current component styles.130 private variable _initialStyle; # Array of initial component styles.131 128 private variable _reset 1; # Connection to server has been reset. 132 129 … … 849 846 array unset _colormaps 850 847 array unset _seeds 851 array unset _dataset2style852 848 } 853 849 … … 1010 1006 } 1011 1007 if {"" != $_first} { 1012 set location [$_first hints camera]1013 if { $location != "" } {1014 array set view $location1015 }1016 1008 foreach axis { x y z } { 1017 1009 set label [$_first hints ${axis}label] … … 1444 1436 set colormap [$itk_component(colormap) value] 1445 1437 set _settings($what) $colormap 1446 foreach dataset [CurrentDatasets -visible $_first] { 1447 foreach {dataobj comp} [split $dataset -] break 1448 ChangeColormap $dataobj $comp $colormap 1449 } 1438 SetCurrentColormap $colormap 1450 1439 set _legendPending 1 1451 1440 } … … 1524 1513 } 1525 1514 # Set the legend on the first streamlines dataset. 1526 foreach dataset [CurrentDatasets -visible $_first] { 1527 foreach {dataobj comp} [split $dataset -] break 1528 if { [info exists _dataset2style($dataset)] } { 1529 SendCmd \ 1530 "legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0" 1531 break; 1532 } 1533 } 1534 } 1535 1536 # 1537 # ChangeColormap -- 1538 # 1539 itcl::body Rappture::VtkStreamlinesViewer::ChangeColormap {dataobj comp color} { 1540 set tag $dataobj-$comp 1541 if { ![info exist _style($tag)] } { 1542 error "no initial colormap" 1543 } 1544 array set style $_style($tag) 1545 set style(-color) $color 1546 set _style($tag) [array get style] 1547 SetColormap $dataobj $comp 1548 } 1549 1550 # 1551 # SetColormap -- 1552 # 1553 itcl::body Rappture::VtkStreamlinesViewer::SetColormap { dataobj comp } { 1554 array set style { 1555 -color BCGYR 1556 } 1557 set tag $dataobj-$comp 1558 if { ![info exists _initialStyle($tag)] } { 1559 # Save the initial component style. 1560 set _initialStyle($tag) [$dataobj style $comp] 1561 } 1562 1563 # Override defaults with initial style defined in xml. 1564 array set style $_initialStyle($tag) 1565 1566 if { ![info exists _style($tag)] } { 1567 set _style($tag) [array get style] 1568 } 1569 # Override initial style with current style. 1570 array set style $_style($tag) 1571 1572 set name "$style(-color)" 1515 if { $_currentColormap != "" } { 1516 set cmap $_currentColormap 1517 if { ![info exists _colormaps($cmap)] } { 1518 BuildColormap $cmap 1519 set _colormaps($cmap) 1 1520 } 1521 #SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0" 1522 SendCmd "legend2 $cmap $w $h" 1523 } 1524 } 1525 1526 # 1527 # SetCurrentColormap -- 1528 # 1529 itcl::body Rappture::VtkStreamlinesViewer::SetCurrentColormap { name } { 1530 # Keep track of the colormaps that we build. 1573 1531 if { ![info exists _colormaps($name)] } { 1574 BuildColormap $name [array get style]1532 BuildColormap $name 1575 1533 set _colormaps($name) 1 1576 1534 } 1577 if { ![info exists _dataset2style($tag)] || 1578 $_dataset2style($tag) != $name } { 1579 SendCmd "streamlines colormap $name $tag" 1580 SendCmd "cutplane colormap $name $tag" 1581 set _dataset2style($tag) $name 1582 } 1535 set _currentColormap $name 1536 SendCmd "streamlines colormap $_currentColormap" 1537 SendCmd "cutplane colormap $_currentColormap" 1583 1538 } 1584 1539 … … 1586 1541 # BuildColormap -- 1587 1542 # 1588 itcl::body Rappture::VtkStreamlinesViewer::BuildColormap { name styles } { 1589 array set style $styles 1590 set cmap [ColorsToColormap $style(-color)] 1543 itcl::body Rappture::VtkStreamlinesViewer::BuildColormap { name } { 1544 set cmap [ColorsToColormap $name] 1591 1545 if { [llength $cmap] == 0 } { 1592 1546 set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0" … … 2140 2094 # Parse style string. 2141 2095 set tag $dataobj-$comp 2142 set style [$dataobj style $comp] 2143 array set settings { 2096 array set style { 2144 2097 -color BCGYR 2145 2098 -constcolor white … … 2163 2116 -visible 1 2164 2117 } 2118 array set style [$dataobj style $comp] 2165 2119 if { $dataobj != $_first } { 2166 set settings(-opacity) 1 2167 } 2168 array set settings $style 2120 set style(-opacity) 1.0 2121 } 2169 2122 StartBufferingCommands 2170 2123 SendCmd "streamlines add $tag" 2171 SendCmd "streamlines color [Color2RGB $s ettings(-constcolor)] $tag"2172 SendCmd "streamlines edges $s ettings(-edges) $tag"2173 SendCmd "streamlines linecolor [Color2RGB $s ettings(-edgecolor)] $tag"2174 SendCmd "streamlines linewidth $s ettings(-linewidth) $tag"2175 SendCmd "streamlines lighting $s ettings(-lighting) $tag"2176 SendCmd "streamlines opacity $s ettings(-opacity) $tag"2177 SendCmd "streamlines seed color [Color2RGB $s ettings(-seedcolor)] $tag"2178 SendCmd "streamlines seed visible $s ettings(-seeds) $tag"2179 SendCmd "streamlines visible $s ettings(-visible) $tag"2124 SendCmd "streamlines color [Color2RGB $style(-constcolor)] $tag" 2125 SendCmd "streamlines edges $style(-edges) $tag" 2126 SendCmd "streamlines linecolor [Color2RGB $style(-edgecolor)] $tag" 2127 SendCmd "streamlines linewidth $style(-linewidth) $tag" 2128 SendCmd "streamlines lighting $style(-lighting) $tag" 2129 SendCmd "streamlines opacity $style(-opacity) $tag" 2130 SendCmd "streamlines seed color [Color2RGB $style(-seedcolor)] $tag" 2131 SendCmd "streamlines seed visible $style(-seeds) $tag" 2132 SendCmd "streamlines visible $style(-visible) $tag" 2180 2133 set seeds [$dataobj hints seeds] 2181 2134 if { $seeds != "" && ![info exists _seeds($dataobj)] } { 2182 2135 set length [string length $seeds] 2183 SendCmd "streamlines seed fmesh $s ettings(-numseeds) data follows $length $tag"2136 SendCmd "streamlines seed fmesh $style(-numseeds) data follows $length $tag" 2184 2137 SendData $seeds 2185 2138 set _seeds($dataobj) 1 2186 2139 } 2187 set _settings(-streamlineslighting) $s ettings(-lighting)2188 $itk_component(streammode) value $s ettings(-mode)2140 set _settings(-streamlineslighting) $style(-lighting) 2141 $itk_component(streammode) value $style(-mode) 2189 2142 AdjustSetting -streamlinesmode 2190 set _settings(-streamlinesnumseeds) $s ettings(-numseeds)2191 set _settings(-streamlinesopacity) [expr $s ettings(-opacity) * 100.0]2192 set _settings(-streamlineslength) [expr $s ettings(-streamlineslength) * 100.0]2193 set _settings(-streamlinesseedsvisible) $s ettings(-seeds)2194 set _settings(-streamlinesvisible) $s ettings(-visible)2143 set _settings(-streamlinesnumseeds) $style(-numseeds) 2144 set _settings(-streamlinesopacity) [expr $style(-opacity) * 100.0] 2145 set _settings(-streamlineslength) [expr $style(-streamlineslength) * 100.0] 2146 set _settings(-streamlinesseedsvisible) $style(-seeds) 2147 set _settings(-streamlinesvisible) $style(-visible) 2195 2148 2196 2149 SendCmd "cutplane add $tag" 2197 2150 2198 2151 SendCmd "polydata add $tag" 2199 SendCmd "polydata color [Color2RGB $s ettings(-surfacecolor)] $tag"2152 SendCmd "polydata color [Color2RGB $style(-surfacecolor)] $tag" 2200 2153 SendCmd "polydata colormode constant {} $tag" 2201 SendCmd "polydata edges $s ettings(-surfaceedges) $tag"2202 SendCmd "polydata linecolor [Color2RGB $s ettings(-surfaceedgecolor)] $tag"2203 SendCmd "polydata lighting $s ettings(-surfacelighting) $tag"2204 SendCmd "polydata opacity $s ettings(-surfaceopacity) $tag"2205 SendCmd "polydata wireframe $s ettings(-surfacewireframe) $tag"2206 SendCmd "polydata visible $s ettings(-surfacevisible) $tag"2207 set _settings(-surfaceedges) $s ettings(-surfaceedges)2208 set _settings(-surfacelighting) $s ettings(-surfacelighting)2209 set _settings(-surfaceopacity) [expr $s ettings(-surfaceopacity) * 100.0]2210 set _settings(-surfacewireframe) $s ettings(-surfacewireframe)2211 set _settings(-surfacevisible) $s ettings(-surfacevisible)2154 SendCmd "polydata edges $style(-surfaceedges) $tag" 2155 SendCmd "polydata linecolor [Color2RGB $style(-surfaceedgecolor)] $tag" 2156 SendCmd "polydata lighting $style(-surfacelighting) $tag" 2157 SendCmd "polydata opacity $style(-surfaceopacity) $tag" 2158 SendCmd "polydata wireframe $style(-surfacewireframe) $tag" 2159 SendCmd "polydata visible $style(-surfacevisible) $tag" 2160 set _settings(-surfaceedges) $style(-surfaceedges) 2161 set _settings(-surfacelighting) $style(-surfacelighting) 2162 set _settings(-surfaceopacity) [expr $style(-surfaceopacity) * 100.0] 2163 set _settings(-surfacewireframe) $style(-surfacewireframe) 2164 set _settings(-surfacevisible) $style(-surfacevisible) 2212 2165 StopBufferingCommands 2213 SetC olormap $dataobj $comp2214 $itk_component(colormap) value $s ettings(-color)2166 SetCurrentColormap $style(-color) 2167 $itk_component(colormap) value $style(-color) 2215 2168 } 2216 2169 -
branches/1.4/gui/scripts/vtksurfaceviewer.tcl
r5349 r5773 134 134 private variable _isolines 135 135 private variable _contourList "" 136 137 private common _downloadPopup; # download options from popup138 private common _hardcopy139 136 private variable _width 0 140 137 private variable _height 0 … … 143 140 private variable _legendPending 0 144 141 private variable _field "" 145 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 146 private variable _fieldNames {} 142 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 147 143 private variable _fields 148 144 private variable _curFldName "" 149 145 private variable _curFldLabel "" 146 147 private common _downloadPopup; # download options from popup 148 private common _hardcopy 150 149 } 151 150 … … 1465 1464 } 1466 1465 # Set the legend on the first heightmap dataset. 1467 if { $_currentColormap != "" 1466 if { $_currentColormap != "" } { 1468 1467 set cmap $_currentColormap 1469 1468 if { ![info exists _colormaps($cmap)] } { -
branches/1.4/gui/scripts/vtkviewer.tcl
r5671 r5773 67 67 private method BuildAxisTab {} 68 68 private method BuildCameraTab {} 69 private method BuildColormap { name styles}69 private method BuildColormap { name } 70 70 private method BuildCutawayTab {} 71 71 private method BuildDownloadPopup { widget command } … … 147 147 private variable _start 0 148 148 private variable _title "" 149 150 private common _downloadPopup; # download options from popup151 private common _hardcopy152 149 private variable _width 0 153 150 private variable _height 0 … … 162 159 private variable _rotateDelay 150 163 160 private variable _scaleDelay 100 161 162 private common _downloadPopup; # download options from popup 163 private common _hardcopy 164 164 } 165 165 … … 1090 1090 } 1091 1091 if {"" != $_first} { 1092 set location [$_first hints camera]1093 if { $location != "" } {1094 array set view $location1095 }1096 1097 1092 foreach axis { x y z } { 1098 1093 set label [$_first hints ${axis}label] … … 1808 1803 array set style { 1809 1804 -color BCGYR 1810 -levels 61811 -opacity 1.01812 1805 } 1813 1806 if {[$dataobj type $comp] == "molecule"} { … … 1829 1822 array set style $_style($tag) 1830 1823 1831 if { $style(-color) == "elementDefault" } { 1832 set name "$style(-color)" 1833 } else { 1834 set name "$style(-color):$style(-levels):$style(-opacity)" 1835 } 1824 set name "$style(-color)" 1836 1825 if { ![info exists _colormaps($name)] } { 1837 BuildColormap $name [array get style]1826 BuildColormap $name 1838 1827 set _colormaps($name) 1 1839 1828 } … … 1858 1847 # BuildColormap -- 1859 1848 # 1860 itcl::body Rappture::VtkViewer::BuildColormap { name styles} {1861 if { $name == 1849 itcl::body Rappture::VtkViewer::BuildColormap { name } { 1850 if { $name == "elementDefault" } { 1862 1851 return 1863 1852 } 1864 array set style $styles 1865 set cmap [ColorsToColormap $style(-color)] 1853 set cmap [ColorsToColormap $name] 1866 1854 if { [llength $cmap] == 0 } { 1867 1855 set cmap "0.0 0.0 0.0 0.0 1.0 1.0 1.0 1.0" 1868 1856 } 1869 if { ![info exists _settings(polydata-opacity)] } {1870 set _settings(polydata-opacity) $style(-opacity)1871 }1872 set max $_settings(polydata-opacity)1873 1874 1857 set amap "0.0 1.0 1.0 1.0" 1875 1858 SendCmd "colormap add $name { $cmap } { $amap }" -
branches/1.4/gui/scripts/vtkvolumeviewer.tcl
r5733 r5773 1035 1035 } 1036 1036 if {"" != $_first} { 1037 set location [$_first hints camera]1038 if { $location != "" } {1039 array set view $location1040 }1041 1042 1037 foreach axis { x y z } { 1043 1038 set label [$_first hints ${axis}label]
Note: See TracChangeset
for help on using the changeset viewer.