Changeset 1373 for trunk/gui/scripts/flowvisviewer.tcl
- Timestamp:
- Apr 1, 2009 4:55:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/flowvisviewer.tcl
r1357 r1373 72 72 public method OverIsoMarker { m x } 73 73 74 public method drawer {what who}75 74 public method camera {option args} 75 public method tab {what who} 76 76 77 77 protected method Connect {} … … 110 110 private method ParseMarkersOption { tf ivol markers } 111 111 private method ParseLevelsOption { tf ivol levels } 112 private method BuildCutplanesDrawer {} 113 private method BuildSettingsDrawer {} 114 private method BuildCameraDrawer {} 112 private method BuildCutplanesTab {} 113 private method BuildViewTab {} 114 private method BuildVolumeTab {} 115 private method BuildCameraTab {} 115 116 private method PanCamera {} 116 117 private method GetMovie { widget width height } … … 143 144 common downloadPopup_ ;# download options from popup 144 145 145 private variable drawer_146 146 private common hardcopy_ 147 private variable headings_ 147 148 } 148 149 … … 220 221 rename -highlightbackground -controlbackground controlBackground Background 221 222 } 222 pack $itk_component(reset) -side top -padx 2 -pady 1223 pack $itk_component(reset) -side top -padx 2 -pady 2 223 224 Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level" 224 225 … … 233 234 rename -highlightbackground -controlbackground controlBackground Background 234 235 } 235 pack $itk_component(zoomin) -side top -padx 1 -pady 1236 pack $itk_component(zoomin) -side top -padx 2 -pady 2 236 237 Rappture::Tooltip::for $itk_component(zoomin) "Zoom in" 237 238 … … 246 247 rename -highlightbackground -controlbackground controlBackground Background 247 248 } 248 pack $itk_component(zoomout) -side top -padx 2 -pady 1249 pack $itk_component(zoomout) -side top -padx 2 -pady 2 249 250 Rappture::Tooltip::for $itk_component(zoomout) "Zoom out" 250 251 251 itk_component add settingsButton {252 label $itk_component(controls). settingsbutton \252 itk_component add configure_button { 253 label $itk_component(controls).configbutton \ 253 254 -borderwidth 1 -padx 1 -pady 1 \ 254 255 -relief "raised" -image [Rappture::icon wrench] … … 259 260 Background 260 261 } 261 pack $itk_component(settingsButton) -padx 2 -pady 1 \262 -ipadx 1 -ipady 1263 Rappture::Tooltip::for $itk_component(settingsButton) \264 "Configure settings"265 bind $itk_component(settingsButton) <ButtonPress> \266 [itcl::code $this drawer toggle settings]267 pack $itk_component(settingsButton) -side bottom \268 -padx 2 -pady 2 -anchor e269 270 BuildSettingsDrawer271 272 itk_component add cutplanesButton {273 label $itk_component(controls).cutplanesbutton \274 -borderwidth 1 -padx 1 -pady 1 \275 -relief "raised" -image [Rappture::icon cutbutton]276 } {277 usual278 ignore -borderwidth279 rename -highlightbackground -controlbackground controlBackground \280 Background281 }282 Rappture::Tooltip::for $itk_component(cutplanesButton) \283 "Set cutplanes"284 bind $itk_component(cutplanesButton) <ButtonPress> \285 [itcl::code $this drawer toggle cutplanes]286 pack $itk_component(cutplanesButton) -side bottom \287 -padx 2 -pady { 0 2 } -ipadx 1 -ipady 1288 289 BuildCutplanesDrawer290 291 itk_component add cameraButton {292 label $itk_component(controls).camerabutton \293 -borderwidth 1 -padx 1 -pady 1 \294 -relief "raised" -image [Rappture::icon camera]295 } {296 usual297 ignore -borderwidth298 rename -highlightbackground -controlbackground controlBackground \299 Background300 }301 Rappture::Tooltip::for $itk_component(cameraButton) \302 "Camera settings"303 bind $itk_component(cameraButton) <ButtonPress> \304 [itcl::code $this drawer toggle camera]305 pack $itk_component(cameraButton) -side bottom \306 -padx 2 -pady 1 -ipadx 1 -ipady 1307 308 BuildCameraDrawer309 262 310 263 # … … 325 278 Rappture::Tooltip::for $itk_component(volume) \ 326 279 "Toggle the volume cloud on/off" 327 pack $itk_component(volume) -padx 1 -pady 1 280 pack $itk_component(volume) -padx 2 -pady 2 281 282 BuildViewTab 283 BuildVolumeTab 284 BuildCutplanesTab 285 BuildCameraTab 328 286 329 287 # Legend … … 331 289 set _image(legend) [image create photo] 332 290 itk_component add legend { 333 canvas $itk_component( area).legend -height 50 -highlightthickness 0291 canvas $itk_component(plotarea).legend -height 50 -highlightthickness 0 334 292 } { 335 293 usual … … 337 295 rename -background -plotbackground plotBackground Background 338 296 } 339 pack $itk_component(legend) -side bottom -fill x340 297 bind $itk_component(legend) <Configure> \ 341 298 [list $_dispatcher event -idle !legend] 342 299 343 300 # Hack around the Tk panewindow. The problem is that the requested 301 # size of the 3d view isn't set until an image is retrieved from 302 # the server. So the panewindow uses the tiny size. 303 set w [expr [winfo reqwidth $itk_component(hull)] - 80] 304 blt::table $itk_component(plotarea) \ 305 0,0 $itk_component(3dview) -fill both -reqwidth $w \ 306 1,0 $itk_component(legend) -fill both 307 344 308 # Create flow controls... 345 309 … … 475 439 set _image(download) [image create photo] 476 440 441 $itk_component(scroller) contents $itk_component(view_canvas) 442 $itk_component(title) configure -text "$headings_(view)" 443 477 444 eval itk_initialize $args 478 445 … … 662 629 switch $option { 663 630 coming { 664 if {[catch {blt::winop snap $itk_component(area) $_image(download)}]} { 631 if {[catch {blt::winop snap $itk_component(plotarea) \ 632 $_image(download)}]} { 665 633 $_image(download) configure -width 1 -height 1 666 634 $_image(download) put #000000 … … 791 759 # sent later. 792 760 # 793 itcl::body Rappture::FlowvisViewer::SendCmd { string} {761 itcl::body Rappture::FlowvisViewer::SendCmd { string } { 794 762 if {[llength $sendobjs_] > 0} { 795 763 append outbuf_ $string "\n" … … 816 784 set data [$dataobj values $comp] 817 785 set nbytes [string length $data] 818 if { ![SendBytes "flow data follows $nbytes"] } { 819 return 820 } 786 set extents [$dataobj extents $comp] 787 788 # I have a field. Is a vector field or a volume field? 789 if { $extents == 1 } { 790 set cmd "volume data follows $nbytes" 791 } else { 792 set cmd "flow data follows $nbytes $extents" 793 } 794 if { ![SendBytes $cmd] } { 795 return 796 } 821 797 if { ![SendBytes $data] } { 822 798 return … … 1370 1346 if {$op} { 1371 1347 $itk_component(${axis}CutButton) configure \ 1372 -image [Rappture::icon ${axis}-cutplane-on] \1373 1348 -relief sunken 1374 1349 SendCmd "cutplane state 1 $axis [CurrentVolumeIds -cutplanes]" … … 1376 1351 } else { 1377 1352 $itk_component(${axis}CutButton) configure \ 1378 -image [Rappture::icon ${axis}-cutplane-off] \1379 1353 -relief raised 1380 1354 SendCmd "cutplane state 0 $axis [CurrentVolumeIds -cutplanes]" … … 1626 1600 "legend" { 1627 1601 if { $settings_($this-legend) } { 1628 pack $itk_component(legend) -side bottom -fill x 1602 blt::table $itk_component(plotarea) \ 1603 1,0 $itk_component(legend) -fill x 1629 1604 } else { 1630 pack forget $itk_component(legend)1605 blt::table forget $itk_component(legend) 1631 1606 } 1632 1607 FixLegend … … 2059 2034 } 2060 2035 2061 itcl::body Rappture::FlowvisViewer::drawer { what who } { 2062 if { [info exists drawer_(current)] && $who != $drawer_(current) } { 2063 drawer deactivate $drawer_(current) 2064 } 2065 switch -- ${what} { 2066 "activate" { 2067 $itk_component(drawer) add $itk_component($who) -sticky nsew 2068 after idle [list focus $itk_component($who)] 2069 if { ![info exists drawer_($who)] } { 2070 set rw [winfo reqwidth $itk_component($who)] 2071 set w [winfo width $itk_component(drawer)] 2072 set x [expr $w - $rw] 2073 $itk_component(drawer) sash place 0 $x 0 2074 set drawer_($who) 1 2075 } else { 2076 set w [winfo width $itk_component(drawer)] 2077 puts stderr "w of drawer is $w" 2078 puts stderr "w of last($who) is $drawer_($who-lastx)" 2079 set x [expr $w - $drawer_($who-lastx) - 10] 2080 puts stderr "setting sash to $x for $who" 2081 $itk_component(drawer) sash place 0 $x 0 2082 $itk_component(drawer) paneconfigure $itk_component($who) \ 2083 -width $drawer_($who-lastx) 2084 $itk_component(3dview) configure -width $x 2085 } 2086 set drawer_(current) $who 2087 $itk_component(${who}Button) configure -relief sunken -bd 1 2088 } 2089 "deactivate" { 2090 # Save the current width of the drawer. 2091 puts stderr "component=$who" 2092 set width [winfo width $itk_component($who)] 2093 set reqwidth [winfo reqwidth $itk_component($who)] 2094 if { $reqwidth < $width } { 2095 set width $reqwidth 2096 } 2097 set x [lindex [$itk_component(drawer) sash coord 0] 0] 2098 puts stderr "sashx=$x" 2099 set drawer_($who-lastx) $width 2100 $itk_component(drawer) forget $itk_component($who) 2101 $itk_component(${who}Button) configure -relief raised -bd 1 2102 unset drawer_(current) 2103 } 2104 "toggle" { 2105 set slaves [$itk_component(drawer) panes] 2106 if { [lsearch $slaves $itk_component($who)] >= 0 } { 2107 drawer deactivate $who 2108 } else { 2109 drawer activate $who 2110 } 2111 } 2112 "resize" { 2113 set bbox [$itk_component(${who}Canvas) bbox all] 2114 set wid [winfo width $itk_component(${who}Frame)] 2115 $itk_component(${who}Canvas) configure -width $wid \ 2116 -scrollregion $bbox -yscrollincrement 0.1i 2117 } 2118 } 2119 } 2120 2121 itcl::body Rappture::FlowvisViewer::BuildSettingsDrawer {} { 2036 2037 itcl::body Rappture::FlowvisViewer::BuildViewTab {} { 2122 2038 foreach { key value } { 2123 2039 grid 0 … … 2128 2044 particles 1 2129 2045 lic 1 2046 } { 2047 set settings_($this-$key) $value 2048 } 2049 itk_component add view_canvas { 2050 canvas $itk_component(scroller).viewcanvas -highlightthickness 0 2051 } { 2052 ignore -highlightthickness 2053 } 2054 $itk_component(sidebar) insert end "view" \ 2055 -image [Rappture::icon wrench] -text "" -padx 0 -pady 0 \ 2056 -command [itcl::code $this tab select "view"] 2057 set headings_(view) "View Settings" 2058 2059 itk_component add view_frame { 2060 frame $itk_component(view_canvas).frame \ 2061 -highlightthickness 0 2062 } { 2063 ignore -highlightthickness 2064 } 2065 $itk_component(view_canvas) create window 0 0 \ 2066 -anchor nw -window $itk_component(view_frame) 2067 bind $itk_component(view_frame) <Configure> \ 2068 [itcl::code $this tab resize "view"] 2069 2070 set inner $itk_component(view_frame) 2071 2072 set fg [option get $itk_component(hull) font Font] 2073 #set bfg [option get $itk_component(hull) boldFont Font] 2074 2075 set ::Rappture::FlowvisViewer::settings_($this-isosurface) 0 2076 checkbutton $inner.isosurface \ 2077 -text "Isosurface shading" \ 2078 -variable [itcl::scope settings_($this-isosurface)] \ 2079 -command [itcl::code $this FixSettings isosurface] \ 2080 -font "Arial 9" 2081 2082 checkbutton $inner.axes \ 2083 -text "Axes" \ 2084 -variable [itcl::scope settings_($this-axes)] \ 2085 -command [itcl::code $this FixSettings axes] \ 2086 -font "Arial 9" 2087 2088 checkbutton $inner.grid \ 2089 -text "Grid" \ 2090 -variable [itcl::scope settings_($this-grid)] \ 2091 -command [itcl::code $this FixSettings grid] \ 2092 -font "Arial 9" 2093 2094 checkbutton $inner.outline \ 2095 -text "Outline" \ 2096 -variable [itcl::scope settings_($this-outline)] \ 2097 -command [itcl::code $this FixSettings outline] \ 2098 -font "Arial 9" 2099 2100 checkbutton $inner.legend \ 2101 -text "Legend" \ 2102 -variable [itcl::scope settings_($this-legend)] \ 2103 -command [itcl::code $this FixSettings legend] \ 2104 -font "Arial 9" 2105 2106 checkbutton $inner.volume \ 2107 -text "Volume" \ 2108 -variable [itcl::scope settings_($this-volume)] \ 2109 -command [itcl::code $this FixSettings volume] \ 2110 -font "Arial 9" 2111 2112 checkbutton $inner.particles \ 2113 -text "Particles" \ 2114 -variable [itcl::scope settings_($this-particles)] \ 2115 -command [itcl::code $this FixSettings particles] \ 2116 -font "Arial 9" 2117 2118 checkbutton $inner.lic \ 2119 -text "Lic" \ 2120 -variable [itcl::scope settings_($this-lic)] \ 2121 -command [itcl::code $this FixSettings lic] \ 2122 -font "Arial 9" 2123 2124 blt::table $inner \ 2125 0,0 $inner.axes -columnspan 2 -anchor w \ 2126 1,0 $inner.grid -columnspan 2 -anchor w \ 2127 2,0 $inner.outline -columnspan 2 -anchor w \ 2128 3,0 $inner.volume -columnspan 2 -anchor w \ 2129 4,0 $inner.legend -columnspan 2 -anchor w \ 2130 5,0 $inner.particles -columnspan 2 -anchor w \ 2131 6,0 $inner.lic -columnspan 1 -anchor w \ 2132 2133 } 2134 2135 itcl::body Rappture::FlowvisViewer::BuildVolumeTab {} { 2136 foreach { key value } { 2130 2137 light 40 2131 2138 transp 50 … … 2135 2142 set settings_($this-$key) $value 2136 2143 } 2137 itk_component add settings { 2138 Rappture::Scroller $itk_component(drawer).settings \ 2139 -xscrollmode auto -yscrollmode auto \ 2140 -highlightthickness 0 2141 } 2142 2143 itk_component add settingsCanvas { 2144 canvas $itk_component(settings).canvas -highlightthickness 0 2144 itk_component add volume_canvas { 2145 canvas $itk_component(scroller).volumecanvas -highlightthickness 0 2145 2146 } { 2146 2147 ignore -highlightthickness 2147 2148 } 2148 $itk_component(settings) contents $itk_component(settingsCanvas) 2149 2150 itk_component add settingsFrame { 2151 frame $itk_component(settingsCanvas).frame \ 2149 $itk_component(sidebar) insert end "volume" \ 2150 -image [Rappture::icon playback-record] -text "" -padx 0 -pady 0 \ 2151 -command [itcl::code $this tab select "volume"] 2152 set headings_(volume) "Volume Settings" 2153 2154 itk_component add volume_frame { 2155 frame $itk_component(volume_canvas).frame \ 2152 2156 -highlightthickness 0 2153 2157 } { 2154 2158 ignore -highlightthickness 2155 2159 } 2156 $itk_component(settingsCanvas) create window 0 0 \ 2157 -anchor nw -window $itk_component(settingsFrame) 2158 bind $itk_component(settingsFrame) <Configure> \ 2159 [itcl::code $this drawer resize settings] 2160 2161 set inner $itk_component(settingsFrame) 2162 2163 label $inner.title -text "View Settings" -font "Arial 10 bold" 2164 label $inner.volset -text "Volume Settings" -font "Arial 10 bold" 2160 $itk_component(volume_canvas) create window 0 0 \ 2161 -anchor nw -window $itk_component(volume_frame) 2162 bind $itk_component(volume_frame) <Configure> \ 2163 [itcl::code $this tab resize "volume"] 2164 2165 set inner $itk_component(volume_frame) 2165 2166 2166 2167 set fg [option get $itk_component(hull) font Font] … … 2195 2196 label $inner.thick -text "Thick" -font $fg 2196 2197 2197 set ::Rappture::FlowvisViewer::settings_($this-isosurface) 02198 checkbutton $inner.isosurface \2199 -text "Isosurface shading" \2200 -variable [itcl::scope settings_($this-isosurface)] \2201 -command [itcl::code $this FixSettings isosurface] \2202 -font "Arial 9"2203 2204 checkbutton $inner.axes \2205 -text "Axes" \2206 -variable [itcl::scope settings_($this-axes)] \2207 -command [itcl::code $this FixSettings axes] \2208 -font "Arial 9"2209 2210 checkbutton $inner.grid \2211 -text "Grid" \2212 -variable [itcl::scope settings_($this-grid)] \2213 -command [itcl::code $this FixSettings grid] \2214 -font "Arial 9"2215 2216 checkbutton $inner.outline \2217 -text "Outline" \2218 -variable [itcl::scope settings_($this-outline)] \2219 -command [itcl::code $this FixSettings outline] \2220 -font "Arial 9"2221 2222 checkbutton $inner.legend \2223 -text "Legend" \2224 -variable [itcl::scope settings_($this-legend)] \2225 -command [itcl::code $this FixSettings legend] \2226 -font "Arial 9"2227 2228 checkbutton $inner.volume \2229 -text "Volume" \2230 -variable [itcl::scope settings_($this-volume)] \2231 -command [itcl::code $this FixSettings volume] \2232 -font "Arial 9"2233 2234 checkbutton $inner.particles \2235 -text "Particles" \2236 -variable [itcl::scope settings_($this-particles)] \2237 -command [itcl::code $this FixSettings particles] \2238 -font "Arial 9"2239 2240 checkbutton $inner.lic \2241 -text "Lic" \2242 -variable [itcl::scope settings_($this-lic)] \2243 -command [itcl::code $this FixSettings lic] \2244 -font "Arial 9"2245 2246 2198 blt::table $inner \ 2247 0,0 $inner.title -anchor w -columnspan 4 \ 2248 1,1 $inner.axes -columnspan 2 -anchor w \ 2249 2,1 $inner.grid -columnspan 2 -anchor w \ 2250 3,1 $inner.outline -columnspan 2 -anchor w \ 2251 4,1 $inner.volume -columnspan 2 -anchor w \ 2252 1,3 $inner.legend -columnspan 2 -anchor w \ 2253 2,3 $inner.particles -columnspan 2 -anchor w \ 2254 3,3 $inner.lic -columnspan 1 -anchor w \ 2255 9,0 $inner.volset -anchor w -columnspan 4 \ 2256 11,1 $inner.dim -anchor e \ 2257 11,2 $inner.light -columnspan 2 \ 2258 11,4 $inner.bright -anchor w \ 2259 12,1 $inner.fog -anchor e \ 2260 12,2 $inner.transp -columnspan 2 \ 2261 12,4 $inner.plastic -anchor w \ 2262 13,1 $inner.clear -anchor e \ 2263 13,2 $inner.opacity -columnspan 2 \ 2264 13,4 $inner.opaque -anchor w \ 2265 14,1 $inner.thin -anchor e \ 2266 14,2 $inner.thickness -columnspan 2 \ 2267 14,4 $inner.thick -anchor w \ 2268 2269 blt::table configure $inner c0 -resize expand -width 4 2270 } 2271 2272 itcl::body Rappture::FlowvisViewer::BuildCutplanesDrawer {} { 2273 itk_component add cutplanes { 2274 Rappture::Scroller $itk_component(drawer).cutplanes \ 2275 -xscrollmode auto -yscrollmode auto \ 2276 -highlightthickness 0 2277 } 2278 2279 # 2280 # Create slicer controls... 2281 # 2282 itk_component add cutplanesCanvas { 2283 canvas $itk_component(cutplanes).canvas -highlightthickness 0 2199 0,0 $inner.dim -anchor e \ 2200 0,1 $inner.light -columnspan 2 \ 2201 0,3 $inner.bright -anchor w \ 2202 1,0 $inner.fog -anchor e \ 2203 1,1 $inner.transp -columnspan 2 \ 2204 1,3 $inner.plastic -anchor w \ 2205 2,0 $inner.clear -anchor e \ 2206 2,1 $inner.opacity -columnspan 2 \ 2207 2,3 $inner.opaque -anchor w \ 2208 3,0 $inner.thin -anchor e \ 2209 3,1 $inner.thickness -columnspan 2 \ 2210 3,3 $inner.thick -anchor w \ 2211 } 2212 2213 itcl::body Rappture::FlowvisViewer::BuildCutplanesTab {} { 2214 2215 itk_component add cutplanes_canvas { 2216 canvas $itk_component(scroller).cutplanescanvas -highlightthickness 0 2284 2217 } { 2285 2218 ignore -highlightthickness 2286 2219 } 2287 $itk_component(cutplanes) contents $itk_component(cutplanesCanvas) 2288 2289 itk_component add cutplanesFrame { 2290 frame $itk_component(cutplanesCanvas).frame \ 2220 $itk_component(sidebar) insert end "cutplanes" \ 2221 -image [Rappture::icon cutbutton] -text "" -padx 0 -pady 0 \ 2222 -command [itcl::code $this tab select "cutplanes"] 2223 set headings_(cutplanes) "Cutplane Settings" 2224 2225 itk_component add cutplanes_frame { 2226 frame $itk_component(cutplanes_canvas).frame \ 2291 2227 -highlightthickness 0 2292 2228 } { 2293 2229 ignore -highlightthickness 2294 2230 } 2295 $itk_component(cutplanesCanvas) create window 0 0 \ 2296 -anchor nw -window $itk_component(cutplanesFrame) 2297 bind $itk_component(cutplanesFrame) <Configure> \ 2298 [itcl::code $this drawer resize cutplanes] 2299 2300 set inner $itk_component(cutplanesFrame) 2301 2302 label $inner.title -text "Cutplanes" -font "Arial 10 bold" 2231 $itk_component(cutplanes_canvas) create window 0 0 \ 2232 -anchor nw -window $itk_component(cutplanes_frame) 2233 bind $itk_component(cutplanes_frame) <Configure> \ 2234 [itcl::code $this tab resize cutplanes] 2235 2236 set inner $itk_component(cutplanes_frame) 2303 2237 2304 2238 # X-value slicer... 2305 2239 itk_component add xCutButton { 2306 label $itk_component(cutplanes ).xbutton \2240 label $itk_component(cutplanes_frame).xbutton \ 2307 2241 -borderwidth 1 -relief raised -padx 1 -pady 1 \ 2308 -image [Rappture::icon x-cutplane -off] \2242 -image [Rappture::icon x-cutplane] \ 2309 2243 -highlightthickness 0 2310 2244 } { … … 2320 2254 2321 2255 itk_component add xCutScale { 2322 ::scale $itk_component(cutplanes ).xval -from 100 -to 0 \2256 ::scale $itk_component(cutplanes_frame).xval -from 100 -to 0 \ 2323 2257 -width 10 -orient vertical -showvalue off \ 2324 -borderwidth 1 -highlightthickness 0 \2258 -borderwidth 1 -highlightthickness 0 -state disabled \ 2325 2259 -command [itcl::code $this Slice move x] 2326 2260 } { … … 2334 2268 } 2335 2269 $itk_component(xCutScale) set 50 2336 #$itk_component(xCutScale) configure -state disabled2337 2270 Rappture::Tooltip::for $itk_component(xCutScale) \ 2338 2271 "@[itcl::code $this SlicerTip x]" … … 2340 2273 # Y-value slicer... 2341 2274 itk_component add yCutButton { 2342 label $itk_component(cutplanes ).ybutton \2275 label $itk_component(cutplanes_frame).ybutton \ 2343 2276 -borderwidth 1 -relief raised -padx 1 -pady 1 \ 2344 -image [Rappture::icon y-cutplane -off] \2277 -image [Rappture::icon y-cutplane] \ 2345 2278 -highlightthickness 0 2346 2279 } { … … 2356 2289 2357 2290 itk_component add yCutScale { 2358 ::scale $itk_component(cutplanes ).yval -from 100 -to 0 \2291 ::scale $itk_component(cutplanes_frame).yval -from 100 -to 0 \ 2359 2292 -width 10 -orient vertical -showvalue off \ 2360 -borderwidth 1 -highlightthickness 0 \2293 -borderwidth 1 -highlightthickness 0 -state disabled \ 2361 2294 -command [itcl::code $this Slice move y] 2362 2295 } { … … 2367 2300 rename -troughcolor -controldarkbackground controlDarkBackground Background 2368 2301 } 2369 $itk_component(yCutScale) set 502370 #$itk_component(yCutScale) configure -state disabled2371 2302 Rappture::Tooltip::for $itk_component(yCutScale) \ 2372 2303 "@[itcl::code $this SlicerTip y]" 2304 $itk_component(yCutScale) set 50 2373 2305 2374 2306 # Z-value slicer... 2375 2307 itk_component add zCutButton { 2376 label $itk_component(cutplanes ).zbutton \2308 label $itk_component(cutplanes_frame).zbutton \ 2377 2309 -borderwidth 1 -relief raised -padx 1 -pady 1 \ 2378 -image [Rappture::icon z-cutplane -off] \2310 -image [Rappture::icon z-cutplane] \ 2379 2311 -highlightthickness 0 2380 2312 } { … … 2389 2321 2390 2322 itk_component add zCutScale { 2391 ::scale $itk_component(cutplanes ).zval -from 100 -to 0 \2323 ::scale $itk_component(cutplanes_frame).zval -from 100 -to 0 \ 2392 2324 -width 10 -orient vertical -showvalue off \ 2393 -borderwidth 1 -highlightthickness 0 \2325 -borderwidth 1 -highlightthickness 0 -state disabled \ 2394 2326 -command [itcl::code $this Slice move z] 2395 2327 } { … … 2406 2338 2407 2339 blt::table $inner \ 2408 0,0 $inner.title -anchor w -columnspan 4 \ 2409 3,1 $itk_component(xCutButton) \ 2410 3,2 $itk_component(yCutButton) \ 2411 3,3 $itk_component(zCutButton) \ 2412 2,1 $itk_component(xCutScale) \ 2413 2,2 $itk_component(yCutScale) \ 2414 2,3 $itk_component(zCutScale) \ 2415 2416 blt::table configure $inner c0 -resize expand -width 4 2417 } 2418 2419 itcl::body Rappture::FlowvisViewer::BuildCameraDrawer {} { 2420 2421 itk_component add camera { 2422 Rappture::Scroller $itk_component(drawer).camerascrl \ 2423 -xscrollmode auto -yscrollmode auto \ 2424 -highlightthickness 0 2425 } 2426 2427 itk_component add cameraCanvas { 2428 canvas $itk_component(camera).canvas -highlightthickness 0 2340 1,0 $itk_component(xCutButton) \ 2341 1,1 $itk_component(yCutButton) \ 2342 1,2 $itk_component(zCutButton) \ 2343 0,0 $itk_component(xCutScale) \ 2344 0,1 $itk_component(yCutScale) \ 2345 0,2 $itk_component(zCutScale) \ 2346 } 2347 2348 itcl::body Rappture::FlowvisViewer::BuildCameraTab {} { 2349 2350 itk_component add camera_canvas { 2351 canvas $itk_component(scroller).cameracanvas -highlightthickness 0 2429 2352 } { 2430 2353 ignore -highlightthickness 2431 2354 } 2432 $itk_component(camera) contents $itk_component(cameraCanvas) 2433 2434 itk_component add cameraFrame { 2435 frame $itk_component(cameraCanvas).frame \ 2355 $itk_component(sidebar) insert end "camera" \ 2356 -image [Rappture::icon camera] -text "" -padx 0 -pady 0 \ 2357 -command [itcl::code $this tab select "camera"] 2358 set headings_(camera) "Camera Settings" 2359 2360 itk_component add camera_frame { 2361 frame $itk_component(camera_canvas).frame \ 2436 2362 -highlightthickness 0 2437 2363 } 2438 $itk_component(cameraCanvas) create window 0 0 \ 2439 -anchor nw -window $itk_component(cameraFrame) 2440 bind $itk_component(cameraFrame) <Configure> \ 2441 [itcl::code $this drawer resize camera] 2442 2443 set inner $itk_component(cameraFrame) 2444 2445 label $inner.title -text "Camera Settings" -font "Arial 10 bold" 2364 $itk_component(camera_canvas) create window 0 0 \ 2365 -anchor nw -window $itk_component(camera_frame) 2366 bind $itk_component(camera_frame) <Configure> \ 2367 [itcl::code $this tab resize "camera"] 2368 2369 set inner $itk_component(camera_frame) 2446 2370 2447 2371 set labels { phi theta psi pan-x pan-y zoom } 2448 blt::table $inner \ 2449 0,0 $inner.title -anchor w -columnspan 4 2450 set row 1 2372 set row 0 2451 2373 foreach tag $labels { 2452 2374 label $inner.${tag}label -text $tag -font "Arial 9" … … 2456 2378 [itcl::code $this camera set ${tag}] 2457 2379 blt::table $inner \ 2458 $row, 1$inner.${tag}label -anchor e \2459 $row, 2$inner.${tag} -anchor w2380 $row,0 $inner.${tag}label -anchor e \ 2381 $row,1 $inner.${tag} -anchor w 2460 2382 incr row 2461 2383 } 2462 bind $inner.title <Shift-ButtonPress> \ 2463 [itcl::code $this camera show] 2464 blt::table configure $inner c0 -resize expand -width 4 2465 blt::table configure $inner c1 c2 -resize none 2466 blt::table configure $inner c3 -resize expand 2384 blt::table configure $inner c0 c1 -resize none 2385 blt::table configure $inner c2 -resize expand 2467 2386 2468 2387 } … … 2576 2495 return "" 2577 2496 } 2497 2498 itcl::body Rappture::FlowvisViewer::tab { what who } { 2499 switch -- ${what} { 2500 "select" { 2501 $itk_component(scroller) contents $itk_component(${who}_canvas) 2502 after idle [list focus $itk_component(${who}_canvas)] 2503 $itk_component(title) configure -text "$headings_($who)" 2504 drawer open 2505 } 2506 "deselect" { 2507 drawer close 2508 } 2509 "resize" { 2510 set bbox [$itk_component(${who}_canvas) bbox all] 2511 set wid [winfo width $itk_component(${who}_frame)] 2512 $itk_component(${who}_canvas) configure -width $wid \ 2513 -scrollregion $bbox -yscrollincrement 0.1i 2514 } 2515 } 2516 } 2517
Note: See TracChangeset
for help on using the changeset viewer.