Changeset 6414 for branches/blt4_trunk/gui/scripts/vtkimageviewer.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/vtkimageviewer.tcl
r6351 r6414 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 } … … 1389 1355 1390 1356 # Get the new limits because the field changed. 1391 SendCmd "dataset scalar $_curFldName"1392 #SendCmd "image colormode scalar $_curFldName"1357 SendCmd [list dataset scalar $_curFldName] 1358 #SendCmd [list image colormode scalar $_curFldName] 1393 1359 SendCmd "camera reset" 1394 1360 DrawLegend … … 1545 1511 set _colormaps($cmap) 1 1546 1512 } 1547 #SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"1513 #SendCmd [list legend $cmap scalar $_curFldName {} $w $h 0] 1548 1514 SendCmd "legend2 $cmap $w $h" 1549 1515 } … … 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" … … 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 }
Note: See TracChangeset
for help on using the changeset viewer.