- Timestamp:
- Jun 8, 2009, 8:29:19 AM (15 years ago)
- Location:
- trunk/gui/scripts
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/Makefile.in
r1471 r1491 50 50 $(srcdir)/flowdial.tcl \ 51 51 $(srcdir)/flowhints.tcl \ 52 $(srcdir)/flowspeed.tcl \ 52 53 $(srcdir)/flowvisviewer.tcl \ 53 54 $(srcdir)/gauge.tcl \ -
trunk/gui/scripts/field.tcl
r1463 r1491 639 639 if {[$_xmlobj element $path] != ""} { 640 640 set element [$_xmlobj element -as type $path] 641 puts stderr "element is $element"642 641 if { $element == "unirect2d" } { 643 642 set _comp2dims($cname) "2D" -
trunk/gui/scripts/flowhints.tcl
r1449 r1491 59 59 "position" "0.0%" 60 60 "streams" "on" 61 "arrows" "off" 61 62 "volume" "on" 62 63 } … … 72 73 "volume" { GetBoolean $f $child _hints(volume) } 73 74 "streams" { GetBoolean $f $child _hints(streams) } 75 "arrows" { GetBoolean $f $child _hints(arrows) } 74 76 "axis" { GetAxis $f $child _hints(axis) } 75 77 "position" { GetPosition $f $child _hints(position) } -
trunk/gui/scripts/flowvisviewer.tcl
r1479 r1491 58 58 public method camera {option args} 59 59 public method delete {args} 60 public method disconnect {} 60 61 public method download {option args} 61 62 public method flow {option} … … 69 70 public method rmdupmarker { m x } 70 71 public method scale {args} 72 public method sendto { cmd } 71 73 public method updatetransferfuncs {} 72 74 … … 74 76 protected method CurrentVolumeIds {{what -all}} 75 77 protected method Disconnect {} 76 protected method DoResize {}78 protected method Resize {} 77 79 protected method ResizeLegend {} 78 80 protected method FixSettings {what {value ""}} … … 121 123 private method box { tag name } 122 124 private method streams { tag name } 125 private method arrows { tag name } 123 126 124 127 private variable _outbuf ;# buffer for outgoing commands … … 189 192 # Resize event. 190 193 $_dispatcher register !resize 191 $_dispatcher dispatch $this !resize "[itcl::code $this DoResize]; list"194 $_dispatcher dispatch $this !resize "[itcl::code $this Resize]; list" 192 195 193 196 $_dispatcher register !play … … 225 228 226 229 array set _settings [subst { 230 $this-arrows 0 227 231 $this-currenttime 0 232 $this-duration 1:00 228 233 $this-loop 0 229 234 $this-pan-x $_view(pan-x) … … 232 237 $this-play 0 233 238 $this-psi $_view(psi) 239 $this-speed 500 234 240 $this-step 0 235 $this-speed 500 236 $this-duration 1:00 241 $this-streams 0 237 242 $this-theta $_view(theta) 238 243 $this-volume 1 … … 299 304 BuildCutplanesTab 300 305 BuildCameraTab 301 302 306 303 307 bind $itk_component(3dview) <Configure> \ … … 409 413 entry $itk_component(flowcontrols).duration \ 410 414 -textvariable [itcl::scope _settings($this-duration)] \ 411 -bg white -width 6 415 -bg white -width 6 -font "arial 9" 412 416 } { 413 417 usual … … 440 444 # Speed 441 445 itk_component add speed { 442 Rappture:: Spinint$itk_component(flowcontrols).speed \443 -min 1 -max 10 -width 2446 Rappture::Flowspeed $itk_component(flowcontrols).speed \ 447 -min 1 -max 10 -width 3 -font "arial 9" 444 448 } { 445 449 usual … … 837 841 itcl::body Rappture::FlowvisViewer::isconnected {} { 838 842 return [VisViewer::IsConnected] 843 } 844 845 # 846 # disconnect -- 847 # 848 itcl::body Rappture::FlowvisViewer::disconnect {} { 849 Disconnect 850 } 851 852 # 853 # sendto -- 854 # 855 itcl::body Rappture::FlowvisViewer::sendto { bytes } { 856 SendBytes "$bytes\n" 839 857 } 840 858 … … 1012 1030 if { $info(-type) == "image" } { 1013 1031 $_image(plot) configure -data $bytes 1032 #puts stderr "image received [image width $_image(plot)] by [image height $_image(plot)]" 1014 1033 } elseif { $info(type) == "print" } { 1015 1034 set tag $this-print-$info(-token) … … 1038 1057 return 1039 1058 } 1040 puts stderr "receive legend $tag $vmin $vmax $size"1059 #puts stderr "receive legend $tag $vmin $vmax $size" 1041 1060 set bytes [ReceiveBytes $size] 1042 1061 $_image(legend) configure -data $bytes … … 1570 1589 switch -- $what { 1571 1590 light { 1572 if { [isconnected]} {1591 if { $_first != "" } { 1573 1592 set comp [lindex [$_first components] 0] 1574 1593 set tag $_first-$comp … … 1579 1598 } 1580 1599 transp { 1581 if { [isconnected]} {1600 if { $_first != "" } { 1582 1601 set comp [lindex [$_first components] 0] 1583 1602 set tag $_first-$comp … … 1587 1606 } 1588 1607 opacity { 1589 if { [isconnected]&& $_activeTf != "" } {1608 if { $_first != "" && && $_activeTf != "" } { 1590 1609 set opacity [expr { 0.01 * double($_settings($this-opacity)) }] 1591 1610 set tf $_activeTf … … 1596 1615 1597 1616 thickness { 1598 if { [isconnected]&& $_activeTf != "" } {1617 if { $_first != "" && && $_activeTf != "" } { 1599 1618 set val $_settings($this-thickness) 1600 1619 # Scale values between 0.00001 and 0.01000 … … 1606 1625 } 1607 1626 "outline" { 1608 if { [isconnected]} {1627 if { $_first != "" } { 1609 1628 set comp [lindex [$_first components] 0] 1610 1629 set tag $_first-$comp … … 1613 1632 } 1614 1633 "isosurface" { 1615 if { [isconnected]} {1616 1617 1634 if { [isconnected] } { 1635 SendCmd "volume shading isosurface $_settings($this-isosurface)" 1636 } 1618 1637 } 1619 1638 "grid" { … … 1638 1657 } 1639 1658 "volume" { 1640 if { [isconnected]} {1659 if { $_first != "" } { 1641 1660 set comp [lindex [$_first components] 0] 1642 1661 set tag $_first-$comp … … 1673 1692 # ---------------------------------------------------------------------- 1674 1693 itcl::body Rappture::FlowvisViewer::ResizeLegend {} { 1675 puts stderr "ResizeLegend"1676 1694 set _resizeLegendPending 0 1677 1695 set lineht [font metrics $itk_option(-font) -linespace] 1678 1696 set w [expr {$_width-20}] 1679 1697 set h [expr {[winfo height $itk_component(legend)]-20-$lineht}] 1698 #puts stderr "ResizeLegend $w $h" 1680 1699 1681 1700 if { $_first == "" } { … … 2143 2162 #set bfg [option get $itk_component(hull) boldFont Font] 2144 2163 2164 checkbutton $inner.vol -text "Show volume" -font $fg \ 2165 -text "Volume" \ 2166 -variable [itcl::scope _settings($this-volume)] \ 2167 -command [itcl::code $this FixSettings volume] \ 2168 -font "Arial 9" 2169 2170 label $inner.shading -text "Shading:" -font $fg 2171 2145 2172 label $inner.dim -text "Dim" -font $fg 2146 2173 ::scale $inner.light -from 0 -to 100 -orient horizontal \ … … 2172 2199 2173 2200 blt::table $inner \ 2201 0,0 $inner.vol -columnspan 4 -anchor w -pady 2 \ 2202 1,0 $inner.shading -columnspan 4 -anchor w -pady {10 2} \ 2203 2,0 $inner.dim -anchor e -pady 2 \ 2204 2,1 $inner.light -columnspan 2 -pady 2 -fill x \ 2205 2,3 $inner.bright -anchor w -pady 2 \ 2206 3,0 $inner.fog -anchor e -pady 2 \ 2207 3,1 $inner.transp -columnspan 2 -pady 2 -fill x \ 2208 3,3 $inner.plastic -anchor w -pady 2 \ 2209 4,0 $inner.clear -anchor e -pady 2 \ 2210 4,1 $inner.opacity -columnspan 2 -pady 2 -fill x\ 2211 4,3 $inner.opaque -anchor w -pady 2 \ 2212 5,0 $inner.thin -anchor e -pady 2 \ 2213 5,1 $inner.thickness -columnspan 2 -pady 2 -fill x\ 2214 5,3 $inner.thick -anchor w -pady 2 2215 2216 if 0 { 2174 2217 0,0 $inner.dim -anchor e -pady 2 \ 2175 2218 0,1 $inner.light -columnspan 2 -pady 2 \ … … 2184 2227 3,1 $inner.thickness -columnspan 2 -pady 2 \ 2185 2228 3,3 $inner.thick -anchor w -pady 2 2186 2229 } 2187 2230 blt::table configure $inner c0 c1 c3 r* -resize none 2188 2231 blt::table configure $inner r6 -resize expand … … 2336 2379 -font "Arial 9" 2337 2380 Rappture::Tooltip::for $inner.showstreams $hints(description) 2381 2382 checkbutton $inner.showarrows -text "Arrows" \ 2383 -variable [itcl::scope _settings($this-arrows)] \ 2384 -command [itcl::code $this arrows $key $hints(name)] \ 2385 -font "Arial 9" 2386 2338 2387 label $inner.particles -text "Particles" -font "Arial 9 bold" 2339 2388 label $inner.boxes -text "Boxes" -font "Arial 9 bold" 2340 2389 2341 2390 blt::table $inner \ 2342 1,0 $inner.showstreams -anchor w 2343 blt::table configure $inner c0 -resize none 2344 blt::table configure $inner c1 -resize expand 2345 2346 set row 2 2391 1,0 $inner.showstreams -anchor w \ 2392 2,0 $inner.showarrows -anchor w 2393 blt::table configure $inner c0 c1 -resize none 2394 blt::table configure $inner c2 -resize expand 2395 2396 set row 3 2347 2397 set particles [$flowobj particles] 2348 2398 if { [llength $particles] > 0 } { … … 2414 2464 } 2415 2465 2466 itcl::body Rappture::FlowvisViewer::arrows { tag name } { 2467 set bool $_settings($this-arrows) 2468 SendCmd "$tag configure -arrows no" 2469 } 2470 2416 2471 # ---------------------------------------------------------------------- 2417 2472 # USAGE: Slice move x|y|z <newval> … … 2458 2513 2459 2514 2460 itcl::body Rappture::FlowvisViewer::DoResize {} { 2515 itcl::body Rappture::FlowvisViewer::Resize {} { 2516 #puts stderr "Resize $_width $_height" 2461 2517 SendCmd "screen $_width $_height" 2462 2518 set _resizePending 0 … … 2473 2529 2474 2530 itcl::body Rappture::FlowvisViewer::EventuallyResizeLegend {} { 2531 #puts stderr "in EventuallyResizeLegend" 2475 2532 if { !$_resizeLegendPending } { 2476 puts stderr "in EventuallyResizeLegend"2477 2533 $_dispatcher event -after 100 !legend 2478 2534 set _resizeLegendPending 1 … … 2538 2594 append cmd "flow add $tag -position $info(position) -axis $info(axis) " 2539 2595 append cmd "-volume $info(volume) -outline $info(outline) " 2540 append cmd "-slice $info(streams) \n"2596 append cmd "-slice $info(streams) -arrows $info(arrows)\n" 2541 2597 foreach part [$flowobj particles] { 2542 2598 array unset info … … 2795 2851 set min [expr floor($value / 60000.0)] 2796 2852 set sec [expr ($value - ($min*60000.0)) / 1000.0] 2797 puts stderr "min=$min sec=$sec"2853 #puts stderr "min=$min sec=$sec" 2798 2854 return [format %02d:%02d [expr round($min)] [expr round($sec)]] 2799 2855 } -
trunk/gui/scripts/pushbutton.tcl
r1442 r1491 1 1 2 # ---------------------------------------------------------------------- 2 3 # COMPONENT: PushButton - widget for entering a choice of strings … … 27 28 public method toggle {} 28 29 30 protected method _fixValue {args} 31 29 32 private variable _state 0 30 33 public variable command ""; # Command to be invoked 31 p ublic variablevariable ""; # Variable to be set.34 private variable _variable ""; # Variable to be set. 32 35 public variable onimage ""; # Image displayed when selected 33 36 public variable offimage ""; # Image displayed when deselected. … … 74 77 } 75 78 79 # ---------------------------------------------------------------------- 80 # USAGE: _fixValue ?<name1> <name2> <op>? 81 # 82 # Invoked automatically whenever the -variable associated with this 83 # widget is modified. Copies the value to the current settings for 84 # the widget. 85 # ---------------------------------------------------------------------- 86 itcl::body Rappture::PushButton::_fixValue {args} { 87 if {"" == $itk_option(-variable)} { 88 return 89 } 90 upvar #0 $itk_option(-variable) var 91 if { $var == $onvalue } { 92 set _state 1 93 $itk_component(button) configure -relief sunken \ 94 -image $onimage -bg white 95 } elseif { $var == $offvalue } { 96 set _state 0 97 $itk_component(button) configure -relief raise \ 98 -image $offimage -bg grey85 99 } 100 } 101 102 76 103 itcl::body Rappture::PushButton::select {} { 77 set _state 1 78 $itk_component(button) configure -relief sunken \ 79 -image $onimage -bg white 80 upvar #0 $variable state 104 upvar #0 $_variable state 81 105 set state $onvalue 82 106 } 83 107 84 108 itcl::body Rappture::PushButton::deselect {} { 85 set _state 0 86 $itk_component(button) configure -relief raise \ 87 -image $offimage -bg grey85 88 upvar #0 $variable state 109 upvar #0 $_variable state 89 110 set state $offvalue 90 111 } 112 113 114 # ---------------------------------------------------------------------- 115 # CONFIGURE: -variable 116 # ---------------------------------------------------------------------- 117 itcl::configbody Rappture::PushButton::variable { 118 if {"" != $_variable} { 119 upvar #0 $_variable var 120 trace remove variable var write [itcl::code $this _fixValue] 121 } 122 set _variable $itk_option(-variable) 123 124 if {"" != $_variable} { 125 upvar #0 $_variable var 126 trace add variable var write [itcl::code $this _fixValue] 127 128 # sync to the current value of this variable 129 if {[info exists var]} { 130 _fixValue 131 } 132 } 133 } -
trunk/gui/scripts/spinint.tcl
r1448 r1491 1 1 2 # ---------------------------------------------------------------------- 2 3 # COMPONENT: spinint - spinner for integer values
Note: See TracChangeset
for help on using the changeset viewer.