- Timestamp:
- Sep 23, 2013 11:21:27 AM (11 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/field.tcl
r3940 r3948 926 926 close $f 927 927 } 928 # This is temporary. I put a check for this in the DxToVtk 929 # parser. 930 if { [string range $contents 0 3] == "<DX>" } { 931 set contents [string range $contents 4 end] 932 } 928 933 if { [catch { Rappture::DxToVtk $contents } vtkdata] == 0 } { 929 934 set vector [ReadVtkDataSet $cname $vtkdata] … … 936 941 close $f 937 942 } 938 if { $_viewer != "nanovis" } {943 if { $_viewer != "nanovis" && $_viewer != "flowvis" } { 939 944 set _type "vtk" 940 945 set _comp2vtk($cname) $vtkdata -
trunk/gui/scripts/nanovisviewer.tcl
r3946 r3948 130 130 131 131 private variable _dlist "" ;# list of data objects 132 private variable _allDataObjs133 132 private variable _obj2ovride ;# maps dataobj => style override 134 133 private variable _serverDatasets ;# contains all the dataobj-component … … 231 230 $this-transp 50 232 231 $this-volume 1 232 $this-volumeVisible 1 233 233 $this-xcutplane 1 234 234 $this-xcutposition 0 … … 240 240 $this-zcutposition 0 241 241 $this-zoom $_view(zoom) 242 $this-volumeVisible 1243 242 }] 244 243 … … 448 447 if {$pos < 0} { 449 448 lappend _dlist $dataobj 450 set _allDataObjs($dataobj) 1451 449 set _obj2ovride($dataobj-color) $params(-color) 452 450 set _obj2ovride($dataobj-width) $params(-width) … … 806 804 $c coords title [expr {$w/2}] $ly 807 805 808 809 806 # The colormap may have changed. Resync the slicers with the colormap. 810 807 set datasets [CurrentDatasets -cutplanes] 811 SendCmd "volume data state $_settings($this-volume) $datasets"812 808 813 809 # Adjust the cutplane for only the first component in the topmost volume … … 1324 1320 } 1325 1321 "volume" { 1326 set datasets [CurrentDatasets -cutplanes] 1327 SendCmd "volume data state $_settings($this-volume) $datasets" 1322 # This is the global volume visibility control. It controls the 1323 # visibility of all the all volumes. Whenever it's changed, you 1324 # have to synchronize each of the local controls (see below) with 1325 # this. 1326 set datasets [CurrentDatasets] 1327 set bool $_settings($this-volume) 1328 SendCmd "volume data state $bool $datasets" 1329 foreach cname $_componentsList { 1330 set _settings($cname-volumeVisible) $bool 1331 } 1332 set _settings($this-volumeVisible) $bool 1328 1333 } 1329 1334 "volumeVisible" { 1335 # This is the component specific control. It changes the 1336 # visibility of only the current component. 1330 1337 set _settings($_current-volumeVisible) \ 1331 1338 $_settings($this-volumeVisible) … … 1672 1679 #set bfont [option get $itk_component(hull) boldFont Font] 1673 1680 1674 label $inner.shading_l -text "Lighting" -font "Arial 9 bold" 1681 label $inner.lighting_l \ 1682 -text "Lighting / Material Properties" \ 1683 -font "Arial 9 bold" 1675 1684 1676 1685 checkbutton $inner.light2side \ … … 1691 1700 ::scale $inner.ambient -from 0 -to 100 -orient horizontal \ 1692 1701 -variable [itcl::scope _settings($this-ambient)] \ 1693 -showvalue off -command [itcl::code $this AdjustSetting ambient] 1702 -showvalue off -command [itcl::code $this AdjustSetting ambient] \ 1703 -troughcolor grey92 1694 1704 1695 1705 label $inner.diffuse_l -text "Diffuse" -font $font 1696 1706 ::scale $inner.diffuse -from 0 -to 100 -orient horizontal \ 1697 1707 -variable [itcl::scope _settings($this-diffuse)] \ 1698 -showvalue off -command [itcl::code $this AdjustSetting diffuse] 1708 -showvalue off -command [itcl::code $this AdjustSetting diffuse] \ 1709 -troughcolor grey92 1699 1710 1700 1711 label $inner.specularLevel_l -text "Specular" -font $font 1701 1712 ::scale $inner.specularLevel -from 0 -to 100 -orient horizontal \ 1702 1713 -variable [itcl::scope _settings($this-specularLevel)] \ 1703 -showvalue off -command [itcl::code $this AdjustSetting specularLevel] 1714 -showvalue off -command [itcl::code $this AdjustSetting specularLevel] \ 1715 -troughcolor grey92 1704 1716 1705 1717 label $inner.specularExponent_l -text "Shininess" -font $font … … 1707 1719 -variable [itcl::scope _settings($this-specularExponent)] \ 1708 1720 -showvalue off \ 1709 -command [itcl::code $this AdjustSetting specularExponent] 1721 -command [itcl::code $this AdjustSetting specularExponent] \ 1722 -troughcolor grey92 1710 1723 1711 1724 label $inner.transp_l -text "Opacity" -font $font 1712 1725 ::scale $inner.transp -from 0 -to 100 -orient horizontal \ 1713 1726 -variable [itcl::scope _settings($this-transp)] \ 1714 -showvalue off -command [itcl::code $this AdjustSetting transp] 1715 1716 label $inner.tf -text "Transfer Function" -font "Arial 9 bold" 1727 -showvalue off -command [itcl::code $this AdjustSetting transp] \ 1728 -troughcolor grey92 1729 1730 label $inner.transferfunction_l \ 1731 -text "Transfer Function" -font "Arial 9 bold" 1717 1732 1718 1733 label $inner.thin -text "Thin" -font $font 1719 1734 ::scale $inner.thickness -from 0 -to 1000 -orient horizontal \ 1720 1735 -variable [itcl::scope _settings($this-thickness)] \ 1721 -showvalue off -command [itcl::code $this AdjustSetting thickness] 1736 -showvalue off -command [itcl::code $this AdjustSetting thickness] \ 1737 -troughcolor grey92 1738 1722 1739 label $inner.thick -text "Thick" -font $font 1723 1740 … … 1761 1778 1762 1779 blt::table $inner \ 1763 0, 1 $inner.volcomponents_l -anchor e\1780 0,0 $inner.volcomponents_l -anchor e -cspan 2 \ 1764 1781 0,2 $inner.volcomponents -cspan 3 -fill x \ 1765 1, 0 $inner.shading_l -anchor w -cspan 5\1782 1,1 $inner.lighting_l -anchor w -cspan 4 \ 1766 1783 2,1 $inner.ambient_l -anchor e -pady 2 \ 1767 1784 2,2 $inner.ambient -cspan 3 -fill x \ … … 1774 1791 6,1 $inner.light2side -cspan 3 -anchor w \ 1775 1792 7,1 $inner.visibility -cspan 3 -anchor w \ 1776 8, 0 $inner.tf -anchor w -cspan 5\1793 8,1 $inner.transferfunction_l -anchor w -cspan 4 \ 1777 1794 9,1 $inner.transp_l -anchor e -pady 2 \ 1778 1795 9,2 $inner.transp -cspan 3 -fill x \ 1779 1796 10,1 $inner.colormap_l -anchor e \ 1780 10,2 $inner.colormap - cspan 3 -fill x \1797 10,2 $inner.colormap -padx 2 -cspan 3 -fill x \ 1781 1798 11,1 $inner.thin -anchor e \ 1782 1799 11,2 $inner.thickness -cspan 2 -fill x \ … … 2122 2139 2123 2140 2141 # 2142 # InitComponentSettings -- 2143 # 2144 # Initializes the volume settings for a specific component. This 2145 # should match what's used as global settings above. This 2146 # is called the first time we try to switch to a given component 2147 # in SwitchComponent below. 2148 # 2124 2149 itcl::body Rappture::NanovisViewer::InitComponentSettings { cname } { 2125 2150 array set _settings [subst { 2126 $cname-ambient 202151 $cname-ambient 60 2127 2152 $cname-colormap default 2128 $cname-diffuse 802153 $cname-diffuse 40 2129 2154 $cname-light2side 1 2130 2155 $cname-opacity 100 … … 2138 2163 } 2139 2164 2140 # Reset global settings from dataset's settings. 2165 # 2166 # SwitchComponent -- 2167 # 2168 # This is called when the current component is changed by the 2169 # dropdown menu in the volume tab. It synchronizes the global 2170 # volume settings with the settings of the new current component. 2171 # 2141 2172 itcl::body Rappture::NanovisViewer::SwitchComponent { cname } { 2142 2173 if { ![info exists _settings($cname-ambient)] } { … … 2159 2190 } 2160 2191 2161 # Reset global settings from dataset's settings. 2192 # 2193 # BuildVolumeComponents -- 2194 # 2195 # This is called from the "scale" method which is called when a 2196 # new dataset is added or deleted. It repopulates the dropdown 2197 # menu of volume component names. It sets the current component 2198 # to the first component in the list (of components found). 2199 # Finally, if there is only one component, don't display the 2200 # label or the combobox in the volume settings tab. 2201 # 2162 2202 itcl::body Rappture::NanovisViewer::BuildVolumeComponents {} { 2163 2203 $itk_component(volcomponents) choices delete 0 end … … 2167 2207 set _current [lindex $_componentsList 0] 2168 2208 $itk_component(volcomponents) value $_current 2169 } 2170 2171 # Reset global settings from dataset's settings. 2209 set parent [winfo parent $itk_component(volcomponents)] 2210 if { [llength $_componentsList] <= 1 } { 2211 # Unpack the components label and dropdown if there's only one 2212 # component. 2213 blt::table forget $parent.volcomponents_l $parent.volcomponents 2214 } else { 2215 # Pack the components label and dropdown into the table there's 2216 # more than one component to select. 2217 blt::table $parent \ 2218 0,0 $parent.volcomponents_l -anchor e -cspan 2 \ 2219 0,2 $parent.volcomponents -cspan 3 -fill x 2220 } 2221 } 2222 2223 # 2224 # GetDatasetsWithComponents -- 2225 # 2226 # Returns a list of all the datasets (known by the combination of 2227 # their data object and component name) that match the given 2228 # component name. For example, this is used where we want to change 2229 # the settings of volumes that have the current component. 2230 # 2172 2231 itcl::body Rappture::NanovisViewer::GetDatasetsWithComponent { cname } { 2173 2232 if { ![info exists _volcomponents($cname)] } { … … 2187 2246 # HideAllMarkers -- 2188 2247 # 2189 # Hide all the markers . Can't simply delete and recreate markers2190 # from the <style> since the user may have create, deleted, or moved2191 # markers.2248 # Hide all the markers in all the transfer functions. Can't simply 2249 # delete and recreate markers from the <style> since the user may 2250 # have create, deleted, or moved markers. 2192 2251 # 2193 2252 itcl::body Rappture::NanovisViewer::HideAllMarkers {} {
Note: See TracChangeset
for help on using the changeset viewer.