Changeset 1375 for trunk/gui/scripts/flowvisviewer.tcl
- Timestamp:
- Apr 2, 2009 6:05:34 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/flowvisviewer.tcl
r1373 r1375 24 24 option add *FlowvisViewer.height 4i widgetDefault 25 25 option add *FlowvisViewer.foreground black widgetDefault 26 option add *FlowvisViewer.controlBackground gray widgetDefault27 option add *FlowvisViewer.controlDarkBackground #999999 widgetDefault28 26 option add *FlowvisViewer.plotBackground black widgetDefault 29 27 option add *FlowvisViewer.plotForeground white widgetDefault … … 73 71 74 72 public method camera {option args} 75 public method tab {what who}76 73 77 74 protected method Connect {} … … 145 142 146 143 private common hardcopy_ 147 private variable headings_148 144 } 149 145 … … 211 207 set settings_($this-speed) 10 212 208 209 set f [$itk_component(main) component controls] 213 210 itk_component add reset { 214 button $itk_component(controls).reset \ 215 -borderwidth 1 -padx 1 -pady 1 \ 211 button $f.reset -borderwidth 1 -padx 1 -pady 1 \ 216 212 -image [Rappture::icon reset-view] \ 217 213 -command [itcl::code $this Zoom reset] 218 } {219 usual220 ignore -borderwidth221 rename -highlightbackground -controlbackground controlBackground Background222 214 } 223 215 pack $itk_component(reset) -side top -padx 2 -pady 2 … … 225 217 226 218 itk_component add zoomin { 227 button $itk_component(controls).zin \ 228 -borderwidth 1 -padx 1 -pady 1 \ 219 button $f.zin -borderwidth 1 -padx 1 -pady 1 \ 229 220 -image [Rappture::icon zoom-in] \ 230 221 -command [itcl::code $this Zoom in] 231 } {232 usual233 ignore -borderwidth234 rename -highlightbackground -controlbackground controlBackground Background235 222 } 236 223 pack $itk_component(zoomin) -side top -padx 2 -pady 2 … … 238 225 239 226 itk_component add zoomout { 240 button $itk_component(controls).zout \ 241 -borderwidth 1 -padx 1 -pady 1 \ 227 button $f.zout -borderwidth 1 -padx 1 -pady 1 \ 242 228 -image [Rappture::icon zoom-out] \ 243 229 -command [itcl::code $this Zoom out] 244 } {245 usual246 ignore -borderwidth247 rename -highlightbackground -controlbackground controlBackground Background248 230 } 249 231 pack $itk_component(zoomout) -side top -padx 2 -pady 2 250 232 Rappture::Tooltip::for $itk_component(zoomout) "Zoom out" 251 252 itk_component add configure_button {253 label $itk_component(controls).configbutton \254 -borderwidth 1 -padx 1 -pady 1 \255 -relief "raised" -image [Rappture::icon wrench]256 } {257 usual258 ignore -borderwidth259 rename -highlightbackground -controlbackground controlBackground \260 Background261 }262 233 263 234 # … … 265 236 # 266 237 itk_component add volume { 267 label $itk_component(controls).volume \ 268 -borderwidth 1 -relief sunken -padx 1 -pady 1 \ 238 label $f.volume -borderwidth 1 -relief sunken -padx 1 -pady 1 \ 269 239 -text "Volume" \ 270 240 -image [Rappture::icon playback-record] 271 } {272 usual273 ignore -borderwidth274 rename -highlightbackground -controlbackground controlBackground Background275 241 } 276 242 bind $itk_component(volume) <ButtonPress> \ … … 438 404 439 405 set _image(download) [image create photo] 440 441 $itk_component(scroller) contents $itk_component(view_canvas)442 $itk_component(title) configure -text "$headings_(view)"443 406 444 407 eval itk_initialize $args … … 2047 2010 set settings_($this-$key) $value 2048 2011 } 2049 itk_component add view_canvas {2050 canvas $itk_component(scroller).viewcanvas -highlightthickness 02051 } {2052 ignore -highlightthickness2053 }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 02062 } {2063 ignore -highlightthickness2064 }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 2012 2072 2013 set fg [option get $itk_component(hull) font Font] 2073 2014 #set bfg [option get $itk_component(hull) boldFont Font] 2015 2016 set inner [$itk_component(main) insert end \ 2017 -title "View Settings" \ 2018 -icon [Rappture::icon wrench]] 2019 $inner configure -borderwidth 4 2074 2020 2075 2021 set ::Rappture::FlowvisViewer::settings_($this-isosurface) 0 … … 2131 2077 6,0 $inner.lic -columnspan 1 -anchor w \ 2132 2078 2079 for {set n 0} {$n <= 6} {incr n} { 2080 blt::table configure $inner r$n -resize none 2081 } 2082 blt::table configure $inner r$n -resize expand 2133 2083 } 2134 2084 … … 2142 2092 set settings_($this-$key) $value 2143 2093 } 2144 itk_component add volume_canvas { 2145 canvas $itk_component(scroller).volumecanvas -highlightthickness 0 2146 } { 2147 ignore -highlightthickness 2148 } 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 \ 2156 -highlightthickness 0 2157 } { 2158 ignore -highlightthickness 2159 } 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) 2094 2095 set inner [$itk_component(main) insert end \ 2096 -title "Volume Settings" \ 2097 -icon [Rappture::icon playback-record]] 2098 $inner configure -borderwidth 4 2166 2099 2167 2100 set fg [option get $itk_component(hull) font Font] … … 2197 2130 2198 2131 blt::table $inner \ 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 \ 2132 0,0 $inner.dim -anchor e -pady 2 \ 2133 0,1 $inner.light -columnspan 2 -pady 2 \ 2134 0,3 $inner.bright -anchor w -pady 2 \ 2135 1,0 $inner.fog -anchor e -pady 2 \ 2136 1,1 $inner.transp -columnspan 2 -pady 2 \ 2137 1,3 $inner.plastic -anchor w -pady 2 \ 2138 2,0 $inner.clear -anchor e -pady 2 \ 2139 2,1 $inner.opacity -columnspan 2 -pady 2 \ 2140 2,3 $inner.opaque -anchor w -pady 2 \ 2141 3,0 $inner.thin -anchor e -pady 2 \ 2142 3,1 $inner.thickness -columnspan 2 -pady 2 \ 2143 3,3 $inner.thick -anchor w -pady 2 2144 2145 for {set n 0} {$n <= 3} {incr n} { 2146 blt::table configure $inner r$n -resize none 2147 } 2148 blt::table configure $inner r$n -resize expand 2211 2149 } 2212 2150 2213 2151 itcl::body Rappture::FlowvisViewer::BuildCutplanesTab {} { 2214 2215 itk_component add cutplanes_canvas { 2216 canvas $itk_component(scroller).cutplanescanvas -highlightthickness 0 2217 } { 2218 ignore -highlightthickness 2219 } 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 \ 2227 -highlightthickness 0 2228 } { 2229 ignore -highlightthickness 2230 } 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) 2152 set inner [$itk_component(main) insert end \ 2153 -title "Cutplane Settings" \ 2154 -icon [Rappture::icon cutbutton]] 2155 $inner configure -borderwidth 4 2237 2156 2238 2157 # X-value slicer... 2239 2158 itk_component add xCutButton { 2240 label $i tk_component(cutplanes_frame).xbutton \2159 label $inner.xbutton \ 2241 2160 -borderwidth 1 -relief raised -padx 1 -pady 1 \ 2242 2161 -image [Rappture::icon x-cutplane] \ … … 2245 2164 usual 2246 2165 ignore -borderwidth -highlightthickness 2247 rename -highlightbackground -controlbackground \2248 controlBackground Background2249 2166 } 2250 2167 bind $itk_component(xCutButton) <ButtonPress> \ … … 2254 2171 2255 2172 itk_component add xCutScale { 2256 ::scale $i tk_component(cutplanes_frame).xval -from 100 -to 0 \2173 ::scale $inner.xval -from 100 -to 0 \ 2257 2174 -width 10 -orient vertical -showvalue off \ 2258 2175 -borderwidth 1 -highlightthickness 0 -state disabled \ … … 2260 2177 } { 2261 2178 usual 2262 ignore -borderwidth 2263 ignore -highlightthickness 2264 rename -highlightbackground -controlbackground \ 2265 controlBackground Background 2266 rename -troughcolor -controldarkbackground \ 2267 controlDarkBackground Background 2179 ignore -borderwidth -highlightthickness 2268 2180 } 2269 2181 $itk_component(xCutScale) set 50 … … 2273 2185 # Y-value slicer... 2274 2186 itk_component add yCutButton { 2275 label $i tk_component(cutplanes_frame).ybutton \2187 label $inner.ybutton \ 2276 2188 -borderwidth 1 -relief raised -padx 1 -pady 1 \ 2277 2189 -image [Rappture::icon y-cutplane] \ … … 2280 2192 usual 2281 2193 ignore -borderwidth -highlightthickness 2282 rename -highlightbackground -controlbackground \2283 controlBackground Background2284 2194 } 2285 2195 bind $itk_component(yCutButton) <ButtonPress> \ … … 2289 2199 2290 2200 itk_component add yCutScale { 2291 ::scale $i tk_component(cutplanes_frame).yval -from 100 -to 0 \2201 ::scale $inner.yval -from 100 -to 0 \ 2292 2202 -width 10 -orient vertical -showvalue off \ 2293 2203 -borderwidth 1 -highlightthickness 0 -state disabled \ … … 2295 2205 } { 2296 2206 usual 2297 ignore -borderwidth 2298 ignore -highlightthickness 2299 rename -highlightbackground -controlbackground controlBackground Background 2300 rename -troughcolor -controldarkbackground controlDarkBackground Background 2207 ignore -borderwidth -highlightthickness 2301 2208 } 2302 2209 Rappture::Tooltip::for $itk_component(yCutScale) \ … … 2306 2213 # Z-value slicer... 2307 2214 itk_component add zCutButton { 2308 label $i tk_component(cutplanes_frame).zbutton \2215 label $inner.zbutton \ 2309 2216 -borderwidth 1 -relief raised -padx 1 -pady 1 \ 2310 2217 -image [Rappture::icon z-cutplane] \ … … 2313 2220 usual 2314 2221 ignore -borderwidth -highlightthickness 2315 rename -highlightbackground -controlbackground controlBackground Background2316 2222 } 2317 2223 bind $itk_component(zCutButton) <ButtonPress> \ … … 2321 2227 2322 2228 itk_component add zCutScale { 2323 ::scale $i tk_component(cutplanes_frame).zval -from 100 -to 0 \2229 ::scale $inner.zval -from 100 -to 0 \ 2324 2230 -width 10 -orient vertical -showvalue off \ 2325 2231 -borderwidth 1 -highlightthickness 0 -state disabled \ … … 2327 2233 } { 2328 2234 usual 2329 ignore -borderwidth 2330 ignore -highlightthickness 2331 rename -highlightbackground -controlbackground controlBackground Background 2332 rename -troughcolor -controldarkbackground controlDarkBackground Background 2235 ignore -borderwidth -highlightthickness 2333 2236 } 2334 2237 $itk_component(zCutScale) set 50 … … 2344 2247 0,1 $itk_component(yCutScale) \ 2345 2248 0,2 $itk_component(zCutScale) \ 2249 2250 for {set n 0} {$n <= 1} {incr n} { 2251 blt::table configure $inner r$n -resize none 2252 } 2253 blt::table configure $inner r$n -resize expand 2346 2254 } 2347 2255 2348 2256 itcl::body Rappture::FlowvisViewer::BuildCameraTab {} { 2349 2350 itk_component add camera_canvas { 2351 canvas $itk_component(scroller).cameracanvas -highlightthickness 0 2352 } { 2353 ignore -highlightthickness 2354 } 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 \ 2362 -highlightthickness 0 2363 } 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) 2257 set inner [$itk_component(main) insert end \ 2258 -title "Camera Settings" \ 2259 -icon [Rappture::icon camera]] 2260 $inner configure -borderwidth 4 2370 2261 2371 2262 set labels { phi theta psi pan-x pan-y zoom } … … 2378 2269 [itcl::code $this camera set ${tag}] 2379 2270 blt::table $inner \ 2380 $row,0 $inner.${tag}label -anchor e \ 2381 $row,1 $inner.${tag} -anchor w 2271 $row,0 $inner.${tag}label -anchor e -pady 2 \ 2272 $row,1 $inner.${tag} -anchor w -pady 2 2273 blt::table configure $inner r$row -resize none 2382 2274 incr row 2383 2275 } 2384 2276 blt::table configure $inner c0 c1 -resize none 2385 2277 blt::table configure $inner c2 -resize expand 2386 2278 blt::table configure $inner r$row -resize expand 2387 2279 } 2388 2280 … … 2495 2387 return "" 2496 2388 } 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 open2505 }2506 "deselect" {2507 drawer close2508 }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.1i2514 }2515 }2516 }2517
Note: See TracChangeset
for help on using the changeset viewer.