Changeset 4727 for branches/1.3/gui/scripts
- Timestamp:
- Nov 13, 2014, 7:47:56 PM (10 years ago)
- Location:
- branches/1.3
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/gui/scripts/flowvisviewer.tcl
r4670 r4727 250 250 $this-streams 0 251 251 $this-volume 1 252 $this-light 40 253 $this-light2side 1 254 $this-opacity 50 255 $this-thickness 350 252 256 $this-xcutplane 0 253 257 $this-xcutposition 0 … … 720 724 -levels 6 721 725 -markers "" 722 -opacity 1.0726 -opacity 0.5 723 727 } 724 728 array unset _limits … … 945 949 } 946 950 947 # Ensure that the global opacity and thickness settings (in the slider 948 # settings widgets) are used for the active transfer-function. Update the 949 # values in the _settings varible. 950 set value $_settings($this-opacity) 951 set opacity [expr { double($value) * 0.01 }] 952 set _settings($this-$tf-opacity) $opacity 951 # Ensure that the global thickness setting (in the slider settings widget) 952 # is used for the active transfer-function. Update the values in the 953 # _settings varible. 954 953 955 set value $_settings($this-thickness) 954 956 # Scale values between 0.00001 and 0.01000 … … 1174 1176 1175 1177 # Reset the camera and other view parameters 1176 InitSettings light2side light transpisosurface grid axes volume outline1177 1178 InitSettings light2side light opacity isosurface grid axes volume outline 1179 1178 1180 # nothing to send -- activate the proper volume 1179 1181 if {"" != $_first} { 1180 AdjustSetting light1181 AdjustSetting transp1182 1182 set axis [$_first hints updir] 1183 1183 if {"" != $axis} { … … 1574 1574 } 1575 1575 } 1576 transp{1576 opacity { 1577 1577 if { $_first != "" } { 1578 1578 set comp [lindex [$_first components] 0] 1579 1579 set tag $_first-$comp 1580 set opacity [expr { 0.01 * double($_settings($this- transp)) }]1580 set opacity [expr { 0.01 * double($_settings($this-opacity)) }] 1581 1581 SendCmd "$tag configure -opacity $opacity" 1582 1582 } 1583 1583 } 1584 opacity {1585 if { $_first != "" && $_activeTf != "" } {1586 set opacity [expr { 0.01 * double($_settings($this-opacity)) }]1587 set tf $_activeTf1588 set _settings($this-$tf-opacity) $opacity1589 updateTransferFunctions1590 }1591 }1592 1593 1584 thickness { 1594 1585 if { $_first != "" && $_activeTf != "" } { … … 1710 1701 -color BCGYR 1711 1702 -levels 6 1712 -light 40 1713 -opacity 1.0 1714 -transp 50 1703 -opacity 0.5 1715 1704 } 1716 1705 array set styles [lindex [$dataobj components -style $cname] 0] 1717 set _settings($this-light) $styles(-light)1718 set _settings($this-transp) $styles(-transp)1719 1706 set _settings($this-opacity) [expr $styles(-opacity) * 100] 1720 1707 set _obj2style($dataobj-$cname) $cname … … 1736 1723 -color BCGYR 1737 1724 -levels 6 1738 -opacity 1.0 1739 -light 40 1740 -transp 50 1725 -opacity 0.5 1741 1726 } 1742 1727 set dataobj ""; set comp "" … … 1746 1731 } 1747 1732 array set styles [lindex [$dataobj components -style $comp] 0] 1748 1749 1733 1750 1734 # We have to parse the style attributes for a volume using this … … 1777 1761 set cmap [ColorsToColormap $styles(-color)] 1778 1762 } 1779 set tag $this-$tf 1780 if { ![info exists _settings($tag-opacity)] } { 1781 set _settings($tag-opacity) $styles(-opacity) 1782 } 1783 set max 1.0 ;#$_settings($tag-opacity) 1784 1763 1764 if { ![info exists _settings($this-opacity)] } { 1765 set _settings($this-opacity) [expr $styles(-opacity) * 100] 1766 } 1767 1768 # Transfer function should be normalized with [0,1] range 1769 # The volume shading opacity setting is used to scale opacity 1770 # in the volume shader. 1771 set max 1.0 1772 1785 1773 set isovalues {} 1786 1774 foreach m $_isomarkers($tf) { … … 1790 1778 set isovalues [lsort -real $isovalues] 1791 1779 1780 set tag $this-$tf 1792 1781 if { ![info exists _settings($tag-thickness)]} { 1793 1782 set _settings($tag-thickness) 0.005 … … 2123 2112 2124 2113 itcl::body Rappture::FlowvisViewer::BuildVolumeTab {} { 2125 foreach { key value } {2126 light2side 12127 light 402128 transp 502129 opacity 1002130 thickness 3502131 } {2132 set _settings($this-$key) $value2133 }2134 2135 2114 set inner [$itk_component(main) insert end \ 2136 2115 -title "Volume Settings" \ … … 2159 2138 -showvalue off -command [itcl::code $this AdjustSetting light] 2160 2139 label $inner.bright -text "Surface" -font $fg 2161 2162 label $inner.fog -text "Clear" -font $fg2163 ::scale $inner.transp -from 0 -to 100 -orient horizontal \2164 -variable [itcl::scope _settings($this-transp)] \2165 -width 10 \2166 -showvalue off -command [itcl::code $this AdjustSetting transp]2167 label $inner.plastic -text "Opaque" -font $fg2168 2140 2169 2141 label $inner.clear -text "Clear" -font $fg … … 2198 2170 3,1 $inner.light -cspan 2 -pady 2 -fill x \ 2199 2171 3,3 $inner.bright -anchor w -pady 2 \ 2200 4,0 $inner. fog-anchor e -pady 2 \2201 4,1 $inner. transp-cspan 2 -pady 2 -fill x \2202 4,3 $inner. plastic-anchor w -pady 2 \2172 4,0 $inner.clear -anchor e -pady 2 \ 2173 4,1 $inner.opacity -cspan 2 -pady 2 -fill x \ 2174 4,3 $inner.opaque -anchor w -pady 2 \ 2203 2175 5,0 $inner.thin -anchor e -pady 2 \ 2204 2176 5,1 $inner.thickness -cspan 2 -pady 2 -fill x\ -
branches/1.3/gui/scripts/nanovisviewer.tcl
r4712 r4727 2250 2250 # Transfer function should be normalized with [0,1] range 2251 2251 # The volume shading opacity setting is used to scale opacity 2252 # in the volume shader. 2252 # in the volume shader. 2253 2253 set max 1.0 2254 2254
Note: See TracChangeset
for help on using the changeset viewer.