- Timestamp:
- Apr 28, 2015, 7:44:36 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkvolumeviewer.tcl
r5336 r5341 104 104 private method DoRotate {} 105 105 private method DrawLegend {} 106 private method DrawLegendOld {}107 106 private method EnterLegend { x y } 108 107 private method EventuallyResize { w h } … … 1655 1654 1656 1655 itcl::body Rappture::VtkVolumeViewer::BuildViewTab {} { 1657 set f g[option get $itk_component(hull) font Font]1658 #set bf g[option get $itk_component(hull) boldFont Font]1656 set font [option get $itk_component(hull) font Font] 1657 #set bfont [option get $itk_component(hull) boldFont Font] 1659 1658 1660 1659 set inner [$itk_component(main) insert end \ … … 1667 1666 -variable [itcl::scope _settings(-axesvisible)] \ 1668 1667 -command [itcl::code $this AdjustSetting -axesvisible] \ 1669 -font "Arial 9"1668 -font $font 1670 1669 1671 1670 checkbutton $inner.outline \ … … 1673 1672 -variable [itcl::scope _settings(-volumeoutline)] \ 1674 1673 -command [itcl::code $this AdjustSetting -volumeoutline] \ 1675 -font "Arial 9"1674 -font $font 1676 1675 1677 1676 checkbutton $inner.legend \ … … 1679 1678 -variable [itcl::scope _settings(-legendvisible)] \ 1680 1679 -command [itcl::code $this AdjustSetting -legendvisible] \ 1681 -font "Arial 9"1680 -font $font 1682 1681 1683 1682 checkbutton $inner.volume \ … … 1685 1684 -variable [itcl::scope _settings(-volumevisible)] \ 1686 1685 -command [itcl::code $this AdjustSetting -volumevisible] \ 1687 -font "Arial 9"1688 1689 label $inner.background_l -text "Background" -font "Arial 9"1686 -font $font 1687 1688 label $inner.background_l -text "Background" -font $font 1690 1689 itk_component add background { 1691 1690 Rappture::Combobox $inner.background -width 10 -editable no 1692 1691 } 1693 1692 $inner.background choices insert end \ 1694 "black" "black"\1695 "white" "white"\1696 "grey" 1693 "black" "black" \ 1694 "white" "white" \ 1695 "grey" "grey" 1697 1696 1698 1697 $itk_component(background) value $_settings(-background) … … 1701 1700 1702 1701 blt::table $inner \ 1703 0,0 $inner.axes 1704 1,0 $inner.outline 1705 2,0 $inner.volume 1706 3,0 $inner.legend 1707 4,0 $inner.background_l 1708 4,1 $inner.background -fill x \1702 0,0 $inner.axes -cspan 2 -anchor w \ 1703 1,0 $inner.outline -cspan 2 -anchor w \ 1704 2,0 $inner.volume -cspan 2 -anchor w \ 1705 3,0 $inner.legend -cspan 2 -anchor w \ 1706 4,0 $inner.background_l -anchor e -pady 2 \ 1707 4,1 $inner.background -fill x 1709 1708 1710 1709 blt::table configure $inner r* -resize none … … 1714 1713 itcl::body Rappture::VtkVolumeViewer::BuildVolumeTab {} { 1715 1714 set font [option get $itk_component(hull) font Font] 1716 #set bfont [option get $itk_component(hull) boldFont Font]1715 set bfont [option get $itk_component(hull) boldFont Font] 1717 1716 1718 1717 set inner [$itk_component(main) insert end \ … … 1736 1735 label $inner.lighting_l \ 1737 1736 -text "Lighting / Material Properties" \ 1738 -font "Arial 9 bold"1737 -font $bfont 1739 1738 1740 1739 checkbutton $inner.lighting \ … … 1796 1795 1797 1796 label $inner.transferfunction_l \ 1798 -text "Transfer Function" -font "Arial 9 bold"1797 -text "Transfer Function" -font $bfont 1799 1798 1800 1799 label $inner.thin -text "Thin" -font $font … … 1823 1822 } 1824 1823 $inner.blendmode choices insert end \ 1825 "composite" 1826 "max_intensity" 1827 "additive" 1824 "composite" "Composite" \ 1825 "max_intensity" "Maximum Intensity" \ 1826 "additive" "Additive" 1828 1827 1829 1828 $itk_component(blendmode) value \ … … 1834 1833 blt::table $inner \ 1835 1834 0,0 $inner.volcomponents_l -anchor e -cspan 2 \ 1836 0,2 $inner.volcomponents 1837 1,0 $inner.field_l 1838 1,2 $inner.field 1835 0,2 $inner.volcomponents -cspan 3 -fill x \ 1836 1,0 $inner.field_l -anchor e -cspan 2 \ 1837 1,2 $inner.field -cspan 3 -fill x \ 1839 1838 2,0 $inner.lighting_l -anchor w -cspan 4 \ 1840 3,1 $inner.lighting 1841 4,1 $inner.ambient_l -anchor e -pady 2\1842 4,2 $inner.ambient 1843 5,1 $inner.diffuse_l -anchor e -pady 2\1844 5,2 $inner.diffuse 1845 6,1 $inner.specularLevel_l -anchor e -pady 2\1846 6,2 $inner.specularLevel 1847 7,1 $inner.specularExponent_l -anchor e -pady 2\1848 7,2 $inner.specularExponent 1849 8,1 $inner.visibility 1850 9,1 $inner.quality_l -anchor e -pady 2\1851 9,2 $inner.quality 1852 10,0 $inner.transferfunction_l -anchor w 1853 11,1 $inner.opacity_l -anchor e -pady 2\1854 11,2 $inner.opacity 1855 12,1 $inner.colormap_l -anchor e 1856 12,2 $inner.colormap 1857 13,1 $inner.blendmode_l -anchor e 1858 13,2 $inner.blendmode 1859 14,1 $inner.thin 1860 14,2 $inner.thickness 1839 3,1 $inner.lighting -anchor w -cspan 3 \ 1840 4,1 $inner.ambient_l -anchor e \ 1841 4,2 $inner.ambient -cspan 3 -fill x \ 1842 5,1 $inner.diffuse_l -anchor e \ 1843 5,2 $inner.diffuse -cspan 3 -fill x \ 1844 6,1 $inner.specularLevel_l -anchor e \ 1845 6,2 $inner.specularLevel -cspan 3 -fill x \ 1846 7,1 $inner.specularExponent_l -anchor e \ 1847 7,2 $inner.specularExponent -cspan 3 -fill x \ 1848 8,1 $inner.visibility -anchor w -cspan 3 \ 1849 9,1 $inner.quality_l -anchor e \ 1850 9,2 $inner.quality -cspan 3 -fill x \ 1851 10,0 $inner.transferfunction_l -anchor w -cspan 4 \ 1852 11,1 $inner.opacity_l -anchor e \ 1853 11,2 $inner.opacity -cspan 3 -fill x \ 1854 12,1 $inner.colormap_l -anchor e \ 1855 12,2 $inner.colormap -padx 2 -cspan 3 -fill x \ 1856 13,1 $inner.blendmode_l -anchor e \ 1857 13,2 $inner.blendmode -padx 2 -cspan 3 -fill x \ 1858 14,1 $inner.thin -anchor e \ 1859 14,2 $inner.thickness -cspan 2 -fill x \ 1861 1860 14,4 $inner.thick -anchor w 1862 1861 … … 1868 1867 1869 1868 itcl::body Rappture::VtkVolumeViewer::BuildAxisTab {} { 1870 set f g[option get $itk_component(hull) font Font]1871 #set bf g[option get $itk_component(hull) boldFont Font]1869 set font [option get $itk_component(hull) font Font] 1870 #set bfont [option get $itk_component(hull) boldFont Font] 1872 1871 1873 1872 set inner [$itk_component(main) insert end \ … … 1880 1879 -variable [itcl::scope _settings(-axesvisible)] \ 1881 1880 -command [itcl::code $this AdjustSetting -axesvisible] \ 1882 -font "Arial 9"1881 -font $font 1883 1882 1884 1883 checkbutton $inner.labels \ … … 1886 1885 -variable [itcl::scope _settings(-axislabels)] \ 1887 1886 -command [itcl::code $this AdjustSetting -axislabels] \ 1888 -font "Arial 9"1889 label $inner.grid_l -text "Grid" -font "Arial 9"1887 -font $font 1888 label $inner.grid_l -text "Grid" -font $font 1890 1889 checkbutton $inner.xgrid \ 1891 1890 -text "X" \ 1892 1891 -variable [itcl::scope _settings(-xgrid)] \ 1893 1892 -command [itcl::code $this AdjustSetting -xgrid] \ 1894 -font "Arial 9"1893 -font $font 1895 1894 checkbutton $inner.ygrid \ 1896 1895 -text "Y" \ 1897 1896 -variable [itcl::scope _settings(-ygrid)] \ 1898 1897 -command [itcl::code $this AdjustSetting -ygrid] \ 1899 -font "Arial 9"1898 -font $font 1900 1899 checkbutton $inner.zgrid \ 1901 1900 -text "Z" \ 1902 1901 -variable [itcl::scope _settings(-zgrid)] \ 1903 1902 -command [itcl::code $this AdjustSetting -zgrid] \ 1904 -font "Arial 9"1903 -font $font 1905 1904 checkbutton $inner.minorticks \ 1906 1905 -text "Minor Ticks" \ 1907 1906 -variable [itcl::scope _settings(-axisminorticks)] \ 1908 1907 -command [itcl::code $this AdjustSetting -axisminorticks] \ 1909 -font "Arial 9"1910 1911 label $inner.mode_l -text "Mode" -font "Arial 9"1908 -font $font 1909 1910 label $inner.mode_l -text "Mode" -font $font 1912 1911 1913 1912 itk_component add axismode { … … 1924 1923 blt::table $inner \ 1925 1924 0,0 $inner.visible -anchor w -cspan 4 \ 1926 1,0 $inner.labels 1927 2,0 $inner.minorticks 1928 4,0 $inner.grid_l 1929 4,1 $inner.xgrid 1930 4,2 $inner.ygrid 1931 4,3 $inner.zgrid 1932 5,0 $inner.mode_l 1933 5,1 $inner.mode -fill x-cspan 31925 1,0 $inner.labels -anchor w -cspan 4 \ 1926 2,0 $inner.minorticks -anchor w -cspan 4 \ 1927 4,0 $inner.grid_l -anchor w \ 1928 4,1 $inner.xgrid -anchor w \ 1929 4,2 $inner.ygrid -anchor w \ 1930 4,3 $inner.zgrid -anchor w \ 1931 5,0 $inner.mode_l -anchor w -padx { 2 0 } \ 1932 5,1 $inner.mode -fill x -cspan 3 1934 1933 1935 1934 blt::table configure $inner r* c* -resize none … … 1939 1938 1940 1939 itcl::body Rappture::VtkVolumeViewer::BuildCameraTab {} { 1940 set font [option get $itk_component(hull) font Font] 1941 1941 set inner [$itk_component(main) insert end \ 1942 1942 -title "Camera Settings" \ … … 1944 1944 $inner configure -borderwidth 4 1945 1945 1946 label $inner.view_l -text "view" -font "Arial 9"1946 label $inner.view_l -text "view" -font $font 1947 1947 set f [frame $inner.view] 1948 1948 foreach side { front back left right top bottom } { … … 1960 1960 set labels { qx qy qz qw xpan ypan zoom } 1961 1961 foreach tag $labels { 1962 label $inner.${tag}label -text $tag -font "Arial 9"1963 entry $inner.${tag} -font "Arial 9"-bg white \1962 label $inner.${tag}label -text $tag -font $font 1963 entry $inner.${tag} -font $font -bg white \ 1964 1964 -textvariable [itcl::scope _view(-$tag)] 1965 1965 bind $inner.${tag} <Return> \ … … 1977 1977 -variable [itcl::scope _view(-ortho)] \ 1978 1978 -command [itcl::code $this camera set -ortho] \ 1979 -font "Arial 9"1979 -font $font 1980 1980 blt::table $inner \ 1981 1981 $row,0 $inner.ortho -cspan 2 -anchor w -pady 2 … … 1989 1989 1990 1990 itcl::body Rappture::VtkVolumeViewer::BuildCutplaneTab {} { 1991 1992 set fg [option get $itk_component(hull) font Font] 1991 set font [option get $itk_component(hull) font Font] 1993 1992 1994 1993 set inner [$itk_component(main) insert end \ … … 2002 2001 -variable [itcl::scope _settings(-cutplanesvisible)] \ 2003 2002 -command [itcl::code $this AdjustSetting -cutplanesvisible] \ 2004 -font "Arial 9"2003 -font $font 2005 2004 2006 2005 checkbutton $inner.lighting \ … … 2008 2007 -variable [itcl::scope _settings(-cutplanelighting)] \ 2009 2008 -command [itcl::code $this AdjustSetting -cutplanelighting] \ 2010 -font "Arial 9"2011 2012 label $inner.opacity_l -text "Opacity" -font "Arial 9"2009 -font $font 2010 2011 label $inner.opacity_l -text "Opacity" -font $font 2013 2012 ::scale $inner.opacity -from 0 -to 100 -orient horizontal \ 2014 2013 -variable [itcl::scope _settings(-cutplaneopacity)] \ … … 2335 2334 2336 2335 # 2337 # DrawLegendOld --2338 #2339 # Draws the legend in it's own canvas which resides to the right2340 # of the contour plot area.2341 #2342 itcl::body Rappture::VtkVolumeViewer::DrawLegendOld { } {2343 set fname $_curFldName2344 set c $itk_component(view)2345 set w [winfo width $c]2346 set h [winfo height $c]2347 set font "Arial 8"2348 set lineht [font metrics $font -linespace]2349 2350 if { [info exists _fields($fname)] } {2351 foreach { title units } $_fields($fname) break2352 if { $units != "" } {2353 set title [format "%s (%s)" $title $units]2354 }2355 } else {2356 set title $fname2357 }2358 if { $_settings(-legendvisible) } {2359 set x [expr $w - 2]2360 if { [$c find withtag "legend"] == "" } {2361 set y 22362 $c create text $x $y \2363 -anchor ne \2364 -fill $itk_option(-plotforeground) -tags "title legend" \2365 -font $font2366 incr y $lineht2367 $c create text $x $y \2368 -anchor ne \2369 -fill $itk_option(-plotforeground) -tags "vmax legend" \2370 -font $font2371 incr y $lineht2372 $c create image $x $y \2373 -anchor ne \2374 -image $_image(legend) -tags "colormap legend"2375 $c create text $x [expr {$h-2}] \2376 -anchor se \2377 -fill $itk_option(-plotforeground) -tags "vmin legend" \2378 -font $font2379 #$c bind colormap <Enter> [itcl::code $this EnterLegend %x %y]2380 $c bind colormap <Leave> [itcl::code $this LeaveLegend]2381 $c bind colormap <Motion> [itcl::code $this MotionLegend %x %y]2382 }2383 $c bind title <ButtonPress> [itcl::code $this Combo post]2384 $c bind title <Enter> [itcl::code $this Combo activate]2385 $c bind title <Leave> [itcl::code $this Combo deactivate]2386 # Reset the item coordinates according the current size of the plot.2387 $c itemconfigure title -text $title2388 if { [info exists _limits($_curFldName)] } {2389 foreach { vmin vmax } $_limits($_curFldName) break2390 $c itemconfigure vmin -text [format %g $vmin]2391 $c itemconfigure vmax -text [format %g $vmax]2392 }2393 set y 22394 $c coords title $x $y2395 incr y $lineht2396 $c coords vmax $x $y2397 incr y $lineht2398 $c coords colormap $x $y2399 $c coords vmin $x [expr {$h - 2}]2400 }2401 }2402 2403 #2404 2336 # EnterLegend -- 2405 2337 #
Note: See TracChangeset
for help on using the changeset viewer.