Changeset 6363 for branches/1.6/gui
- Timestamp:
- May 24, 2016, 8:18:10 AM (8 years ago)
- Location:
- branches/1.6
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.6
- Property svn:mergeinfo changed
/trunk merged: 6343-6346,6355-6357,6359-6362
- Property svn:mergeinfo changed
-
branches/1.6/gui/scripts/flowvisviewer.tcl
r6358 r6363 1119 1119 DoResize 1120 1120 } 1121 1121 if { $_reset } { 1122 InitSettings -background -axesvisible -gridvisible 1123 } 1122 1124 set _first "" 1123 1125 foreach dataobj [get] { … … 1165 1167 1166 1168 # Reset the camera and other view parameters 1167 InitSettings -axesvisible -gridvisible \ 1168 -opacity -light2side -isosurfaceshading \ 1169 InitSettings -opacity -light2side -isosurfaceshading \ 1169 1170 -light \ 1170 1171 -volume -outlinevisible -cutplanesvisible \ -
branches/1.6/gui/scripts/nanovisviewer.tcl
r6358 r6363 940 940 DoResize 941 941 } 942 942 if { $_reset } { 943 InitSettings -background -axesvisible -gridvisible 944 } 943 945 foreach dataobj [get] { 944 946 foreach cname [$dataobj components] { … … 1005 1007 } 1006 1008 1007 InitSettings -axesvisible -gridvisible \ 1008 -light2side -isosurfaceshading -opacity \ 1009 InitSettings -opacity -light2side -isosurfaceshading \ 1009 1010 -light \ 1010 1011 -xcutplanevisible -ycutplanevisible -zcutplanevisible -
branches/1.6/gui/scripts/vtkglyphviewer.tcl
r6340 r6363 144 144 private variable _rotatePending 0 145 145 private variable _cutplanePending 0 146 private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar)147 146 private variable _fields 148 147 private variable _curFldName "" 149 148 private variable _curFldLabel "" 149 private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar) 150 150 151 151 private common _downloadPopup; # download options from popup … … 597 597 set _dlist [lreplace $_dlist $pos $pos] 598 598 array unset _obj2ovride $dataobj-* 599 array unset _settings $dataobj-*600 599 set changed 1 601 600 } … … 1278 1277 itcl::body Rappture::VtkGlyphViewer::InitSettings { args } { 1279 1278 foreach spec $args { 1280 if { [info exists _settings($_first${spec})] } {1281 # Reset global setting with dataobj specific setting1282 set _settings($spec) $_settings($_first${spec})1283 }1284 1279 AdjustSetting $spec 1285 1280 } -
branches/1.6/gui/scripts/vtkheightmapviewer.tcl
r6340 r6363 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 } … … 261 262 262 263 itk_component add fieldmenu { 263 menu $itk_component(plotarea).menu \ 264 -relief flat \ 265 -tearoff 0 264 menu $itk_component(plotarea).menu -relief flat -tearoff 0 266 265 } { 267 266 usual … … 292 291 } 293 292 pack $itk_component(reset) -side top -padx 2 -pady { 2 0 } 294 Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level" 293 Rappture::Tooltip::for $itk_component(reset) \ 294 "Reset the view to the default zoom level" 295 295 296 296 itk_component add zoomin { … … 526 526 set _dlist [lreplace $_dlist $pos $pos] 527 527 array unset _obj2ovride $dataobj-* 528 array unset _settings $dataobj-*529 528 set changed 1 530 529 } … … 923 922 # Reset the camera and other view parameters 924 923 # 925 InitSettings -isheightmap -background 924 InitSettings -isheightmap -background \ 925 -xgrid -ygrid -zgrid -axismode \ 926 -axesvisible -axislabels -axisminorticks 926 927 927 928 # Setting a custom exponent and label format for axes is causing … … 936 937 #SendCmd "axis exp 0 0 0 1" 937 938 939 SendCmd "axis tickpos outside" 938 940 SendCmd "axis lrot z 90" 939 941 $_arcball quaternion [ViewToQuaternion] … … 960 962 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 961 963 set _first $dataobj 964 SetCurrentFieldName $dataobj 962 965 } 963 966 foreach comp [$dataobj components] { … … 1001 1004 } 1002 1005 } 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 } 1006 1032 1007 InitSettings -stretchtofit -outline 1033 1034 1008 if { $_reset } { 1035 SendCmd "axis tickpos outside"1036 #SendCmd "axis lformat all %g"1037 1038 1009 foreach axis { x y z } { 1039 1010 set label "" … … 1092 1063 } 1093 1064 PanCamera 1094 InitSettings -xgrid -ygrid -zgrid \ 1095 -axesvisible -axislabels -heightmapscale -field -isheightmap \ 1096 -numisolines 1065 InitSettings -heightmapscale -field -isheightmap -numisolines 1097 1066 if { [array size _fields] < 2 } { 1098 1067 catch {blt::table forget $itk_component(field) $itk_component(field_l)} … … 1334 1303 itcl::body Rappture::VtkHeightmapViewer::InitSettings { args } { 1335 1304 foreach spec $args { 1336 if { [info exists _settings($_first${spec})] } {1337 # Reset global setting with dataobj specific setting1338 set _settings($spec) $_settings($_first${spec})1339 }1340 1305 AdjustSetting $spec 1341 1306 } … … 1604 1569 set _changed($what) 1 1605 1570 set bool $_settings($what) 1606 if { $bool } { 1571 set color [$itk_component(isolinecolor) value] 1572 if { $bool && $color != $_settings(-isolinecolor)} { 1607 1573 $itk_component(isolinecolor) value $_settings(-isolinecolor) 1608 1574 } … … 2276 2242 set tag $dataobj-$comp 2277 2243 array set style { 2278 -color BCGYR 2279 -colormapvisible 1 2280 -edgecolor black 2281 -edges 0 2282 -isolinecolor black 2283 -isolinesvisible 1 2284 -isolinewidth 1.0 2285 -levels 10 2286 -linewidth 1.0 2287 -opacity 1.0 2288 -outline 0 2289 -wireframe 0 2244 -color BCGYR 2245 -colormapdiscrete 0 2246 -colormapvisible 1 2247 -edgecolor black 2248 -edges 0 2249 -isolinecolor black 2250 -isolinesvisible 1 2251 -isolinewidth 1.0 2252 -levels 10 2253 -linewidth 1.0 2254 -opacity 1.0 2255 -outline 0 2256 -wireframe 0 2290 2257 } 2291 2258 set stylelist [$dataobj style $comp] … … 2325 2292 DrawLegend 2326 2293 } 2327 foreach setting {-edges -outline -wireframe \2294 foreach setting {-edges -outline -wireframe -colormapdiscrete \ 2328 2295 -colormapvisible -isolinecolor -isolinesvisible} { 2329 2296 if {$_changed($setting)} { … … 2348 2315 SendCmd "heightmap wireframe $style(-wireframe) $tag" 2349 2316 SetCurrentColormap $style(-color) 2317 if {$style(-colormapdiscrete)} { 2318 SendCmd "heightmap preinterp 1 $tag" 2319 set numColors [expr $style(-levels) + 1] 2320 SendCmd "colormap res $numColors $style(-color)" 2321 } 2350 2322 SendCmd "heightmap isolinecolor [Color2RGB $style(-isolinecolor)] $tag" 2351 2323 $itk_component(isolinecolor) value $style(-isolinecolor) … … 2391 2363 # DrawLegend -- 2392 2364 # 2393 # Draws the legend in theown canvas on the right side of the plot area.2365 # Draws the legend in its own canvas on the right side of the plot area. 2394 2366 # 2395 2367 itcl::body Rappture::VtkHeightmapViewer::DrawLegend {} { … … 2678 2650 blt::vector destroy $v 2679 2651 } 2652 2653 itcl::body Rappture::VtkHeightmapViewer::SetCurrentFieldName { dataobj } { 2654 set _first $dataobj 2655 $itk_component(field) choices delete 0 end 2656 $itk_component(fieldmenu) delete 0 end 2657 array unset _fields 2658 set _curFldName "" 2659 foreach cname [$_first components] { 2660 foreach fname [$_first fieldnames $cname] { 2661 if { [info exists _fields($fname)] } { 2662 continue 2663 } 2664 foreach { label units components } \ 2665 [$_first fieldinfo $fname] break 2666 $itk_component(field) choices insert end "$fname" "$label" 2667 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2668 -value $label -variable [itcl::scope _curFldLabel] \ 2669 -selectcolor red \ 2670 -activebackground $itk_option(-plotbackground) \ 2671 -activeforeground $itk_option(-plotforeground) \ 2672 -font "Arial 8" \ 2673 -command [itcl::code $this LegendTitleAction save] 2674 set _fields($fname) [list $label $units $components] 2675 if { $_curFldName == "" } { 2676 set _curFldName $fname 2677 set _curFldLabel $label 2678 } 2679 } 2680 } 2681 $itk_component(field) value $_curFldLabel 2682 } -
branches/1.6/gui/scripts/vtkimageviewer.tcl
r6340 r6363 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 } … … 243 244 244 245 itk_component add fieldmenu { 245 menu $itk_component(plotarea).menu \ 246 -relief flat \ 247 -tearoff 0 246 menu $itk_component(plotarea).menu -relief flat -tearoff 0 248 247 } { 249 248 usual … … 274 273 } 275 274 pack $itk_component(reset) -side top -padx 2 -pady { 2 0 } 276 Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level" 275 Rappture::Tooltip::for $itk_component(reset) \ 276 "Reset the view to the default zoom level" 277 277 278 278 itk_component add zoomin { … … 510 510 set _dlist [lreplace $_dlist $pos $pos] 511 511 array unset _obj2ovride $dataobj-* 512 array unset _settings $dataobj-*513 512 set changed 1 514 513 } … … 604 603 } 605 604 foreach axis { x y } { 605 set units [$dataobj hints ${axis}units] 606 set found($units) 1 606 607 set lim [$dataobj limits $axis] 607 608 if { ![info exists _limits($axis)] } { … … 618 619 } 619 620 set _limits($axis) [list $amin $amax] 620 set units [$dataobj hints ${axis}units]621 set found($units) 1622 621 } 623 622 foreach { fname lim } [$dataobj fieldlimits] { … … 900 899 DoResize 901 900 if { $_settings(-stretchtofit) } { 902 AdjustSetting -stretch ToFit901 AdjustSetting -stretchtofit 903 902 } 904 903 } … … 907 906 # Reset the camera and other view parameters 908 907 # 909 InitSettings -view3d -background 910 908 InitSettings -view3d -background \ 909 -xgrid -ygrid -zgrid -axismode \ 910 -axesvisible -axislabels -axisminorticks 911 912 SendCmd "axis tickpos outside" 911 913 SendCmd "axis lrot z 90" 912 914 $_arcball quaternion [ViewToQuaternion] … … 932 934 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 933 935 set _first $dataobj 936 SetCurrentFieldName $dataobj 934 937 } 935 938 foreach comp [$dataobj components] { … … 968 971 } 969 972 } 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 } 973 999 974 InitSettings -stretchtofit -outline 1000 1001 975 if { $_reset } { 1002 SendCmd "axis tickpos outside"1003 #SendCmd "axis lformat all %g"1004 1005 976 foreach axis { x y z } { 1006 977 set label "" … … 1043 1014 } 1044 1015 PanCamera 1045 InitSettings -xgrid -ygrid -zgrid \ 1046 -axesvisible -axislabels -field -view3d 1016 InitSettings -field -view3d 1047 1017 if { [array size _fields] < 2 } { 1048 1018 catch {blt::table forget $itk_component(field) $itk_component(field_l)} … … 1275 1245 itcl::body Rappture::VtkImageViewer::InitSettings { args } { 1276 1246 foreach spec $args { 1277 if { [info exists _settings($_first${spec})] } {1278 # Reset global setting with dataobj specific setting1279 set _settings($spec) $_settings($_first${spec})1280 }1281 1247 AdjustSetting $spec 1282 1248 } … … 2046 2012 if { [info exists style(-stretchtofit)] } { 2047 2013 set _settings(-stretchtofit) $style(-stretchtofit) 2048 AdjustSetting -stretch ToFit2014 AdjustSetting -stretchtofit 2049 2015 } 2050 2016 SendCmd "outline add $tag" … … 2092 2058 # DrawLegend -- 2093 2059 # 2094 # Draws the legend in theown canvas on the right side of the plot area.2060 # Draws the legend in its own canvas on the right side of the plot area. 2095 2061 # 2096 2062 itcl::body Rappture::VtkImageViewer::DrawLegend {} { … … 2327 2293 set _view(-zoom) 1.0 2328 2294 } 2295 2296 itcl::body Rappture::VtkImageViewer::SetCurrentFieldName { dataobj } { 2297 set _first $dataobj 2298 $itk_component(field) choices delete 0 end 2299 $itk_component(fieldmenu) delete 0 end 2300 array unset _fields 2301 set _curFldName "" 2302 foreach cname [$_first components] { 2303 foreach fname [$_first fieldnames $cname] { 2304 if { [info exists _fields($fname)] } { 2305 continue 2306 } 2307 foreach { label units components } \ 2308 [$_first fieldinfo $fname] break 2309 $itk_component(field) choices insert end "$fname" "$label" 2310 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2311 -value $label -variable [itcl::scope _curFldLabel] \ 2312 -selectcolor red \ 2313 -activebackground $itk_option(-plotbackground) \ 2314 -activeforeground $itk_option(-plotforeground) \ 2315 -font "Arial 8" \ 2316 -command [itcl::code $this LegendTitleAction save] 2317 set _fields($fname) [list $label $units $components] 2318 if { $_curFldName == "" } { 2319 set _curFldName $fname 2320 set _curFldLabel $label 2321 } 2322 } 2323 } 2324 $itk_component(field) value $_curFldLabel 2325 } -
branches/1.6/gui/scripts/vtkisosurfaceviewer.tcl
r6340 r6363 160 160 private variable _rotatePending 0 161 161 private variable _cutplanePending 0 162 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar)163 162 private variable _fields 164 163 private variable _curFldName "" 165 164 private variable _curFldLabel "" 165 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 166 166 private variable _mouseOver ""; # what called LegendRangeAction: 167 167 # vmin or vmax … … 653 653 set _dlist [lreplace $_dlist $pos $pos] 654 654 array unset _obj2ovride $dataobj-* 655 array unset _settings $dataobj-*656 655 set changed 1 657 656 } … … 1346 1345 itcl::body Rappture::VtkIsosurfaceViewer::InitSettings { args } { 1347 1346 foreach spec $args { 1348 if { [info exists _settings($_first${spec})] } {1349 # Reset global setting with dataobj specific setting1350 set _settings($spec) $_settings($_first${spec})1351 }1352 1347 AdjustSetting $spec 1353 1348 } -
branches/1.6/gui/scripts/vtkstreamlinesviewer.tcl
r6340 r6363 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 } … … 145 146 private variable _curFldName "" 146 147 private variable _curFldLabel "" 148 private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar) 147 149 private variable _streamlinesLength 0 148 150 private variable _numSeeds 200 149 private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar)150 151 151 152 private common _downloadPopup; # download options from popup … … 300 301 } 301 302 pack $itk_component(reset) -side top -padx 2 -pady 2 302 Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level" 303 Rappture::Tooltip::for $itk_component(reset) \ 304 "Reset the view to the default zoom level" 303 305 304 306 itk_component add zoomin { … … 588 590 set _dlist [lreplace $_dlist $pos $pos] 589 591 array unset _obj2ovride $dataobj-* 590 array unset _settings $dataobj-*591 592 set changed 1 592 593 } … … 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 … … 1295 1269 itcl::body Rappture::VtkStreamlinesViewer::InitSettings { args } { 1296 1270 foreach spec $args { 1297 if { [info exists _settings($_first${spec})] } {1298 # Reset global setting with dataobj specific setting1299 set _settings($spec) $_settings($_first${spec})1300 }1301 1271 AdjustSetting $spec 1302 1272 } … … 2434 2404 set _view(-zoom) 1.0 2435 2405 } 2406 2407 itcl::body Rappture::VtkStreamlinesViewer::SetCurrentFieldName { dataobj } { 2408 set _first $dataobj 2409 $itk_component(field) choices delete 0 end 2410 $itk_component(fieldmenu) delete 0 end 2411 array unset _fields 2412 set _curFldName "" 2413 set _curFldLabel "" 2414 foreach cname [$_first components] { 2415 foreach fname [$_first fieldnames $cname] { 2416 if { [info exists _fields($fname)] } { 2417 continue 2418 } 2419 foreach { label units components } \ 2420 [$_first fieldinfo $fname] break 2421 $itk_component(field) choices insert end "$fname" "$label" 2422 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2423 -value $label -variable [itcl::scope _curFldLabel] \ 2424 -selectcolor red \ 2425 -activebackground $itk_option(-plotbackground) \ 2426 -activeforeground $itk_option(-plotforeground) \ 2427 -font "Arial 8" \ 2428 -command [itcl::code $this LegendTitleAction save] 2429 set _fields($fname) [list $label $units $components] 2430 if { $_curFldName == "" && $components == 3 } { 2431 set _curFldName $fname 2432 set _curFldLabel $label 2433 } 2434 } 2435 } 2436 $itk_component(field) value $_curFldLabel 2437 } -
branches/1.6/gui/scripts/vtksurfaceviewer.tcl
r6340 r6363 139 139 private variable _legendPending 0 140 140 private variable _rotatePending 0 141 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar)142 141 private variable _fields 143 142 private variable _curFldName "" 144 143 private variable _curFldLabel "" 144 private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar) 145 145 146 146 private common _downloadPopup; # download options from popup … … 509 509 set _dlist [lreplace $_dlist $pos $pos] 510 510 array unset _obj2ovride $dataobj-* 511 array unset _settings $dataobj-*512 511 set changed 1 513 512 } … … 1190 1189 itcl::body Rappture::VtkSurfaceViewer::InitSettings { args } { 1191 1190 foreach spec $args { 1192 if { [info exists _settings($_first${spec})] } {1193 # Reset global setting with dataobj specific setting1194 set _settings($spec) $_settings($_first${spec})1195 }1196 1191 AdjustSetting $spec 1197 1192 } … … 1315 1310 set _changed($what) 1 1316 1311 set color [$itk_component(isolinecolor) value] 1317 set _settings($what) $color 1318 SendCmd "contour2d linecolor [Color2RGB $color]" 1312 if { $color == "none" } { 1313 if { $_settings(-isolinesvisible) } { 1314 set _changed(-isolinesvisible) 1 1315 foreach tag [CurrentDatasets -visible] { 1316 SendCmd "contour2d visible 0 $tag" 1317 } 1318 set _settings(-isolinesvisible) 0 1319 } 1320 } else { 1321 set _settings($what) $color 1322 if { !$_settings(-isolinesvisible) } { 1323 set _changed(-isolinesvisible) 1 1324 foreach tag [CurrentDatasets -visible] { 1325 SendCmd "contour2d visible 1 $tag" 1326 } 1327 set _settings(-isolinesvisible) 1 1328 } 1329 SendCmd "contour2d linecolor [Color2RGB $color]" 1330 } 1319 1331 DrawLegend 1320 1332 } … … 1324 1336 SendCmd "contour2d visible 0" 1325 1337 if { $bool } { 1338 if { [$itk_component(isolinecolor) value] != $_settings(-isolinecolor)} { 1339 $itk_component(isolinecolor) value $_settings(-isolinecolor) 1340 } 1326 1341 foreach tag [CurrentDatasets -visible] { 1327 1342 SendCmd "contour2d visible $bool $tag" -
branches/1.6/gui/scripts/vtkviewer.tcl
r6340 r6363 631 631 set _dlist [lreplace $_dlist $pos $pos] 632 632 array unset _obj2ovride $dataobj-* 633 array unset _settings $dataobj-*634 633 set changed 1 635 634 } -
branches/1.6/gui/scripts/vtkvolumeviewer.tcl
r6342 r6363 105 105 private method Rotate {option x y} 106 106 private method SetColormap { dataobj comp } 107 private method SetCurrentFieldName { dataobj } 107 108 private method SetLegendTip { x y } 108 109 private method SetObjectStyle { dataobj cname } … … 548 549 set _dlist [lreplace $_dlist $pos $pos] 549 550 array unset _obj2ovride $dataobj-* 550 array unset _settings $dataobj-*551 551 set changed 1 552 552 } … … 986 986 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 987 987 set _first $dataobj 988 SetCurrentFieldName $dataobj 988 989 } 989 990 foreach cname [$dataobj components] { … … 1032 1033 } 1033 1034 } 1034 $itk_component(field) choices delete 0 end1035 $itk_component(fieldmenu) delete 0 end1036 array unset _fields1037 set _curFldName ""1038 foreach cname [$_first components] {1039 foreach fname [$_first fieldnames $cname] {1040 if { [info exists _fields($fname)] } {1041 continue1042 }1043 foreach { label units components } \1044 [$_first fieldinfo $fname] break1045 # Only scalar fields are valid1046 if {$_allowMultiComponent || $components == 1} {1047 $itk_component(field) choices insert end "$fname" "$label"1048 $itk_component(fieldmenu) add radiobutton -label "$label" \1049 -value $label -variable [itcl::scope _curFldLabel] \1050 -selectcolor red \1051 -activebackground $itk_option(-plotbackground) \1052 -activeforeground $itk_option(-plotforeground) \1053 -font "Arial 8" \1054 -command [itcl::code $this LegendTitleAction save]1055 set _fields($fname) [list $label $units $components]1056 if { $_curFldName == "" } {1057 set _curFldName $fname1058 set _curFldLabel $label1059 }1060 }1061 }1062 }1063 $itk_component(field) value $_curFldLabel1064 1035 } 1065 1036 … … 1296 1267 itcl::body Rappture::VtkVolumeViewer::InitSettings { args } { 1297 1268 foreach spec $args { 1298 if { [info exists _settings($_first${spec})] } {1299 # Reset global setting with dataobj specific setting1300 set _settings($spec) $_settings($_first${spec})1301 }1302 1269 AdjustSetting $spec 1303 1270 } … … 2414 2381 return $_volcomponents($cname) 2415 2382 } 2383 2384 itcl::body Rappture::VtkVolumeViewer::SetCurrentFieldName { dataobj } { 2385 set _first $dataobj 2386 $itk_component(field) choices delete 0 end 2387 $itk_component(fieldmenu) delete 0 end 2388 array unset _fields 2389 set _curFldName "" 2390 foreach cname [$_first components] { 2391 foreach fname [$_first fieldnames $cname] { 2392 if { [info exists _fields($fname)] } { 2393 continue 2394 } 2395 foreach { label units components } \ 2396 [$_first fieldinfo $fname] break 2397 # Only scalar fields are valid 2398 if {$_allowMultiComponent || $components == 1} { 2399 $itk_component(field) choices insert end "$fname" "$label" 2400 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2401 -value $label -variable [itcl::scope _curFldLabel] \ 2402 -selectcolor red \ 2403 -activebackground $itk_option(-plotbackground) \ 2404 -activeforeground $itk_option(-plotforeground) \ 2405 -font "Arial 8" \ 2406 -command [itcl::code $this LegendTitleAction save] 2407 set _fields($fname) [list $label $units $components] 2408 if { $_curFldName == "" } { 2409 set _curFldName $fname 2410 set _curFldLabel $label 2411 } 2412 } 2413 } 2414 } 2415 $itk_component(field) value $_curFldLabel 2416 }
Note: See TracChangeset
for help on using the changeset viewer.