Changeset 4768
- Timestamp:
- Nov 23, 2014, 3:29:00 AM (10 years ago)
- Location:
- branches/1.3
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.3
-
branches/1.3/gui/scripts/flowvisviewer.tcl
r4766 r4768 1160 1160 # I have a field. Is a vector field or a volume field? 1161 1161 if { !$isvtk && $extents == 1 } { 1162 set cmd "volume data follows $nbytes $tag\n"1162 SendCmd "volume data follows $nbytes $tag" 1163 1163 } else { 1164 1164 set cmd [FlowCmd $dataobj $comp $nbytes $extents] … … 1167 1167 continue 1168 1168 } 1169 }1170 append _outbuf $cmd1169 append _outbuf $cmd 1170 } 1171 1171 append _outbuf $data 1172 1172 NameTransferFunc $dataobj $comp -
branches/1.3/gui/scripts/nanovisviewer.tcl
r4766 r4768 918 918 if 0 { 919 919 set f [open "/tmp/volume.vtk" "w"] 920 puts $f $data 920 fconfigure $f -translation binary -encoding binary 921 puts -nonewline $f $data 921 922 close $f 922 923 } -
branches/1.3/gui/scripts/vtkglyphviewer.tcl
r4766 r4768 860 860 if { $info(-type) == "image" } { 861 861 if 0 { 862 set f [open "last.ppm" "w"] 863 puts $f $bytes 862 set f [open "last.ppm" "w"] 863 fconfigure $f -encoding binary 864 puts -nonewline $f $bytes 864 865 close $f 865 866 } … … 978 979 if 0 { 979 980 set f [open "/tmp/glyph.vtk" "w"] 980 puts $f $bytes 981 fconfigure $f -translation binary -encoding binary 982 puts -nonewline $f $bytes 981 983 close $f 982 984 } -
branches/1.3/gui/scripts/vtkheightmapviewer.tcl
r4766 r4768 843 843 if { $info(-type) == "image" } { 844 844 if 0 { 845 set f [open "last.ppm" "w"] 846 puts $f $bytes 845 set f [open "last.ppm" "w"] 846 fconfigure $f -encoding binary 847 puts -nonewline $f $bytes 847 848 close $f 848 849 } … … 982 983 if 0 { 983 984 set f [open /tmp/vtkheightmap.vtk "w"] 984 puts $f $bytes 985 fconfigure $f -translation binary -encoding binary 986 puts -nonewline $f $bytes 985 987 close $f 986 988 } -
branches/1.3/gui/scripts/vtkimageviewer.tcl
r4766 r4768 831 831 if { $info(-type) == "image" } { 832 832 if 0 { 833 set f [open "last.ppm" "w"] 834 puts $f $bytes 833 set f [open "last.ppm" "w"] 834 fconfigure $f -encoding binary 835 puts -nonewline $f $bytes 835 836 close $f 836 837 } … … 958 959 if 0 { 959 960 set f [open /tmp/vtkimage.vtk "w"] 960 puts $f $bytes 961 fconfigure $f -translation binary -encoding binary 962 puts -nonewline $f $bytes 961 963 close $f 962 964 } … … 1626 1628 set rgb [Color2RGB $itk_option(-plotforeground)] 1627 1629 if { !$_reset } { 1630 SendCmd "axis color all $rgb" 1628 1631 SendCmd "outline color $rgb" 1629 SendCmd "axis color all $rgb"1630 1632 } 1631 1633 } -
branches/1.3/gui/scripts/vtkisosurfaceviewer.tcl
r4766 r4768 7 7 # ====================================================================== 8 8 # AUTHOR: Michael McLennan, Purdue University 9 # Copyright (c) 2004-20 05 Purdue Research Foundation9 # Copyright (c) 2004-2014 HUBzero Foundation, LLC 10 10 # 11 11 # See the file "license.terms" for information on usage and … … 63 63 64 64 # The following methods are only used by this class. 65 66 65 private method AdjustSetting {what {value ""}} 67 66 private method BuildAxisTab {} … … 229 228 -xpan 0 230 229 -ypan 0 231 -zoom 1.0 230 -zoom 1.0 232 231 } 233 232 set _arcball [blt::arcball create 100 100] … … 241 240 } 242 241 array set _settings { 243 -axesvisible 244 -axislabels 245 -axisminorticks 246 -axismode 247 -background 248 -colormap 249 -colormapvisible 250 -cutplaneedges 251 -cutplanelighting 252 -cutplaneopacity 253 -cutplanepreinterp 254 -cutplanesvisible 255 -cutplanewireframe 256 -field 257 -isolinecolor 258 -isosurfaceedges 259 -isosurfacelighting 260 -isosurfaceopacity 261 -isosurfacevisible 262 -isosurfacewireframe 263 -legendvisible 264 -numcontours 265 -outline 266 -xcutplaneposition 267 -xcutplanevisible 268 -xgrid 269 -ycutplaneposition 270 -ycutplanevisible 271 -ygrid 272 -zcutplaneposition 273 -zcutplanevisible 274 -zgrid 242 -axesvisible 1 243 -axislabels 1 244 -axisminorticks 1 245 -axismode "static" 246 -background black 247 -colormap BCGYR 248 -colormapvisible 1 249 -cutplaneedges 0 250 -cutplanelighting 1 251 -cutplaneopacity 1.0 252 -cutplanepreinterp 1 253 -cutplanesvisible 0 254 -cutplanewireframe 0 255 -field "Default" 256 -isolinecolor white 257 -isosurfaceedges 0 258 -isosurfacelighting 1 259 -isosurfaceopacity 0.6 260 -isosurfacevisible 1 261 -isosurfacewireframe 0 262 -legendvisible 1 263 -numcontours 10 264 -outline 0 265 -xcutplaneposition 50 266 -xcutplanevisible 1 267 -xgrid 0 268 -ycutplaneposition 50 269 -ycutplanevisible 1 270 -ygrid 0 271 -zcutplaneposition 50 272 -zcutplanevisible 1 273 -zgrid 0 275 274 } 276 275 array set _changed { … … 390 389 puts stderr errs=$errs 391 390 } 391 392 392 # Legend 393 394 393 set _image(legend) [image create photo] 395 394 itk_component add legend { … … 596 595 } 597 596 598 599 597 # ---------------------------------------------------------------------- 600 598 # USAGE: delete ?<dataobj1> <dataobj2> ...? … … 908 906 if { $info(-type) == "image" } { 909 907 if 0 { 910 set f [open "last.ppm" "w"] 911 puts $f $bytes 908 set f [open "last.ppm" "w"] 909 fconfigure $f -encoding binary 910 puts -nonewline $f $bytes 912 911 close $f 913 912 } … … 990 989 # generates a new call to Rebuild). 991 990 StartBufferingCommands 991 992 992 if { $_reset } { 993 993 set _width $w … … 1023 1023 if { ![info exists _datasets($tag)] } { 1024 1024 set bytes [$dataobj vtkdata $comp] 1025 if 0 { 1026 set f [open "/tmp/isosurface.vtk" "w"] 1027 puts $f $bytes 1028 close $f 1025 if 0 { 1026 set f [open "/tmp/isosurface.vtk" "w"] 1027 fconfigure $f -translation binary -encoding binary 1028 puts -nonewline $f $bytes 1029 close $f 1029 1030 } 1030 1031 set length [string length $bytes] … … 1076 1077 set label [string toupper $axis] 1077 1078 } 1079 # May be a space in the axis label 1078 1080 SendCmd [list axis name $axis $label] 1079 1081 } … … 1185 1187 SendCmd "camera pan $x $y" 1186 1188 } 1187 1188 1189 1189 1190 # ---------------------------------------------------------------------- … … 1536 1537 } 1537 1538 } 1538 1539 1539 1540 1540 # … … 2322 2322 } 2323 2323 2324 2325 2324 # ---------------------------------------------------------------------- 2326 2325 # USAGE: Slice move x|y|z <newval> … … 2390 2389 set font "Arial 8" 2391 2390 set lineht [font metrics $font -linespace] 2392 2391 2393 2392 if { [string match "component*" $fname] } { 2394 2393 set title "" -
branches/1.3/gui/scripts/vtkmeshviewer.tcl
r4766 r4768 164 164 # Populate parser with commands handle incoming requests 165 165 # 166 $_parser alias image 167 $_parser alias dataset 166 $_parser alias image [itcl::code $this ReceiveImage] 167 $_parser alias dataset [itcl::code $this ReceiveDataset] 168 168 169 169 # Initialize the view to some default parameters. … … 736 736 if { $info(-type) == "image" } { 737 737 if 0 { 738 set f [open "last.ppm" "w"] 738 set f [open "last.ppm" "w"] 739 739 fconfigure $f -encoding binary 740 740 puts -nonewline $f $bytes … … 844 844 if { $bytes == "" } { 845 845 continue 846 } 847 if 0 { 848 set f [open /tmp/vtkmesh.vtk "w"] 849 fconfigure $f -translation binary -encoding binary 850 puts -nonewline $f $bytes 851 close $f 846 852 } 847 853 set length [string length $bytes] -
branches/1.3/gui/scripts/vtkstreamlinesviewer.tcl
r4766 r4768 875 875 if { $info(-type) == "image" } { 876 876 if 0 { 877 set f [open "last.ppm" "w"] 878 puts $f $bytes 877 set f [open "last.ppm" "w"] 878 fconfigure $f -encoding binary 879 puts -nonewline $f $bytes 879 880 close $f 880 881 } … … 990 991 set f [open /tmp/vtkstreamlines.vtk "w"] 991 992 fconfigure $f -translation binary -encoding binary 992 puts $f $bytes993 puts -nonewline $f $bytes 993 994 close $f 994 995 } -
branches/1.3/gui/scripts/vtksurfaceviewer.tcl
r4766 r4768 77 77 private method DrawLegend {} 78 78 private method EnterLegend { x y } 79 private method EventuallyRequestLegend {} 79 80 private method EventuallyResize { w h } 80 81 private method EventuallyRotate { q } 81 private method EventuallyRequestLegend {}82 82 private method GetImage { args } 83 83 private method GetVtkData { args } … … 98 98 private method RequestLegend {} 99 99 private method Rotate {option x y} 100 private method SetCurrentColormap { color } 100 101 private method SetLegendTip { x y } 101 private method SetObjectStyle { dataobj comp } 102 private method SetCurrentColormap { color } 102 private method SetObjectStyle { dataobj comp } 103 103 private method SetOrientation { side } 104 104 private method UpdateContourList {} … … 208 208 -axislabels 1 209 209 -axisminorticks 1 210 -background black 211 -colormap BCGYR 212 -colormapvisible 1 213 -field "Default" 214 -isolinecolor white 210 -axismode "static" 211 -background black 212 -colormap BCGYR 213 -colormapvisible 1 214 -field "Default" 215 -isolinecolor white 215 216 -isolinesvisible 0 216 217 -legendvisible 1 … … 314 315 $itk_component(surface) select 315 316 Rappture::Tooltip::for $itk_component(surface) \ 316 " Don't displaythe surface"317 "Hide the surface" 317 318 pack $itk_component(surface) -padx 2 -pady 2 318 319 … … 784 785 # disconnected -- no more data sitting on server 785 786 set _outbuf "" 786 array unset _datasets 787 array unset _data 788 array unset _colormaps 789 array unset _dataset2style 790 array unset _obj2datasets 787 array unset _datasets 788 array unset _data 789 array unset _colormaps 790 array unset _dataset2style 791 array unset _obj2datasets 791 792 } 792 793 … … 808 809 if { $info(-type) == "image" } { 809 810 if 0 { 810 set f [open "last.ppm" "w"] 811 set f [open "last.ppm" "w"] 811 812 fconfigure $f -encoding binary 812 813 puts -nonewline $f $bytes … … 897 898 $_arcball resize $w $h 898 899 DoResize 899 #900 900 # Reset the camera and other view parameters 901 #902 901 $_arcball quaternion [ViewToQuaternion] 903 902 if {$_view(-ortho)} { … … 909 908 PanCamera 910 909 set _first "" 911 InitSettings -x axisgrid -yaxisgrid -zaxisgrid -axismode \910 InitSettings -xgrid -ygrid -zgrid -axismode \ 912 911 -axesvisible -axislabels -axisminorticks 913 912 #SendCmd "axis lformat all %g" … … 927 926 if { ![info exists _datasets($tag)] } { 928 927 set bytes [$dataobj vtkdata $comp] 929 if 0 { 930 set f [open "/tmp/surface.vtk" "w"] 931 puts $f $bytes 932 close $f 928 if 0 { 929 set f [open "/tmp/surface.vtk" "w"] 930 fconfigure $f -translation binary -encoding binary 931 puts -nonewline $f $bytes 932 close $f 933 933 } 934 934 set length [string length $bytes] … … 954 954 # Setting dataset visible enables outline 955 955 # and contour2d 956 956 SendCmd "dataset visible 1 $tag" 957 957 } 958 958 } … … 1254 1254 } 1255 1255 switch -- $what { 1256 "-axesvisible" { 1257 set bool $_settings($what) 1258 SendCmd "axis visible all $bool" 1259 } 1260 "-axislabels" { 1261 set bool $_settings($what) 1262 SendCmd "axis labels all $bool" 1263 } 1264 "-axisminorticks" { 1265 set bool $_settings($what) 1266 SendCmd "axis minticks all $bool" 1267 } 1268 "-axismode" { 1269 set mode [$itk_component(axisMode) value] 1270 set mode [$itk_component(axisMode) translate $mode] 1271 set _settings($what) $mode 1272 SendCmd "axis flymode $mode" 1273 } 1256 1274 "-background" { 1257 1275 set bgcolor [$itk_component(background) value] … … 1265 1283 $itk_component(view) delete "legend" 1266 1284 DrawLegend 1267 }1268 "-axesvisible" {1269 set bool $_settings($what)1270 SendCmd "axis visible all $bool"1271 }1272 "-axislabels" {1273 set bool $_settings($what)1274 SendCmd "axis labels all $bool"1275 }1276 "-axisminorticks" {1277 set bool $_settings($what)1278 SendCmd "axis minticks all $bool"1279 }1280 "-xaxisgrid" - "-yaxisgrid" - "-zaxisgrid" {1281 set axis [string tolower [string range $what 1 1]]1282 set bool $_settings($what)1283 SendCmd "axis grid $axis $bool"1284 }1285 "-axismode" {1286 set mode [$itk_component(axisMode) value]1287 set mode [$itk_component(axisMode) translate $mode]1288 set _settings($what) $mode1289 SendCmd "axis flymode $mode"1290 1285 } 1291 1286 "-colormap" { … … 1331 1326 EventuallyRequestLegend 1332 1327 } 1328 "-field" { 1329 set label [$itk_component(field) value] 1330 set fname [$itk_component(field) translate $label] 1331 set _settings($what) $fname 1332 if { [info exists _fields($fname)] } { 1333 foreach { label units components } $_fields($fname) break 1334 if { $components > 1 } { 1335 set _colorMode vmag 1336 } else { 1337 set _colorMode scalar 1338 } 1339 set _curFldName $fname 1340 set _curFldLabel $label 1341 } else { 1342 puts stderr "unknown field \"$fname\"" 1343 return 1344 } 1345 SendCmd "dataset scalar $_curFldName" 1346 if { ![info exists _limits($_curFldName)] } { 1347 SendCmd "dataset maprange all" 1348 } else { 1349 SendCmd "dataset maprange explicit $_limits($_curFldName) $_curFldName" 1350 } 1351 #SendCmd "contour2d colormode $_colorMode $_curFldName" 1352 SendCmd "polydata colormode $_colorMode $_curFldName" 1353 SendCmd "camera reset" 1354 UpdateContourList 1355 DrawLegend 1356 } 1357 "-isolinecolor" { 1358 set color [$itk_component(isolineColor) value] 1359 set _settings($what) $color 1360 SendCmd "contour2d linecolor [Color2RGB $color]" 1361 DrawLegend 1362 } 1363 "-isolinesvisible" { 1364 set bool $_settings($what) 1365 SendCmd "contour2d visible $bool" 1366 DrawLegend 1367 } 1368 "-legendvisible" { 1369 if { !$_settings($what) } { 1370 $itk_component(view) delete legend 1371 } 1372 DrawLegend 1373 } 1333 1374 "-numcontours" { 1334 1375 set _settings($what) [$itk_component(numcontours) value] … … 1345 1386 } 1346 1387 } 1347 "- surfacewireframe" {1388 "-outline" { 1348 1389 set bool $_settings($what) 1349 SendCmd " polydata wireframe $bool"1350 } 1351 "- isolinesvisible" {1390 SendCmd "outline visible $bool" 1391 } 1392 "-surfaceedges" { 1352 1393 set bool $_settings($what) 1353 SendCmd "contour2d visible $bool" 1354 DrawLegend 1394 SendCmd "polydata edges $bool" 1395 } 1396 "-surfacelighting" { 1397 set bool $_settings($what) 1398 SendCmd "polydata lighting $bool" 1399 } 1400 "-surfaceopacity" { 1401 set val $_settings($what) 1402 set sval [expr { 0.01 * double($val) }] 1403 SendCmd "polydata opacity $sval" 1355 1404 } 1356 1405 "-surfacevisible" { … … 1366 1415 DrawLegend 1367 1416 } 1368 "-surface lighting" {1417 "-surfacewireframe" { 1369 1418 set bool $_settings($what) 1370 SendCmd "polydata lighting $bool" 1371 } 1372 "-surfaceedges" { 1419 SendCmd "polydata wireframe $bool" 1420 } 1421 "-xgrid" - "-ygrid" - "-zgrid" { 1422 set axis [string tolower [string range $what 1 1]] 1373 1423 set bool $_settings($what) 1374 SendCmd "polydata edges $bool" 1375 } 1376 "-outline" { 1377 set bool $_settings($what) 1378 SendCmd "outline visible $bool" 1379 } 1380 "-isolinecolor" { 1381 set color [$itk_component(isolineColor) value] 1382 set _settings($what) $color 1383 SendCmd "contour2d linecolor [Color2RGB $color]" 1384 DrawLegend 1385 } 1386 "-surfaceopacity" { 1387 set val $_settings($what) 1388 set sval [expr { 0.01 * double($val) }] 1389 SendCmd "polydata opacity $sval" 1390 } 1391 "-field" { 1392 set label [$itk_component(field) value] 1393 set fname [$itk_component(field) translate $label] 1394 set _settings($what) $fname 1395 if { [info exists _fields($fname)] } { 1396 foreach { label units components } $_fields($fname) break 1397 if { $components > 1 } { 1398 set _colorMode vmag 1399 } else { 1400 set _colorMode scalar 1401 } 1402 set _curFldName $fname 1403 set _curFldLabel $label 1404 } else { 1405 puts stderr "unknown field \"$fname\"" 1406 return 1407 } 1408 SendCmd "dataset scalar $_curFldName" 1409 if { ![info exists _limits($_curFldName)] } { 1410 SendCmd "dataset maprange all" 1411 } else { 1412 SendCmd "dataset maprange explicit $_limits($_curFldName) $_curFldName" 1413 } 1414 #SendCmd "contour2d colormode $_colorMode $_curFldName" 1415 SendCmd "polydata colormode $_colorMode $_curFldName" 1416 SendCmd "camera reset" 1417 UpdateContourList 1418 DrawLegend 1419 } 1420 "-legendvisible" { 1421 if { !$_settings($what) } { 1422 $itk_component(view) delete legend 1423 } 1424 DrawLegend 1424 SendCmd "axis grid $axis $bool" 1425 1425 } 1426 1426 default { … … 1429 1429 } 1430 1430 } 1431 1432 1431 1433 1432 # … … 1678 1677 checkbutton $inner.xgrid \ 1679 1678 -text "X" \ 1680 -variable [itcl::scope _settings(-x axisgrid)] \1681 -command [itcl::code $this AdjustSetting -x axisgrid] \1679 -variable [itcl::scope _settings(-xgrid)] \ 1680 -command [itcl::code $this AdjustSetting -xgrid] \ 1682 1681 -font "Arial 9" 1683 1682 checkbutton $inner.ygrid \ 1684 1683 -text "Y" \ 1685 -variable [itcl::scope _settings(-y axisgrid)] \1686 -command [itcl::code $this AdjustSetting -y axisgrid] \1684 -variable [itcl::scope _settings(-ygrid)] \ 1685 -command [itcl::code $this AdjustSetting -ygrid] \ 1687 1686 -font "Arial 9" 1688 1687 checkbutton $inner.zgrid \ 1689 1688 -text "Z" \ 1690 -variable [itcl::scope _settings(-z axisgrid)] \1691 -command [itcl::code $this AdjustSetting -z axisgrid] \1689 -variable [itcl::scope _settings(-zgrid)] \ 1690 -command [itcl::code $this AdjustSetting -zgrid] \ 1692 1691 -font "Arial 9" 1693 1692 checkbutton $inner.minorticks \ … … 1707 1706 "furthest_triad" "farthest" \ 1708 1707 "outer_edges" "outer" 1709 $itk_component(axisMode) value "static"1708 $itk_component(axisMode) value $_settings(-axismode) 1710 1709 bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axismode] 1711 1710 … … 1744 1743 0,0 $inner.view_l -anchor e -pady 2 \ 1745 1744 0,1 $inner.view -anchor w -pady 2 1745 blt::table configure $inner r0 -resize none 1746 1746 1747 1747 set labels { qx qy qz qw xpan ypan zoom } … … 1771 1771 incr row 1772 1772 1773 blt::table configure $inner c* r*-resize none1773 blt::table configure $inner c* -resize none 1774 1774 blt::table configure $inner c2 -resize expand 1775 1775 blt::table configure $inner r$row -resize expand … … 1898 1898 array set style [$dataobj style $comp] 1899 1899 if { $dataobj != $_first || $style(-levels) == 1 } { 1900 set style(-opacity) 1 1900 set style(-opacity) 1.0 1901 1901 } 1902 1902 … … 2272 2272 foreach name { -qw -qx -qy -qz } value $positions($side) { 2273 2273 set _view($name) $value 2274 } 2274 } 2275 2275 set q [ViewToQuaternion] 2276 2276 $_arcball quaternion $q -
branches/1.3/gui/scripts/vtkviewer.tcl
r4766 r4768 951 951 if { $info(-type) == "image" } { 952 952 if 0 { 953 set f [open "last.ppm" "w"] 953 set f [open "last.ppm" "w"] 954 954 fconfigure $f -encoding binary 955 955 puts -nonewline $f $bytes … … 1061 1061 if { $bytes == "" } { 1062 1062 continue 1063 } 1064 if 0 { 1065 set f [open /tmp/vtkviewer.vtk "w"] 1066 fconfigure $f -translation binary -encoding binary 1067 puts -nonewline $f $bytes 1068 close $f 1063 1069 } 1064 1070 set length [string length $bytes] -
branches/1.3/gui/scripts/vtkvolumeviewer.tcl
r4766 r4768 848 848 if { $info(-type) == "image" } { 849 849 if 0 { 850 set f [open "last.ppm" "w"] 851 puts $f $bytes 850 set f [open "last.ppm" "w"] 851 fconfigure $f -encoding binary 852 puts -nonewline $f $bytes 852 853 close $f 853 854 } … … 971 972 if { ![info exists _datasets($tag)] } { 972 973 set bytes [$dataobj vtkdata $comp] 974 if 0 { 975 set f [open /tmp/vtkvolume.vtk "w"] 976 fconfigure $f -translation binary -encoding binary 977 puts -nonewline $f $bytes 978 close $f 979 } 973 980 set length [string length $bytes] 974 981 if { $_reportClientInfo } {
Note: See TracChangeset
for help on using the changeset viewer.