Ignore:
Timestamp:
Jan 4, 2015, 6:52:23 PM (10 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

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

    r4344 r4919  
    118118    # heightmaps displayed.
    119119    private variable _currentColormap ""
    120     private variable _currentOpacity ""
    121120
    122121    private variable _dataset2style    ;# maps dataobj-component to transfunc
     
    183182    $_dispatcher register !xcutplane
    184183    $_dispatcher dispatch $this !xcutplane \
    185         "[itcl::code $this AdjustSetting cutplaneXPosition]; list"
     184        "[itcl::code $this AdjustSetting -cutplanexposition]; list"
    186185
    187186    # Y-Cutplane event
    188187    $_dispatcher register !ycutplane
    189188    $_dispatcher dispatch $this !ycutplane \
    190         "[itcl::code $this AdjustSetting cutplaneYPosition]; list"
     189        "[itcl::code $this AdjustSetting -cutplaneyposition]; list"
    191190
    192191    # Z-Cutplane event
    193192    $_dispatcher register !zcutplane
    194193    $_dispatcher dispatch $this !zcutplane \
    195         "[itcl::code $this AdjustSetting cutplaneZPosition]; list"
     194        "[itcl::code $this AdjustSetting -cutplanezposition]; list"
    196195
    197196    #
     
    218217
    219218    array set _settings [subst {
    220         background              black
    221         colormap                BCGYR
    222         colormapVisible         1
    223         field                   "Default"
    224         axesVisible             1
    225         axisLabelsVisible       1
    226         axisXGrid               0
    227         axisYGrid               0
    228         axisZGrid               0
    229         cutplaneEdges           0
    230         cutplaneLighting        1
    231         cutplanePreinterp       1
    232         cutplaneOpacity         100
    233         cutplaneVisible         0
    234         cutplaneWireframe       0
    235         cutplaneXPosition       50
    236         cutplaneXVisible        1
    237         cutplaneYPosition       50
    238         cutplaneYVisible        1
    239         cutplaneZPosition       50
    240         cutplaneZVisible        1
    241         glyphEdges              0
    242         glyphLighting           1
    243         glyphNormscale          1
    244         glyphOpacity            100
    245         saveGlyphOpacity        100
    246         glyphOrient             1
    247         glyphOutline            0
    248         glyphScale              1
    249         glyphScaleMode          "vmag"
    250         glyphShape              "arrow"
    251         glyphVisible            1
    252         glyphWireframe          0
    253         legendVisible           1
     219        -axesvisible            1
     220        -axislabels             1
     221        -axisminorticks         1
     222        -axismode               "static"
     223        -background             black
     224        -colormap               BCGYR
     225        -colormapvisible        1
     226        -cutplaneedges          0
     227        -cutplanelighting       1
     228        -cutplanepreinterp      1
     229        -cutplaneopacity        100
     230        -cutplanevisible        0
     231        -cutplanewireframe      0
     232        -cutplanexposition      50
     233        -cutplanexvisible       1
     234        -cutplaneyposition      50
     235        -cutplaneyvisible       1
     236        -cutplanezposition      50
     237        -cutplanezvisible       1
     238        -field                  "Default"
     239        -glyphedges             0
     240        -glyphlighting          1
     241        -glyphopacity           100
     242        -glyphoutline           0
     243        -glyphscale             1
     244        -glyphvisible           1
     245        -glyphwireframe         0
     246        -legendvisible          1
     247        -saveglyphopacity       100
     248        -xgrid                  0
     249        -ygrid                  0
     250        -zgrid                  0
    254251    }]
    255252    array set _changed {
    256         glyphOpacity            0
    257         colormap                0
     253        -colormap               0
     254        -glyphopacity           0
    258255    }
    259256
     
    335332            -onimage [Rappture::icon volume-on] \
    336333            -offimage [Rappture::icon volume-off] \
    337             -variable [itcl::scope _settings(glyphVisible)] \
    338             -command [itcl::code $this AdjustSetting glyphVisible]
     334            -variable [itcl::scope _settings(-glyphvisible)] \
     335            -command [itcl::code $this AdjustSetting -glyphvisible]
    339336    }
    340337    $itk_component(glyphs) select
     
    348345            -onimage [Rappture::icon cutbutton] \
    349346            -offimage [Rappture::icon cutbutton] \
    350             -variable [itcl::scope _settings(cutplaneVisible)] \
    351             -command [itcl::code $this AdjustSetting cutplaneVisible]
     347            -variable [itcl::scope _settings(-cutplanevisible)] \
     348            -command [itcl::code $this AdjustSetting -cutplanevisible]
    352349    }
    353350    Rappture::Tooltip::for $itk_component(cutplane) \
     
    439436    eval itk_initialize $args
    440437    Connect
    441     update
    442438}
    443439
     
    547543}
    548544
    549 
    550545# ----------------------------------------------------------------------
    551546# USAGE: delete ?<dataobj1> <dataobj2> ...?
    552547#
    553 #       Clients use this to delete a dataobj from the plot.  If no dataobjs
    554 #       are specified, then all dataobjs are deleted.  No data objects are
    555 #       deleted.  They are only removed from the display list.
     548#    Clients use this to delete a dataobj from the plot.  If no dataobjs
     549#    are specified, then all dataobjs are deleted.  No data objects are
     550#    deleted.  They are only removed from the display list.
    556551#
    557552# ----------------------------------------------------------------------
     
    782777                set session $env(SESSION)
    783778            }
     779            lappend info "version" "$Rappture::version"
     780            lappend info "build" "$Rappture::build"
     781            lappend info "svnurl" "$Rappture::svnurl"
     782            lappend info "installdir" "$Rappture::installdir"
    784783            lappend info "hub" [exec hostname]
    785784            lappend info "client" "vtkglyphviewer"
     
    799798# isconnected --
    800799#
    801 #       Indicates if we are currently connected to the visualization server.
     800#    Indicates if we are currently connected to the visualization server.
    802801#
    803802itcl::body Rappture::VtkGlyphViewer::isconnected {} {
     
    816815# Disconnect --
    817816#
    818 #       Clients use this method to disconnect from the current rendering
    819 #       server.
     817#    Clients use this method to disconnect from the current rendering
     818#    server.
    820819#
    821820itcl::body Rappture::VtkGlyphViewer::Disconnect {} {
     
    955954        PanCamera
    956955        set _first ""
    957         InitSettings axisXGrid axisYGrid axisZGrid axisMode \
    958             axesVisible axisLabelsVisible
     956        InitSettings -xgrid -ygrid -zgrid -axismode \
     957            -axesvisible -axislabels -axisminorticks
    959958        foreach axis { x y z } {
    960959            SendCmd "axis lformat $axis %g"
     
    975974            if { ![info exists _datasets($tag)] } {
    976975                set bytes [$dataobj vtkdata $comp]
    977                 if 0 {
    978                     set f [open "/tmp/glyph.vtk" "w"]
    979                     puts $f $bytes
    980                     close $f
     976                if 0 {
     977                    set f [open "/tmp/glyph.vtk" "w"]
     978                    puts $f $bytes
     979                    close $f
    981980                }
    982981                set length [string length $bytes]
     
    992991                    SendCmd "clientinfo [list $info]"
    993992                }
    994                 append _outbuf "dataset add $tag data follows $length\n"
     993                SendCmd "dataset add $tag data follows $length"
    995994                append _outbuf $bytes
    996995                set _datasets($tag) 1
     
    10011000                # Setting dataset visible enables outline
    10021001                # and glyphs
    1003                 SendCmd "dataset visible 1 $tag"
     1002                SendCmd "dataset visible 1 $tag"
    10041003            }
    10051004        }
     
    10071006
    10081007    if { $_first != "" } {
    1009         $itk_component(field) choices delete 0 end
    1010         $itk_component(fieldmenu) delete 0 end
    1011         array unset _fields
     1008        $itk_component(field) choices delete 0 end
     1009        $itk_component(fieldmenu) delete 0 end
     1010        array unset _fields
    10121011        set _curFldName ""
    10131012        foreach cname [$_first components] {
     
    10351034        $itk_component(field) value $_curFldLabel
    10361035    }
    1037     InitSettings glyphOutline
    1038         #cutplaneVisible
     1036    InitSettings -glyphoutline
     1037        #-cutplanevisible
    10391038    if { $_reset } {
    1040         # These are settings that rely on a dataset being loaded.
     1039        # These are settings that rely on a dataset being loaded.
    10411040        InitSettings \
    1042             glyphLighting \
    1043             field \
    1044             glyphEdges glyphLighting glyphOpacity \
    1045             glyphWireframe
    1046 
    1047         #cutplaneXPosition cutplaneYPosition cutplaneZPosition \
    1048             cutplaneXVisible cutplaneYVisible cutplaneZVisible \
    1049             cutplanePreinterp
     1041            -glyphlighting \
     1042            -field \
     1043            -glyphedges -glyphlighting -glyphopacity \
     1044            -glyphwireframe
     1045
     1046        #-cutplanexposition -cutplaneyposition -cutplanezposition \
     1047            -cutplanexvisible -cutplaneyvisible -cutplanezvisible \
     1048            -cutplanepreinterp
    10501049
    10511050        Zoom reset
    1052         foreach axis { x y z } {
     1051        foreach axis { x y z } {
    10531052            # Another problem fixed by a <view>. We looking into a data
    10541053            # object for the name of the axes. This should be global to
    10551054            # the viewer itself.
    1056             set label [$_first hints ${axis}label]
    1057             if { $label == "" } {
     1055            set label [$_first hints ${axis}label]
     1056            if { $label == "" } {
    10581057                set label [string toupper $axis]
    1059             }
    1060             # May be a space in the axis label.
    1061             SendCmd [list axis name $axis $label]
     1058            }
     1059            # May be a space in the axis label.
     1060            SendCmd [list axis name $axis $label]
    10621061        }
    10631062        if { [array size _fields] < 2 } {
    1064             blt::table forget $itk_component(field) $itk_component(field_l)
     1063            catch {blt::table forget $itk_component(field) $itk_component(field_l)}
    10651064        }
    10661065        set _reset 0
     
    11661165    SendCmd "camera pan $x $y"
    11671166}
    1168 
    11691167
    11701168# ----------------------------------------------------------------------
     
    12871285itcl::body Rappture::VtkGlyphViewer::InitSettings { args } {
    12881286    foreach spec $args {
    1289         if { [info exists _settings($_first-$spec)] } {
     1287        if { [info exists _settings($_first${spec})] } {
    12901288            # Reset global setting with dataobj specific setting
    1291             set _settings($spec) $_settings($_first-$spec)
     1289            set _settings($spec) $_settings($_first${spec})
    12921290        }
    12931291        AdjustSetting $spec
     
    12981296# AdjustSetting --
    12991297#
    1300 #       Changes/updates a specific setting in the widget.  There are
    1301 #       usually user-setable option.  Commands are sent to the render
    1302 #       server.
     1298#    Changes/updates a specific setting in the widget.  There are
     1299#    usually user-setable option.  Commands are sent to the render
     1300#    server.
    13031301#
    13041302itcl::body Rappture::VtkGlyphViewer::AdjustSetting {what {value ""}} {
     
    13071305    }
    13081306    switch -- $what {
    1309         "background" {
     1307        "-background" {
    13101308            set bgcolor [$itk_component(background) value]
    1311             array set fgcolors {
    1312                 "black" "white"
    1313                 "white" "black"
    1314                 "grey"  "black"
    1315             }
     1309            array set fgcolors {
     1310                "black" "white"
     1311                "white" "black"
     1312                "grey"  "black"
     1313            }
    13161314            configure -plotbackground $bgcolor \
    1317                 -plotforeground $fgcolors($bgcolor)
    1318             $itk_component(view) delete "legend"
    1319             DrawLegend
    1320         }
    1321         "axesVisible" {
    1322             set bool $_settings(axesVisible)
     1315                -plotforeground $fgcolors($bgcolor)
     1316            $itk_component(view) delete "legend"
     1317            DrawLegend
     1318        }
     1319        "-axesvisible" {
     1320            set bool $_settings($what)
    13231321            SendCmd "axis visible all $bool"
    13241322        }
    1325         "axisLabelsVisible" {
    1326             set bool $_settings(axisLabelsVisible)
     1323        "-axislabels" {
     1324            set bool $_settings($what)
    13271325            SendCmd "axis labels all $bool"
    13281326        }
    1329         "axisXGrid" - "axisYGrid" - "axisZGrid" {
    1330             set axis [string tolower [string range $what 4 4]]
     1327        "-axisminorticks" {
     1328            set bool $_settings($what)
     1329            SendCmd "axis minticks all $bool"
     1330        }
     1331        "-xgrid" - "-ygrid" - "-zgrid" {
     1332            set axis [string tolower [string range $what 1 1]]
    13311333            set bool $_settings($what)
    13321334            SendCmd "axis grid $axis $bool"
    13331335        }
    1334         "axisMode" {
     1336        "-axismode" {
    13351337            set mode [$itk_component(axisMode) value]
    13361338            set mode [$itk_component(axisMode) translate $mode]
     
    13381340            SendCmd "axis flymode $mode"
    13391341        }
    1340         "cutplaneEdges" {
     1342        "-cutplaneedges" {
    13411343            set bool $_settings($what)
    13421344            SendCmd "cutplane edges $bool"
    13431345        }
    1344         "cutplaneVisible" {
     1346        "-cutplanevisible" {
    13451347            set bool $_settings($what)
    13461348            SendCmd "cutplane visible $bool"
    13471349        }
    1348         "cutplaneWireframe" {
     1350        "-cutplanewireframe" {
    13491351            set bool $_settings($what)
    13501352            SendCmd "cutplane wireframe $bool"
    13511353        }
    1352         "cutplaneLighting" {
     1354        "-cutplanelighting" {
    13531355            set bool $_settings($what)
    13541356            SendCmd "cutplane lighting $bool"
    13551357        }
    1356         "cutplaneOpacity" {
     1358        "-cutplaneopacity" {
    13571359            set val $_settings($what)
    13581360            set sval [expr { 0.01 * double($val) }]
    13591361            SendCmd "cutplane opacity $sval"
    13601362        }
    1361         "cutplanePreinterp" {
     1363        "-cutplanepreinterp" {
    13621364            set bool $_settings($what)
    13631365            SendCmd "cutplane preinterp $bool"
    13641366        }
    1365         "cutplaneXVisible" - "cutplaneYVisible" - "cutplaneZVisible" {
    1366             set axis [string tolower [string range $what 8 8]]
     1367        "-cutplanexvisible" - "-cutplaneyvisible" - "-cutplanezvisible" {
     1368            set axis [string tolower [string range $what 9 9]]
    13671369            set bool $_settings($what)
    13681370            if { $bool } {
     
    13731375                    -troughcolor grey82
    13741376            }
    1375             SendCmd "cutplane axis $axis $bool"
    1376         }
    1377         "cutplaneXPosition" - "cutplaneYPosition" - "cutplaneZPosition" {
    1378             set axis [string tolower [string range $what 8 8]]
     1377            SendCmd "cutplane axis $axis $bool"
     1378        }
     1379        "-cutplanexposition" - "-cutplaneyposition" - "-cutplanezposition" {
     1380            set axis [string tolower [string range $what 9 9]]
    13791381            set pos [expr $_settings($what) * 0.01]
    13801382            SendCmd "cutplane slice ${axis} ${pos}"
    13811383            set _cutplanePending 0
    13821384        }
    1383         "colormap" {
    1384             set _changed(colormap) 1
     1385        "-colormap" {
     1386            set _changed($what) 1
    13851387            StartBufferingCommands
    13861388            set color [$itk_component(colormap) value]
    1387             set _settings(colormap) $color
    1388             if { $color == "none" } {
    1389                 if { $_settings(colormapVisible) } {
    1390                     SendCmd "glyphs colormode constant {}"
    1391                     set _settings(colormapVisible) 0
    1392                 }
    1393             } else {
    1394                 if { !$_settings(colormapVisible) } {
    1395                     SendCmd "glyphs colormode $_colorMode $_curFldName"
    1396                     set _settings(colormapVisible) 1
    1397                 }
    1398                 SetCurrentColormap $color
    1399             }
     1389            set _settings($what) $color
     1390            if { $color == "none" } {
     1391                if { $_settings(-colormapvisible) } {
     1392                    SendCmd "glyphs colormode constant {}"
     1393                    set _settings(-colormapvisible) 0
     1394                }
     1395            } else {
     1396                if { !$_settings(-colormapvisible) } {
     1397                    SendCmd "glyphs colormode $_colorMode $_curFldName"
     1398                    set _settings(-colormapvisible) 1
     1399                }
     1400                SetCurrentColormap $color
     1401            }
    14001402            StopBufferingCommands
    1401             EventuallyRequestLegend
    1402         }
    1403         "glyphWireframe" {
     1403            EventuallyRequestLegend
     1404        }
     1405        "-glyphwireframe" {
    14041406            set bool $_settings($what)
    1405             SendCmd "glyphs wireframe $bool"
    1406         }
    1407         "glyphVisible" {
     1407            SendCmd "glyphs wireframe $bool"
     1408        }
     1409        "-glyphvisible" {
    14081410            set bool $_settings($what)
    1409             SendCmd "glyphs visible $bool"
     1411            SendCmd "glyphs visible $bool"
    14101412            if { $bool } {
    14111413                Rappture::Tooltip::for $itk_component(glyphs) \
     
    14151417                    "Show the glyph"
    14161418            }
    1417             DrawLegend
    1418         }
    1419         "glyphLighting" {
     1419            DrawLegend
     1420        }
     1421        "-glyphlighting" {
    14201422            set bool $_settings($what)
    1421             SendCmd "glyphs lighting $bool"
    1422         }
    1423         "glyphEdges" {
     1423            SendCmd "glyphs lighting $bool"
     1424        }
     1425        "-glyphedges" {
    14241426            set bool $_settings($what)
    1425             SendCmd "glyphs edges $bool"
    1426         }
    1427         "glyphOutline" {
     1427            SendCmd "glyphs edges $bool"
     1428        }
     1429        "-glyphoutline" {
    14281430            set bool $_settings($what)
    1429             SendCmd "outline visible $bool"
    1430         }
    1431         "glyphOpacity" {
     1431            SendCmd "outline visible $bool"
     1432        }
     1433        "-glyphopacity" {
    14321434            set val $_settings($what)
    14331435            set sval [expr { 0.01 * double($val) }]
    1434             SendCmd "glyphs opacity $sval"
    1435         }
    1436         "glyphNormscale" {
    1437             set bool $_settings($what)
    1438             SendCmd "glyphs normscale $bool"
    1439         }
    1440         "glyphOrient" {
    1441             set bool $_settings($what)
    1442             SendCmd "glyphs gorient $bool {}"
    1443         }
    1444         "glyphScale" {
     1436            SendCmd "glyphs opacity $sval"
     1437        }
     1438        "-glyphscale" {
    14451439            set val $_settings($what)
    1446             SendCmd "glyphs gscale $val"
    1447         }
    1448         "glyphScaleMode" {
    1449             set label [$itk_component(scaleMode) value]
    1450             set mode [$itk_component(scaleMode) translate $label]
    1451             set _settings($what) $mode
    1452             SendCmd "glyphs smode $mode {}"
    1453         }
    1454         "glyphShape" {
    1455             set label [$itk_component(gshape) value]
    1456             set shape [$itk_component(gshape) translate $label]
    1457             set _settings($what) $shape
    1458             SendCmd "glyphs shape $shape"
    1459         }
    1460         "field" {
     1440            if { [string is double $val] } {
     1441                SendCmd "glyphs gscale $val"
     1442            }
     1443        }
     1444        "-field" {
    14611445            set label [$itk_component(field) value]
    14621446            set fname [$itk_component(field) translate $label]
    1463             set _settings(field) $fname
     1447            set _settings($what) $fname
    14641448            if { [info exists _fields($fname)] } {
    14651449                foreach { label units components } $_fields($fname) break
     
    14751459                return
    14761460            }
    1477             #if { ![info exists _limits($_curFldName)] } {
    1478             #    SendCmd "dataset maprange all"
    1479             #} else {
    1480             #    SendCmd "dataset maprange explicit $_limits($_curFldName) $_curFldName"
    1481             #}
    1482             #SendCmd "cutplane colormode $_colorMode $_curFldName"
    14831461            SendCmd "glyphs colormode $_colorMode $_curFldName"
    14841462            DrawLegend
    14851463        }
    1486         "legendVisible" {
     1464        "-legendvisible" {
    14871465            if { !$_settings($what) } {
    14881466                $itk_component(view) delete legend
    1489             }
    1490             DrawLegend
     1467            }
     1468            DrawLegend
    14911469        }
    14921470        default {
     
    14961474}
    14971475
    1498 
    14991476#
    15001477# RequestLegend --
    15011478#
    1502 #       Request a new legend from the server.  The size of the legend
    1503 #       is determined from the height of the canvas. 
     1479#    Request a new legend from the server.  The size of the legend
     1480#    is determined from the height of the canvas. 
    15041481#
    15051482# This should be called when
    1506 #       1.  A new current colormap is set.
    1507 #       2.  Window is resized.
    1508 #       3.  The limits of the data have changed.  (Just need a redraw).
    1509 #       4.  Number of glyph have changed. (Just need a redraw).
    1510 #       5.  Legend becomes visible (Just need a redraw).
     1483#    1.  A new current colormap is set.
     1484#    2.  Window is resized.
     1485#    3.  The limits of the data have changed.  (Just need a redraw).
     1486#    4.  Number of glyph have changed. (Just need a redraw).
     1487#    5.  Legend becomes visible (Just need a redraw).
    15111488#
    15121489itcl::body Rappture::VtkGlyphViewer::RequestLegend {} {
     
    15201497    set fname $_curFldName
    15211498    if { [string match "component*" $fname] } {
    1522         set title ""
     1499        set title ""
    15231500    } else {
    1524         if { [info exists _fields($fname)] } {
    1525             foreach { title units } $_fields($fname) break
    1526             if { $units != "" } {
    1527                 set title [format "%s (%s)" $title $units]
    1528             }
    1529         } else {
    1530             set title $fname
    1531         }
     1501        if { [info exists _fields($fname)] } {
     1502            foreach { title units } $_fields($fname) break
     1503            if { $units != "" } {
     1504                set title [format "%s (%s)" $title $units]
     1505            }
     1506        } else {
     1507            set title $fname
     1508        }
    15321509    }
    15331510    # If there's a title too, substract one more line
     
    15401517    # Set the legend on the first heightmap dataset.
    15411518    if { $_currentColormap != ""  } {
    1542         set cmap $_currentColormap
    1543         SendCmdNoWait "legend $cmap $_colorMode $_curFldName {} $w $h 0"
     1519        set cmap $_currentColormap
     1520        SendCmdNoWait "legend $cmap $_colorMode $_curFldName {} $w $h 0"
    15441521    }
    15451522}
     
    15611538    if { [isconnected] } {
    15621539        set rgb [Color2RGB $itk_option(-plotforeground)]
    1563         SendCmd "axis color all $rgb"
     1540        SendCmd "axis color all $rgb"
    15641541        SendCmd "outline color $rgb"
    15651542        #SendCmd "cutplane color $rgb"
     
    15871564    checkbutton $inner.glyphs \
    15881565        -text "Glyphs" \
    1589         -variable [itcl::scope _settings(glyphVisible)] \
    1590         -command [itcl::code $this AdjustSetting glyphVisible] \
     1566        -variable [itcl::scope _settings(-glyphvisible)] \
     1567        -command [itcl::code $this AdjustSetting -glyphvisible] \
    15911568        -font "Arial 9"
    1592 
    1593     label $inner.gshape_l -text "Glyph shape" -font "Arial 9"
    1594     itk_component add gshape {
    1595         Rappture::Combobox $inner.gshape -width 10 -editable no
    1596     }
    1597     $inner.gshape choices insert end \
    1598         "arrow"              "arrow"           \
    1599         "cone"               "cone"            \
    1600         "cube"               "cube"            \
    1601         "cylinder"           "cylinder"        \
    1602         "dodecahedron"       "dodecahedron"    \
    1603         "icosahedron"        "icosahedron"     \
    1604         "line"               "line"            \
    1605         "octahedron"         "octahedron"      \
    1606         "point"              "point"           \
    1607         "sphere"             "sphere"          \
    1608         "tetrahedron"        "tetrahedron"
    1609 
    1610     $itk_component(gshape) value $_settings(glyphShape)
    1611     bind $inner.gshape <<Value>> [itcl::code $this AdjustSetting glyphShape]
    1612 
    1613     label $inner.scaleMode_l -text "Scale by" -font "Arial 9"
    1614     itk_component add scaleMode {
    1615         Rappture::Combobox $inner.scaleMode -width 10 -editable no
    1616     }
    1617     $inner.scaleMode choices insert end \
    1618         "scalar" "Scalar"            \
    1619         "vmag"   "Vector magnitude"  \
    1620         "vcomp"  "Vector components" \
    1621         "off"    "Constant size"
    1622 
    1623     $itk_component(scaleMode) value "[$itk_component(scaleMode) label $_settings(glyphScaleMode)]"
    1624     bind $inner.scaleMode <<Value>> [itcl::code $this AdjustSetting glyphScaleMode]
    1625 
    1626     checkbutton $inner.normscale \
    1627         -text "Normalize scaling" \
    1628         -variable [itcl::scope _settings(glyphNormscale)] \
    1629         -command [itcl::code $this AdjustSetting glyphNormscale] \
    1630         -font "Arial 9"
    1631     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"
    1632 
    1633     checkbutton $inner.gorient \
    1634         -text "Orient" \
    1635         -variable [itcl::scope _settings(glyphOrient)] \
    1636         -command [itcl::code $this AdjustSetting glyphOrient] \
    1637         -font "Arial 9"
    1638     Rappture::Tooltip::for $inner.gorient "Orient glyphs by vector field directions"
    16391569
    16401570    checkbutton $inner.wireframe \
    16411571        -text "Wireframe" \
    1642         -variable [itcl::scope _settings(glyphWireframe)] \
    1643         -command [itcl::code $this AdjustSetting glyphWireframe] \
     1572        -variable [itcl::scope _settings(-glyphwireframe)] \
     1573        -command [itcl::code $this AdjustSetting -glyphwireframe] \
    16441574        -font "Arial 9"
    16451575
    16461576    checkbutton $inner.lighting \
    16471577        -text "Enable Lighting" \
    1648         -variable [itcl::scope _settings(glyphLighting)] \
    1649         -command [itcl::code $this AdjustSetting glyphLighting] \
     1578        -variable [itcl::scope _settings(-glyphlighting)] \
     1579        -command [itcl::code $this AdjustSetting -glyphlighting] \
    16501580        -font "Arial 9"
    16511581
    16521582    checkbutton $inner.edges \
    16531583        -text "Edges" \
    1654         -variable [itcl::scope _settings(glyphEdges)] \
    1655         -command [itcl::code $this AdjustSetting glyphEdges] \
     1584        -variable [itcl::scope _settings(-glyphedges)] \
     1585        -command [itcl::code $this AdjustSetting -glyphedges] \
    16561586        -font "Arial 9"
    16571587
    16581588    checkbutton $inner.outline \
    16591589        -text "Outline" \
    1660         -variable [itcl::scope _settings(glyphOutline)] \
    1661         -command [itcl::code $this AdjustSetting glyphOutline] \
     1590        -variable [itcl::scope _settings(-glyphoutline)] \
     1591        -command [itcl::code $this AdjustSetting -glyphoutline] \
    16621592        -font "Arial 9"
    16631593
    16641594    checkbutton $inner.legend \
    16651595        -text "Legend" \
    1666         -variable [itcl::scope _settings(legendVisible)] \
    1667         -command [itcl::code $this AdjustSetting legendVisible] \
     1596        -variable [itcl::scope _settings(-legendvisible)] \
     1597        -command [itcl::code $this AdjustSetting -legendvisible] \
    16681598        -font "Arial 9"
    16691599
     
    16771607        "grey"               "grey"             
    16781608
    1679     $itk_component(background) value $_settings(background)
    1680     bind $inner.background <<Value>> [itcl::code $this AdjustSetting background]
     1609    $itk_component(background) value $_settings(-background)
     1610    bind $inner.background <<Value>> [itcl::code $this AdjustSetting -background]
    16811611
    16821612    label $inner.opacity_l -text "Opacity" -font "Arial 9"
    16831613    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1684         -variable [itcl::scope _settings(glyphOpacity)] \
     1614        -variable [itcl::scope _settings(-glyphopacity)] \
    16851615        -width 10 \
    16861616        -showvalue off \
    1687         -command [itcl::code $this AdjustSetting glyphOpacity]
     1617        -command [itcl::code $this AdjustSetting -glyphopacity]
    16881618
    16891619    label $inner.gscale_l -text "Scale factor" -font "Arial 9"
    1690     if {0} {
    16911620    ::scale $inner.gscale -from 1 -to 100 -orient horizontal \
    1692         -variable [itcl::scope _settings(glyphScale)] \
     1621        -variable [itcl::scope _settings(-glyphscale)] \
    16931622        -width 10 \
    16941623        -showvalue off \
    1695         -command [itcl::code $this AdjustSetting glyphScale]
    1696     } else {
    1697     itk_component add gscale {
    1698         entry $inner.gscale -font "Arial 9" -bg white \
    1699             -textvariable [itcl::scope _settings(glyphScale)]
    1700     } {
    1701         ignore -font -background
    1702     }
    1703     bind $inner.gscale <Return> \
    1704         [itcl::code $this AdjustSetting glyphScale]
    1705     bind $inner.gscale <KP_Enter> \
    1706         [itcl::code $this AdjustSetting glyphScale]
    1707     }
     1624        -command [itcl::code $this AdjustSetting -glyphscale]
    17081625    Rappture::Tooltip::for $inner.gscale "Set scaling multiplier (or constant size)"
    17091626
     
    17171634    }
    17181635    bind $inner.field <<Value>> \
    1719         [itcl::code $this AdjustSetting field]
     1636        [itcl::code $this AdjustSetting -field]
    17201637
    17211638    label $inner.colormap_l -text "Colormap" -font "Arial 9"
     
    17231640        Rappture::Combobox $inner.colormap -width 10 -editable no
    17241641    }
    1725     $inner.colormap choices insert end [GetColormapList -includeNone]
     1642
     1643    $inner.colormap choices insert end [GetColormapList]
    17261644    $itk_component(colormap) value "BCGYR"
    17271645    bind $inner.colormap <<Value>> \
    1728         [itcl::code $this AdjustSetting colormap]
     1646        [itcl::code $this AdjustSetting -colormap]
    17291647
    17301648    blt::table $inner \
     
    17331651        1,0 $inner.colormap_l   -anchor w -pady 2  \
    17341652        1,1 $inner.colormap     -anchor w -pady 2  -fill x \
    1735         2,0 $inner.gshape_l     -anchor w -pady 2  \
    1736         2,1 $inner.gshape       -anchor w -pady 2  -fill x \
    1737         3,0 $inner.background_l -anchor w -pady 2 \
    1738         3,1 $inner.background   -anchor w -pady 2  -fill x \
    1739         4,0 $inner.scaleMode_l  -anchor w -pady 2  \
    1740         4,1 $inner.scaleMode    -anchor w -pady 2  -fill x \
    1741         5,0 $inner.gscale_l     -anchor w -pady 2 \
    1742         5,1 $inner.gscale       -anchor w -pady 2  -fill x \
    1743         6,0 $inner.normscale    -anchor w -pady 2 -cspan 2 \
    1744         7,0 $inner.gorient      -anchor w -pady 2 -cspan 2 \
    1745         8,0 $inner.wireframe    -anchor w -pady 2 -cspan 2 \
    1746         9,0 $inner.lighting     -anchor w -pady 2 -cspan 2 \
    1747         10,0 $inner.edges        -anchor w -pady 2 -cspan 2 \
    1748         11,0 $inner.outline     -anchor w -pady 2 -cspan 2 \
    1749         12,0 $inner.legend      -anchor w -pady 2 \
    1750         13,0 $inner.opacity_l   -anchor w -pady 2 \
    1751         13,1 $inner.opacity     -fill x   -pady 2 -fill x \
     1653        3,0 $inner.background_l -anchor w -pady 2 \
     1654        3,1 $inner.background   -anchor w -pady 2  -fill x \
     1655        5,0 $inner.wireframe    -anchor w -pady 2 -cspan 2 \
     1656        6,0 $inner.lighting     -anchor w -pady 2 -cspan 2 \
     1657        7,0 $inner.edges        -anchor w -pady 2 -cspan 2 \
     1658        8,0 $inner.outline      -anchor w -pady 2 -cspan 2 \
     1659        9,0 $inner.legend       -anchor w -pady 2 \
     1660        10,0 $inner.opacity_l   -anchor w -pady 2 \
     1661        10,1 $inner.opacity     -fill x   -pady 2 -fill x \
    17521662
    17531663    blt::table configure $inner r* c* -resize none
    1754     blt::table configure $inner r14 c1 -resize expand
     1664    blt::table configure $inner r11 c1 -resize expand
    17551665}
    17561666
     
    17661676
    17671677    checkbutton $inner.visible \
    1768         -text "Show Axes" \
    1769         -variable [itcl::scope _settings(axesVisible)] \
    1770         -command [itcl::code $this AdjustSetting axesVisible] \
     1678        -text "Axes" \
     1679        -variable [itcl::scope _settings(-axesvisible)] \
     1680        -command [itcl::code $this AdjustSetting -axesvisible] \
    17711681        -font "Arial 9"
    17721682
    17731683    checkbutton $inner.labels \
    1774         -text "Show Axis Labels" \
    1775         -variable [itcl::scope _settings(axisLabelsVisible)] \
    1776         -command [itcl::code $this AdjustSetting axisLabelsVisible] \
     1684        -text "Axis Labels" \
     1685        -variable [itcl::scope _settings(-axislabels)] \
     1686        -command [itcl::code $this AdjustSetting -axislabels] \
    17771687        -font "Arial 9"
    1778 
    1779     checkbutton $inner.gridx \
    1780         -text "Show X Grid" \
    1781         -variable [itcl::scope _settings(axisXGrid)] \
    1782         -command [itcl::code $this AdjustSetting axisXGrid] \
     1688    label $inner.grid_l -text "Grid" -font "Arial 9"
     1689    checkbutton $inner.xgrid \
     1690        -text "X" \
     1691        -variable [itcl::scope _settings(-xgrid)] \
     1692        -command [itcl::code $this AdjustSetting -xgrid] \
    17831693        -font "Arial 9"
    1784     checkbutton $inner.gridy \
    1785         -text "Show Y Grid" \
    1786         -variable [itcl::scope _settings(axisYGrid)] \
    1787         -command [itcl::code $this AdjustSetting axisYGrid] \
     1694    checkbutton $inner.ygrid \
     1695        -text "Y" \
     1696        -variable [itcl::scope _settings(-ygrid)] \
     1697        -command [itcl::code $this AdjustSetting -ygrid] \
    17881698        -font "Arial 9"
    1789     checkbutton $inner.gridz \
    1790         -text "Show Z Grid" \
    1791         -variable [itcl::scope _settings(axisZGrid)] \
    1792         -command [itcl::code $this AdjustSetting axisZGrid] \
     1699    checkbutton $inner.zgrid \
     1700        -text "Z" \
     1701        -variable [itcl::scope _settings(-zgrid)] \
     1702        -command [itcl::code $this AdjustSetting -zgrid] \
     1703        -font "Arial 9"
     1704    checkbutton $inner.minorticks \
     1705        -text "Minor Ticks" \
     1706        -variable [itcl::scope _settings(-axisminorticks)] \
     1707        -command [itcl::code $this AdjustSetting -axisminorticks] \
    17931708        -font "Arial 9"
    17941709
     
    18031718        "furthest_triad"  "farthest" \
    18041719        "outer_edges"     "outer"         
    1805     $itk_component(axisMode) value "static"
    1806     bind $inner.mode <<Value>> [itcl::code $this AdjustSetting axisMode]
     1720    $itk_component(axisMode) value $_settings(-axismode)
     1721    bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axismode]
    18071722
    18081723    blt::table $inner \
    1809         0,0 $inner.visible -anchor w -cspan 2 \
    1810         1,0 $inner.labels  -anchor w -cspan 2 \
    1811         2,0 $inner.gridx   -anchor w -cspan 2 \
    1812         3,0 $inner.gridy   -anchor w -cspan 2 \
    1813         4,0 $inner.gridz   -anchor w -cspan 2 \
    1814         5,0 $inner.mode_l  -anchor w -cspan 2 -padx { 2 0 } \
    1815         6,0 $inner.mode    -fill x   -cspan 2
     1724        0,0 $inner.visible    -anchor w -cspan 4 \
     1725        1,0 $inner.labels     -anchor w -cspan 4 \
     1726        2,0 $inner.minorticks -anchor w -cspan 4 \
     1727        4,0 $inner.grid_l     -anchor w \
     1728        4,1 $inner.xgrid      -anchor w \
     1729        4,2 $inner.ygrid      -anchor w \
     1730        4,3 $inner.zgrid      -anchor w \
     1731        5,0 $inner.mode_l     -anchor w -padx { 2 0 } \
     1732        5,1 $inner.mode       -fill x   -cspan 3
    18161733
    18171734    blt::table configure $inner r* c* -resize none
    1818     blt::table configure $inner r7 c1 -resize expand
    1819 }
    1820 
     1735    blt::table configure $inner r7 c6 -resize expand
     1736    blt::table configure $inner r3 -height 0.125i
     1737}
    18211738
    18221739itcl::body Rappture::VtkGlyphViewer::BuildCameraTab {} {
     
    18801797    checkbutton $inner.visible \
    18811798        -text "Cutplanes" \
    1882         -variable [itcl::scope _settings(cutplaneVisible)] \
    1883         -command [itcl::code $this AdjustSetting cutplaneVisible] \
     1799        -variable [itcl::scope _settings(-cutplanevisible)] \
     1800        -command [itcl::code $this AdjustSetting -cutplanevisible] \
    18841801        -font "Arial 9"
    18851802
    18861803    checkbutton $inner.wireframe \
    18871804        -text "Wireframe" \
    1888         -variable [itcl::scope _settings(cutplaneWireframe)] \
    1889         -command [itcl::code $this AdjustSetting cutplaneWireframe] \
     1805        -variable [itcl::scope _settings(-cutplanewireframe)] \
     1806        -command [itcl::code $this AdjustSetting -cutplanewireframe] \
    18901807        -font "Arial 9"
    18911808
    18921809    checkbutton $inner.lighting \
    18931810        -text "Enable Lighting" \
    1894         -variable [itcl::scope _settings(cutplaneLighting)] \
    1895         -command [itcl::code $this AdjustSetting cutplaneLighting] \
     1811        -variable [itcl::scope _settings(-cutplanelighting)] \
     1812        -command [itcl::code $this AdjustSetting -cutplanelighting] \
    18961813        -font "Arial 9"
    18971814
    18981815    checkbutton $inner.edges \
    18991816        -text "Edges" \
    1900         -variable [itcl::scope _settings(cutplaneEdges)] \
    1901         -command [itcl::code $this AdjustSetting cutplaneEdges] \
     1817        -variable [itcl::scope _settings(-cutplaneedges)] \
     1818        -command [itcl::code $this AdjustSetting -cutplaneedges] \
    19021819        -font "Arial 9"
    19031820
    19041821    checkbutton $inner.preinterp \
    19051822        -text "Interpolate Scalars" \
    1906         -variable [itcl::scope _settings(cutplanePreinterp)] \
    1907         -command [itcl::code $this AdjustSetting cutplanePreinterp] \
     1823        -variable [itcl::scope _settings(-cutplanepreinterp)] \
     1824        -command [itcl::code $this AdjustSetting -cutplanepreinterp] \
    19081825        -font "Arial 9"
    19091826
    19101827    label $inner.opacity_l -text "Opacity" -font "Arial 9"
    19111828    ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
    1912         -variable [itcl::scope _settings(cutplaneOpacity)] \
     1829        -variable [itcl::scope _settings(-cutplaneopacity)] \
    19131830        -width 10 \
    19141831        -showvalue off \
    1915         -command [itcl::code $this AdjustSetting cutplaneOpacity]
    1916     $inner.opacity set $_settings(cutplaneOpacity)
     1832        -command [itcl::code $this AdjustSetting -cutplaneopacity]
     1833    $inner.opacity set $_settings(-cutplaneopacity)
    19171834
    19181835    # X-value slicer...
     
    19211838            -onimage [Rappture::icon x-cutplane-red] \
    19221839            -offimage [Rappture::icon x-cutplane-red] \
    1923             -command [itcl::code $this AdjustSetting cutplaneXVisible] \
    1924             -variable [itcl::scope _settings(cutplaneXVisible)] \
     1840            -command [itcl::code $this AdjustSetting -cutplanexvisible] \
     1841            -variable [itcl::scope _settings(-cutplanexvisible)] \
    19251842    }
    19261843    Rappture::Tooltip::for $itk_component(xbutton) \
     
    19321849            -borderwidth 1 -highlightthickness 0 \
    19331850            -command [itcl::code $this EventuallySetCutplane x] \
    1934             -variable [itcl::scope _settings(cutplaneXPosition)] \
    1935             -foreground red2 -font "Arial 9 bold"
     1851            -variable [itcl::scope _settings(-cutplanexposition)] \
     1852            -foreground red2 -font "Arial 9 bold"
    19361853    } {
    19371854        usual
     
    19491866            -onimage [Rappture::icon y-cutplane-green] \
    19501867            -offimage [Rappture::icon y-cutplane-green] \
    1951             -command [itcl::code $this AdjustSetting cutplaneYVisible] \
    1952             -variable [itcl::scope _settings(cutplaneYVisible)] \
     1868            -command [itcl::code $this AdjustSetting -cutplaneyvisible] \
     1869            -variable [itcl::scope _settings(-cutplaneyvisible)] \
    19531870    }
    19541871    Rappture::Tooltip::for $itk_component(ybutton) \
     
    19611878            -borderwidth 1 -highlightthickness 0 \
    19621879            -command [itcl::code $this EventuallySetCutplane y] \
    1963             -variable [itcl::scope _settings(cutplaneYPosition)] \
    1964             -foreground green3 -font "Arial 9 bold"
     1880            -variable [itcl::scope _settings(-cutplaneyposition)] \
     1881            -foreground green3 -font "Arial 9 bold"
    19651882    } {
    19661883        usual
     
    19781895            -onimage [Rappture::icon z-cutplane-blue] \
    19791896            -offimage [Rappture::icon z-cutplane-blue] \
    1980             -command [itcl::code $this AdjustSetting cutplaneZVisible] \
    1981             -variable [itcl::scope _settings(cutplaneZVisible)] \
     1897            -command [itcl::code $this AdjustSetting -cutplanezvisible] \
     1898            -variable [itcl::scope _settings(-cutplanezvisible)] \
    19821899    } {
    1983         usual
    1984         ignore -foreground
     1900        usual
     1901        ignore -foreground
    19851902    }
    19861903    Rappture::Tooltip::for $itk_component(zbutton) \
     
    19931910            -borderwidth 1 -highlightthickness 0 \
    19941911            -command [itcl::code $this EventuallySetCutplane z] \
    1995             -variable [itcl::scope _settings(cutplaneZPosition)] \
    1996             -foreground blue3 -font "Arial 9 bold"
     1912            -variable [itcl::scope _settings(-cutplanezposition)] \
     1913            -foreground blue3 -font "Arial 9 bold"
    19971914    } {
    19981915        usual
     
    20051922
    20061923    blt::table $inner \
    2007         0,0 $inner.visible              -anchor w -pady 2 -cspan 3 \
    2008         1,0 $inner.lighting             -anchor w -pady 2 -cspan 3 \
    2009         2,0 $inner.wireframe            -anchor w -pady 2 -cspan 3 \
    2010         3,0 $inner.edges                -anchor w -pady 2 -cspan 3 \
    2011         4,0 $inner.preinterp            -anchor w -pady 2 -cspan 3 \
    2012         5,0 $inner.opacity_l            -anchor w -pady 2 -cspan 1 \
    2013         5,1 $inner.opacity              -fill x   -pady 2 -cspan 3 \
    2014         6,0 $inner.xbutton              -anchor w -padx 2 -pady 2 \
    2015         7,0 $inner.ybutton              -anchor w -padx 2 -pady 2 \
    2016         8,0 $inner.zbutton              -anchor w -padx 2 -pady 2 \
    2017         6,1 $inner.xval                 -fill y -rspan 4 \
    2018         6,2 $inner.yval                 -fill y -rspan 4 \
    2019         6,3 $inner.zval                 -fill y -rspan 4 \
    2020 
     1924        0,0 $inner.visible   -anchor w -pady 2 -cspan 3 \
     1925        1,0 $inner.lighting  -anchor w -pady 2 -cspan 3 \
     1926        2,0 $inner.wireframe -anchor w -pady 2 -cspan 3 \
     1927        3,0 $inner.edges     -anchor w -pady 2 -cspan 3 \
     1928        4,0 $inner.preinterp -anchor w -pady 2 -cspan 3 \
     1929        5,0 $inner.opacity_l -anchor w -pady 2 -cspan 1 \
     1930        5,1 $inner.opacity   -fill x   -pady 2 -cspan 3 \
     1931        6,0 $inner.xbutton   -anchor w -padx 2 -pady 2 \
     1932        7,0 $inner.ybutton   -anchor w -padx 2 -pady 2 \
     1933        8,0 $inner.zbutton   -anchor w -padx 2 -pady 2 \
     1934        6,1 $inner.xval      -fill y -rspan 4 \
     1935        6,2 $inner.yval      -fill y -rspan 4 \
     1936        6,3 $inner.zval      -fill y -rspan 4 \
    20211937
    20221938    blt::table configure $inner r* c* -resize none
    20231939    blt::table configure $inner r9 c4 -resize expand
    20241940}
    2025 
    2026 
    20271941
    20281942#
     
    21332047    set tag $dataobj-$comp
    21342048    array set style {
    2135         -color \#FFFFFF
    2136         -colormap BCGYR
    2137         -colorMode vmag
     2049        -color BCGYR
    21382050        -edgecolor black
    21392051        -edges 0
     
    21472059        -ptsize 1.0
    21482060        -quality 1
    2149         -scaleMode vmag
    2150         -shape arrow
     2061        -scaleMode "vmag"
     2062        -shape "arrow"
    21512063        -wireframe 0
    21522064    }
    2153     set $style(-color) $itk_option(-plotforeground)
    21542065    set numComponents [$dataobj numComponents $comp]
    21552066    if {$numComponents == 3} {
     
    21572068        set style(-orientGlyphs) 1
    21582069        set style(-scaleMode) "vmag"
    2159         set style(-colorMode) "vmag"
    21602070    } else {
    21612071        set style(-shape) "sphere"
    21622072        set style(-orientGlyphs) 0
    21632073        set style(-scaleMode) "scalar"
    2164         set style(-colorMode) "scalar"
    21652074    }
    21662075    array set style [$dataobj style $comp]
     
    21812090    # the code to handle aberrant cases.
    21822091
    2183     if { $_changed(glyphOpacity) } {
    2184         set style(-opacity) $_settings(glyphOpacity)
    2185     }
    2186     if { $_changed(colormap) } {
    2187         set style(-colormap) $_settings(colormap)
     2092    if { $_changed(-glyphopacity) } {
     2093        set style(-opacity) [expr $_settings(-glyphopacity) * 0.01]
     2094    }
     2095    if { $_changed(-colormap) } {
     2096        set style(-color) $_settings(-colormap)
    21882097    }
    21892098    if { $_currentColormap == "" } {
    2190         $itk_component(colormap) value $style(-colormap)
    2191     }
    2192     set _currentOpacity $style(-opacity)
     2099        $itk_component(colormap) value $style(-color)
     2100    }
     2101
     2102    SendCmd "outline add $tag"
     2103    SendCmd "outline color [Color2RGB $itk_option(-plotforeground)] $tag"
     2104    SendCmd "outline visible $style(-outline) $tag"
     2105    set _settings(-glyphoutline) $style(-outline)
     2106
    21932107    SendCmd "glyphs add $style(-shape) $tag"
    2194     set _settings(glyphShape) $style(-shape)
    2195     $itk_component(gshape) value $style(-shape)
    21962108    SendCmd "glyphs edges $style(-edges) $tag"
     2109    set _settings(-glyphedges) $style(-edges)
     2110
    21972111    # normscale=1 and gscale=1 are defaults
    21982112    if {$style(-normscale) != 1} {
     
    22022116        SendCmd "glyphs gscale $style(-gscale) $tag"
    22032117    }
    2204     set _settings(glyphNormscale) $style(-normscale)
    2205     set _settings(glyphScale) $style(-gscale)
    2206     SendCmd "outline add $tag"
    2207     SendCmd "outline color [Color2RGB $style(-color)] $tag"
    2208     SendCmd "outline visible $style(-outline) $tag"
    2209     set _settings(glyphOutline) $style(-outline)
    2210     set _settings(glyphEdges) $style(-edges)
    2211     if {$style(-colorMode) == "constant" || $style(-colormap) == "none"} {
    2212         SendCmd "glyphs colormode constant {} $tag"
    2213         set _settings(colormapVisible) 0
    2214         set _settings(colormap) "none"
    2215     } else {
    2216         SendCmd "glyphs colormode $style(-colorMode) $_curFldName $tag"
    2217         set _settings(colormapVisible) 1
    2218         set _settings(colormap) $style(-colormap)
    2219         SetCurrentColormap $style(-colormap)
    2220     }
    2221     $itk_component(colormap) value $_settings(colormap)
    2222     set _colorMode $style(-colorMode)
     2118
    22232119    # constant color only used if colormode set to constant
    2224     SendCmd "glyphs color [Color2RGB $style(-color)] $tag"
     2120    SendCmd "glyphs color [Color2RGB $itk_option(-plotforeground)] $tag"
    22252121    # Omitting field name for gorient and smode commands
    22262122    # defaults to active scalars or vectors depending on mode
    22272123    SendCmd "glyphs gorient $style(-orientGlyphs) {} $tag"
    22282124    SendCmd "glyphs smode $style(-scaleMode) {} $tag"
    2229     set _settings(glyphScaleMode) $style(-scaleMode)
    2230     $itk_component(scaleMode) value "[$itk_component(scaleMode) label $style(-scaleMode)]"
    22312125    SendCmd "glyphs quality $style(-quality) $tag"
    22322126    SendCmd "glyphs lighting $style(-lighting) $tag"
    2233     set _settings(glyphLighting) $style(-lighting)
     2127    set _settings(-glyphlighting) $style(-lighting)
    22342128    SendCmd "glyphs linecolor [Color2RGB $style(-edgecolor)] $tag"
    22352129    SendCmd "glyphs linewidth $style(-linewidth) $tag"
    22362130    SendCmd "glyphs ptsize $style(-ptsize) $tag"
    2237     SendCmd "glyphs opacity $_currentOpacity $tag"
    2238     set _settings(glyphOpacity) $style(-opacity)
     2131    SendCmd "glyphs opacity $style(-opacity) $tag"
     2132    set _settings(-glyphopacity) [expr $style(-opacity) * 100.0]
     2133    SetCurrentColormap $style(-color)
    22392134    SendCmd "glyphs wireframe $style(-wireframe) $tag"
    2240     set _settings(glyphWireframe) $style(-wireframe)
    2241     set _settings(glyphOpacity) [expr $style(-opacity) * 100.0]
     2135    set _settings(-glyphwireframe) $style(-wireframe)
    22422136}
    22432137
     
    22932187
    22942188    if { [string match "component*" $fname] } {
    2295         set title ""
     2189        set title ""
    22962190    } else {
    2297         if { [info exists _fields($fname)] } {
    2298             foreach { title units } $_fields($fname) break
    2299             if { $units != "" } {
    2300                 set title [format "%s (%s)" $title $units]
    2301             }
    2302         } else {
    2303             set title $fname
    2304         }
     2191        if { [info exists _fields($fname)] } {
     2192            foreach { title units } $_fields($fname) break
     2193            if { $units != "" } {
     2194                set title [format "%s (%s)" $title $units]
     2195            }
     2196        } else {
     2197            set title $fname
     2198        }
    23052199    }
    23062200    # If there's a legend title, increase the offset by the line height.
     
    23342228}
    23352229
    2336 
    23372230# ----------------------------------------------------------------------
    23382231# USAGE: Slice move x|y|z <newval>
     
    23682261# ReceiveLegend --
    23692262#
    2370 #       Invoked automatically whenever the "legend" command comes in from
    2371 #       the rendering server.  Indicates that binary image data with the
    2372 #       specified <size> will follow.
     2263#    Invoked automatically whenever the "legend" command comes in from
     2264#    the rendering server.  Indicates that binary image data with the
     2265#    specified <size> will follow.
    23732266#
    23742267itcl::body Rappture::VtkGlyphViewer::ReceiveLegend { colormap title min max size } {
     
    23842277        #puts stderr "read $size bytes for [image width $_image(legend)]x[image height $_image(legend)] legend>"
    23852278        if { [catch {DrawLegend} errs] != 0 } {
    2386             global errorInfo
    2387             puts stderr "errs=$errs errorInfo=$errorInfo"
     2279            global errorInfo
     2280            puts stderr "errs=$errs errorInfo=$errorInfo"
    23882281        }
    23892282    }
     
    23932286# DrawLegend --
    23942287#
    2395 #       Draws the legend in the own canvas on the right side of the plot area.
     2288#    Draws the legend in the own canvas on the right side of the plot area.
    23962289#
    23972290itcl::body Rappture::VtkGlyphViewer::DrawLegend {} {
     
    24042297   
    24052298    if { [string match "component*" $fname] } {
    2406         set title ""
     2299        set title ""
    24072300    } else {
    2408         if { [info exists _fields($fname)] } {
    2409             foreach { title units } $_fields($fname) break
    2410             if { $units != "" } {
    2411                 set title [format "%s (%s)" $title $units]
    2412             }
    2413         } else {
    2414             set title $fname
    2415         }
     2301        if { [info exists _fields($fname)] } {
     2302            foreach { title units } $_fields($fname) break
     2303            if { $units != "" } {
     2304                set title [format "%s (%s)" $title $units]
     2305            }
     2306        } else {
     2307            set title $fname
     2308        }
    24162309    }
    24172310    set x [expr $w - 2]
    2418     if { !$_settings(legendVisible) } {
    2419         $c delete legend
    2420         return
     2311    if { !$_settings(-legendvisible) } {
     2312        $c delete legend
     2313        return
    24212314    }
    24222315    if { [$c find withtag "legend"] == "" } {
    2423         set y 2
    2424         # If there's a legend title, create a text item for the title.
     2316        set y 2
     2317        # If there's a legend title, create a text item for the title.
    24252318        $c create text $x $y \
    2426             -anchor ne \
    2427             -fill $itk_option(-plotforeground) -tags "title legend" \
    2428             -font $font
     2319            -anchor ne \
     2320            -fill $itk_option(-plotforeground) -tags "title legend" \
     2321            -font $font
    24292322        if { $title != "" } {
    24302323            incr y $lineht
    24312324        }
    2432         $c create text $x $y \
    2433             -anchor ne \
    2434             -fill $itk_option(-plotforeground) -tags "vmax legend" \
    2435             -font $font
    2436         incr y $lineht
    2437         $c create image $x $y \
    2438             -anchor ne \
    2439             -image $_image(legend) -tags "colormap legend"
    2440         $c create rectangle $x $y 1 1 \
    2441             -fill "" -outline "" -tags "sensor legend"
    2442         $c create text $x [expr {$h-2}] \
    2443             -anchor se \
    2444             -fill $itk_option(-plotforeground) -tags "vmin legend" \
    2445             -font $font
    2446         $c bind sensor <Enter> [itcl::code $this EnterLegend %x %y]
    2447         $c bind sensor <Leave> [itcl::code $this LeaveLegend]
    2448         $c bind sensor <Motion> [itcl::code $this MotionLegend %x %y]
     2325        $c create text $x $y \
     2326            -anchor ne \
     2327            -fill $itk_option(-plotforeground) -tags "vmax legend" \
     2328            -font $font
     2329        incr y $lineht
     2330        $c create image $x $y \
     2331            -anchor ne \
     2332            -image $_image(legend) -tags "colormap legend"
     2333        $c create rectangle $x $y 1 1 \
     2334            -fill "" -outline "" -tags "sensor legend"
     2335        $c create text $x [expr {$h-2}] \
     2336            -anchor se \
     2337            -fill $itk_option(-plotforeground) -tags "vmin legend" \
     2338            -font $font
     2339        $c bind sensor <Enter> [itcl::code $this EnterLegend %x %y]
     2340        $c bind sensor <Leave> [itcl::code $this LeaveLegend]
     2341        $c bind sensor <Motion> [itcl::code $this MotionLegend %x %y]
    24492342    }
    24502343    set x2 $x
     
    24602353    if { [info exists _limits($_curFldName)] } {
    24612354        foreach { vmin vmax } $_limits($_curFldName) break
    2462         $c itemconfigure vmin -text [format %g $vmin]
    2463         $c itemconfigure vmax -text [format %g $vmax]
     2355        $c itemconfigure vmin -text [format %g $vmin]
     2356        $c itemconfigure vmax -text [format %g $vmax]
    24642357    }
    24652358    set y 2
     
    24672360    if { $title != "" } {
    24682361        $c itemconfigure title -text $title
    2469         $c coords title $x $y
    2470         incr y $lineht
     2362        $c coords title $x $y
     2363        incr y $lineht
    24712364        $c raise title
    24722365    }
     
    25102403        invoke {
    25112404            $itk_component(field) value $_curFldLabel
    2512             AdjustSetting field
     2405            AdjustSetting -field
    25132406        }
    25142407        default {
     
    25342427# BuildColormap --
    25352428#
    2536 #       Build the designated colormap on the server.
     2429#    Build the designated colormap on the server.
    25372430#
    25382431itcl::body Rappture::VtkGlyphViewer::BuildColormap { name } {
     
    25652458    set _view(zoom) 1.0
    25662459}
    2567 
Note: See TracChangeset for help on using the changeset viewer.