Changeset 4194 for trunk/gui/scripts/vtkvolumeviewer.tcl
- Timestamp:
- Feb 26, 2014, 11:08:22 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkvolumeviewer.tcl
r4193 r4194 250 250 -axislabelsvisible 1 251 251 -background black 252 -cutplaneedgesvisible 0253 252 -cutplanelighting 1 254 253 -cutplaneopacity 100 255 254 -cutplanesvisible 0 256 -cutplanewireframe 0257 255 -legendvisible 1 258 256 -volumeambient 40 … … 1373 1371 } 1374 1372 switch -- $what { 1373 "-current" { 1374 set cname [$itk_component(volcomponents) value] 1375 SwitchComponent $cname 1376 } 1375 1377 "-background" { 1376 1378 set bgcolor [$itk_component(background) value] … … 1438 1440 } 1439 1441 "-volumeambient" { 1442 # Other parts of the code use the -volumeambient setting to 1443 # tell if the component settings have been initialized 1444 if { ![info exists _settings($_current${what})] } { 1445 InitComponentSettings $_current 1446 } 1440 1447 set val $_settings(${what}) 1441 1448 set _settings($_current${what}) $val … … 1503 1510 set _settings(${what}) $mode 1504 1511 SendCmd "axis flymode $mode" 1505 }1506 "-cutplaneedgesvisible" {1507 set bool $_settings(${what})1508 foreach dataset [CurrentDatasets -visible] {1509 if {$_cutplaneCmd != "imgcutplane"} {1510 SendCmd "$_cutplaneCmd edges $bool $dataset"1511 }1512 }1513 }1514 "-cutplanewireframe" {1515 set bool $_settings(${what})1516 foreach dataset [CurrentDatasets -visible] {1517 if {$_cutplaneCmd != "imgcutplane"} {1518 SendCmd "$_cutplaneCmd wireframe $bool $dataset"1519 }1520 }1521 1512 } 1522 1513 "-cutplanesvisible" { … … 1913 1904 checkbutton $inner.labels \ 1914 1905 -text "Show Axis Labels" \ 1915 -variable [itcl::scope _settings(-axislabelsvisib oe)] \1906 -variable [itcl::scope _settings(-axislabelsvisible)] \ 1916 1907 -command [itcl::code $this AdjustSetting -axislabelsvisible] \ 1917 1908 -font "Arial 9" … … 2024 2015 -font "Arial 9" 2025 2016 2026 checkbutton $inner.wireframe \2027 -text "Show Wireframe" \2028 -variable [itcl::scope _settings(-cutplanewireframe)] \2029 -command [itcl::code $this AdjustSetting -cutplanewireframe] \2030 -font "Arial 9"2031 2032 2017 checkbutton $inner.lighting \ 2033 2018 -text "Enable Lighting" \ 2034 2019 -variable [itcl::scope _settings(-cutplanelighting)] \ 2035 2020 -command [itcl::code $this AdjustSetting -cutplanelighting] \ 2036 -font "Arial 9"2037 2038 checkbutton $inner.edges \2039 -text "Show Edges" \2040 -variable [itcl::scope _settings(-cutplaneedgesvisible)] \2041 -command [itcl::code $this AdjustSetting -cutplaneedgesvisible] \2042 2021 -font "Arial 9" 2043 2022 … … 2136 2115 0,0 $inner.visible -anchor w -pady 2 -cspan 4 \ 2137 2116 1,0 $inner.lighting -anchor w -pady 2 -cspan 4 \ 2138 2,0 $inner.wireframe -anchor w -pady 2 -cspan 4 \ 2139 3,0 $inner.edges -anchor w -pady 2 -cspan 4 \ 2140 4,0 $inner.opacity_l -anchor w -pady 2 -cspan 3 \ 2141 5,0 $inner.opacity -fill x -pady 2 -cspan 3 \ 2142 6,0 $itk_component(xCutButton) -anchor e -padx 2 -pady 2 \ 2143 7,0 $itk_component(xCutScale) -fill y \ 2144 6,1 $itk_component(yCutButton) -anchor e -padx 2 -pady 2 \ 2145 7,1 $itk_component(yCutScale) -fill y \ 2146 6,2 $itk_component(zCutButton) -anchor e -padx 2 -pady 2 \ 2147 7,2 $itk_component(zCutScale) -fill y \ 2117 2,0 $inner.opacity_l -anchor w -pady 2 -cspan 3 \ 2118 3,0 $inner.opacity -fill x -pady 2 -cspan 3 \ 2119 4,0 $itk_component(xCutButton) -anchor e -padx 2 -pady 2 \ 2120 5,0 $itk_component(xCutScale) -fill y \ 2121 4,1 $itk_component(yCutButton) -anchor e -padx 2 -pady 2 \ 2122 5,1 $itk_component(yCutScale) -fill y \ 2123 4,2 $itk_component(zCutButton) -anchor e -padx 2 -pady 2 \ 2124 5,2 $itk_component(zCutScale) -fill y \ 2148 2125 2149 2126 blt::table configure $inner r* c* -resize none 2150 blt::table configure $inner r 7c3 -resize expand2127 blt::table configure $inner r5 c3 -resize expand 2151 2128 } 2152 2129 … … 2259 2236 -color BCGYR 2260 2237 -volumelighting 1 2261 -volumelinewidth 1.02262 2238 -volumeoutline 0 2263 2239 -volumevisible 1 2264 }2265 if { $dataobj != $_first } {2266 set style(-opacity) 12267 2240 } 2268 2241 array set styles [$dataobj style $cname] … … 2675 2648 -color BCGYR 2676 2649 -levels 6 2677 -opacity 1.02678 2650 -markers "" 2679 2651 } … … 2685 2657 } 2686 2658 set _settings($cname-color) $styles(-color) 2687 set _settings($cname-volumeopacity) $styles(-opacity)2688 2659 set cmap [ColorsToColormap $styles(-color)] 2689 2660 set _cname2defaultcolormap($cname) $cmap … … 2789 2760 array set _settings [subst { 2790 2761 $cname-color default 2791 $cname-light2side 12792 $cname-volumeoutline 02793 2762 $cname-volumeambient 40 2794 2763 $cname-volumeblendmode composite 2795 2764 $cname-volumediffuse 60 2765 $cname-volumelight2side 1 2796 2766 $cname-volumelighting 1 2797 2767 $cname-volumeopacity 50 2768 $cname-volumeoutline 0 2798 2769 $cname-volumequality 80 2799 2770 $cname-volumespecularexponent 90 … … 2817 2788 # _settings variables change widgets, except for colormap 2818 2789 foreach name { 2819 -volume light2side2820 -volume outline2821 -volume ambient2822 -volume blendmode2823 -volume diffuse2824 -volume lighting2825 -volumeo pacity2826 -volumequality 2827 -volumespecularexponent 2828 -volumespecularlevel 2829 -volumethickness 2830 -volumevisible 2790 -volumeambient 2791 -volumeblendmode 2792 -volumediffuse 2793 -volumelight2side 2794 -volumelighting 2795 -volumeopacity 2796 -volumeoutline 2797 -volumequality 2798 -volumespecularexponent 2799 -volumespecularlevel 2800 -volumethickness 2801 -volumevisible 2831 2802 } { 2832 set _settings($name) $_settings(${cname} -${name})2803 set _settings($name) $_settings(${cname}${name}) 2833 2804 } 2834 2805 $itk_component(colormap) value $_settings($cname-color) … … 2843 2814 InitComponentSettings $cname 2844 2815 } 2845 set max 1.0 ; #$_settings($tag-opacity)2846 2816 2847 2817 set isovalues [$_transferFunctionEditors($cname) values] 2848 2818 2849 # Ensure that the global opacity and thickness settings (in the slider 2850 # settings widgets) are used for the active transfer-function. Update 2851 # the values in the _settings varible. 2852 set opacity [expr { double($_settings($cname-volumeopacity)) * 0.01 }] 2853 2819 # Currently using volume opacity to scale opacity in 2820 # the volume shader. The transfer function always sets full 2821 # opacity 2822 set max 1.0; 2823 2824 # Use the component-wise thickness setting from the slider 2825 # settings widget 2854 2826 # Scale values between 0.00001 and 0.01000 2855 2827 set delta [expr {double($_settings($cname-volumethickness)) * 0.0001}]
Note: See TracChangeset
for help on using the changeset viewer.