Ignore:
Timestamp:
Apr 1, 2009 4:55:25 PM (15 years ago)
Author:
gah
Message:

First pass at changes to visualization widgets.

nanovisview.tcl use png icons.
visviewer.tcl change to sidebar layout
molvisviewer.tcl use png icons, fixed for sidebar layout.
heightmapviewer.tcl use png icons, fixed for sidebar layout.
flowvisviewer.tcl use png icons, fixed for sidebar layout.

resultviewer.tcl recognize flow data
field.tcl recognize unirect3d mesh.
field3dresult.tcl load FlowvisViewer? component description.
panes.tcl added horizontal panes. Need cursor fix. Must specify

correct cursor from options.

unirect2d.tcl added "axisorder" tag to specify order of field data.

Changed name to Unirect2d from UniRect2d.

unirect3d.tcl added "axisorder" tag to specify order of field data.

Right now, this is a test platform for me for flow
visualizations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/flowvisviewer.tcl

    r1357 r1373  
    7272    public method OverIsoMarker { m x }
    7373
    74     public method drawer {what who}
    7574    public method camera {option args}
     75    public method tab {what who}
    7676
    7777    protected method Connect {}
     
    110110    private method ParseMarkersOption { tf ivol markers }
    111111    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 {}
    115116    private method PanCamera {}
    116117    private method GetMovie { widget width height }
     
    143144    common downloadPopup_          ;# download options from popup
    144145
    145     private variable drawer_
    146146    private common hardcopy_
     147    private variable headings_
    147148}
    148149
     
    220221        rename -highlightbackground -controlbackground controlBackground Background
    221222    }
    222     pack $itk_component(reset) -side top -padx 2 -pady 1
     223    pack $itk_component(reset) -side top -padx 2 -pady 2
    223224    Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level"
    224225
     
    233234        rename -highlightbackground -controlbackground controlBackground Background
    234235    }
    235     pack $itk_component(zoomin) -side top -padx 1 -pady 1
     236    pack $itk_component(zoomin) -side top -padx 2 -pady 2
    236237    Rappture::Tooltip::for $itk_component(zoomin) "Zoom in"
    237238
     
    246247        rename -highlightbackground -controlbackground controlBackground Background
    247248    }
    248     pack $itk_component(zoomout) -side top -padx 2 -pady 1
     249    pack $itk_component(zoomout) -side top -padx 2 -pady 2
    249250    Rappture::Tooltip::for $itk_component(zoomout) "Zoom out"
    250251
    251     itk_component add settingsButton {
    252         label $itk_component(controls).settingsbutton \
     252    itk_component add configure_button {
     253        label $itk_component(controls).configbutton \
    253254            -borderwidth 1 -padx 1 -pady 1 \
    254255            -relief "raised" -image [Rappture::icon wrench]
     
    259260            Background
    260261    }
    261     pack $itk_component(settingsButton) -padx 2 -pady 1 \
    262         -ipadx 1 -ipady 1
    263     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 e
    269 
    270     BuildSettingsDrawer
    271 
    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         usual
    278         ignore -borderwidth
    279         rename -highlightbackground -controlbackground controlBackground \
    280             Background
    281     }
    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 1
    288 
    289     BuildCutplanesDrawer
    290 
    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         usual
    297         ignore -borderwidth
    298         rename -highlightbackground -controlbackground controlBackground \
    299             Background
    300     }
    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 1
    307 
    308     BuildCameraDrawer
    309262
    310263    #
     
    325278    Rappture::Tooltip::for $itk_component(volume) \
    326279        "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
    328286
    329287    # Legend
     
    331289    set _image(legend) [image create photo]
    332290    itk_component add legend {
    333         canvas $itk_component(area).legend -height 50 -highlightthickness 0
     291        canvas $itk_component(plotarea).legend -height 50 -highlightthickness 0
    334292    } {
    335293        usual
     
    337295        rename -background -plotbackground plotBackground Background
    338296    }
    339     pack $itk_component(legend) -side bottom -fill x
    340297    bind $itk_component(legend) <Configure> \
    341298        [list $_dispatcher event -idle !legend]
    342299
    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       
    344308    # Create flow controls...
    345309
     
    475439    set _image(download) [image create photo]
    476440
     441    $itk_component(scroller) contents $itk_component(view_canvas)
     442    $itk_component(title) configure -text "$headings_(view)"
     443
    477444    eval itk_initialize $args
    478445
     
    662629    switch $option {
    663630        coming {
    664             if {[catch {blt::winop snap $itk_component(area) $_image(download)}]} {
     631            if {[catch {blt::winop snap $itk_component(plotarea) \
     632                            $_image(download)}]} {
    665633                $_image(download) configure -width 1 -height 1
    666634                $_image(download) put #000000
     
    791759#       sent later.
    792760#
    793 itcl::body Rappture::FlowvisViewer::SendCmd {string} {
     761itcl::body Rappture::FlowvisViewer::SendCmd { string } {
    794762    if {[llength $sendobjs_] > 0} {
    795763        append outbuf_ $string "\n"
     
    816784            set data [$dataobj values $comp]
    817785            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            }
    821797            if { ![SendBytes $data] } {
    822798                return
     
    13701346            if {$op} {
    13711347                $itk_component(${axis}CutButton) configure \
    1372                     -image [Rappture::icon ${axis}-cutplane-on] \
    13731348                    -relief sunken
    13741349                SendCmd "cutplane state 1 $axis [CurrentVolumeIds -cutplanes]"
     
    13761351            } else {
    13771352                $itk_component(${axis}CutButton) configure \
    1378                     -image [Rappture::icon ${axis}-cutplane-off] \
    13791353                    -relief raised
    13801354                SendCmd "cutplane state 0 $axis [CurrentVolumeIds -cutplanes]"
     
    16261600        "legend" {
    16271601            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
    16291604            } else {
    1630                 pack forget $itk_component(legend)
     1605                blt::table forget $itk_component(legend)
    16311606            }
    16321607            FixLegend
     
    20592034}
    20602035
    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
     2037itcl::body Rappture::FlowvisViewer::BuildViewTab {} {
    21222038    foreach { key value } {
    21232039        grid            0
     
    21282044        particles       1
    21292045        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
     2135itcl::body Rappture::FlowvisViewer::BuildVolumeTab {} {
     2136    foreach { key value } {
    21302137        light           40
    21312138        transp          50
     
    21352142        set settings_($this-$key) $value
    21362143    }
    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
    21452146    } {
    21462147        ignore -highlightthickness
    21472148    }
    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 \
    21522156            -highlightthickness 0
    21532157    } {
    21542158        ignore -highlightthickness
    21552159    }
    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)
    21652166
    21662167    set fg [option get $itk_component(hull) font Font]
     
    21952196    label $inner.thick -text "Thick" -font $fg
    21962197
    2197     set ::Rappture::FlowvisViewer::settings_($this-isosurface) 0
    2198     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 
    22462198    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
     2213itcl::body Rappture::FlowvisViewer::BuildCutplanesTab {} {
     2214
     2215    itk_component add cutplanes_canvas {
     2216        canvas $itk_component(scroller).cutplanescanvas -highlightthickness 0
    22842217    } {
    22852218        ignore -highlightthickness
    22862219    }
    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 \
    22912227            -highlightthickness 0
    22922228    }  {
    22932229        ignore -highlightthickness
    22942230    }
    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)
    23032237
    23042238    # X-value slicer...
    23052239    itk_component add xCutButton {
    2306         label $itk_component(cutplanes).xbutton \
     2240        label $itk_component(cutplanes_frame).xbutton \
    23072241            -borderwidth 1 -relief raised -padx 1 -pady 1 \
    2308             -image [Rappture::icon x-cutplane-off] \
     2242            -image [Rappture::icon x-cutplane] \
    23092243            -highlightthickness 0
    23102244    } {
     
    23202254
    23212255    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 \
    23232257            -width 10 -orient vertical -showvalue off \
    2324             -borderwidth 1 -highlightthickness 0 \
     2258            -borderwidth 1 -highlightthickness 0 -state disabled \
    23252259            -command [itcl::code $this Slice move x]
    23262260    } {
     
    23342268    }
    23352269    $itk_component(xCutScale) set 50
    2336     #$itk_component(xCutScale) configure -state disabled
    23372270    Rappture::Tooltip::for $itk_component(xCutScale) \
    23382271        "@[itcl::code $this SlicerTip x]"
     
    23402273    # Y-value slicer...
    23412274    itk_component add yCutButton {
    2342         label $itk_component(cutplanes).ybutton \
     2275        label $itk_component(cutplanes_frame).ybutton \
    23432276            -borderwidth 1 -relief raised -padx 1 -pady 1 \
    2344             -image [Rappture::icon y-cutplane-off] \
     2277            -image [Rappture::icon y-cutplane] \
    23452278            -highlightthickness 0
    23462279    } {
     
    23562289
    23572290    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 \
    23592292            -width 10 -orient vertical -showvalue off \
    2360             -borderwidth 1 -highlightthickness 0 \
     2293            -borderwidth 1 -highlightthickness 0 -state disabled \
    23612294            -command [itcl::code $this Slice move y]
    23622295    } {
     
    23672300        rename -troughcolor -controldarkbackground controlDarkBackground Background
    23682301    }
    2369     $itk_component(yCutScale) set 50
    2370     #$itk_component(yCutScale) configure -state disabled
    23712302    Rappture::Tooltip::for $itk_component(yCutScale) \
    23722303        "@[itcl::code $this SlicerTip y]"
     2304    $itk_component(yCutScale) set 50
    23732305
    23742306    # Z-value slicer...
    23752307    itk_component add zCutButton {
    2376         label $itk_component(cutplanes).zbutton \
     2308        label $itk_component(cutplanes_frame).zbutton \
    23772309            -borderwidth 1 -relief raised -padx 1 -pady 1 \
    2378             -image [Rappture::icon z-cutplane-off] \
     2310            -image [Rappture::icon z-cutplane] \
    23792311            -highlightthickness 0
    23802312    } {
     
    23892321
    23902322    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 \
    23922324            -width 10 -orient vertical -showvalue off \
    2393             -borderwidth 1 -highlightthickness 0 \
     2325            -borderwidth 1 -highlightthickness 0 -state disabled \
    23942326            -command [itcl::code $this Slice move z]
    23952327    } {
     
    24062338
    24072339    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
     2348itcl::body Rappture::FlowvisViewer::BuildCameraTab {} {
     2349
     2350    itk_component add camera_canvas {
     2351        canvas $itk_component(scroller).cameracanvas -highlightthickness 0
    24292352    } {
    24302353        ignore -highlightthickness
    24312354    }
    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 \
    24362362            -highlightthickness 0
    24372363    }
    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)
    24462370
    24472371    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
    24512373    foreach tag $labels {
    24522374        label $inner.${tag}label -text $tag -font "Arial 9"
     
    24562378            [itcl::code $this camera set ${tag}]
    24572379        blt::table $inner \
    2458             $row,1 $inner.${tag}label -anchor e \
    2459             $row,2 $inner.${tag} -anchor w
     2380            $row,0 $inner.${tag}label -anchor e \
     2381            $row,1 $inner.${tag} -anchor w
    24602382        incr row
    24612383    }
    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
    24672386
    24682387}
     
    25762495    return ""
    25772496}
     2497
     2498itcl::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.