Changeset 4725 for trunk/gui/scripts/flowvisviewer.tcl
- Timestamp:
- Nov 13, 2014, 7:26:24 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/flowvisviewer.tcl
r4669 r4725 253 253 $this-diffuse 40 254 254 $this-light2side 1 255 $this-opacity 100255 $this-opacity 50 256 256 $this-specularLevel 30 257 257 $this-specularExponent 90 258 258 $this-thickness 350 259 $this-transp 50260 259 $this-cutplaneVisible 0 261 260 $this-xcutplane 1 … … 740 739 -levels 6 741 740 -markers "" 742 -opacity 1.0741 -opacity 0.5 743 742 } 744 743 array unset _limits … … 965 964 } 966 965 967 # Ensure that the global opacity and thickness settings (in the slider 968 # settings widgets) are used for the active transfer-function. Update the 969 # values in the _settings varible. 970 set value $_settings($this-opacity) 971 set opacity [expr { double($value) * 0.01 }] 972 set _settings($this-$tf-opacity) $opacity 966 # Ensure that the global thickness setting (in the slider settings widget) 967 # is used for the active transfer-function. Update the values in the 968 # _settings varible. 969 973 970 set value $_settings($this-thickness) 974 971 # Scale values between 0.00001 and 0.01000 … … 1200 1197 # Reset the camera and other view parameters 1201 1198 InitSettings light2side ambient diffuse specularLevel specularExponent \ 1202 transpisosurface grid axes volume outline \1199 opacity isosurface grid axes volume outline \ 1203 1200 cutplaneVisible xcutplane ycutplane zcutplane 1204 1201 … … 1622 1619 } 1623 1620 } 1624 transp{1621 opacity { 1625 1622 if { $_first != "" } { 1626 1623 set comp [lindex [$_first components] 0] 1627 1624 set tag $_first-$comp 1628 set opacity [expr { 0.01 * double($_settings($this- transp)) }]1625 set opacity [expr { 0.01 * double($_settings($this-opacity)) }] 1629 1626 SendCmd "$tag configure -opacity $opacity" 1630 1627 } 1631 1628 } 1632 opacity {1633 if { $_first != "" && $_activeTf != "" } {1634 set opacity [expr { 0.01 * double($_settings($this-opacity)) }]1635 set tf $_activeTf1636 set _settings($this-$tf-opacity) $opacity1637 updateTransferFunctions1638 }1639 }1640 1641 1629 thickness { 1642 1630 if { $_first != "" && $_activeTf != "" } { … … 1764 1752 -color BCGYR 1765 1753 -levels 6 1766 -light 40 1767 -opacity 1.0 1768 -transp 50 1754 -opacity 0.5 1769 1755 } 1770 1756 array set styles [lindex [$dataobj components -style $cname] 0] 1771 set _settings($this-light) $styles(-light)1772 set _settings($this-transp) $styles(-transp)1773 1757 set _settings($this-opacity) [expr $styles(-opacity) * 100] 1774 1758 set _obj2style($dataobj-$cname) $cname … … 1790 1774 -color BCGYR 1791 1775 -levels 6 1792 -opacity 1.0 1793 -light 40 1794 -transp 50 1776 -opacity 0.5 1795 1777 } 1796 1778 set dataobj ""; set comp "" … … 1800 1782 } 1801 1783 array set styles [lindex [$dataobj components -style $comp] 0] 1802 1803 1784 1804 1785 # We have to parse the style attributes for a volume using this … … 1831 1812 set cmap [ColorsToColormap $styles(-color)] 1832 1813 } 1833 set tag $this-$tf 1834 if { ![info exists _settings($tag-opacity)] } { 1835 set _settings($tag-opacity) $styles(-opacity) 1836 } 1837 set max 1.0 ;#$_settings($tag-opacity) 1838 1814 1815 if { ![info exists _settings($this-opacity)] } { 1816 set _settings($this-opacity) [expr $styles(-opacity) * 100] 1817 } 1818 1819 # Transfer function should be normalized with [0,1] range 1820 # The volume shading opacity setting is used to scale opacity 1821 # in the volume shader. 1822 set max 1.0 1823 1839 1824 set isovalues {} 1840 1825 foreach m $_isomarkers($tf) { … … 1844 1829 set isovalues [lsort -real $isovalues] 1845 1830 1831 set tag $this-$tf 1846 1832 if { ![info exists _settings($tag-thickness)]} { 1847 1833 set _settings($tag-thickness) 0.005 … … 2222 2208 2223 2209 label $inner.clear -text "Clear" -font $fg 2224 ::scale $inner. transp-from 0 -to 100 -orient horizontal \2225 -variable [itcl::scope _settings($this- transp)] \2210 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 2211 -variable [itcl::scope _settings($this-opacity)] \ 2226 2212 -width 10 \ 2227 -showvalue off -command [itcl::code $this AdjustSetting transp]2213 -showvalue off -command [itcl::code $this AdjustSetting opacity] 2228 2214 label $inner.opaque -text "Opaque" -font $fg 2229 2215 … … 2257 2243 6,1 $inner.specularExponent -cspan 3 -pady 2 -fill x \ 2258 2244 7,0 $inner.clear -anchor e -pady 2 \ 2259 7,1 $inner. transp-cspan 2 -pady 2 -fill x \2245 7,1 $inner.opacity -cspan 2 -pady 2 -fill x \ 2260 2246 7,3 $inner.opaque -anchor w -pady 2 \ 2261 2247 8,0 $inner.thin -anchor e -pady 2 \
Note: See TracChangeset
for help on using the changeset viewer.