Changeset 4762 for branches


Ignore:
Timestamp:
Nov 22, 2014, 11:58:38 PM (10 years ago)
Author:
ldelgass
Message:

Sync glyph viewer with trunk, but don't enable new UI controls yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.3/gui/scripts/vtkglyphviewer.tcl

    r4759 r4762  
    238238        -glyphedges             0
    239239        -glyphlighting          1
     240        -glyphnormscale         1
    240241        -glyphopacity           100
     242        -glyphorient            1
    241243        -glyphoutline           0
    242244        -glyphscale             1
     245        -glyphscalemode         "vmag"
     246        -glyphshape             "arrow"
    243247        -glyphvisible           1
    244248        -glyphwireframe         0
     
    10371041        # These are settings that rely on a dataset being loaded.
    10381042        InitSettings \
    1039             -glyphlighting \
    10401043            -field \
    10411044            -glyphedges -glyphlighting -glyphopacity \
     
    13441347        "-cutplanevisible" {
    13451348            set bool $_settings($what)
    1346             SendCmd "cutplane visible $bool"
     1349            SendCmd "cutplane visible 0"
     1350            if { $bool } {
     1351                foreach tag [CurrentDatasets -visible] {
     1352                    SendCmd "cutplane visible $bool $tag"
     1353                }
     1354            }
    13471355        }
    13481356        "-cutplanewireframe" {
     
    14071415        "-glyphvisible" {
    14081416            set bool $_settings($what)
    1409             SendCmd "glyphs visible $bool"
     1417            SendCmd "glyphs visible 0"
     1418            if { $bool } {
     1419                foreach tag [CurrentDatasets -visible] {
     1420                    SendCmd "glyphs visible $bool $tag"
     1421                }
     1422            }
    14101423            if { $bool } {
    14111424                Rappture::Tooltip::for $itk_component(glyphs) \
     
    14271440        "-glyphoutline" {
    14281441            set bool $_settings($what)
    1429             SendCmd "outline visible $bool"
     1442            SendCmd "outline visible 0"
     1443            if { $bool } {
     1444                foreach tag [CurrentDatasets -visible] {
     1445                    SendCmd "outline visible $bool $tag"
     1446                }
     1447            }
    14301448        }
    14311449        "-glyphopacity" {
     
    14341452            SendCmd "glyphs opacity $sval"
    14351453        }
     1454        "-glyphnormscale" {
     1455            set bool $_settings($what)
     1456            SendCmd "glyphs normscale $bool"
     1457        }
     1458        "-glyphorient" {
     1459            set bool $_settings($what)
     1460            SendCmd "glyphs gorient $bool {}"
     1461        }
    14361462        "-glyphscale" {
    14371463            set val $_settings($what)
     
    14391465                SendCmd "glyphs gscale $val"
    14401466            }
     1467        }
     1468        "-glyphscalemode" {
     1469            set label [$itk_component(scaleMode) value]
     1470            set mode [$itk_component(scaleMode) translate $label]
     1471            set _settings($what) $mode
     1472            SendCmd "glyphs smode $mode {}"
     1473        }
     1474        "-glyphshape" {
     1475            set label [$itk_component(gshape) value]
     1476            set shape [$itk_component(gshape) translate $label]
     1477            set _settings($what) $shape
     1478            SendCmd "glyphs shape $shape"
    14411479        }
    14421480        "-field" {
     
    15641602        -font "Arial 9"
    15651603
     1604    label $inner.gshape_l -text "Glyph shape" -font "Arial 9"
     1605    itk_component add gshape {
     1606        Rappture::Combobox $inner.gshape -width 10 -editable no
     1607    }
     1608    $inner.gshape choices insert end \
     1609        "arrow"              "arrow"           \
     1610        "cone"               "cone"            \
     1611        "cube"               "cube"            \
     1612        "cylinder"           "cylinder"        \
     1613        "dodecahedron"       "dodecahedron"    \
     1614        "icosahedron"        "icosahedron"     \
     1615        "line"               "line"            \
     1616        "octahedron"         "octahedron"      \
     1617        "point"              "point"           \
     1618        "sphere"             "sphere"          \
     1619        "tetrahedron"        "tetrahedron"
     1620
     1621    $itk_component(gshape) value $_settings(-glyphshape)
     1622    bind $inner.gshape <<Value>> [itcl::code $this AdjustSetting -glyphshape]
     1623
     1624    label $inner.scaleMode_l -text "Scale by" -font "Arial 9"
     1625    itk_component add scaleMode {
     1626        Rappture::Combobox $inner.scaleMode -width 10 -editable no
     1627    }
     1628    $inner.scaleMode choices insert end \
     1629        "scalar" "Scalar"            \
     1630        "vmag"   "Vector magnitude"  \
     1631        "vcomp"  "Vector components" \
     1632        "off"    "Constant size"
     1633
     1634    $itk_component(scaleMode) value "[$itk_component(scaleMode) label $_settings(-glyphscalemode)]"
     1635    bind $inner.scaleMode <<Value>> [itcl::code $this AdjustSetting -glyphscalemode]
     1636
     1637    checkbutton $inner.normscale \
     1638        -text "Normalize scaling" \
     1639        -variable [itcl::scope _settings(-glyphnormscale)] \
     1640        -command [itcl::code $this AdjustSetting -glyphnormscale] \
     1641        -font "Arial 9"
     1642    Rappture::Tooltip::for $inner.normscale "If enabled, field values are normalized to \[0,1\] before scaling and scale factor is relative to a default size"
     1643
     1644    checkbutton $inner.gorient \
     1645        -text "Orient" \
     1646        -variable [itcl::scope _settings(-glyphorient)] \
     1647        -command [itcl::code $this AdjustSetting -glyphorient] \
     1648        -font "Arial 9"
     1649    Rappture::Tooltip::for $inner.gorient "Orient glyphs by vector field directions"
     1650
    15661651    checkbutton $inner.wireframe \
    15671652        -text "Wireframe" \
     
    16141699
    16151700    label $inner.gscale_l -text "Scale factor" -font "Arial 9"
     1701    if {0} {
    16161702    ::scale $inner.gscale -from 1 -to 100 -orient horizontal \
    16171703        -variable [itcl::scope _settings(-glyphscale)] \
     
    16191705        -showvalue off \
    16201706        -command [itcl::code $this AdjustSetting -glyphscale]
     1707    } else {
     1708    itk_component add gscale {
     1709        entry $inner.gscale -font "Arial 9" -bg white \
     1710            -textvariable [itcl::scope _settings(-glyphscale)]
     1711    } {
     1712        ignore -font -background
     1713    }
     1714    bind $inner.gscale <Return> \
     1715        [itcl::code $this AdjustSetting -glyphscale]
     1716    bind $inner.gscale <KP_Enter> \
     1717        [itcl::code $this AdjustSetting -glyphscale]
     1718    }
    16211719    Rappture::Tooltip::for $inner.gscale "Set scaling multiplier (or constant size)"
    16221720
     
    21052203
    21062204    SendCmd "glyphs add $style(-shape) $tag"
     2205    set _settings(-glyphshape) $style(-shape)
     2206    $itk_component(gshape) value $style(-shape)
    21072207    SendCmd "glyphs edges $style(-edges) $tag"
    21082208    set _settings(-glyphedges) $style(-edges)
     
    21152215        SendCmd "glyphs gscale $style(-gscale) $tag"
    21162216    }
     2217    set _settings(-glyphnormscale) $style(-normscale)
     2218    set _settings(-glyphscale) $style(-gscale)
    21172219
    21182220    # constant color only used if colormode set to constant
     
    21212223    # defaults to active scalars or vectors depending on mode
    21222224    SendCmd "glyphs gorient $style(-orientGlyphs) {} $tag"
     2225    set _settings(-glyphorient) $style(-orientGlyphs)
    21232226    SendCmd "glyphs smode $style(-scaleMode) {} $tag"
     2227    set _settings(-glyphscalemode) $style(-scaleMode)
     2228    $itk_component(scaleMode) value "[$itk_component(scaleMode) label $style(-scaleMode)]"
    21242229    SendCmd "glyphs quality $style(-quality) $tag"
    21252230    SendCmd "glyphs lighting $style(-lighting) $tag"
Note: See TracChangeset for help on using the changeset viewer.