Changeset 2673 for trunk/gui/scripts
- Timestamp:
- Nov 14, 2011, 11:58:46 AM (13 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/visviewer.tcl
r2672 r2673 72 72 protected method Color2RGB { color } 73 73 protected method Euler2XYZ { theta phi psi } 74 protected method StartWaiting {} 75 protected method StopWaiting {} 74 76 75 77 private method Waiting { option widget } … … 415 417 flush $_sid 416 418 } 419 return $_done($this) 420 } 421 422 # 423 # ReceiveBytes -- 424 # 425 # Read some number of bytes from the visualization server. 426 # 427 itcl::body Rappture::VisViewer::StartWaiting {} { 417 428 after cancel $_afterId 418 429 set _afterId [after 500 [itcl::code $this SplashScreen on]] 419 return $_done($this) 430 } 431 432 itcl::body Rappture::VisViewer::StopWaiting {} { 433 SplashScreen off 420 434 } 421 435 … … 426 440 # 427 441 itcl::body Rappture::VisViewer::ReceiveBytes { size } { 428 SplashScreen off429 442 if { ![CheckConnection] } { 430 443 return 0 … … 561 574 set inner [frame $itk_component(plotarea).view.splash] 562 575 $inner configure -relief raised -bd 2 563 label $inner.text1 -text "Rendering . Please Wait." \576 label $inner.text1 -text "Rendering, please wait." \ 564 577 -font "Arial 10" 565 578 label $inner.icon -
trunk/gui/scripts/vtkstreamlinesviewer.tcl
r2671 r2673 81 81 protected method Rotate {option x y} 82 82 protected method SendCmd {string} 83 protected method SendCmdNoWait {string} 83 84 protected method Zoom {option} 84 85 … … 98 99 private method EventuallyReseed { numPoints } 99 100 private method EventuallyRotate { q } 100 private method EventuallyRequestLegend {}101 101 private method EventuallySetCutplane { axis args } 102 102 private method GetImage { args } … … 495 495 set _start [clock clicks -milliseconds] 496 496 SendCmd "screen size $_width $_height" 497 EventuallyRequestLegend497 set _legendPending 1 498 498 499 499 #SendCmd "imgflush" … … 553 553 set _cutplanePending 1 554 554 $_dispatcher event -after 100 !${axis}cutplane 555 }556 }557 558 itcl::body Rappture::VtkStreamlinesViewer::EventuallyRequestLegend {} {559 if { !$_legendPending } {560 set _legendPending 1561 555 } 562 556 } … … 875 869 itcl::body Rappture::VtkStreamlinesViewer::sendto { bytes } { 876 870 SendBytes "$bytes\n" 871 StartWaiting 877 872 } 878 873 … … 889 884 } else { 890 885 SendBytes "$string\n" 886 StartWaiting 887 } 888 } 889 890 # 891 # SendCmdNoWait 892 # 893 # Send commands off to the rendering server. If we're currently 894 # sending data objects to the server, buffer the commands to be 895 # sent later. 896 # 897 itcl::body Rappture::VtkStreamlinesViewer::SendCmdNoWait {string} { 898 if { $_buffering } { 899 append _outbuf $string "\n" 900 } else { 901 SendBytes "$string\n" 891 902 } 892 903 } … … 907 918 array set info $args 908 919 set bytes [ReceiveBytes $info(-bytes)] 920 StopWaiting 909 921 if { $info(-type) == "image" } { 910 922 if 0 { … … 989 1001 } 990 1002 1003 set _buffering 1 1004 set _legendPending 1 991 1005 # Turn on buffering of commands to the server. We don't want to 992 1006 # be preempted by a server disconnect/reconnect (which automatically 993 1007 # generates a new call to Rebuild). 994 set _buffering 1995 1008 set _width $w 996 1009 set _height $h … … 1118 1131 # care. We're finished here. 1119 1132 blt::busy hold $itk_component(hull) 1120 SendBytes$_outbuf;1133 sendto $_outbuf; 1121 1134 blt::busy release $itk_component(hull) 1122 1135 set _outbuf ""; # Clear the buffer. … … 1509 1522 ChangeColormap $dataobj $comp $palette 1510 1523 } 1511 EventuallyRequestLegend1524 set _legendPending 1 1512 1525 } 1513 1526 "streamlines-opacity" { … … 1553 1566 SendCmd "cutplane colormode $_colorMode ${name} $dataset" 1554 1567 } 1555 EventuallyRequestLegend1568 set _legendPending 1 1556 1569 } 1557 1570 default { … … 1569 1582 # 1570 1583 itcl::body Rappture::VtkStreamlinesViewer::RequestLegend {} { 1571 puts stderr "RequestLegend"1572 set _legendPending 01573 1584 set font "Arial 8" 1574 1585 set lineht [font metrics $font -linespace] … … 1590 1601 foreach {dataobj comp} [split $dataset -] break 1591 1602 if { [info exists _dataset2style($dataset)] } { 1592 SendCmd "legend $_dataset2style($dataset) $_colorMode $name {} $w $h 0" 1603 SendCmdNoWait \ 1604 "legend $_dataset2style($dataset) $_colorMode $name {} $w $h 0" 1593 1605 break; 1594 1606 } … … 2568 2580 # ---------------------------------------------------------------------- 2569 2581 itcl::body Rappture::VtkStreamlinesViewer::ReceiveLegend { colormap title vmin vmax size } { 2582 set _legendPending 0 2570 2583 puts stderr "ReceiveLegend colormap=$colormap title=$title range=$vmin,$vmax size=$size" 2571 2584 set _limits(vmin) $vmin
Note: See TracChangeset
for help on using the changeset viewer.