Changeset 6414 for branches/blt4_trunk/gui/scripts/vtkstreamlinesviewer.tcl
- Timestamp:
- Jul 1, 2016, 7:11:32 AM (8 years ago)
- Location:
- branches/blt4_trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4_trunk
- Property svn:mergeinfo changed
/branches/multichoice (added) merged: 6249,6251,6317,6371 /trunk merged: 6352-6353,6355-6357,6359-6362,6365-6367,6370,6372,6376-6377,6379,6405-6407,6410,6412-6413
- Property svn:mergeinfo changed
-
branches/blt4_trunk/gui/scripts/vtkstreamlinesviewer.tcl
r6351 r6414 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 } … … 1382 1352 SendCmd "dataset maprange all" 1383 1353 } else { 1384 SendCmd "dataset maprange explicit $_limits($_curFldName) $_curFldName" 1385 } 1386 SendCmd "streamlines colormode $_colorMode $_curFldName" 1387 SendCmd "cutplane colormode $_colorMode $_curFldName" 1354 foreach { vmin vmax } $_limits($_curFldName) break 1355 SendCmd [list dataset maprange explicit $vmin $vmax $_curFldName] 1356 } 1357 SendCmd [list streamlines colormode $_colorMode $_curFldName] 1358 SendCmd [list cutplane colormode $_colorMode $_curFldName] 1388 1359 DrawLegend 1389 1360 } … … 1526 1497 set _colormaps($cmap) 1 1527 1498 } 1528 #SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0"1499 #SendCmd [list legend $cmap $_colorMode $_curFldName {} $w $h 0] 1529 1500 SendCmd "legend2 $cmap $w $h" 1530 1501 } … … 2434 2405 set _view(-zoom) 1.0 2435 2406 } 2407 2408 itcl::body Rappture::VtkStreamlinesViewer::SetCurrentFieldName { dataobj } { 2409 set _first $dataobj 2410 $itk_component(field) choices delete 0 end 2411 $itk_component(fieldmenu) delete 0 end 2412 array unset _fields 2413 set _curFldName "" 2414 set _curFldLabel "" 2415 foreach cname [$_first components] { 2416 foreach fname [$_first fieldnames $cname] { 2417 if { [info exists _fields($fname)] } { 2418 continue 2419 } 2420 foreach { label units components } \ 2421 [$_first fieldinfo $fname] break 2422 $itk_component(field) choices insert end "$fname" "$label" 2423 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2424 -value $label -variable [itcl::scope _curFldLabel] \ 2425 -selectcolor red \ 2426 -activebackground $itk_option(-plotbackground) \ 2427 -activeforeground $itk_option(-plotforeground) \ 2428 -font "Arial 8" \ 2429 -command [itcl::code $this LegendTitleAction save] 2430 set _fields($fname) [list $label $units $components] 2431 if { $_curFldName == "" && $components == 3 } { 2432 set _curFldName $fname 2433 set _curFldLabel $label 2434 } 2435 } 2436 } 2437 $itk_component(field) value $_curFldLabel 2438 }
Note: See TracChangeset
for help on using the changeset viewer.