Index: trunk/gui/scripts/vtkvolumeviewer.tcl
===================================================================
--- trunk/gui/scripts/vtkvolumeviewer.tcl	(revision 4188)
+++ trunk/gui/scripts/vtkvolumeviewer.tcl	(revision 4192)
@@ -81,4 +81,10 @@
     private method SwitchComponent { cname } 
     private method RemoveMarker { x y }
+    private method ViewToQuaternion {} { 
+        return [list $_view(-qw) $_view(-qx) $_view(-qy) $_view(-qz)]
+    }
+    private method QuaternionToView { q } { 
+        foreach { _view(-qw) _view(-qx) _view(-qy) _view(-qz) } $q break
+    }
 
     private variable _current "";       # Currently selected component 
@@ -207,15 +213,15 @@
     $_dispatcher register !xcutplane
     $_dispatcher dispatch $this !xcutplane \
-        "[itcl::code $this AdjustSetting cutplanePositionX]; list"
+        "[itcl::code $this AdjustSetting -xcutplaneposition]; list"
 
     # Y-Cutplane event
     $_dispatcher register !ycutplane
     $_dispatcher dispatch $this !ycutplane \
-        "[itcl::code $this AdjustSetting cutplanePositionY]; list"
+        "[itcl::code $this AdjustSetting -ycutplaneposition]; list"
 
     # Z-Cutplane event
     $_dispatcher register !zcutplane
     $_dispatcher dispatch $this !zcutplane \
-        "[itcl::code $this AdjustSetting cutplanePositionZ]; list"
+        "[itcl::code $this AdjustSetting -xcutplaneposition]; list"
 
     #
@@ -228,47 +234,48 @@
     # Initialize the view to some default parameters.
     array set _view {
-        qw              0.853553
-        qx              -0.353553
-        qy              0.353553
-        qz              0.146447
-        zoom            1.0 
-        xpan            0
-        ypan            0
-        ortho           0
+        -qw              0.853553
+        -qx              -0.353553
+        -qy              0.353553
+        -qz              0.146447
+        -zoom            1.0 
+        -xpan            0
+        -ypan            0
+        -ortho           0
     }
     set _arcball [blt::arcball create 100 100]
-    set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
-    $_arcball quaternion $q
+    $_arcball quaternion [ViewToQuaternion]
 
     array set _settings {
-        axesVisible             1
-        axisGridX               0
-        axisGridY               0
-        axisGridZ               0
-        axisLabels              1
-	background		black
-        cutplaneEdges           0
-        cutplaneLighting        1
-        cutplaneOpacity         100
-        cutplanePositionX       50
-        cutplanePositionY       50
-        cutplanePositionZ       50
-        cutplaneVisible         0
-        cutplaneVisibleX        1
-        cutplaneVisibleY        1
-        cutplaneVisibleZ        1
-        cutplaneWireframe       0
-        legendVisible           1
-        outline                 0
-        volumeAmbient           40
-        volumeBlendMode         composite
-        volumeDiffuse           60
-        volumeLighting          1
-        volumeOpacity           50
-        volumeQuality           80
-        volumeSpecularExponent  90
-        volumeSpecularLevel     30
-        volumeThickness         350
-        volumeVisible           1
+	-background                     black
+        -axesvisible                    1
+        -axislabelsvisible              1
+        -cutplaneedgesvisible           0
+        -cutplanelighting               1
+        -cutplaneopacity                100
+        -cutplanesvisible               0
+        -cutplanewireframe              0
+        -legendvisible                  1
+        -volumeambient                  40
+        -volumeblendmode                composite
+        -volumediffuse                  60
+        -volumeedgesvisible             0
+        -volumelighting                 1
+        -volumeopacity                  50
+        -volumeoutline                  0
+        -volumeoutline                  0
+        -volumequality                  80
+        -volumespecularexponent         90
+        -volumespecularlevel            30
+        -volumethickness                350
+        -volumevisible                  1
+        -xcutplaneposition              50
+        -xcutplanevisible               1
+        -xgridvisible                   0
+        -xgridvisible                   0
+        -ycutplaneposition              50
+        -ycutplanevisible               1
+        -ygridvisible                   0
+        -zcutplaneposition              50
+        -zcutplanevisible               1
     }
 
@@ -349,6 +356,6 @@
             -onimage [Rappture::icon volume-on] \
             -offimage [Rappture::icon volume-off] \
-            -variable [itcl::scope _settings(volumeVisible)] \
-            -command [itcl::code $this AdjustSetting volumeVisible] 
+            -variable [itcl::scope _settings(-volumevisible)] \
+            -command [itcl::code $this AdjustSetting -volumevisible] 
     }
     $itk_component(volume) select
@@ -361,6 +368,6 @@
             -onimage [Rappture::icon cutbutton] \
             -offimage [Rappture::icon cutbutton] \
-            -variable [itcl::scope _settings(cutplaneVisible)] \
-            -command [itcl::code $this AdjustSetting cutplaneVisible] 
+            -variable [itcl::scope _settings(-cutplanesvisible)] \
+            -command [itcl::code $this AdjustSetting -cutplanesvisible] 
     }
     Rappture::Tooltip::for $itk_component(cutplane) \
@@ -491,6 +498,5 @@
 
 itcl::body Rappture::VtkVolumeViewer::DoRotate {} {
-    set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
-    SendCmd "camera orient $q" 
+    SendCmd "camera orient [ViewToQuaternion]" 
     set _rotatePending 0
 }
@@ -516,5 +522,5 @@
 
 itcl::body Rappture::VtkVolumeViewer::EventuallyRotate { q } {
-    foreach { _view(qw) _view(qx) _view(qy) _view(qz) } $q break
+    QuaternionToView $q 
     if { !$_rotatePending } {
         set _rotatePending 1
@@ -684,10 +690,4 @@
 # ----------------------------------------------------------------------
 itcl::body Rappture::VtkVolumeViewer::scale {args} {
-    array set style {
-        -color BCGYR
-        -levels 6
-        -opacity 1.0
-        -markers ""
-    }
     array unset _limits 
     array unset _volcomponents 
@@ -1016,7 +1016,6 @@
         # Reset the camera and other view parameters
         #
-        set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
-        $_arcball quaternion $q
-        if {$_view(ortho)} {
+        $_arcball quaternion [ViewToQuaternion]
+        if {$_view(-ortho)} {
             SendCmd "camera mode ortho"
         } else {
@@ -1024,7 +1023,7 @@
         }
         DoRotate
-        InitSettings outline background \
-            axisGridX axisGridY axisGridZ axisFlyMode \
-            axesVisible axisLabels
+        InitSettings -volumeoutline -background \
+            -xgridvisible -ygridvisible -zgridvisible -axisflymode \
+            -axesvisible -axislabelsvisible
         PanCamera
     }
@@ -1122,16 +1121,16 @@
     }
 
-    InitSettings volumeColormap \
-        volumeAmbient volumeDiffuse volumeSpecularLevel volumeSpecularExponent \
-        volumeBlendMode volumeThickness \
-        volumeOpacity volumeQuality volumeVisible \
-        cutplaneVisible \
-        cutplanePositionX cutplanePositionY cutplanePositionZ \
-        cutplaneVisibleX cutplaneVisibleY cutplaneVisibleZ
+    InitSettings -color \
+        -volumeambient -volumediffuse -volumespecularlevel \
+        -volumespecularexponent -volumeblendmode -volumethickness \
+        -volumeopacity -volumequality -volumevisible \
+        -cutplanesvisible \
+        -xcutplaneposition -ycutplaneposition -zcutplaneposition \
+        -xcutplanevisible -ycutplanevisible -zcutplanevisible
 
     if { $_reset } {
-        InitSettings volumeLighting
+        InitSettings -volumelighting
         SendCmd "camera reset"
-        SendCmd "camera zoom $_view(zoom)"
+        SendCmd "camera zoom $_view(-zoom)"
         RequestLegend
         set _reset 0
@@ -1200,20 +1199,20 @@
     switch -- $option {
         "in" {
-            set _view(zoom) [expr {$_view(zoom)*1.25}]
-            SendCmd "camera zoom $_view(zoom)"
+            set _view(-zoom) [expr {$_view(-zoom)*1.25}]
+            SendCmd "camera zoom $_view(-zoom)"
         }
         "out" {
-            set _view(zoom) [expr {$_view(zoom)*0.8}]
-            SendCmd "camera zoom $_view(zoom)"
+            set _view(-zoom) [expr {$_view(-zoom)*0.8}]
+            SendCmd "camera zoom $_view(-zoom)"
         }
         "reset" {
             array set _view {
-                qw      0.853553
-                qx      -0.353553
-                qy      0.353553
-                qz      0.146447
-                zoom    1.0
-                xpan   0
-                ypan   0
+                -qw      0.853553
+                -qx      -0.353553
+                -qy      0.353553
+                -qz      0.146447
+                -zoom    1.0
+                -xpan   0
+                -ypan   0
             }
             if { $_first != "" } {
@@ -1223,6 +1222,5 @@
                 }
             }
-            set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
-            $_arcball quaternion $q
+            $_arcball quaternion [ViewToQuaternion]
             DoRotate
             SendCmd "camera reset"
@@ -1232,6 +1230,6 @@
 
 itcl::body Rappture::VtkVolumeViewer::PanCamera {} {
-    set x $_view(xpan)
-    set y $_view(ypan)
+    set x $_view(-xpan)
+    set y $_view(-ypan)
     SendCmd "camera pan $x $y"
 }
@@ -1311,6 +1309,6 @@
             set x [expr $x / double($w)]
             set y [expr $y / double($h)]
-            set _view(xpan) [expr $_view(xpan) + $x]
-            set _view(ypan) [expr $_view(ypan) + $y]
+            set _view(-xpan) [expr $_view(-xpan) + $x]
+            set _view(-ypan) [expr $_view(-ypan) + $y]
             PanCamera
             return
@@ -1334,6 +1332,6 @@
             set _click(x) $x
             set _click(y) $y
-            set _view(xpan) [expr $_view(xpan) - $dx]
-            set _view(ypan) [expr $_view(ypan) - $dy]
+            set _view(-xpan) [expr $_view(-xpan) - $dx]
+            set _view(-ypan) [expr $_view(-ypan) - $dy]
             PanCamera
         }
@@ -1357,7 +1355,7 @@
 itcl::body Rappture::VtkVolumeViewer::InitSettings { args } {
     foreach spec $args {
-        if { [info exists _settings($_first-$spec)] } {
+        if { [info exists _settings($_first${spec})] } {
             # Reset global setting with dataobj specific setting
-            set _settings($spec) $_settings($_first-$spec)
+            set _settings($spec) $_settings($_first${spec})
         }
         AdjustSetting $spec
@@ -1381,6 +1379,7 @@
     }
     switch -- $what {
-        "background" {
+        "-background" {
             set bgcolor [$itk_component(background) value]
+            set _settings(${what}) $bgcolor
 	    array set fgcolors {
 		"black" "white"
@@ -1393,6 +1392,6 @@
 	    DrawLegend
         }
-        "outline" {
-            set bool $_settings(outline)
+        "-volumeoutline" {
+            set bool $_settings(${what})
             SendCmd "outline visible 0"
             foreach tag [GetDatasetsWithComponent $_current] {
@@ -1400,11 +1399,17 @@
             }
         }
-        "legendVisible" {
-            set bool $_settings(legendVisible)
-            set _settings($_current-legendVisible) $bool
-        }
-        "volumeVisible" {
-            set bool $_settings(volumeVisible)
-            set _settings($_current-volumeVisible) $bool
+        "-legendvisible" {
+            set bool $_settings(${what})
+            set _settings($_current${what}) $bool
+            if { $bool } {
+                blt::table $itk_component(plotarea) \
+                    1,0 $itk_component(legend) -fill x 
+            } else {
+                blt::table forget $itk_component(legend) 
+            }
+        }
+        "-volumevisible" {
+            set bool $_settings(${what})
+            set _settings($_current${what}) $bool
             # Only the data objects in the array _obj2ovride(*-raise) are
             # in the working set and can be displayed on screen. The global
@@ -1429,16 +1434,16 @@
             }
         }
-        "volumeBlendMode" {
+        "-volumeblendmode" {
             set val [$itk_component(blendmode) value]
             set mode [$itk_component(blendmode) translate $val]
-            set _settings(volumeBlendMode) $mode
-            set _settings($_current-volumeBlendMode) $mode
+            set _settings(${what}) $mode
+            set _settings($_current${what}) $mode
             foreach tag [GetDatasetsWithComponent $_current] {
                 SendCmd "volume blendmode $mode $tag"
             }
         }
-        "volumeAmbient" {
-            set val $_settings(volumeAmbient)
-            set _settings($_current-volumeAmbient) $val
+        "-volumeambient" {
+            set val $_settings(${what})
+            set _settings($_current${what}) $val
             set ambient [expr {0.01*$val}]
             foreach tag [GetDatasetsWithComponent $_current] {
@@ -1446,7 +1451,7 @@
             }
         }
-        "volumeDiffuse" {
-            set val $_settings(volumeDiffuse)
-            set _settings($_current-volumeDiffuse) $val
+        "-volumediffuse" {
+            set val $_settings(${what})
+            set _settings($_current${what}) $val
             set diffuse [expr {0.01*$val}]
             foreach tag [GetDatasetsWithComponent $_current] {
@@ -1454,23 +1459,23 @@
             }
         }
-        "volumeSpecularLevel" - "volumeSpecularExponent" {
-            set val $_settings(volumeSpecularLevel)
-            set _settings($_current-volumeSpecularLevel) $val
+        "-volumespecularlevel" - "-volumespecularexponent" {
+            set val $_settings(${what})
+            set _settings($_current${what}) $val
             set level [expr {0.01*$val}]
-            set exp $_settings(volumeSpecularExponent)
+            set exp $_settings(${what})
             foreach tag [GetDatasetsWithComponent $_current] {
                 SendCmd "volume shading specular $level $exp $tag"
             }
         }
-        "volumeLighting" {
-            set bool $_settings(volumeLighting)
-            set _settings($_current-volumeLighting) $bool
+        "-volumelighting" {
+            set bool $_settings($what)
+            set _settings($_current{$what}) $bool
             foreach tag [GetDatasetsWithComponent $_current] {
                 SendCmd "volume lighting $bool $tag"
             }
         }
-        "volumeOpacity" {
-            set val $_settings(volumeOpacity)
-            set _settings($_current-volumeOpacity) $val
+        "-volumeopacity" {
+            set val $_settings(${what})
+            set _settings($_current${what}) $val
             set val [expr {0.01*$val}]
             foreach tag [GetDatasetsWithComponent $_current] {
@@ -1478,7 +1483,7 @@
             }
         }
-        "volumeQuality" {
-            set val $_settings(volumeQuality)
-            set _settings($_current-volumeQuality) $val
+        "-volumequality" {
+            set val $_settings(${what})
+            set _settings($_current${what}) $val
             set val [expr {0.01*$val}]
             foreach tag [GetDatasetsWithComponent $_current] {
@@ -1486,25 +1491,25 @@
             }
         }
-        "axesVisible" {
-            set bool $_settings(axesVisible)
+        "-axesvisible" {
+            set bool $_settings(${what})
             SendCmd "axis visible all $bool"
         }
-        "axisLabels" {
-            set bool $_settings(axisLabels)
+        "-axislabelsvisible" {
+            set bool $_settings(${what})
             SendCmd "axis labels all $bool"
         }
-        "axisGridX" - "axisGridY" - "axisGridZ" {
-            set axis [string tolower [string range $what end end]]
-            set bool $_settings($what)
+        "-xgridvisible" - "-ygridvisible" - "-zgridvisible" {
+            set axis [string tolower [string range $what 1 1 ]]
+            set bool $_settings(${what})
             SendCmd "axis grid $axis $bool"
         }
-        "axisFlyMode" {
+        "-axisflymode" {
             set mode [$itk_component(axismode) value]
             set mode [$itk_component(axismode) translate $mode]
-            set _settings($what) $mode
+            set _settings(${what}) $mode
             SendCmd "axis flymode $mode"
         }
-        "cutplaneEdges" {
-            set bool $_settings($what)
+        "-cutplaneedgesvisible" {
+            set bool $_settings(${what})
             foreach dataset [CurrentDatasets -visible] {
                 if {$_cutplaneCmd != "imgcutplane"} {
@@ -1513,6 +1518,6 @@
             }
         }
-        "cutplaneWireframe" {
-            set bool $_settings($what)
+        "-cutplanewireframe" {
+            set bool $_settings(${what})
             foreach dataset [CurrentDatasets -visible] {
                 if {$_cutplaneCmd != "imgcutplane"} {
@@ -1521,12 +1526,12 @@
             }
         }
-        "cutplaneVisible" {
-            set bool $_settings($what)
+        "-cutplanesvisible" {
+            set bool $_settings(${what})
             foreach dataset [CurrentDatasets -visible] {
                 SendCmd "$_cutplaneCmd visible $bool $dataset"
             }
         }
-        "cutplaneLighting" {
-            set bool $_settings($what)
+        "-cutplanelighting" {
+            set bool $_settings(${what})
             foreach dataset [CurrentDatasets -visible] {
                 if {$_cutplaneCmd != "imgcutplane"} {
@@ -1544,6 +1549,6 @@
             }
         }
-        "cutplaneOpacity" {
-            set val $_settings($what)
+        "-cutplaneopacity" {
+            set val $_settings(${what})
             set sval [expr { 0.01 * double($val) }]
             foreach dataset [CurrentDatasets -visible] {
@@ -1551,7 +1556,7 @@
             }
         }
-        "cutplaneVisibleX" - "cutplaneVisibleY" - "cutplaneVisibleZ" {
-            set axis [string tolower [string range $what end end]]
-            set bool $_settings($what)
+        "-xcutplanevisible" - "-ycutplanevisible" - "-zcutplanevisible" {
+            set axis [string tolower [string range $what 1 1]]
+            set bool $_settings(${what})
             if { $bool } {
                 $itk_component(${axis}CutScale) configure -state normal \
@@ -1565,7 +1570,7 @@
             }
         }
-        "cutplanePositionX" - "cutplanePositionY" - "cutplanePositionZ" {
-            set axis [string tolower [string range $what end end]]
-            set pos [expr $_settings($what) * 0.01]
+        "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" {
+            set axis [string tolower [string range $what 1 1]]
+            set pos [expr $_settings(${what}) * 0.01]
             foreach dataset [CurrentDatasets -visible] {
                 SendCmd "$_cutplaneCmd slice ${axis} ${pos} $dataset"
@@ -1573,18 +1578,18 @@
             set _cutplanePending 0
         }
-        "volumeThickness" {
-            set _settings($_current-volumeThickness) $_settings(volumeThickness)
+        "-volumethickness" {
+            set _settings($_current${what}) $_settings(${what})
             updateTransferFunctions
         }
-        "volumeColormap" {
+        "-color" {
             set color [$itk_component(colormap) value]
-            set _settings(colormap) $color
-            set _settings($_current-colormap) $color
+            set _settings(${what}) $color
+            set _settings($_current${what}) $color
             ResetColormap $_current $color
         }
-        "field" {
+        "-field" {
             set label [$itk_component(field) value]
             set fname [$itk_component(field) translate $label]
-            set _settings(field) $fname
+            set _settings(${what}) $fname
             if { [info exists _fields($fname)] } {
                 foreach { label units components } $_fields($fname) break
@@ -1666,15 +1671,4 @@
 
 itcl::body Rappture::VtkVolumeViewer::BuildViewTab {} {
-    foreach { key value } {
-        grid            0
-        axes            1
-        outline         0
-        volume          1
-        legend          1
-        particles       1
-        lic             1
-    } {
-        set _settings($this-$key) $value
-    }
 
     set fg [option get $itk_component(hull) font Font]
@@ -1688,24 +1682,24 @@
     checkbutton $inner.axes \
         -text "Axes" \
-        -variable [itcl::scope _settings(axesVisible)] \
-        -command [itcl::code $this AdjustSetting axesVisible] \
+        -variable [itcl::scope _settings(-axesvisible)] \
+        -command [itcl::code $this AdjustSetting -axesvisible] \
         -font "Arial 9"
 
     checkbutton $inner.outline \
         -text "Outline" \
-        -variable [itcl::scope _settings(outline)] \
-        -command [itcl::code $this AdjustSetting outline] \
+        -variable [itcl::scope _settings(-volumeoutline)] \
+        -command [itcl::code $this AdjustSetting -volumeoutline] \
         -font "Arial 9"
 
     checkbutton $inner.legend \
         -text "Legend" \
-        -variable [itcl::scope _settings(legendVisible)] \
-        -command [itcl::code $this AdjustSetting legendVisible] \
+        -variable [itcl::scope _settings(-legendvisible)] \
+        -command [itcl::code $this AdjustSetting -legendvisible] \
         -font "Arial 9"
 
     checkbutton $inner.volume \
         -text "Volume" \
-        -variable [itcl::scope _settings(volumeVisible)] \
-        -command [itcl::code $this AdjustSetting volumeVisible] \
+        -variable [itcl::scope _settings(-volumevisible)] \
+        -command [itcl::code $this AdjustSetting -volumevisible] \
         -font "Arial 9"
 
@@ -1719,6 +1713,7 @@
         "grey"               "grey"             
 
-    $itk_component(background) value $_settings(background)
-    bind $inner.background <<Value>> [itcl::code $this AdjustSetting background]
+    $itk_component(background) value $_settings(-background)
+    bind $inner.background <<Value>> \
+        [itcl::code $this AdjustSetting -background]
 
     blt::table $inner \
@@ -1749,11 +1744,11 @@
     $itk_component(volcomponents) value "BCGYR"
     bind $inner.volcomponents <<Value>> \
-        [itcl::code $this AdjustSetting current]
+        [itcl::code $this AdjustSetting -current]
 
     checkbutton $inner.visibility \
         -text "Visible" \
         -font $font \
-        -variable [itcl::scope _settings(volumeVisible)] \
-        -command [itcl::code $this AdjustSetting volumeVisible]
+        -variable [itcl::scope _settings(-volumevisible)] \
+        -command [itcl::code $this AdjustSetting -volumevisible]
 
     label $inner.lighting_l \
@@ -1764,6 +1759,6 @@
         -text "Enable Lighting" \
         -font $font \
-        -variable [itcl::scope _settings(volumeLighting)] \
-        -command [itcl::code $this AdjustSetting volumeLighting]
+        -variable [itcl::scope _settings(-volumelighting)] \
+        -command [itcl::code $this AdjustSetting -volumelighting]
 
     label $inner.ambient_l \
@@ -1771,36 +1766,42 @@
         -font $font
     ::scale $inner.ambient -from 0 -to 100 -orient horizontal \
-        -variable [itcl::scope _settings(volumeAmbient)] \
-        -showvalue off -command [itcl::code $this AdjustSetting volumeAmbient] \
+        -variable [itcl::scope _settings(-volumeambient)] \
+        -showvalue off \
+        -command [itcl::code $this AdjustSetting -volumeambient] \
         -troughcolor grey92
 
     label $inner.diffuse_l -text "Diffuse" -font $font
     ::scale $inner.diffuse -from 0 -to 100 -orient horizontal \
-        -variable [itcl::scope _settings(volumeDiffuse)] \
-        -showvalue off -command [itcl::code $this AdjustSetting volumeDiffuse] \
+        -variable [itcl::scope _settings(-volumediffuse)] \
+        -showvalue off \
+        -command [itcl::code $this AdjustSetting -volumediffuse] \
         -troughcolor grey92
 
     label $inner.specularLevel_l -text "Specular" -font $font
     ::scale $inner.specularLevel -from 0 -to 100 -orient horizontal \
-        -variable [itcl::scope _settings(volumeSpecularLevel)] \
-        -showvalue off -command [itcl::code $this AdjustSetting volumeSpecularLevel] \
+        -variable [itcl::scope _settings(-volumespecularlevel)] \
+        -showvalue off \
+        -command [itcl::code $this AdjustSetting -volumespecularlevel] \
         -troughcolor grey92
 
     label $inner.specularExponent_l -text "Shininess" -font $font
     ::scale $inner.specularExponent -from 10 -to 128 -orient horizontal \
-        -variable [itcl::scope _settings(volumeSpecularExponent)] \
-        -showvalue off -command [itcl::code $this AdjustSetting volumeSpecularExponent] \
+        -variable [itcl::scope _settings(-volumespecularexponent)] \
+        -showvalue off \
+        -command [itcl::code $this AdjustSetting -volumespecularexponent] \
         -troughcolor grey92
 
     label $inner.opacity_l -text "Opacity" -font $font
     ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
-        -variable [itcl::scope _settings(volumeOpacity)] \
-        -showvalue off -command [itcl::code $this AdjustSetting volumeOpacity] \
+        -variable [itcl::scope _settings(-volumeopacity)] \
+        -showvalue off \
+        -command [itcl::code $this AdjustSetting -volumeopacity] \
         -troughcolor grey92
 
     label $inner.quality_l -text "Quality" -font $font
     ::scale $inner.quality -from 0 -to 100 -orient horizontal \
-        -variable [itcl::scope _settings(volumeQuality)] \
-        -showvalue off -command [itcl::code $this AdjustSetting volumeQuality] \
+        -variable [itcl::scope _settings(-volumequality)] \
+        -showvalue off \
+        -command [itcl::code $this AdjustSetting -volumequality] \
         -troughcolor grey92
 
@@ -1810,5 +1811,5 @@
     }
     bind $inner.field <<Value>> \
-        [itcl::code $this AdjustSetting field]
+        [itcl::code $this AdjustSetting -field]
 
     label $inner.transferfunction_l \
@@ -1817,10 +1818,11 @@
     label $inner.thin -text "Thin" -font $font
     ::scale $inner.thickness -from 0 -to 1000 -orient horizontal \
-        -variable [itcl::scope _settings(volumeThickness)] \
-        -showvalue off -command [itcl::code $this AdjustSetting volumeThickness] \
+        -variable [itcl::scope _settings(-volumethickness)] \
+        -showvalue off \
+        -command [itcl::code $this AdjustSetting -volumethickness] \
         -troughcolor grey92
 
     label $inner.thick -text "Thick" -font $font
-    $inner.thickness set $_settings(volumeThickness)
+    $inner.thickness set $_settings(-volumethickness)
 
     label $inner.colormap_l -text "Colormap" -font $font
@@ -1848,5 +1850,5 @@
     $itk_component(colormap) value "BCGYR"
     bind $inner.colormap <<Value>> \
-        [itcl::code $this AdjustSetting volumeColormap]
+        [itcl::code $this AdjustSetting -color]
 
     label $inner.blendmode_l -text "Blend Mode" -font $font
@@ -1859,7 +1861,8 @@
         "additive"           "Additive"
 
-    $itk_component(blendmode) value "[$itk_component(blendmode) label $_settings(volumeBlendMode)]"
+    $itk_component(blendmode) value \
+        "[$itk_component(blendmode) label $_settings(-volumeblendmode)]"
     bind $inner.blendmode <<Value>> \
-        [itcl::code $this AdjustSetting volumeBlendMode]
+        [itcl::code $this AdjustSetting -volumeblendmode]
 
     blt::table $inner \
@@ -1910,28 +1913,28 @@
     checkbutton $inner.visible \
         -text "Show Axes" \
-        -variable [itcl::scope _settings(axesVisible)] \
-        -command [itcl::code $this AdjustSetting axesVisible] \
+        -variable [itcl::scope _settings(-axesvisible)] \
+        -command [itcl::code $this AdjustSetting -axesvisible] \
         -font "Arial 9"
 
     checkbutton $inner.labels \
         -text "Show Axis Labels" \
-        -variable [itcl::scope _settings(axisLabels)] \
-        -command [itcl::code $this AdjustSetting axisLabels] \
+        -variable [itcl::scope _settings(-axislabelsvisiboe)] \
+        -command [itcl::code $this AdjustSetting -axislabelsvisible] \
         -font "Arial 9"
 
     checkbutton $inner.gridx \
         -text "Show X Grid" \
-        -variable [itcl::scope _settings(axisGridX)] \
-        -command [itcl::code $this AdjustSetting axisGridX] \
+        -variable [itcl::scope _settings(-xgridvisible)] \
+        -command [itcl::code $this AdjustSetting -xgridvisible] \
         -font "Arial 9"
     checkbutton $inner.gridy \
         -text "Show Y Grid" \
-        -variable [itcl::scope _settings(axisGridY)] \
-        -command [itcl::code $this AdjustSetting axisGridY] \
+        -variable [itcl::scope _settings(-ygridvisible)] \
+        -command [itcl::code $this AdjustSetting -ygridvisible] \
         -font "Arial 9"
     checkbutton $inner.gridz \
         -text "Show Z Grid" \
-        -variable [itcl::scope _settings(axisGridZ)] \
-        -command [itcl::code $this AdjustSetting axisGridZ] \
+        -variable [itcl::scope _settings(-zgridvisible)] \
+        -command [itcl::code $this AdjustSetting -zgridvisible] \
         -font "Arial 9"
 
@@ -1983,5 +1986,5 @@
     set row 1
 
-    set labels { qx qy qz qw xpan ypan zoom }
+    set labels { -qx -qy -qz -qw -xpan -ypan -zoom }
     foreach tag $labels {
         label $inner.${tag}label -text $tag -font "Arial 9"
@@ -1998,5 +2001,5 @@
     checkbutton $inner.ortho \
         -text "Orthographic Projection" \
-        -variable [itcl::scope _view(ortho)] \
+        -variable [itcl::scope _view(-ortho)] \
         -command [itcl::code $this camera set ortho] \
         -font "Arial 9"
@@ -2023,33 +2026,33 @@
     checkbutton $inner.visible \
         -text "Show Cutplanes" \
-        -variable [itcl::scope _settings(cutplaneVisible)] \
-        -command [itcl::code $this AdjustSetting cutplaneVisible] \
+        -variable [itcl::scope _settings(-cutplanesvisible)] \
+        -command [itcl::code $this AdjustSetting -cutplanesvisible] \
         -font "Arial 9"
 
     checkbutton $inner.wireframe \
         -text "Show Wireframe" \
-        -variable [itcl::scope _settings(cutplaneWireframe)] \
-        -command [itcl::code $this AdjustSetting cutplaneWireframe] \
+        -variable [itcl::scope _settings(-cutplanewireframe)] \
+        -command [itcl::code $this AdjustSetting -cutplanewireframe] \
         -font "Arial 9"
 
     checkbutton $inner.lighting \
         -text "Enable Lighting" \
-        -variable [itcl::scope _settings(cutplaneLighting)] \
-        -command [itcl::code $this AdjustSetting cutplaneLighting] \
+        -variable [itcl::scope _settings(-cutplanelighting)] \
+        -command [itcl::code $this AdjustSetting -cutplanelighting] \
         -font "Arial 9"
 
     checkbutton $inner.edges \
         -text "Show Edges" \
-        -variable [itcl::scope _settings(cutplaneEdges)] \
-        -command [itcl::code $this AdjustSetting cutplaneEdges] \
+        -variable [itcl::scope _settings(-cutplaneedgesvisible)] \
+        -command [itcl::code $this AdjustSetting -cutplaneedgesvisible] \
         -font "Arial 9"
 
     label $inner.opacity_l -text "Opacity" -font "Arial 9"
     ::scale $inner.opacity -from 0 -to 100 -orient horizontal \
-        -variable [itcl::scope _settings(cutplaneOpacity)] \
+        -variable [itcl::scope _settings(-cutplaneopacity)] \
         -width 10 \
         -showvalue off \
-        -command [itcl::code $this AdjustSetting cutplaneOpacity]
-    $inner.opacity set $_settings(cutplaneOpacity)
+        -command [itcl::code $this AdjustSetting -cutplaneopacity]
+    $inner.opacity set $_settings(-cutplaneopacity)
 
     # X-value slicer...
@@ -2058,6 +2061,6 @@
             -onimage [Rappture::icon x-cutplane] \
             -offimage [Rappture::icon x-cutplane] \
-            -command [itcl::code $this AdjustSetting cutplaneVisibleX] \
-            -variable [itcl::scope _settings(cutplaneVisibleX)]
+            -command [itcl::code $this AdjustSetting -xcutplanevisible] \
+            -variable [itcl::scope _settings(-xcutplanevisible)]
     }
     Rappture::Tooltip::for $itk_component(xCutButton) \
@@ -2070,5 +2073,5 @@
             -borderwidth 1 -highlightthickness 0 \
             -command [itcl::code $this EventuallySetCutplane x] \
-            -variable [itcl::scope _settings(cutplanePositionX)]
+            -variable [itcl::scope _settings(-xcutplaneposition)]
     } {
         usual
@@ -2086,6 +2089,6 @@
             -onimage [Rappture::icon y-cutplane] \
             -offimage [Rappture::icon y-cutplane] \
-            -command [itcl::code $this AdjustSetting cutplaneVisibleY] \
-            -variable [itcl::scope _settings(cutplaneVisibleY)]
+            -command [itcl::code $this AdjustSetting -ycutplanevisible] \
+            -variable [itcl::scope _settings(-ycutplanevisible)]
     }
     Rappture::Tooltip::for $itk_component(yCutButton) \
@@ -2098,5 +2101,5 @@
             -borderwidth 1 -highlightthickness 0 \
             -command [itcl::code $this EventuallySetCutplane y] \
-            -variable [itcl::scope _settings(cutplanePositionY)]
+            -variable [itcl::scope _settings(-ycutplaneposition)]
     } {
         usual
@@ -2114,6 +2117,6 @@
             -onimage [Rappture::icon z-cutplane] \
             -offimage [Rappture::icon z-cutplane] \
-            -command [itcl::code $this AdjustSetting cutplaneVisibleZ] \
-            -variable [itcl::scope _settings(cutplaneVisibleZ)]
+            -command [itcl::code $this AdjustSetting -zcutplanevisible] \
+            -variable [itcl::scope _settings(-zcutplanevisible)]
     }
     Rappture::Tooltip::for $itk_component(zCutButton) \
@@ -2126,5 +2129,5 @@
             -borderwidth 1 -highlightthickness 0 \
             -command [itcl::code $this EventuallySetCutplane z] \
-            -variable [itcl::scope _settings(cutplanePositionZ)]
+            -variable [itcl::scope _settings(-zcutplaneposition)]
     } {
         usual
@@ -2170,6 +2173,6 @@
             }
             switch -- $who {
-                "ortho" {
-                    if {$_view(ortho)} {
+                "-ortho" {
+                    if {$_view(-ortho)} {
                         SendCmd "camera mode ortho"
                     } else {
@@ -2177,14 +2180,14 @@
                     }
                 }
-                "xpan" - "ypan" {
+                "-xpan" - "-ypan" {
                     PanCamera
                 }
-                "qx" - "qy" - "qz" - "qw" {
-                    set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
+                "-qx" - "-qy" - "-qz" - "-qw" {
+                    set q [ViewToQuaternion]
                     $_arcball quaternion $q
                     EventuallyRotate $q
                 }
-                "zoom" {
-                    SendCmd "camera zoom $_view(zoom)"
+                "-zoom" {
+                    SendCmd "camera zoom $_view(-zoom)"
                 }
             }
@@ -2259,29 +2262,35 @@
     # Parse style string.
     set tag $dataobj-$cname
-    set style [$dataobj style $cname]
-    array set settings {
-        -color \#808080
-        -edges 0
-        -edgecolor black
-        -linewidth 1.0
-        -opacity 0.4
-        -wireframe 0
-        -lighting 1
-        -visible 1
+    array set styles {
+        -color BCGYR
+        -volumeedgesvisible     0
+        -volumeedgecolor        black
+        -volumelinewidth        1.0
+        -volumewireframe        0
+        -volumelighting         1
+        -volumevisible          1
+        -volumeoutline          0
     }
     if { $dataobj != $_first } {
-        set settings(-opacity) 1
-    }
-    array set settings $style
+        set style(-opacity) 1
+    }
+    array set styles [$dataobj style $cname]
     SendCmd "volume add $tag"
+    set _settings($cname-volumewireframe)       $styles(-volumewireframe)
+    set _settings($cname-volumeedgesvisible)    $styles(-volumeedgesvisible)
+    set _settings($cname-volumeoutline)         $styles(-volumeoutline)
+    set _settings($cname-volumelighting)        $styles(-volumelighting)
+    set _settings($cname-volumevisible)         $styles(-volumevisible)
+
+    $itk_component(colormap) value $styles(-color)
+
     SendCmd "$_cutplaneCmd add $tag"
     SendCmd "$_cutplaneCmd visible 0 $tag"
-    SendCmd "volume lighting $settings(-lighting) $tag"
-    set _settings(volumeLighting) $settings(-lighting)
+    SendCmd "volume lighting $styles(-volumelighting) $tag"
     SetInitialTransferFunction $dataobj $cname
     SendCmd "volume colormap $cname $tag"
     SendCmd "$_cutplaneCmd colormap $cname-opaque $tag"
     SendCmd "outline add $tag"
-    SendCmd "outline visible 0 $tag"
+    SendCmd "outline visible $styles(-volumeoutline) $tag"
 }
 
@@ -2387,5 +2396,5 @@
         set title $fname
     }
-    if { $_settings(legendVisible) } {
+    if { $_settings(-legendvisible) } {
         set x [expr $w - 2]
         if { [$c find withtag "legend"] == "" } {
@@ -2674,5 +2683,5 @@
 
     if { ![info exists _parsedFunction($cname)] || ![info exists _cname2transferFunction($cname)] } {
-        array set style {
+        array set styles {
             -color BCGYR
             -levels 6
@@ -2680,21 +2689,22 @@
             -markers ""
         }
-
         # Accumulate the style from all the datasets using it.
         foreach tag [GetDatasetsWithComponent $cname] {
             foreach {dataobj cname} [split [lindex $tag 0] -] break
-            array set style [lindex [$dataobj components -style $cname] 0]
-        }
-        set cmap [ColorsToColormap $style(-color)]
+            set option [lindex [$dataobj components -style $cname] 0]
+            array set styles $option
+        }
+        set _settings($cname-color) $styles(-color)
+        set _settings($cname-volumeopacity) $styles(-opacity)
+        set cmap [ColorsToColormap $styles(-color)]
         set _cname2defaultcolormap($cname) $cmap
-        set _settings($cname-colormap) $style(-color)
         if { [info exists _transferFunctionEditors($cname)] } {
             eval $_transferFunctionEditors($cname) limits $_limits($cname)
         }
-        if { [info exists style(-markers)] &&
-             [llength $style(-markers)] > 0 } {
-            ParseMarkersOption $cname $style(-markers)
+        if { [info exists styles(-markers)] &&
+             [llength $styles(-markers)] > 0 } {
+            ParseMarkersOption $cname $styles(-markers)
         } else {
-            ParseLevelsOption $cname $style(-levels)
+            ParseLevelsOption $cname $styles(-levels)
         }
     } else {
@@ -2767,17 +2777,14 @@
         bottom "0.707107 0.707107 0 0"
     }
-    foreach name { qw qx qy qz } value $positions($side) {
+    foreach name { -qw -qx -qy -qz } value $positions($side) {
         set _view($name) $value
     } 
-    set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
+    set q [ViewToQuaternion]
     $_arcball quaternion $q
     SendCmd "camera orient $q" 
     SendCmd "camera reset"
-    set _view(xpan) 0
-    set _view(ypan) 0
-    set _view(zoom) 1.0
-    set _settings($this-xpan) $_view(xpan)
-    set _settings($this-ypan) $_view(ypan)
-    set _settings($this-zoom) $_view(zoom)
+    set _view(-xpan) 0
+    set _view(-ypan) 0
+    set _view(-zoom) 1.0
 }
 
@@ -2792,17 +2799,17 @@
 itcl::body Rappture::VtkVolumeViewer::InitComponentSettings { cname } { 
     array set _settings [subst {
-        $cname-colormap                 default
+        $cname-color                    default
         $cname-light2side               1
-        $cname-outline                  0
-        $cname-volumeAmbient            40
-        $cname-volumeBlendMode          composite
-        $cname-volumeDiffuse            60
-        $cname-volumeLighting           1
-        $cname-volumeOpacity            50
-        $cname-volumeQuality            80
-        $cname-volumeSpecularExponent   90
-        $cname-volumeSpecularLevel      30
-        $cname-volumeThickness          350
-        $cname-volumeVisible            1
+        $cname-volumeoutline            0
+        $cname-volumeambient            40
+        $cname-volumeblendmode          composite
+        $cname-volumediffuse            60
+        $cname-volumelighting           1
+        $cname-volumeopacity            50
+        $cname-volumequality            80
+        $cname-volumespecularexponent   90
+        $cname-volumespecularlevel      30
+        $cname-volumethickness          350
+        $cname-volumevisible            1
     }]
 }
@@ -2816,25 +2823,25 @@
 #
 itcl::body Rappture::VtkVolumeViewer::SwitchComponent { cname } { 
-    if { ![info exists _settings(${cname}-volumeAmbient)] } {
+    if { ![info exists _settings(${cname}-volumeambient)] } {
         InitComponentSettings $cname
     }
     # _settings variables change widgets, except for colormap
     foreach name {
-        light2side              
-        outline                 
-        volumeAmbient           
-        volumeBlendMode         
-        volumeDiffuse           
-        volumeLighting          
-        volumeOpacity           
-        volumeQuality           
-        volumeSpecularExponent  
-        volumeSpecularLevel     
-        volumeThickness         
-        volumeVisible           
+        -volumelight2side              
+        -volumeoutline                 
+        -volumeambient           
+        -volumeblendmode         
+        -volumediffuse           
+        -volumelighting          
+        -volumeopacity           
+        -volumequality           
+        -volumespecularexponent  
+        -volumespecularlevel     
+        -volumethickness         
+        -volumevisible           
     } {
         set _settings($name) $_settings(${cname}-${name})
     }
-    $itk_component(colormap) value        $_settings($cname-colormap)
+    $itk_component(colormap) value        $_settings($cname-color)
     set _current $cname;                # Reset the current component
 }
@@ -2844,5 +2851,5 @@
         return [list 0.0 0.0 1.0 1.0]
     }
-    if { ![info exists _settings($cname-volumeAmbient)] } {
+    if { ![info exists _settings($cname-volumeambient)] } {
         InitComponentSettings $cname
     }
@@ -2854,8 +2861,8 @@
     # settings widgets) are used for the active transfer-function.  Update
     # the values in the _settings varible.
-    set opacity [expr { double($_settings($cname-volumeOpacity)) * 0.01 }]
+    set opacity [expr { double($_settings($cname-volumeopacity)) * 0.01 }]
 
     # Scale values between 0.00001 and 0.01000
-    set delta [expr {double($_settings($cname-volumeThickness)) * 0.0001}]
+    set delta [expr {double($_settings($cname-volumethickness)) * 0.0001}]
     set first [lindex $isovalues 0]
     set last [lindex $isovalues end]
