Changeset 5083 for branches/uiuc_vtk_viewers
- Timestamp:
- Mar 5, 2015 6:06:27 AM (8 years ago)
- Location:
- branches/uiuc_vtk_viewers
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/uiuc_vtk_viewers
- Property svn:mergeinfo changed
/trunk merged: 5054,5056,5062,5068-5069,5071,5077-5078
- Property svn:mergeinfo changed
-
branches/uiuc_vtk_viewers/gui/scripts/images/ask.png
- Property svn:executable deleted
-
branches/uiuc_vtk_viewers/gui/scripts/images/folder.gif
- Property svn:executable deleted
-
branches/uiuc_vtk_viewers/gui/scripts/images/molvis-3dorth.gif
- Property svn:executable deleted
-
branches/uiuc_vtk_viewers/gui/scripts/images/molvis-3dpers.gif
- Property svn:executable deleted
-
branches/uiuc_vtk_viewers/gui/scripts/images/popup.png
- Property svn:executable deleted
-
branches/uiuc_vtk_viewers/gui/scripts/panes.tcl
r5053 r5083 1 # -*- mode: tcl; indent-tabs-mode: nil -*- 1 2 # ---------------------------------------------------------------------- 2 3 # COMPONENT: Panes - creates a series of adjustable panes -
branches/uiuc_vtk_viewers/gui/scripts/visviewer.tcl
r5053 r5083 60 60 protected variable _debugConsole 0 61 61 protected variable _reportClientInfo 1 62 # Number of milliscends to wait for server reply before displaying wait 63 # dialog. If set to 0, dialog is never displayed. 62 64 protected variable _waitTimeout 0 63 65 … … 99 101 protected method SendBytes { bytes } 100 102 protected method SendCmd {string} 101 protected method SendCmdNoWait {string}102 103 protected method SendEcho { channel {data ""} } 103 104 protected method StartBufferingCommands {} … … 487 488 # StartWaiting -- 488 489 # 489 # Read some number of bytes from the visualization server. 490 # 491 490 # Display a waiting dialog after a timeout has passed 491 # 492 492 itcl::body Rappture::VisViewer::StartWaiting {} { 493 493 if { $_waitTimeout > 0 } { … … 497 497 } 498 498 499 # 500 # StopWaiting -- 501 # 502 # Take down waiting dialog 503 # 499 504 itcl::body Rappture::VisViewer::StopWaiting {} { 500 505 if { $_waitTimeout > 0 } { … … 1201 1206 } 1202 1207 } 1203 1204 #1205 # SendCmdNoWait1206 #1207 # Send commands off to the rendering server. If we're currently1208 # sending data objects to the server, buffer the commands to be1209 # sent later.1210 #1211 itcl::body Rappture::VisViewer::SendCmdNoWait {string} {1212 incr _cmdSeq1213 if {$_trace} {1214 puts stderr "$_cmdSeq>>[string range $string 0 70]"1215 }1216 if { $_buffering } {1217 append _outbuf $string "\n"1218 } else {1219 SendBytes "$string\n"1220 }1221 } -
branches/uiuc_vtk_viewers/gui/scripts/vtkglyphviewer.tcl
r4767 r5083 1562 1562 if { $_currentColormap != "" } { 1563 1563 set cmap $_currentColormap 1564 SendCmd NoWait"legend $cmap $_colorMode $_curFldName {} $w $h 0"1564 SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0" 1565 1565 } 1566 1566 } -
branches/uiuc_vtk_viewers/gui/scripts/vtkisosurfaceviewer.tcl
r5052 r5083 87 87 private method GetImage { args } 88 88 private method GetVtkData { args } 89 private method InitSettings { args 89 private method InitSettings { args } 90 90 private method IsValidObject { dataobj } 91 91 private method LeaveLegend {} … … 293 293 array set _changed { 294 294 -colormap 0 295 -cutplaneedges 0 296 -cutplanelighting 0 297 -cutplaneopacity 0 298 -cutplanepreinterp 0 299 -cutplanesvisible 0 300 -cutplanewireframe 0 301 -isosurfaceedges 0 302 -isosurfacelighting 0 295 303 -isosurfaceopacity 0 296 -cutplaneopacity 0 304 -isosurfacevisible 0 305 -isosurfacewireframe 0 297 306 -numcontours 0 307 -outline 0 308 -xcutplaneposition 0 309 -xcutplanevisible 0 310 -ycutplaneposition 0 311 -ycutplanevisible 0 312 -zcutplaneposition 0 313 -zcutplanevisible 0 298 314 } 299 315 array set _widget { … … 1416 1432 } 1417 1433 "-cutplaneedges" { 1434 set _changed($what) 1 1418 1435 set bool $_settings($what) 1419 1436 SendCmd "cutplane edges $bool" 1420 1437 } 1421 1438 "-cutplanelighting" { 1439 set _changed($what) 1 1422 1440 set bool $_settings($what) 1423 1441 SendCmd "cutplane lighting $bool" 1424 1442 } 1425 1443 "-cutplaneopacity" { 1444 set _changed($what) 1 1426 1445 set _settings($what) [expr $_widget($what) * 0.01] 1427 1446 SendCmd "cutplane opacity $_settings($what)" 1428 1447 } 1429 1448 "-cutplanepreinterp" { 1449 set _changed($what) 1 1430 1450 set bool $_settings($what) 1431 1451 SendCmd "cutplane preinterp $bool" 1432 1452 } 1433 1453 "-cutplanesvisible" { 1454 set _changed($what) 1 1434 1455 set bool $_settings($what) 1435 1456 SendCmd "cutplane visible 0" … … 1448 1469 } 1449 1470 "-cutplanewireframe" { 1471 set _changed($what) 1 1450 1472 set bool $_settings($what) 1451 1473 SendCmd "cutplane wireframe $bool" … … 1516 1538 } 1517 1539 "-isosurfaceedges" { 1540 set _changed($what) 1 1518 1541 set bool $_settings($what) 1519 1542 SendCmd "contour3d edges $bool" 1520 1543 } 1521 1544 "-isosurfacelighting" { 1545 set _changed($what) 1 1522 1546 set bool $_settings($what) 1523 1547 SendCmd "contour3d lighting $bool" 1524 1548 } 1525 1549 "-isosurfaceopacity" { 1550 set _changed($what) 1 1526 1551 set _settings($what) [expr $_widget($what) * 0.01] 1527 1552 SendCmd "contour3d opacity $_settings($what)" 1528 1553 } 1529 1554 "-isosurfacevisible" { 1555 set _changed($what) 1 1530 1556 set bool $_settings($what) 1531 1557 SendCmd "contour3d visible 0" … … 1544 1570 } 1545 1571 "-isosurfacewireframe" { 1572 set _changed($what) 1 1546 1573 set bool $_settings($what) 1547 1574 SendCmd "contour3d wireframe $bool" … … 1554 1581 } 1555 1582 "-numcontours" { 1583 set _changed($what) 1 1556 1584 set _settings($what) [$itk_component(numcontours) value] 1557 1585 if { $_contourList(numLevels) != $_settings($what) } { … … 1569 1597 } 1570 1598 "-outline" { 1599 set _changed($what) 1 1571 1600 set bool $_settings($what) 1572 1601 SendCmd "outline visible 0" … … 1590 1619 } 1591 1620 "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" { 1621 set _changed($what) 1 1592 1622 set axis [string tolower [string range $what 1 1]] 1593 1623 set bool $_settings($what) … … 1602 1632 } 1603 1633 "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" { 1634 set _changed($what) 1 1604 1635 set axis [string tolower [string range $what 1 1]] 1605 1636 set pos [expr $_settings($what) * 0.01] … … 1663 1694 if { $_currentColormap != "" } { 1664 1695 set cmap $_currentColormap 1665 SendCmd NoWait"legend $cmap scalar $_curFldName {} $w $h 0"1696 SendCmd "legend $cmap scalar $_curFldName {} $w $h 0" 1666 1697 } 1667 1698 } … … 1821 1852 } 1822 1853 itk_component add min { 1823 Rappture::Gauge $inner.min \1854 Rappture::Gauge $inner.min -font "Arial 9" \ 1824 1855 -validatecommand [itcl::code $this LegendRangeValidate "" vmin] 1825 1856 } … … 1831 1862 } 1832 1863 itk_component add max { 1833 Rappture::Gauge $inner.max \1864 Rappture::Gauge $inner.max -font "Arial 9" \ 1834 1865 -validatecommand [itcl::code $this LegendRangeValidate "" vmax] 1835 1866 } … … 2257 2288 array set style { 2258 2289 -color BCGYR 2290 -cutplaneedges 0 2291 -cutplanelighting 1 2292 -cutplaneopacity 1.0 2293 -cutplanepreinterp 1 2259 2294 -cutplanesvisible 0 2295 -cutplanewireframe 0 2260 2296 -edgecolor black 2261 2297 -edges 0 … … 2288 2324 # the code to handle aberrant cases. 2289 2325 2326 if { $_changed(-isosurfaceedges) } { 2327 set style(-edges) $_settings(-isosurfaceedges) 2328 } 2329 if { $_changed(-isosurfacelighting) } { 2330 set style(-lighting) $_settings(-isosurfacelighting) 2331 } 2290 2332 if { $_changed(-isosurfaceopacity) } { 2291 2333 set style(-opacity) $_settings(-isosurfaceopacity) 2334 } 2335 if { $_changed(-isosurfacewireframe) } { 2336 set style(-wireframe) $_settings(-isosurfacewireframe) 2292 2337 } 2293 2338 if { $_changed(-numcontours) } { … … 2311 2356 EventuallyChangeContourLevels 2312 2357 } 2313 set _settings(-isosurfacevisible) $style(-isosurfacevisible) 2314 set _settings(-cutplanesvisible) $style(-cutplanesvisible) 2315 set _settings(-xcutplanevisible) $style(-xcutplanevisible) 2316 set _settings(-ycutplanevisible) $style(-ycutplanevisible) 2317 set _settings(-zcutplanevisible) $style(-zcutplanevisible) 2318 set _settings(-xcutplaneposition) $style(-xcutplaneposition) 2319 set _settings(-ycutplaneposition) $style(-ycutplaneposition) 2320 set _settings(-zcutplaneposition) $style(-zcutplaneposition) 2358 foreach setting {-outline -isosurfacevisible -cutplanesvisible \ 2359 -xcutplanevisible -ycutplanevisible -zcutplanevisible \ 2360 -xcutplaneposition -ycutplaneposition -zcutplaneposition \ 2361 -cutplaneedges -cutplanelighting -cutplaneopacity \ 2362 -cutplanepreinterp -cutplanewireframe} { 2363 if {$_changed($setting)} { 2364 # User-modified UI setting overrides style 2365 set style($setting) $_settings($setting) 2366 } else { 2367 # Set UI control to style setting (tool provided or default) 2368 set _settings($setting) $style($setting) 2369 } 2370 } 2321 2371 2322 2372 SendCmd "cutplane add $tag" 2323 2373 SendCmd "cutplane color [Color2RGB $itk_option(-plotforeground)] $tag" 2324 2374 foreach axis {x y z} { 2325 set pos [expr $ _settings(-${axis}cutplaneposition) * 0.01]2326 set visible $ _settings(-${axis}cutplanevisible)2375 set pos [expr $style(-${axis}cutplaneposition) * 0.01] 2376 set visible $style(-${axis}cutplanevisible) 2327 2377 SendCmd "cutplane slice $axis $pos $tag" 2328 2378 SendCmd "cutplane axis $axis $visible $tag" 2329 2379 } 2380 SendCmd "cutplane edges $style(-cutplaneedges) $tag" 2381 SendCmd "cutplane lighting $style(-cutplanelighting) $tag" 2382 SendCmd "cutplane opacity $style(-cutplaneopacity) $tag" 2383 SendCmd "cutplane preinterp $style(-cutplanepreinterp) $tag" 2384 SendCmd "cutplane wireframe $style(-cutplanewireframe) $tag" 2330 2385 SendCmd "cutplane visible $style(-cutplanesvisible) $tag" 2331 2386 … … 2333 2388 SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag" 2334 2389 SendCmd "outline visible $style(-outline) $tag" 2335 set _settings(-outline) $style(-outline)2336 2390 2337 2391 GenerateContourList … … 2340 2394 SendCmd "contour3d edges $style(-edges) $tag" 2341 2395 set _settings(-isosurfaceedges) $style(-edges) 2342 #SendCmd "contour3d color [Color2RGB $s ettings(-color)] $tag"2396 #SendCmd "contour3d color [Color2RGB $style(-color)] $tag" 2343 2397 SendCmd "contour3d lighting $style(-lighting) $tag" 2344 2398 set _settings(-isosurfacelighting) $style(-lighting) … … 2417 2471 } 2418 2472 2419 2420 2473 # ---------------------------------------------------------------------- 2421 2474 # USAGE: LegendPointToValue <x> <y> … … 2449 2502 } 2450 2503 2451 2452 2504 # ---------------------------------------------------------------------- 2453 2505 # USAGE: LegendProbeSingleContour <x> <y> … … 2461 2513 SendCmd [list contour3d contourlist $value] 2462 2514 } 2463 2464 2515 2465 2516 # … … 2819 2870 } 2820 2871 2821 2822 2872 itcl::body Rappture::VtkIsosurfaceViewer::MouseOver2Which {} { 2823 2873 switch -- $_mouseOver { … … 2834 2884 return $which 2835 2885 } 2836 2837 2886 2838 2887 # ---------------------------------------------------------------------- … … 2926 2975 } 2927 2976 2928 2929 2977 # ---------------------------------------------------------------------- 2930 2978 # USAGE: ToggleCustomRange … … 2983 3031 AdjustSetting -range 2984 3032 } 2985 2986 3033 2987 3034 # ---------------------------------------------------------------------- … … 3019 3066 } 3020 3067 3021 3022 3068 # 3023 3069 # SetCurrentColormap -- … … 3082 3128 set values $_contourList(reqValues) 3083 3129 } else { 3084 # use the field limits to calculate the contour list values 3085 foreach { vmin vmax } $_limits($_curFldName) break 3086 3087 # if custom range has been set and are within the field's 3088 # range, use the custom min and max to generate contour list values 3130 # if custom range has been set, use the custom min and max 3131 # to generate contour list values 3089 3132 if { $_settings(-customrange) } { 3090 if { [$itk_component(min) value] > $vmin } { 3091 set vmin [$itk_component(min) value] 3092 } 3093 if { [$itk_component(max) value] < $vmax } { 3094 set vmax [$itk_component(max) value] 3095 } 3133 set vmin [$itk_component(min) value] 3134 set vmax [$itk_component(max) value] 3135 } else { 3136 # use the field limits to calculate the contour list values 3137 foreach { vmin vmax } $_limits($_curFldName) break 3096 3138 } 3097 3139 … … 3134 3176 } 3135 3177 $itk_component(field) value $_curFldLabel 3136 if { ![info exists _limits($_curFldName)] } { 3137 SendCmd "dataset maprange all" 3138 } else { 3139 set limits $_limits($_curFldName) 3178 if { $_settings(-customrange) } { 3179 set limits [list [$itk_component(min) value] [$itk_component(max) value]] 3140 3180 SendCmd "dataset maprange explicit $limits $_curFldName" 3141 3181 if { $limits != $_currentLimits } { … … 3143 3183 EventuallyChangeContourLevels 3144 3184 } 3145 } 3146 } 3185 } else { 3186 if { ![info exists _limits($_curFldName)] } { 3187 SendCmd "dataset maprange all" 3188 } else { 3189 set limits $_limits($_curFldName) 3190 SendCmd "dataset maprange explicit $limits $_curFldName" 3191 if { $limits != $_currentLimits } { 3192 set _currentLimits $limits 3193 EventuallyChangeContourLevels 3194 } 3195 } 3196 } 3197 } -
branches/uiuc_vtk_viewers/gui/scripts/vtkstreamlinesviewer.tcl
r5053 r5083 1238 1238 itcl::body Rappture::VtkStreamlinesViewer::Pick {x y} { 1239 1239 foreach tag [CurrentDatasets -visible] { 1240 SendCmd NoWait"dataset getscalar pixel $x $y $tag"1240 SendCmd "dataset getscalar pixel $x $y $tag" 1241 1241 } 1242 1242 } … … 1522 1522 foreach {dataobj comp} [split $dataset -] break 1523 1523 if { [info exists _dataset2style($dataset)] } { 1524 SendCmd NoWait\1524 SendCmd \ 1525 1525 "legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0" 1526 1526 break; -
branches/uiuc_vtk_viewers/gui/scripts/vtksurfaceviewer.tcl
r5053 r5083 1475 1475 if { $_currentColormap != "" } { 1476 1476 set cmap $_currentColormap 1477 SendCmd NoWait"legend $cmap scalar $_curFldName {} $w $h 0"1477 SendCmd "legend $cmap scalar $_curFldName {} $w $h 0" 1478 1478 } 1479 1479 } -
branches/uiuc_vtk_viewers/gui/scripts/vtkvolumeviewer.tcl
r5053 r5083 1640 1640 foreach {dataobj comp} [split $dataset -] break 1641 1641 if { [info exists _dataset2style($dataset)] } { 1642 SendCmd NoWait\1642 SendCmd \ 1643 1643 "legend2 $_dataset2style($dataset) $w $h" 1644 1644 #"legend $_dataset2style($dataset) $_colorMode $_curFldName {} $w $h 0"
Note: See TracChangeset
for help on using the changeset viewer.