Index: branches/1.4/gui/scripts/vtkvolumeviewer.tcl
===================================================================
--- branches/1.4/gui/scripts/vtkvolumeviewer.tcl	(revision 5206)
+++ branches/1.4/gui/scripts/vtkvolumeviewer.tcl	(revision 5226)
@@ -1,3 +1,3 @@
-# -*- mode: tcl; indent-tabs-mode: nil -*- 
+# -*- mode: tcl; indent-tabs-mode: nil -*-
 # ----------------------------------------------------------------------
 #  COMPONENT: vtkvolumeviewer - Vtk volume viewer
@@ -57,12 +57,12 @@
     public method get {args}
     public method isconnected {}
-    public method parameters {title args} { 
-        # do nothing 
+    public method parameters {title args} {
+        # do nothing
     }
     public method scale {args}
 
-    private method GetDatasetsWithComponent { cname } 
-
-    private variable _volcomponents   ; # Array of components found 
+    private method GetDatasetsWithComponent { cname }
+
+    private variable _volcomponents   ; # Array of components found
     private variable _componentsList   ; # List of component names
 
@@ -73,5 +73,5 @@
     private method BuildColormap { name colors }
     private method BuildCutplaneTab {}
-    private method BuildDownloadPopup { widget command } 
+    private method BuildDownloadPopup { widget command }
     private method BuildViewTab {}
     private method BuildVolumeTab {}
@@ -84,13 +84,13 @@
     private method DoResize {}
     private method DoRotate {}
-    private method EnterLegend { x y } 
-    private method EventuallyResize { w h } 
-    private method EventuallyRequestLegend {} 
-    private method EventuallyRotate { q } 
-    private method EventuallySetCutplane { axis args } 
-    private method GetImage { args } 
-    private method GetVtkData { args } 
+    private method EnterLegend { x y }
+    private method EventuallyResize { w h }
+    private method EventuallyRequestLegend {}
+    private method EventuallyRotate { q }
+    private method EventuallySetCutplane { axis args }
+    private method GetImage { args }
+    private method GetVtkData { args }
     private method InitSettings { args  }
-    private method IsValidObject { dataobj } 
+    private method IsValidObject { dataobj }
     private method LeaveLegend {}
     private method MotionLegend { x y }
@@ -98,5 +98,5 @@
     private method PanCamera {}
     private method Pick {x y}
-    private method QuaternionToView { q } { 
+    private method QuaternionToView { q } {
         foreach { _view(-qw) _view(-qx) _view(-qy) _view(-qz) } $q break
     }
@@ -109,8 +109,8 @@
     private method Rotate {option x y}
     private method SetLegendTip { x y }
-    private method SetObjectStyle { dataobj comp } 
+    private method SetObjectStyle { dataobj comp }
     private method SetOrientation { side }
-    private method Slice {option args} 
-    private method ViewToQuaternion {} { 
+    private method Slice {option args}
+    private method ViewToQuaternion {} {
         return [list $_view(-qw) $_view(-qx) $_view(-qy) $_view(-qz)]
     }
@@ -120,5 +120,5 @@
     private variable _dlist ""     ;    # list of data objects
     private variable _obj2ovride   ;    # maps dataobj => style override
-    private variable _datasets     ;    # contains all the dataobj-component 
+    private variable _datasets     ;    # contains all the dataobj-component
                                    ;    # datasets in the server
     private variable _colormaps    ;    # contains all the colormaps
@@ -146,5 +146,5 @@
     private variable _cutplanePending 0
     private variable _legendPending 0
-    private variable _fields 
+    private variable _fields
     private variable _curFldName ""
     private variable _curFldLabel ""
@@ -215,5 +215,5 @@
         -xpan            0
         -ypan            0
-        -zoom            1.0 
+        -zoom            1.0
     }
     set _arcball [blt::arcball create 100 100]
@@ -258,5 +258,5 @@
     itk_component add fieldmenu {
         menu $itk_component(plotarea).menu -bg black -fg white -relief flat \
-            -tearoff no 
+            -tearoff no
     } {
         usual
@@ -278,6 +278,6 @@
 
     set _map(id) [$c create image 0 0 -anchor nw -image $_image(plot)]
-    set _map(cwidth) -1 
-    set _map(cheight) -1 
+    set _map(cwidth) -1
+    set _map(cheight) -1
     set _map(zoom) 1.0
     set _map(original) ""
@@ -325,5 +325,5 @@
             -offimage [Rappture::icon volume-off] \
             -variable [itcl::scope _settings(-volumevisible)] \
-            -command [itcl::code $this AdjustSetting -volumevisible] 
+            -command [itcl::code $this AdjustSetting -volumevisible]
     }
     $itk_component(volume) select
@@ -337,5 +337,5 @@
             -offimage [Rappture::icon cutbutton] \
             -variable [itcl::scope _settings(-cutplanesvisible)] \
-            -command [itcl::code $this AdjustSetting -cutplanesvisible] 
+            -command [itcl::code $this AdjustSetting -cutplanesvisible]
     }
     Rappture::Tooltip::for $itk_component(cutplane) \
@@ -357,5 +357,5 @@
     set _image(legend) [image create photo]
     itk_component add legend {
-        canvas $itk_component(plotarea).legend -width 50 -highlightthickness 0 
+        canvas $itk_component(plotarea).legend -width 50 -highlightthickness 0
     } {
         usual
@@ -364,5 +364,5 @@
     }
 
-    # Hack around the Tk panewindow.  The problem is that the requested 
+    # Hack around the Tk panewindow.  The problem is that the requested
     # size of the 3d view isn't set until an image is retrieved from
     # the server.  So the panewindow uses the tiny size.
@@ -370,5 +370,5 @@
     pack forget $itk_component(view)
     blt::table $itk_component(plotarea) \
-        0,0 $itk_component(view) -fill both -reqwidth $w 
+        0,0 $itk_component(view) -fill both -reqwidth $w
     blt::table configure $itk_component(plotarea) c1 -resize none
 
@@ -455,5 +455,5 @@
 
 itcl::body Rappture::VtkVolumeViewer::DoRotate {} {
-    SendCmd "camera orient [ViewToQuaternion]" 
+    SendCmd "camera orient [ViewToQuaternion]"
     set _rotatePending 0
 }
@@ -482,5 +482,5 @@
     if { !$_rotatePending } {
         set _rotatePending 1
-        global rotate_delay 
+        global rotate_delay
         $_dispatcher event -after $rotate_delay !rotate
     }
@@ -589,5 +589,5 @@
                     continue
                 }
-                if {[info exists _obj2ovride($dataobj-raise)] && 
+                if {[info exists _obj2ovride($dataobj-raise)] &&
                     $_obj2ovride($dataobj-raise)} {
                     set dlist [linsert $dlist 0 $dataobj]
@@ -617,5 +617,5 @@
             }
             return $dlist
-        }           
+        }
         -image {
             if {[llength $args] != 2} {
@@ -850,7 +850,7 @@
     $_dispatcher cancel !legend
     # disconnected -- no more data sitting on server
-    array unset _datasets 
-    array unset _colormaps 
-    array unset _dataset2style 
+    array unset _datasets
+    array unset _colormaps
+    array unset _dataset2style
 
     set _resizePending 0
@@ -959,5 +959,5 @@
     # Turn on buffering of commands to the server.  We don't want to
     # be preempted by a server disconnect/reconnect (which automatically
-    # generates a new call to Rebuild).   
+    # generates a new call to Rebuild).
     StartBufferingCommands
 
@@ -1001,5 +1001,5 @@
             if { ![info exists _datasets($tag)] } {
                 set bytes [$dataobj vtkdata $comp]
-		if 0 { 
+		if 0 {
                     set f [open /tmp/vtkvolume.vtk "w"]
                     fconfigure $f -translation binary -encoding binary
@@ -1106,5 +1106,5 @@
 itcl::body Rappture::VtkVolumeViewer::CurrentDatasets {args} {
     set flag [lindex $args 0]
-    switch -- $flag { 
+    switch -- $flag {
         "-all" {
             if { [llength $args] > 1 } {
@@ -1125,5 +1125,5 @@
                 set dlist [get -visible]
             }
-        }           
+        }
         default {
             set dlist $args
@@ -1244,5 +1244,5 @@
     foreach tag [CurrentDatasets -visible] {
         SendCmd "dataset getscalar pixel $x $y $tag"
-    } 
+    }
 }
 
@@ -1632,6 +1632,6 @@
         SendCmd "outline color $rgb"
         SendCmd "$_cutplaneCmd color $rgb"
-        $itk_component(legend) itemconfigure labels -fill $color 
-        $itk_component(legend) itemconfigure limits -fill $color 
+        $itk_component(legend) itemconfigure labels -fill $color
+        $itk_component(legend) itemconfigure limits -fill $color
     }
 }
@@ -1670,5 +1670,5 @@
         -font "Arial 9"
 
-    label $inner.background_l -text "Background" -font "Arial 9" 
+    label $inner.background_l -text "Background" -font "Arial 9"
     itk_component add background {
         Rappture::Combobox $inner.background -width 10 -editable no
@@ -1677,5 +1677,5 @@
         "black"              "black"            \
         "white"              "white"            \
-        "grey"               "grey"             
+        "grey"               "grey"
 
     $itk_component(background) value $_settings(-background)
@@ -1811,5 +1811,5 @@
         -font "Arial 9"
 
-    label $inner.mode_l -text "Mode" -font "Arial 9" 
+    label $inner.mode_l -text "Mode" -font "Arial 9"
 
     itk_component add axismode {
@@ -1820,5 +1820,5 @@
         "closest_triad"   "closest" \
         "furthest_triad"  "farthest" \
-        "outer_edges"     "outer"         
+        "outer_edges"     "outer"
     $itk_component(axismode) value $_settings(-axisflymode)
     bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axisflymode]
@@ -1892,8 +1892,8 @@
 itcl::body Rappture::VtkVolumeViewer::BuildCutplaneTab {} {
     set font [option get $itk_component(hull) font Font]
-    
+
     set inner [$itk_component(main) insert end \
         -title "Cutplane Settings" \
-        -icon [Rappture::icon cutbutton]] 
+        -icon [Rappture::icon cutbutton]]
 
     $inner configure -borderwidth 4
@@ -2019,8 +2019,8 @@
 
 #
-#  camera -- 
+#  camera --
 #
 itcl::body Rappture::VtkVolumeViewer::camera {option args} {
-    switch -- $option { 
+    switch -- $option {
         "show" {
             puts [array get _view]
@@ -2070,5 +2070,5 @@
 
 itcl::body Rappture::VtkVolumeViewer::GetImage { args } {
-    if { [image width $_image(download)] > 0 && 
+    if { [image width $_image(download)] > 0 &&
          [image height $_image(download)] > 0 } {
         set bytes [$_image(download) data -format "jpeg -quality 100"]
@@ -2083,13 +2083,13 @@
         -title "[Rappture::filexfer::label downloadWord] as..."
     set inner [$popup component inner]
-    label $inner.summary -text "" -anchor w 
+    label $inner.summary -text "" -anchor w
     radiobutton $inner.vtk_button -text "VTK data file" \
         -variable [itcl::scope _downloadPopup(format)] \
         -font "Helvetica 9 " \
-        -value vtk  
+        -value vtk
     Rappture::Tooltip::for $inner.vtk_button "Save as VTK data file."
     radiobutton $inner.image_button -text "Image File" \
         -variable [itcl::scope _downloadPopup(format)] \
-        -value image 
+        -value image
     Rappture::Tooltip::for $inner.image_button \
         "Save as digital image."
@@ -2112,5 +2112,5 @@
         2,0 $inner.image_button -anchor w -cspan 2 -padx { 4 0 } \
         4,1 $inner.cancel -width .9i -fill y \
-        4,0 $inner.ok -padx 2 -width .9i -fill y 
+        4,0 $inner.ok -padx 2 -width .9i -fill y
     blt::table configure $inner r3 -height 4
     blt::table configure $inner r4 -pady 4
@@ -2192,5 +2192,5 @@
     set font "Arial 8"
     set lineht [font metrics $font -linespace]
-    
+
     if { [info exists _fields($fname)] } {
         foreach { title units } $_fields($fname) break
@@ -2204,5 +2204,5 @@
         set x [expr $w - 2]
         if { [$c find withtag "legend"] == "" } {
-            set y 2 
+            set y 2
             $c create text $x $y \
                 -anchor ne \
@@ -2279,5 +2279,5 @@
     set font "Arial 8"
     set lineht [font metrics $font -linespace]
-    
+
     set imgHeight [image height $_image(legend)]
     set coords [$c coords colormap]
@@ -2302,6 +2302,6 @@
     }
     set color [eval format "\#%02x%02x%02x" $pixel]
-    $_image(swatch) put black  -to 0 0 23 23 
-    $_image(swatch) put $color -to 1 1 22 22 
+    $_image(swatch) put black  -to 0 0 23 23
+    $_image(swatch) put $color -to 1 1 22 22
     .rappturetooltip configure -icon $_image(swatch)
 
@@ -2314,8 +2314,8 @@
         set value 0.0
     }
-    set tipx [expr $x + 15] 
+    set tipx [expr $x + 15]
     set tipy [expr $y - 5]
     Rappture::Tooltip::text $c "$title $value"
-    Rappture::Tooltip::tooltip show $c +$tipx,+$tipy    
+    Rappture::Tooltip::tooltip show $c +$tipx,+$tipy
 }
 
@@ -2363,5 +2363,5 @@
 # ----------------------------------------------------------------------
 itcl::body Rappture::VtkVolumeViewer::Combo {option} {
-    set c $itk_component(view) 
+    set c $itk_component(view)
     switch -- $option {
         post {
@@ -2376,5 +2376,5 @@
         }
         deactivate {
-            $c itemconfigure title -fill $itk_option(-plotforeground) 
+            $c itemconfigure title -fill $itk_option(-plotforeground)
         }
         invoke {
@@ -2388,5 +2388,5 @@
 }
 
-itcl::body Rappture::VtkVolumeViewer::SetOrientation { side } { 
+itcl::body Rappture::VtkVolumeViewer::SetOrientation { side } {
     array set positions {
         front "1 0 0 0"
@@ -2399,8 +2399,8 @@
     foreach name { -qw -qx -qy -qz } value $positions($side) {
         set _view($name) $value
-    } 
+    }
     set q [ViewToQuaternion]
     $_arcball quaternion $q
-    SendCmd "camera orient $q" 
+    SendCmd "camera orient $q"
     SendCmd "camera reset"
     set _view(-xpan) 0
@@ -2413,9 +2413,9 @@
 #
 #       Returns a list of all the datasets (known by the combination of
-#       their data object and component name) that match the given 
-#       component name.  For example, this is used where we want to change 
+#       their data object and component name) that match the given
+#       component name.  For example, this is used where we want to change
 #       the settings of volumes that have the current component.
 #
-itcl::body Rappture::VtkVolumeViewer::GetDatasetsWithComponent { cname } { 
+itcl::body Rappture::VtkVolumeViewer::GetDatasetsWithComponent { cname } {
     if { ![info exists _volcomponents($cname)] } {
         return ""
