Changeset 6212 for branches/1.6


Ignore:
Timestamp:
Mar 28, 2016 6:30:14 AM (7 years ago)
Author:
ldelgass
Message:

merge viewer cleanups from trunk

Location:
branches/1.6
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • branches/1.6

  • branches/1.6/gui/scripts/editor.tcl

    r5679 r6212  
    8888        [itcl::code $this _resize]
    8989    bind $itk_component(editor) <KeyPress-Return> \
     90        [itcl::code $this deactivate]
     91    bind $itk_component(editor) <KP_Enter> \
    9092        [itcl::code $this deactivate]
    9193    bind $itk_component(editor) <KeyPress-Escape> \
  • branches/1.6/gui/scripts/vtkglyphviewer.tcl

    r6155 r6212  
    7070    private method BuildDownloadPopup { widget command }
    7171    private method BuildGlyphTab {}
    72     private method Combo { option }
    7372    private method Connect {}
    7473    private method CurrentDatasets {args}
     
    8786    private method IsValidObject { dataobj }
    8887    private method LeaveLegend {}
     88    private method LegendTitleAction { option }
    8989    private method MotionLegend { x y }
    9090    private method Pan {option x y}
     
    105105    private method SetObjectStyle { dataobj comp }
    106106    private method SetOrientation { side }
     107    private method SetupKeyboardBindings {}
     108    private method SetupMousePanningBindings {}
     109    private method SetupMouseRotationBindings {}
     110    private method SetupMouseZoomBindings {}
    107111    private method Slice {option args}
    108112    private method ViewToQuaternion {} {
     
    133137    private variable _start 0
    134138    private variable _title ""
     139    private variable _widget
    135140    private variable _width 0
    136141    private variable _height 0
     
    225230        -cutplaneedges          0
    226231        -cutplanelighting       1
    227         -cutplaneopacity        100
     232        -cutplaneopacity        1.0
    228233        -cutplanepreinterp      1
    229234        -cutplanesvisible       0
     
    233238        -glyphlighting          1
    234239        -glyphnormscale         1
    235         -glyphopacity           100
     240        -glyphopacity           1.0
    236241        -glyphorient            1
    237242        -glyphscale             1
    238243        -glyphscalemode         "vmag"
    239244        -glyphshape             "arrow"
    240         -glyphvisible           1
     245        -glyphsvisible          1
    241246        -glyphwireframe         0
    242247        -legendvisible          1
    243248        -outline                0
    244         -saveglyphopacity       100
    245249        -xcutplaneposition      50
    246250        -xcutplanevisible       1
     
    255259    array set _changed {
    256260        -colormap               0
     261        -cutplaneedges          0
     262        -cutplanelighting       0
     263        -cutplaneopacity        0
     264        -cutplanepreinterp      0
     265        -cutplanesvisible       0
     266        -cutplanewireframe      0
     267        -glyphedges             0
     268        -glyphlighting          0
     269        -glyphnormscale         0
    257270        -glyphopacity           0
     271        -glyphorient            0
     272        -glyphscale             0
     273        -glyphscalemode         0
     274        -glyphshape             0
     275        -glyphsvisible          0
     276        -glyphwireframe         0
     277        -outline                0
     278        -xcutplaneposition      0
     279        -xcutplanevisible       0
     280        -ycutplaneposition      0
     281        -ycutplanevisible       0
     282        -zcutplaneposition      0
     283        -zcutplanevisible       0
     284    }
     285    array set _widget {
     286        -cutplaneopacity        100
     287        -glyphopacity           100
    258288    }
    259289
     
    273303        ignore -background -foreground -relief -tearoff
    274304    }
     305
    275306    set c $itk_component(view)
    276307    bind $c <Configure> [itcl::code $this EventuallyResize %w %h]
    277     bind $c <4> [itcl::code $this Zoom in 0.25]
    278     bind $c <5> [itcl::code $this Zoom out 0.25]
    279     bind $c <KeyPress-Left>  [list %W xview scroll 10 units]
    280     bind $c <KeyPress-Right> [list %W xview scroll -10 units]
    281     bind $c <KeyPress-Up>    [list %W yview scroll 10 units]
    282     bind $c <KeyPress-Down>  [list %W yview scroll -10 units]
    283     bind $c <Enter> "focus %W"
    284308    bind $c <Control-F1> [itcl::code $this ToggleConsole]
    285309
     
    335359            -onimage [Rappture::icon volume-on] \
    336360            -offimage [Rappture::icon volume-off] \
    337             -variable [itcl::scope _settings(-glyphvisible)] \
    338             -command [itcl::code $this AdjustSetting -glyphvisible]
     361            -variable [itcl::scope _settings(-glyphsvisible)] \
     362            -command [itcl::code $this AdjustSetting -glyphsvisible]
    339363    }
    340364    $itk_component(glyphs) select
     
    384408    blt::table configure $itk_component(plotarea) c1 -resize none
    385409
     410    SetupMouseRotationBindings
     411    SetupMousePanningBindings
     412    SetupMouseZoomBindings
     413    SetupKeyboardBindings
     414
     415    #bind $itk_component(view) <ButtonRelease-3> \
     416    #    [itcl::code $this Pick %x %y]
     417
     418    set _image(download) [image create photo]
     419
     420    eval itk_initialize $args
     421
     422    Connect
     423}
     424
     425# ----------------------------------------------------------------------
     426# DESTRUCTOR
     427# ----------------------------------------------------------------------
     428itcl::body Rappture::VtkGlyphViewer::destructor {} {
     429    Disconnect
     430    image delete $_image(plot)
     431    image delete $_image(download)
     432    catch { blt::arcball destroy $_arcball }
     433}
     434
     435itcl::body Rappture::VtkGlyphViewer::SetupMouseRotationBindings {} {
    386436    # Bindings for rotation via mouse
    387437    bind $itk_component(view) <ButtonPress-1> \
     
    391441    bind $itk_component(view) <ButtonRelease-1> \
    392442        [itcl::code $this Rotate release %x %y]
    393 
     443}
     444
     445itcl::body Rappture::VtkGlyphViewer::SetupMousePanningBindings {} {
    394446    # Bindings for panning via mouse
    395447    bind $itk_component(view) <ButtonPress-2> \
     
    399451    bind $itk_component(view) <ButtonRelease-2> \
    400452        [itcl::code $this Pan release %x %y]
    401 
    402     #bind $itk_component(view) <ButtonRelease-3> \
    403     #    [itcl::code $this Pick %x %y]
    404 
     453}
     454
     455itcl::body Rappture::VtkGlyphViewer::SetupMouseZoomBindings {} {
     456    if {[string equal "x11" [tk windowingsystem]]} {
     457        # Bindings for zoom via mouse
     458        bind $itk_component(view) <4> [itcl::code $this Zoom out]
     459        bind $itk_component(view) <5> [itcl::code $this Zoom in]
     460    }
     461}
     462
     463itcl::body Rappture::VtkGlyphViewer::SetupKeyboardBindings {} {
    405464    # Bindings for panning via keyboard
    406465    bind $itk_component(view) <KeyPress-Left> \
     
    428487
    429488    bind $itk_component(view) <Enter> "focus $itk_component(view)"
    430 
    431     if {[string equal "x11" [tk windowingsystem]]} {
    432         # Bindings for zoom via mouse
    433         bind $itk_component(view) <4> [itcl::code $this Zoom out]
    434         bind $itk_component(view) <5> [itcl::code $this Zoom in]
    435     }
    436 
    437     set _image(download) [image create photo]
    438 
    439     eval itk_initialize $args
    440 
    441     Connect
    442 }
    443 
    444 # ----------------------------------------------------------------------
    445 # DESTRUCTOR
    446 # ----------------------------------------------------------------------
    447 itcl::body Rappture::VtkGlyphViewer::destructor {} {
    448     Disconnect
    449     image delete $_image(plot)
    450     image delete $_image(download)
    451     catch { blt::arcball destroy $_arcball }
    452489}
    453490
     
    9991036    }
    10001037
    1001     InitSettings -glyphvisible -outline
     1038    InitSettings -glyphsvisible -outline
    10021039        #-cutplanesvisible
    10031040    if { $_reset } {
     
    13211358        }
    13221359        "-cutplaneedges" {
     1360            set _changed($what) 1
    13231361            set bool $_settings($what)
    13241362            SendCmd "cutplane edges $bool"
    13251363        }
    13261364        "-cutplanelighting" {
     1365            set _changed($what) 1
    13271366            set bool $_settings($what)
    13281367            SendCmd "cutplane lighting $bool"
    13291368        }
    13301369        "-cutplaneopacity" {
    1331             set val $_settings($what)
    1332             set sval [expr { 0.01 * double($val) }]
    1333             SendCmd "cutplane opacity $sval"
     1370            set _changed($what) 1
     1371            set _settings($what) [expr $_widget($what) * 0.01]
     1372            SendCmd "cutplane opacity $_settings($what)"
    13341373        }
    13351374        "-cutplanepreinterp" {
     1375            set _changed($what) 1
    13361376            set bool $_settings($what)
    13371377            SendCmd "cutplane preinterp $bool"
    13381378        }
    13391379        "-cutplanesvisible" {
     1380            set _changed($what) 1
    13401381            set bool $_settings($what)
    13411382            SendCmd "cutplane visible 0"
     
    13541395        }
    13551396        "-cutplanewireframe" {
     1397            set _changed($what) 1
    13561398            set bool $_settings($what)
    13571399            SendCmd "cutplane wireframe $bool"
     
    13841426        }
    13851427        "-glyphedges" {
     1428            set _changed($what) 1
    13861429            set bool $_settings($what)
    13871430            SendCmd "glyphs edges $bool"
    13881431        }
    13891432        "-glyphlighting" {
     1433            set _changed($what) 1
    13901434            set bool $_settings($what)
    13911435            SendCmd "glyphs lighting $bool"
    13921436        }
    13931437        "-glyphnormscale" {
     1438            set _changed($what) 1
    13941439            set bool $_settings($what)
    13951440            SendCmd "glyphs normscale $bool"
    13961441        }
    13971442        "-glyphopacity" {
    1398             set val $_settings($what)
    1399             set sval [expr { 0.01 * double($val) }]
    1400             SendCmd "glyphs opacity $sval"
     1443            set _changed($what) 1
     1444            set _settings($what) [expr $_widget($what) * 0.01]
     1445            SendCmd "glyphs opacity $_settings($what)"
    14011446        }
    14021447        "-glyphorient" {
     1448            set _changed($what) 1
    14031449            set bool $_settings($what)
    14041450            SendCmd "glyphs gorient $bool {}"
    14051451        }
    14061452        "-glyphscale" {
     1453            set _changed($what) 1
    14071454            set val $_settings($what)
    14081455            if { [string is double $val] } {
     
    14111458        }
    14121459        "-glyphscalemode" {
     1460            set _changed($what) 1
    14131461            set label [$itk_component(scaleMode) value]
    14141462            set mode [$itk_component(scaleMode) translate $label]
     
    14171465        }
    14181466        "-glyphshape" {
     1467            set _changed($what) 1
    14191468            set label [$itk_component(gshape) value]
    14201469            set shape [$itk_component(gshape) translate $label]
     
    14221471            SendCmd "glyphs shape $shape"
    14231472        }
    1424         "-glyphvisible" {
     1473        "-glyphsvisible" {
     1474            set _changed($what) 1
    14251475            set bool $_settings($what)
    14261476            SendCmd "glyphs visible 0"
     
    14291479                    SendCmd "glyphs visible $bool $tag"
    14301480                }
    1431             }
    1432             if { $bool } {
    14331481                Rappture::Tooltip::for $itk_component(glyphs) \
    14341482                    "Hide the glyphs"
     
    14401488        }
    14411489        "-glyphwireframe" {
     1490            set _changed($what) 1
    14421491            set bool $_settings($what)
    14431492            SendCmd "glyphs wireframe $bool"
     
    14581507        }
    14591508        "-outline" {
     1509            set _changed($what) 1
    14601510            set bool $_settings($what)
    14611511            SendCmd "outline visible 0"
     
    14671517        }
    14681518        "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" {
     1519            set _changed($what) 1
    14691520            set axis [string tolower [string range $what 1 1]]
    14701521            set bool $_settings($what)
     
    14791530        }
    14801531        "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" {
     1532            set _changed($what) 1
    14811533            set axis [string tolower [string range $what 1 1]]
    14821534            set pos [expr $_settings($what) * 0.01]
     
    15821634    checkbutton $inner.glyphs \
    15831635        -text "Glyphs" \
    1584         -variable [itcl::scope _settings(-glyphvisible)] \
    1585         -command [itcl::code $this AdjustSetting -glyphvisible] \
     1636        -variable [itcl::scope _settings(-glyphsvisible)] \
     1637        -command [itcl::code $this AdjustSetting -glyphsvisible] \
    15861638        -font "Arial 9"
    15871639
     
    16781730    label $inner.opacity_l -text "Opacity" -font "Arial 9"
    16791731    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1680         -variable [itcl::scope _settings(-glyphopacity)] \
     1732        -variable [itcl::scope _widget(-glyphopacity)] \
    16811733        -width 10 \
    16821734        -showvalue off \
    16831735        -command [itcl::code $this AdjustSetting -glyphopacity]
     1736    $inner.opacity set [expr $_settings(-glyphopacity) * 100.0]
    16841737
    16851738    label $inner.gscale_l -text "Scale factor" -font "Arial 9"
     
    17201773    }
    17211774
    1722     $inner.colormap choices insert end [GetColormapList]
     1775    $inner.colormap choices insert end [GetColormapList -includeNone]
    17231776    $itk_component(colormap) value "BCGYR"
    17241777    bind $inner.colormap <<Value>> \
     
    19171970    label $inner.opacity_l -text "Opacity" -font "Arial 9"
    19181971    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1919         -variable [itcl::scope _settings(-cutplaneopacity)] \
     1972        -variable [itcl::scope _widget(-cutplaneopacity)] \
    19201973        -width 10 \
    19211974        -showvalue off \
    19221975        -command [itcl::code $this AdjustSetting -cutplaneopacity]
    1923     $inner.opacity set $_settings(-cutplaneopacity)
     1976    $inner.opacity set [expr $_settings(-cutplaneopacity) * 100.0]
    19241977
    19251978    # X-value slicer...
     
    21342187
    21352188itcl::body Rappture::VtkGlyphViewer::SetObjectStyle { dataobj comp } {
     2189    DebugTrace "Enter"
    21362190    # Parse style string.
    21372191    set tag $dataobj-$comp
    21382192    array set style {
    2139         -color BCGYR
    2140         -edgecolor black
    2141         -edges 0
    2142         -gscale 1
    2143         -lighting 1
    2144         -linewidth 1.0
    2145         -normscale 1
    2146         -opacity 1.0
    2147         -orientglyphs 1
    2148         -outline 0
    2149         -ptsize 1.0
    2150         -quality 1
    2151         -scalemode vmag
    2152         -shape arrow
    2153         -wireframe 0
    2154     }
     2193        -color                  BCGYR
     2194        -constcolor             white
     2195        -colormode              vmag
     2196        -cutplaneedges          0
     2197        -cutplanelighting       1
     2198        -cutplaneopacity        1.0
     2199        -cutplanepreinterp      1
     2200        -cutplanesvisible       0
     2201        -cutplanewireframe      0
     2202        -edgecolor              black
     2203        -edges                  0
     2204        -glyphsvisible          1
     2205        -gscale                 1
     2206        -lighting               1
     2207        -linewidth              1.0
     2208        -normscale              1
     2209        -opacity                1.0
     2210        -orientglyphs           1
     2211        -outline                0
     2212        -ptsize                 1.0
     2213        -quality                1
     2214        -scalemode              vmag
     2215        -shape                  arrow
     2216        -wireframe              0
     2217        -xcutplaneposition      50
     2218        -xcutplanevisible       1
     2219        -ycutplaneposition      50
     2220        -ycutplanevisible       1
     2221        -zcutplaneposition      50
     2222        -zcutplanevisible       1
     2223    }
     2224    set style(-constcolor) $itk_option(-plotforeground)
    21552225    set numComponents [$dataobj numComponents $comp]
    21562226    if {$numComponents == 3} {
     
    21582228        set style(-orientglyphs) 1
    21592229        set style(-scalemode) "vmag"
     2230        set style(-colormode) "vmag"
    21602231    } else {
    21612232        set style(-shape) "sphere"
    21622233        set style(-orientglyphs) 0
    21632234        set style(-scalemode) "scalar"
     2235        set style(-colormode) "scalar"
    21642236    }
    21652237    array set style [$dataobj style $comp]
     
    21842256    # the code to handle aberrant cases.
    21852257
     2258    if { $_changed(-glyphedges) } {
     2259        set style(-edges) $_settings(-glyphedges)
     2260    }
     2261    if { $_changed(-glyphlighting) } {
     2262        set style(-lighting) $_settings(-glyphlighting)
     2263    }
     2264    if { $_changed(-glyphnormscale) } {
     2265        set style(-normscale) $_settings(-glyphnormscale)
     2266    }
    21862267    if { $_changed(-glyphopacity) } {
    2187         set style(-opacity) [expr $_settings(-glyphopacity) * 0.01]
     2268        set style(-opacity) $_settings(-glyphopacity)
     2269    }
     2270    if { $_changed(-glyphorient) } {
     2271        set style(-orientglyphs) $_settings(-glyphorient)
     2272    }
     2273    if { $_changed(-glyphscale) } {
     2274        set style(-gscale) $_settings(-glyphscale)
     2275    }
     2276    if { $_changed(-glyphwireframe) } {
     2277        set style(-wireframe) $_settings(-glyphwireframe)
    21882278    }
    21892279    if { $_changed(-colormap) } {
     
    21922282    if { $_currentColormap == "" } {
    21932283        $itk_component(colormap) value $style(-color)
     2284    }
     2285    foreach setting {-outline -glyphsvisible -cutplanesvisible \
     2286                     -xcutplanevisible -ycutplanevisible -zcutplanevisible \
     2287                     -xcutplaneposition -ycutplaneposition -zcutplaneposition \
     2288                     -cutplaneedges -cutplanelighting -cutplaneopacity \
     2289                     -cutplanepreinterp -cutplanewireframe} {
     2290        if {$_changed($setting)} {
     2291            # User-modified UI setting overrides style
     2292            set style($setting) $_settings($setting)
     2293        } else {
     2294            # Set UI control to style setting (tool provided or default)
     2295            set _settings($setting) $style($setting)
     2296        }
    21942297    }
    21952298
     
    21972300    SendCmd "cutplane add $tag"
    21982301    SendCmd "cutplane visible 0 $tag"
     2302    foreach axis {x y z} {
     2303        set pos [expr $style(-${axis}cutplaneposition) * 0.01]
     2304        set visible $style(-${axis}cutplanevisible)
     2305        SendCmd "cutplane slice $axis $pos $tag"
     2306        SendCmd "cutplane axis $axis $visible $tag"
     2307    }
     2308    SendCmd "cutplane edges $style(-cutplaneedges) $tag"
     2309    SendCmd "cutplane lighting $style(-cutplanelighting) $tag"
     2310    SendCmd "cutplane opacity $style(-cutplaneopacity) $tag"
     2311    set _widget(-cutplaneopacity) [expr $style(-cutplaneopacity) * 100]
     2312    SendCmd "cutplane preinterp $style(-cutplanepreinterp) $tag"
     2313    SendCmd "cutplane wireframe $style(-cutplanewireframe) $tag"
     2314    SendCmd "cutplane visible $style(-cutplanesvisible) $tag"
    21992315    }
    22002316
    22012317    SendCmd "outline add $tag"
    2202     SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag"
     2318    SendCmd "outline color [Color2RGB $style(-constcolor)] $tag"
    22032319    SendCmd "outline visible $style(-outline) $tag"
    2204     set _settings(-outline) $style(-outline)
    22052320
    22062321    SendCmd "glyphs add $style(-shape) $tag"
    22072322    set _settings(-glyphshape) $style(-shape)
    22082323    $itk_component(gshape) value $style(-shape)
     2324    SendCmd "glyphs visible $style(-glyphsvisible) $tag"
    22092325    SendCmd "glyphs edges $style(-edges) $tag"
    22102326    set _settings(-glyphedges) $style(-edges)
     
    22202336    set _settings(-glyphscale) $style(-gscale)
    22212337
     2338    if {$style(-colormode) == "constant" || $style(-color) == "none"} {
     2339        SendCmd "glyphs colormode constant {} $tag"
     2340        set _settings(-colormapvisible) 0
     2341        set _settings(-colormap) "none"
     2342    } else {
     2343        SendCmd "glyphs colormode $style(-colormode) $_curFldName $tag"
     2344        set _settings(-colormapvisible) 1
     2345        set _settings(-colormap) $style(-color)
     2346        SetCurrentColormap $style(-color)
     2347    }
     2348    $itk_component(colormap) value $_settings(-colormap)
     2349    set _colorMode $style(-colormode)
     2350
    22222351    # constant color only used if colormode set to constant
    2223     SendCmd "glyphs color [Color2RGB $itk_option(-plotforeground)] $tag"
     2352    SendCmd "glyphs color [Color2RGB $style(-constcolor)] $tag"
    22242353    # Omitting field name for gorient and smode commands
    22252354    # defaults to active scalars or vectors depending on mode
     
    22362365    SendCmd "glyphs ptsize $style(-ptsize) $tag"
    22372366    SendCmd "glyphs opacity $style(-opacity) $tag"
    2238     set _settings(-glyphopacity) [expr $style(-opacity) * 100.0]
    2239     SetCurrentColormap $style(-color)
     2367    set _settings(-glyphopacity) $style(-opacity)
     2368    set _widget(-glyphopacity) [expr $style(-opacity) * 100.0]
    22402369    SendCmd "glyphs wireframe $style(-wireframe) $tag"
    22412370    set _settings(-glyphwireframe) $style(-wireframe)
     
    24522581    set x1 [expr $x2 - ($iw*12)/10]
    24532582
    2454     $c bind title <ButtonPress> [itcl::code $this Combo post]
    2455     $c bind title <Enter> [itcl::code $this Combo activate]
    2456     $c bind title <Leave> [itcl::code $this Combo deactivate]
     2583    $c bind title <ButtonPress> [itcl::code $this LegendTitleAction post]
     2584    $c bind title <Enter> [itcl::code $this LegendTitleAction enter]
     2585    $c bind title <Leave> [itcl::code $this LegendTitleAction leave]
    24572586    # Reset the item coordinates according the current size of the plot.
    24582587    $c itemconfigure title -text $title
     
    24792608
    24802609# ----------------------------------------------------------------------
    2481 # USAGE: _dropdown post
    2482 # USAGE: _dropdown unpost
    2483 # USAGE: _dropdown select
    2484 #
    2485 # Used internally to handle the dropdown list for this combobox.  The
    2486 # post/unpost options are invoked when the list is posted or unposted
    2487 # to manage the relief of the controlling button.  The select option
    2488 # is invoked whenever there is a selection from the list, to assign
    2489 # the value back to the gauge.
    2490 # ----------------------------------------------------------------------
    2491 itcl::body Rappture::VtkGlyphViewer::Combo {option} {
     2610# USAGE: LegendTitleAction post
     2611# USAGE: LegendTitleAction enter
     2612# USAGE: LegendTitleAction leave
     2613# USAGE: LegendTitleAction save
     2614#
     2615# Used internally to handle the dropdown list for the fields menu combobox.
     2616# The post option is invoked when the field title is pressed to launch the
     2617# dropdown.  The enter option is invoked when the user mouses over the field
     2618# title. The leave option is invoked when the user moves the mouse away
     2619# from the field title.  The save option is invoked whenever there is a
     2620# selection from the list, to alert the visualization server.
     2621# ----------------------------------------------------------------------
     2622itcl::body Rappture::VtkGlyphViewer::LegendTitleAction {option} {
    24922623    set c $itk_component(view)
    24932624    switch -- $option {
     
    25012632            tk_popup $itk_component(fieldmenu) $x $y
    25022633        }
    2503         activate {
     2634        enter {
    25042635            $c itemconfigure title -fill red
    25052636        }
    2506         deactivate {
     2637        leave {
    25072638            $c itemconfigure title -fill $itk_option(-plotforeground)
    25082639        }
    2509         invoke {
     2640        save {
    25102641            $itk_component(field) value $_curFldLabel
    25112642            AdjustSetting -field
    25122643        }
    25132644        default {
    2514             error "bad option \"$option\": should be post, unpost, select"
     2645            error "bad option \"$option\": should be post, enter, leave or save"
    25152646        }
    25162647    }
     
    25282659    set _currentColormap $name
    25292660    SendCmd "glyphs colormap $_currentColormap"
     2661    #SendCmd "cutplane colormap $_currentColormap"
    25302662}
    25312663
     
    25852717                -activeforeground $itk_option(-plotforeground) \
    25862718                -font "Arial 8" \
    2587                 -command [itcl::code $this Combo invoke]
     2719                -command [itcl::code $this LegendTitleAction save]
    25882720            set _fields($fname) [list $label $units $components]
    25892721            if { $_curFldName == "" } {
  • branches/1.6/gui/scripts/vtkheightmapviewer.tcl

    r6155 r6212  
    113113
    114114    private variable _arcball ""
    115     private variable _dlist ""     ;    # list of data objects
    116     private variable _obj2ovride   ;    # maps dataobj => style override
     115    private variable _dlist "";         # list of data objects
     116    private variable _obj2ovride;       # maps dataobj => style override
    117117    private variable _comp2scale;       # maps dataset to the heightmap scale.
    118     private variable _datasets     ;    # contains all the dataobj-component
    119                                    ;    # datasets in the server
    120     private variable _colormaps    ;    # contains all the colormaps
    121                                    ;    # in the server.
     118    private variable _datasets;         # contains all the dataobj-component
     119                                        # datasets in the server
     120    private variable _colormaps;        # contains all the colormaps
     121                                        # in the server.
    122122
    123123    # The name of the current colormap used.  The colormap is global to all
     
    131131                                        # -stretchtofit
    132132
    133     private variable _click        ;    # info used for rotate operations
    134     private variable _limits       ;    # Holds overall limits for all dataobjs
     133    private variable _click;            # info used for rotate operations
     134    private variable _limits;           # Holds overall limits for all dataobjs
    135135                                        # using the viewer.
    136     private variable _view         ;    # view params for 3D view
     136    private variable _view;             # view params for 3D view
    137137    private variable _settings
    138138    private variable _changed
    139139    private variable _reset 1;          # Connection to server has been reset.
    140140
    141     private variable _first ""     ;    # This is the topmost dataset.
     141    private variable _first "";         # This is the topmost dataset.
    142142    private variable _start 0
    143143    private variable _isolines
     
    153153    private variable _curFldName ""
    154154    private variable _curFldLabel ""
    155     private variable _colorMode "scalar";# Mode of colormap (vmag or scalar)
     155    private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar)
    156156
    157157    private common _downloadPopup;      # download options from popup
     
    193193    #
    194194    $_parser alias image [itcl::code $this ReceiveImage]
     195    $_parser alias legend [itcl::code $this ReceiveLegend]
    195196    $_parser alias dataset [itcl::code $this ReceiveDataset]
    196     $_parser alias legend [itcl::code $this ReceiveLegend]
    197197
    198198    # Create image for legend colorbar.
     
    264264    set c $itk_component(view)
    265265    bind $c <Configure> [itcl::code $this EventuallyResize %w %h]
    266     bind $c <4> [itcl::code $this Zoom in 0.25]
    267     bind $c <5> [itcl::code $this Zoom out 0.25]
    268     bind $c <KeyPress-Left>  [list %W xview scroll 10 units]
    269     bind $c <KeyPress-Right> [list %W xview scroll -10 units]
    270     bind $c <KeyPress-Up>    [list %W yview scroll 10 units]
    271     bind $c <KeyPress-Down>  [list %W yview scroll -10 units]
    272     bind $c <Enter> "focus %W"
    273266    bind $c <Control-F1> [itcl::code $this ToggleConsole]
    274267
  • branches/1.6/gui/scripts/vtkimageviewer.tcl

    r6155 r6212  
    109109
    110110    private variable _arcball ""
    111     private variable _dlist ""     ;    # list of data objects
    112     private variable _obj2ovride   ;    # maps dataobj => style override
    113     private variable _datasets     ;    # contains all the dataobj-component
    114                                    ;    # datasets in the server
    115     private variable _colormaps    ;    # contains all the colormaps
    116                                    ;    # in the server.
     111    private variable _dlist "";         # list of data objects
     112    private variable _obj2ovride;       # maps dataobj => style override
     113    private variable _datasets;         # contains all the dataobj-component
     114                                        # datasets in the server
     115    private variable _colormaps;        # contains all the colormaps
     116                                        # in the server.
    117117
    118118    # The name of the current colormap used.  The colormap is global to all
     
    126126                                        # -stretchtofit
    127127
    128     private variable _click        ;    # info used for rotate operations
    129     private variable _limits       ;    # Holds overall limits for all dataobjs
     128    private variable _click;            # info used for rotate operations
     129    private variable _limits;           # Holds overall limits for all dataobjs
    130130                                        # using the viewer.
    131     private variable _view         ;    # view params for 3D view
     131    private variable _view;             # view params for 3D view
    132132    private variable _settings
    133133    private variable _changed
    134134    private variable _reset 1;          # Connection to server has been reset.
    135135
    136     private variable _first ""     ;    # This is the topmost dataset.
     136    private variable _first "";         # This is the topmost dataset.
    137137    private variable _start 0
    138138    private variable _isolines
     
    148148    private variable _curFldName ""
    149149    private variable _curFldLabel ""
    150     private variable _colorMode "scalar";# Mode of colormap (vmag or scalar)
     150    private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar)
    151151
    152152    private common _downloadPopup;      # download options from popup
     
    188188    #
    189189    $_parser alias image [itcl::code $this ReceiveImage]
     190    $_parser alias legend [itcl::code $this ReceiveLegend]
    190191    $_parser alias dataset [itcl::code $this ReceiveDataset]
    191     $_parser alias legend [itcl::code $this ReceiveLegend]
    192192
    193193    # Create image for legend colorbar.
     
    252252    set c $itk_component(view)
    253253    bind $c <Configure> [itcl::code $this EventuallyResize %w %h]
    254     bind $c <4> [itcl::code $this Zoom in 0.25]
    255     bind $c <5> [itcl::code $this Zoom out 0.25]
    256     bind $c <KeyPress-Left>  [list %W xview scroll 10 units]
    257     bind $c <KeyPress-Right> [list %W xview scroll -10 units]
    258     bind $c <KeyPress-Up>    [list %W yview scroll 10 units]
    259     bind $c <KeyPress-Down>  [list %W yview scroll -10 units]
    260     bind $c <Enter> "focus %W"
    261254    bind $c <Control-F1> [itcl::code $this ToggleConsole]
    262255
  • branches/1.6/gui/scripts/vtkisosurfaceviewer.tcl

    r6155 r6212  
    116116    private method SetObjectStyle { dataobj comp }
    117117    private method SetOrientation { side }
     118    private method SetupKeyboardBindings {}
     119    private method SetupMousePanningBindings {}
    118120    private method SetupMouseRotationBindings {}
    119     private method SetupMousePanningBindings {}
    120     private method SetupKeyboardBindings {}
     121    private method SetupMouseZoomBindings {}
    121122    private method Slice {option args}
    122123    private method ToggleCustomRange { args }
     
    338339    set c $itk_component(view)
    339340    bind $c <Configure> [itcl::code $this EventuallyResize %w %h]
    340     bind $c <4> [itcl::code $this Zoom in 0.25]
    341     bind $c <5> [itcl::code $this Zoom out 0.25]
    342     bind $c <KeyPress-Left>  [list %W xview scroll 10 units]
    343     bind $c <KeyPress-Right> [list %W xview scroll -10 units]
    344     bind $c <KeyPress-Up>    [list %W yview scroll 10 units]
    345     bind $c <KeyPress-Down>  [list %W yview scroll -10 units]
    346     bind $c <Enter> "focus %W"
    347341    bind $c <Control-F1> [itcl::code $this ToggleConsole]
    348342
     
    417411    pack $itk_component(cutplane) -padx 2 -pady 2
    418412
    419 
    420413    if { [catch {
    421414        BuildIsosurfaceTab
     
    448441    SetupMouseRotationBindings
    449442    SetupMousePanningBindings
     443    SetupMouseZoomBindings
    450444    SetupKeyboardBindings
    451 
    452445
    453446    #bind $itk_component(view) <ButtonRelease-3> \
    454447    #    [itcl::code $this Pick %x %y]
    455 
    456 
    457     if {[string equal "x11" [tk windowingsystem]]} {
    458         # Bindings for zoom via mouse
    459         bind $itk_component(view) <4> [itcl::code $this Zoom out]
    460         bind $itk_component(view) <5> [itcl::code $this Zoom in]
    461     }
    462448
    463449    set _image(download) [image create photo]
     
    503489    bind $itk_component(view) <ButtonRelease-2> \
    504490        [itcl::code $this Pan release %x %y]
     491}
     492
     493itcl::body Rappture::VtkIsosurfaceViewer::SetupMouseZoomBindings {} {
     494    if {[string equal "x11" [tk windowingsystem]]} {
     495        # Bindings for zoom via mouse
     496        bind $itk_component(view) <4> [itcl::code $this Zoom out]
     497        bind $itk_component(view) <5> [itcl::code $this Zoom in]
     498    }
    505499}
    506500
     
    16771671            set _colormaps($cmap) 1
    16781672        }
    1679         #SendCmd "legend $cmap scalar $_curFldName {} $w $h 0"
     1673        #SendCmd "legend $cmap $_colorMode $_curFldName {} $w $h 0"
    16801674        SendCmd "legend2 $cmap $w $h"
    16811675    }
     
    18211815        [itcl::code $this AdjustSetting -numcontours]
    18221816
    1823 
    18241817    # add widgets for setting a custom range on the legend
    18251818
     
    18541847    $itk_component(min) configure -state disabled
    18551848    $itk_component(max) configure -state disabled
    1856 
    18571849
    18581850    blt::table $inner \
     
    27622754# Used internally to handle the dropdown list for the fields menu combobox.
    27632755# The post option is invoked when the field title is pressed to launch the
    2764 # dropdown. The enter option is invoked when the user mouses over the field
     2756# dropdown.  The enter option is invoked when the user mouses over the field
    27652757# title. The leave option is invoked when the user moves the mouse away
    27662758# from the field title.  The save option is invoked whenever there is a
     
    27902782        }
    27912783        default {
    2792             error "bad option \"$option\": should be post, enter, leave, save"
     2784            error "bad option \"$option\": should be post, enter, leave or save"
    27932785        }
    27942786    }
  • branches/1.6/gui/scripts/vtkmeshviewer.tcl

    r6155 r6212  
    210210    set c $itk_component(view)
    211211    bind $c <Configure> [itcl::code $this EventuallyResize %w %h]
    212     bind $c <4> [itcl::code $this Zoom in 0.25]
    213     bind $c <5> [itcl::code $this Zoom out 0.25]
    214     bind $c <KeyPress-Left>  [list %W xview scroll 10 units]
    215     bind $c <KeyPress-Right> [list %W xview scroll -10 units]
    216     bind $c <KeyPress-Up>    [list %W yview scroll 10 units]
    217     bind $c <KeyPress-Down>  [list %W yview scroll -10 units]
    218     bind $c <Enter> "focus %W"
    219212    bind $c <Control-F1> [itcl::code $this ToggleConsole]
    220213
  • branches/1.6/gui/scripts/vtkstreamlinesviewer.tcl

    r6155 r6212  
    114114    private variable _arcball ""
    115115
    116     private variable _dlist ""     ;    # list of data objects
    117     private variable _obj2ovride   ;    # maps dataobj => style override
    118     private variable _datasets     ;    # contains all the dataobj-component
    119                                    ;    # datasets in the server
    120     private variable _colormaps    ;    # contains all the colormaps
    121                                    ;    # in the server.
     116    private variable _dlist "";         # list of data objects
     117    private variable _obj2ovride;       # maps dataobj => style override
     118    private variable _datasets;         # contains all the dataobj-component
     119                                        # datasets in the server
     120    private variable _colormaps;        # contains all the colormaps
     121                                        # in the server.
    122122    private variable _currentColormap ""
    123123
    124     private variable _click        ;    # info used for rotate operations
    125     private variable _limits       ;    # autoscale min/max for all axes
    126     private variable _view         ;    # view params for 3D view
     124    private variable _click;            # info used for rotate operations
     125    private variable _limits;           # autoscale min/max for all axes
     126    private variable _view;             # view params for 3D view
    127127    private variable _settings
    128128    private variable _reset 1;          # Connection to server has been reset.
    129129
    130     private variable _first ""     ;    # This is the topmost dataset.
     130    private variable _first "";         # This is the topmost dataset.
    131131    private variable _start 0
    132132    private variable _title ""
     
    144144    private variable _field      ""
    145145    private variable _numSeeds 200
    146     private variable _colorMode "vmag";# Mode of colormap (vmag or scalar)
     146    private variable _colorMode "vmag"; # Mode of colormap (vmag or scalar)
    147147
    148148    private common _downloadPopup;      # download options from popup
     
    271271    set c $itk_component(view)
    272272    bind $c <Configure> [itcl::code $this EventuallyResize %w %h]
    273     bind $c <4> [itcl::code $this Zoom in 0.25]
    274     bind $c <5> [itcl::code $this Zoom out 0.25]
    275     bind $c <KeyPress-Left>  [list %W xview scroll 10 units]
    276     bind $c <KeyPress-Right> [list %W xview scroll -10 units]
    277     bind $c <KeyPress-Up>    [list %W yview scroll 10 units]
    278     bind $c <KeyPress-Down>  [list %W yview scroll -10 units]
    279     bind $c <Enter> "focus %W"
    280273    bind $c <Control-F1> [itcl::code $this ToggleConsole]
    281274
  • branches/1.6/gui/scripts/vtksurfaceviewer.tcl

    r6155 r6212  
    111111    private variable _arcball ""
    112112
    113     private variable _dlist ""     ;    # list of data objects
    114     private variable _obj2ovride   ;    # maps dataobj => style override
    115     private variable _datasets     ;    # contains all the dataobj-component
    116                                    ;    # datasets in the server
    117     private variable _colormaps    ;    # contains all the colormaps
    118                                    ;    # in the server.
     113    private variable _dlist "";         # list of data objects
     114    private variable _obj2ovride;       # maps dataobj => style override
     115    private variable _datasets;         # contains all the dataobj-component
     116                                        # datasets in the server
     117    private variable _colormaps;        # contains all the colormaps
     118                                        # in the server.
    119119    # The name of the current colormap used.  The colormap is global to all
    120120    # heightmaps displayed.
     
    122122    private variable _currentNumContours -1
    123123
    124     private variable _click        ;    # info used for rotate operations
    125     private variable _limits       ;    # autoscale min/max for all axes
    126     private variable _view         ;    # view params for 3D view
     124    private variable _click;            # info used for rotate operations
     125    private variable _limits;           # autoscale min/max for all axes
     126    private variable _view;             # view params for 3D view
    127127    private variable _settings
    128128    private variable _changed
    129129    private variable _reset 1;          # Connection to server has been reset.
    130130
    131     private variable _first ""     ;    # This is the topmost dataset.
     131    private variable _first "";         # This is the topmost dataset.
    132132    private variable _start 0
    133133    private variable _title ""
     
    139139    private variable _legendPending 0
    140140    private variable _rotatePending 0
    141     private variable _field      ""
    142     private variable _colorMode "scalar"; #  Mode of colormap (vmag or scalar)
     141    private variable _field ""
     142    private variable _colorMode "scalar"; # Mode of colormap (vmag or scalar)
    143143    private variable _fields
    144144    private variable _curFldName ""
     
    251251    set c $itk_component(view)
    252252    bind $c <Configure> [itcl::code $this EventuallyResize %w %h]
    253     bind $c <4> [itcl::code $this Zoom in 0.25]
    254     bind $c <5> [itcl::code $this Zoom out 0.25]
    255     bind $c <KeyPress-Left>  [list %W xview scroll 10 units]
    256     bind $c <KeyPress-Right> [list %W xview scroll -10 units]
    257     bind $c <KeyPress-Up>    [list %W yview scroll 10 units]
    258     bind $c <KeyPress-Down>  [list %W yview scroll -10 units]
    259     bind $c <Enter> "focus %W"
    260253    bind $c <Control-F1> [itcl::code $this ToggleConsole]
    261254
  • branches/1.6/gui/scripts/vtkviewer.tcl

    r6155 r6212  
    225225    #
    226226    $_parser alias image [itcl::code $this ReceiveImage]
     227    $_parser alias legend [itcl::code $this ReceiveLegend]
    227228    $_parser alias dataset [itcl::code $this ReceiveDataset]
    228     $_parser alias legend [itcl::code $this ReceiveLegend]
    229229
    230230    # Initialize the view to some default parameters.
     
    305305    set c $itk_component(view)
    306306    bind $c <Configure> [itcl::code $this EventuallyResize %w %h]
    307     bind $c <4> [itcl::code $this Zoom in 0.25]
    308     bind $c <5> [itcl::code $this Zoom out 0.25]
    309     bind $c <KeyPress-Left>  [list %W xview scroll 10 units]
    310     bind $c <KeyPress-Right> [list %W xview scroll -10 units]
    311     bind $c <KeyPress-Up>    [list %W yview scroll 10 units]
    312     bind $c <KeyPress-Down>  [list %W yview scroll -10 units]
    313     bind $c <Enter> "focus %W"
    314307    bind $c <Control-F1> [itcl::code $this ToggleConsole]
    315308
  • branches/1.6/gui/scripts/vtkvolumeviewer.tcl

    r6155 r6212  
    267267    set c $itk_component(view)
    268268    bind $c <Configure> [itcl::code $this EventuallyResize %w %h]
    269     bind $c <4> [itcl::code $this Zoom in 0.25]
    270     bind $c <5> [itcl::code $this Zoom out 0.25]
    271     bind $c <KeyPress-Left>  [list %W xview scroll 10 units]
    272     bind $c <KeyPress-Right> [list %W xview scroll -10 units]
    273     bind $c <KeyPress-Up>    [list %W yview scroll 10 units]
    274     bind $c <KeyPress-Down>  [list %W yview scroll -10 units]
    275     bind $c <Enter> "focus %W"
    276269    bind $c <Control-F1> [itcl::code $this ToggleConsole]
    277270
  • branches/1.6/puq/Makefile.in

    r6189 r6212  
    3535            $(INSTALL) -m 0444 $$i $(puq_libdir) ; \
    3636        done
    37         $(INSTALL) -m 0555 puq.sh $(bindir)
    38 
     37        $(INSTALL) -m 0555 puq.sh $(bindir)
    3938
    4039clean:
  • branches/1.6/puq/puq.sh.in

    • Property svn:executable set to *
Note: See TracChangeset for help on using the changeset viewer.