Changeset 6355
- Timestamp:
- May 23, 2016, 12:07:34 PM (8 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkheightmapviewer.tcl
r6345 r6355 103 103 private method Rotate {option x y} 104 104 private method SetCurrentColormap { color } 105 private method SetCurrentFieldName { dataobj } 105 106 private method SetLegendTip { x y } 106 107 private method SetObjectStyle { dataobj comp } … … 960 961 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 961 962 set _first $dataobj 963 SetCurrentFieldName $dataobj 962 964 } 963 965 foreach comp [$dataobj components] { … … 1001 1003 } 1002 1004 } 1003 if { $_first != "" } { 1004 $itk_component(field) choices delete 0 end 1005 $itk_component(fieldmenu) delete 0 end 1006 array unset _fields 1007 set _curFldName "" 1008 foreach cname [$_first components] { 1009 foreach fname [$_first fieldnames $cname] { 1010 if { [info exists _fields($fname)] } { 1011 continue 1012 } 1013 foreach { label units components } \ 1014 [$_first fieldinfo $fname] break 1015 $itk_component(field) choices insert end "$fname" "$label" 1016 $itk_component(fieldmenu) add radiobutton -label "$label" \ 1017 -value $label -variable [itcl::scope _curFldLabel] \ 1018 -selectcolor red \ 1019 -activebackground $itk_option(-plotbackground) \ 1020 -activeforeground $itk_option(-plotforeground) \ 1021 -font "Arial 8" \ 1022 -command [itcl::code $this LegendTitleAction save] 1023 set _fields($fname) [list $label $units $components] 1024 if { $_curFldName == "" } { 1025 set _curFldName $fname 1026 set _curFldLabel $label 1027 } 1028 } 1029 } 1030 $itk_component(field) value $_curFldLabel 1031 } 1005 1032 1006 InitSettings -stretchtofit -outline 1033 1034 1007 if { $_reset } { 1035 1008 SendCmd "axis tickpos outside" … … 2679 2652 blt::vector destroy $v 2680 2653 } 2654 2655 itcl::body Rappture::VtkHeightmapViewer::SetCurrentFieldName { dataobj } { 2656 set _first $dataobj 2657 $itk_component(field) choices delete 0 end 2658 $itk_component(fieldmenu) delete 0 end 2659 array unset _fields 2660 set _curFldName "" 2661 foreach cname [$_first components] { 2662 foreach fname [$_first fieldnames $cname] { 2663 if { [info exists _fields($fname)] } { 2664 continue 2665 } 2666 foreach { label units components } \ 2667 [$_first fieldinfo $fname] break 2668 $itk_component(field) choices insert end "$fname" "$label" 2669 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2670 -value $label -variable [itcl::scope _curFldLabel] \ 2671 -selectcolor red \ 2672 -activebackground $itk_option(-plotbackground) \ 2673 -activeforeground $itk_option(-plotforeground) \ 2674 -font "Arial 8" \ 2675 -command [itcl::code $this LegendTitleAction save] 2676 set _fields($fname) [list $label $units $components] 2677 if { $_curFldName == "" } { 2678 set _curFldName $fname 2679 set _curFldLabel $label 2680 } 2681 } 2682 } 2683 $itk_component(field) value $_curFldLabel 2684 } -
trunk/gui/scripts/vtkimageviewer.tcl
r6346 r6355 100 100 private method Rotate {option x y} 101 101 private method SetCurrentColormap { color } 102 private method SetCurrentFieldName { dataobj } 102 103 private method SetLegendTip { x y } 103 104 private method SetObjectStyle { dataobj comp } … … 932 933 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 933 934 set _first $dataobj 935 SetCurrentFieldName $dataobj 934 936 } 935 937 foreach comp [$dataobj components] { … … 968 970 } 969 971 } 970 if { $_first != "" } { 971 $itk_component(field) choices delete 0 end 972 $itk_component(fieldmenu) delete 0 end 973 array unset _fields 974 set _curFldName "" 975 foreach cname [$_first components] { 976 foreach fname [$_first fieldnames $cname] { 977 if { [info exists _fields($fname)] } { 978 continue 979 } 980 foreach { label units components } \ 981 [$_first fieldinfo $fname] break 982 $itk_component(field) choices insert end "$fname" "$label" 983 $itk_component(fieldmenu) add radiobutton -label "$label" \ 984 -value $label -variable [itcl::scope _curFldLabel] \ 985 -selectcolor red \ 986 -activebackground $itk_option(-plotbackground) \ 987 -activeforeground $itk_option(-plotforeground) \ 988 -font "Arial 8" \ 989 -command [itcl::code $this LegendTitleAction save] 990 set _fields($fname) [list $label $units $components] 991 if { $_curFldName == "" } { 992 set _curFldName $fname 993 set _curFldLabel $label 994 } 995 } 996 } 997 $itk_component(field) value $_curFldLabel 998 } 972 999 973 InitSettings -stretchtofit -outline 1000 1001 974 if { $_reset } { 1002 975 SendCmd "axis tickpos outside" … … 2327 2300 set _view(-zoom) 1.0 2328 2301 } 2302 2303 itcl::body Rappture::VtkImageViewer::SetCurrentFieldName { dataobj } { 2304 set _first $dataobj 2305 $itk_component(field) choices delete 0 end 2306 $itk_component(fieldmenu) delete 0 end 2307 array unset _fields 2308 set _curFldName "" 2309 foreach cname [$_first components] { 2310 foreach fname [$_first fieldnames $cname] { 2311 if { [info exists _fields($fname)] } { 2312 continue 2313 } 2314 foreach { label units components } \ 2315 [$_first fieldinfo $fname] break 2316 $itk_component(field) choices insert end "$fname" "$label" 2317 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2318 -value $label -variable [itcl::scope _curFldLabel] \ 2319 -selectcolor red \ 2320 -activebackground $itk_option(-plotbackground) \ 2321 -activeforeground $itk_option(-plotforeground) \ 2322 -font "Arial 8" \ 2323 -command [itcl::code $this LegendTitleAction save] 2324 set _fields($fname) [list $label $units $components] 2325 if { $_curFldName == "" } { 2326 set _curFldName $fname 2327 set _curFldLabel $label 2328 } 2329 } 2330 } 2331 $itk_component(field) value $_curFldLabel 2332 } -
trunk/gui/scripts/vtkstreamlinesviewer.tcl
r6338 r6355 105 105 private method Rotate {option x y} 106 106 private method SetCurrentColormap { color } 107 private method SetCurrentFieldName { dataobj } 107 108 private method SetLegendTip { x y } 108 109 private method SetObjectStyle { dataobj comp } … … 978 979 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 979 980 set _first $dataobj 981 SetCurrentFieldName $dataobj 980 982 } 981 983 foreach comp [$dataobj components] { … … 1023 1025 } 1024 1026 } 1025 $itk_component(field) choices delete 0 end1026 $itk_component(fieldmenu) delete 0 end1027 array unset _fields1028 set _curFldName ""1029 set _curFldLabel ""1030 foreach cname [$_first components] {1031 foreach fname [$_first fieldnames $cname] {1032 if { [info exists _fields($fname)] } {1033 continue1034 }1035 foreach { label units components } \1036 [$_first fieldinfo $fname] break1037 $itk_component(field) choices insert end "$fname" "$label"1038 $itk_component(fieldmenu) add radiobutton -label "$label" \1039 -value $label -variable [itcl::scope _curFldLabel] \1040 -selectcolor red \1041 -activebackground $itk_option(-plotbackground) \1042 -activeforeground $itk_option(-plotforeground) \1043 -font "Arial 8" \1044 -command [itcl::code $this LegendTitleAction save]1045 set _fields($fname) [list $label $units $components]1046 if { $_curFldName == "" && $components == 3 } {1047 set _curFldName $fname1048 set _curFldLabel $label1049 }1050 }1051 }1052 $itk_component(field) value $_curFldLabel1053 1027 } 1054 1028 … … 2434 2408 set _view(-zoom) 1.0 2435 2409 } 2410 2411 itcl::body Rappture::VtkStreamlinesViewer::SetCurrentFieldName { dataobj } { 2412 set _first $dataobj 2413 $itk_component(field) choices delete 0 end 2414 $itk_component(fieldmenu) delete 0 end 2415 array unset _fields 2416 set _curFldName "" 2417 set _curFldLabel "" 2418 foreach cname [$_first components] { 2419 foreach fname [$_first fieldnames $cname] { 2420 if { [info exists _fields($fname)] } { 2421 continue 2422 } 2423 foreach { label units components } \ 2424 [$_first fieldinfo $fname] break 2425 $itk_component(field) choices insert end "$fname" "$label" 2426 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2427 -value $label -variable [itcl::scope _curFldLabel] \ 2428 -selectcolor red \ 2429 -activebackground $itk_option(-plotbackground) \ 2430 -activeforeground $itk_option(-plotforeground) \ 2431 -font "Arial 8" \ 2432 -command [itcl::code $this LegendTitleAction save] 2433 set _fields($fname) [list $label $units $components] 2434 if { $_curFldName == "" && $components == 3 } { 2435 set _curFldName $fname 2436 set _curFldLabel $label 2437 } 2438 } 2439 } 2440 $itk_component(field) value $_curFldLabel 2441 } -
trunk/gui/scripts/vtkvolumeviewer.tcl
r6338 r6355 115 115 private method Rotate {option x y} 116 116 private method SendTransferFunctions {} 117 private method SetCurrentFieldName { dataobj } 117 118 private method SetInitialTransferFunction { dataobj cname } 118 119 private method SetLegendTip { x y } … … 1017 1018 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 1018 1019 set _first $dataobj 1020 SetCurrentFieldName $dataobj 1019 1021 } 1020 1022 foreach cname [$dataobj components] { … … 1063 1065 } 1064 1066 } 1065 $itk_component(field) choices delete 0 end1066 $itk_component(fieldmenu) delete 0 end1067 array unset _fields1068 set _curFldName ""1069 foreach cname [$_first components] {1070 foreach fname [$_first fieldnames $cname] {1071 if { [info exists _fields($fname)] } {1072 continue1073 }1074 foreach { label units components } \1075 [$_first fieldinfo $fname] break1076 # Only scalar fields are valid1077 if {$_allowMultiComponent || $components == 1} {1078 $itk_component(field) choices insert end "$fname" "$label"1079 $itk_component(fieldmenu) add radiobutton -label "$label" \1080 -value $label -variable [itcl::scope _curFldLabel] \1081 -selectcolor red \1082 -activebackground $itk_option(-plotbackground) \1083 -activeforeground $itk_option(-plotforeground) \1084 -font "Arial 8" \1085 -command [itcl::code $this LegendTitleAction save]1086 set _fields($fname) [list $label $units $components]1087 if { $_curFldName == "" } {1088 set _curFldName $fname1089 set _curFldLabel $label1090 }1091 }1092 }1093 }1094 $itk_component(field) value $_curFldLabel1095 1067 } 1096 1068 … … 2864 2836 return [ColorsToColormap $color] 2865 2837 } 2838 2839 itcl::body Rappture::VtkVolumeViewer::SetCurrentFieldName { dataobj } { 2840 set _first $dataobj 2841 $itk_component(field) choices delete 0 end 2842 $itk_component(fieldmenu) delete 0 end 2843 array unset _fields 2844 set _curFldName "" 2845 foreach cname [$_first components] { 2846 foreach fname [$_first fieldnames $cname] { 2847 if { [info exists _fields($fname)] } { 2848 continue 2849 } 2850 foreach { label units components } \ 2851 [$_first fieldinfo $fname] break 2852 # Only scalar fields are valid 2853 if {$_allowMultiComponent || $components == 1} { 2854 $itk_component(field) choices insert end "$fname" "$label" 2855 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2856 -value $label -variable [itcl::scope _curFldLabel] \ 2857 -selectcolor red \ 2858 -activebackground $itk_option(-plotbackground) \ 2859 -activeforeground $itk_option(-plotforeground) \ 2860 -font "Arial 8" \ 2861 -command [itcl::code $this LegendTitleAction save] 2862 set _fields($fname) [list $label $units $components] 2863 if { $_curFldName == "" } { 2864 set _curFldName $fname 2865 set _curFldLabel $label 2866 } 2867 } 2868 } 2869 } 2870 $itk_component(field) value $_curFldLabel 2871 }
Note: See TracChangeset
for help on using the changeset viewer.