Index: branches/1.4/gui/scripts/vtkisosurfaceviewer.tcl
===================================================================
--- branches/1.4/gui/scripts/vtkisosurfaceviewer.tcl	(revision 5016)
+++ branches/1.4/gui/scripts/vtkisosurfaceviewer.tcl	(revision 5018)
@@ -1,3 +1,3 @@
-# -*- mode: tcl; indent-tabs-mode: nil -*- 
+# -*- mode: tcl; indent-tabs-mode: nil -*-
 # ----------------------------------------------------------------------
 #  COMPONENT: vtkisosurfaceviewer - Vtk 3D contour object viewer
@@ -57,6 +57,6 @@
     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}
@@ -68,5 +68,5 @@
     private method BuildColormap { name }
     private method BuildCutplaneTab {}
-    private method BuildDownloadPopup { widget command } 
+    private method BuildDownloadPopup { widget command }
     private method BuildIsosurfaceTab {}
     private method Combo { option }
@@ -78,21 +78,21 @@
     private method DoRotate {}
     private method DrawLegend {}
-    private method EnterLegend { x y } 
-    private method EventuallyChangeContourLevels {} 
-    private method EventuallyRequestLegend {} 
-    private method EventuallyResize { w h } 
-    private method EventuallyRotate { q } 
-    private method EventuallySetCutplane { axis args } 
+    private method EnterLegend { x y }
+    private method EventuallyChangeContourLevels {}
+    private method EventuallyRequestLegend {}
+    private method EventuallyResize { w h }
+    private method EventuallyRotate { q }
+    private method EventuallySetCutplane { axis args }
     private method GenerateContourList {}
-    private method GetImage { args } 
-    private method GetVtkData { 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 } 
+    private method MotionLegend { x y }
     private method Pan {option x y}
     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,5 +109,5 @@
     private method SetOrientation { side }
     private method Slice {option args}
-    private method ViewToQuaternion {} { 
+    private method ViewToQuaternion {} {
         return [list $_view(-qw) $_view(-qx) $_view(-qy) $_view(-qz)]
     }
@@ -119,5 +119,5 @@
     private variable _obj2datasets
     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
@@ -157,7 +157,7 @@
     private variable _legendPending 0
     private variable _field      ""
-    private variable _colorMode "scalar";	#  Mode of colormap (vmag or scalar)
-    private variable _fieldNames {} 
-    private variable _fields 
+    private variable _colorMode "scalar";   #  Mode of colormap (vmag or scalar)
+    private variable _fieldNames {}
+    private variable _fields
     private variable _curFldName ""
     private variable _curFldLabel ""
@@ -294,5 +294,5 @@
     itk_component add fieldmenu {
         menu $itk_component(plotarea).menu -bg black -fg white -relief flat \
-            -tearoff 0 
+            -tearoff 0
     } {
         usual
@@ -314,6 +314,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) ""
@@ -362,5 +362,5 @@
             -offimage [Rappture::icon volume-off] \
             -variable [itcl::scope _settings(-isosurfacevisible)] \
-            -command [itcl::code $this AdjustSetting -isosurfacevisible] 
+            -command [itcl::code $this AdjustSetting -isosurfacevisible]
     }
     $itk_component(contour) select
@@ -374,5 +374,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) \
@@ -393,5 +393,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
@@ -400,5 +400,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.
@@ -406,5 +406,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
 
@@ -501,5 +501,5 @@
 
 itcl::body Rappture::VtkIsosurfaceViewer::DoRotate {} {
-    SendCmd "camera orient [ViewToQuaternion]" 
+    SendCmd "camera orient [ViewToQuaternion]"
     set _rotatePending 0
 }
@@ -528,5 +528,5 @@
     if { !$_rotatePending } {
         set _rotatePending 1
-        global rotate_delay 
+        global rotate_delay
         $_dispatcher event -after $rotate_delay !rotate
     }
@@ -545,5 +545,5 @@
     if { !$_contourList(updatePending) } {
         set _contourList(updatePending) 1
-        global rotate_delay 
+        global rotate_delay
         $_dispatcher event -after $rotate_delay !contours
     }
@@ -644,5 +644,5 @@
                     continue
                 }
-                if {[info exists _obj2ovride($dataobj-raise)] && 
+                if {[info exists _obj2ovride($dataobj-raise)] &&
                     $_obj2ovride($dataobj-raise)} {
                     set dlist [linsert $dlist 0 $dataobj]
@@ -672,5 +672,5 @@
             }
             return $dlist
-        }           
+        }
         -image {
             if {[llength $args] != 2} {
@@ -911,5 +911,5 @@
         #set w [image width $_image(plot)]
         #set h [image height $_image(plot)]
-        #puts stderr "$date: received image ${w}x${h} image"        
+        #puts stderr "$date: received image ${w}x${h} image"
         if { $_start > 0 } {
             set finish [clock clicks -milliseconds]
@@ -982,5 +982,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
 
@@ -1044,5 +1044,5 @@
             lappend _obj2datasets($dataobj) $tag
             if { [info exists _obj2ovride($dataobj-raise)] } {
-		SendCmd "contour3d visible 1 $tag"
+                SendCmd "contour3d visible 1 $tag"
             }
         }
@@ -1051,5 +1051,5 @@
     InitSettings -cutplanesvisible -isosurfacevisible -outline
     if { $_reset } {
-	# These are settings that rely on a dataset being loaded.
+        # These are settings that rely on a dataset being loaded.
         InitSettings \
             -isosurfacelighting \
@@ -1057,21 +1057,21 @@
             -isosurfacevisible \
             -isosurfaceedges -isosurfacelighting -isosurfaceopacity \
-	    -isosurfacewireframe \
+            -isosurfacewireframe \
             -cutplanesvisible \
-	    -xcutplaneposition -ycutplaneposition -zcutplaneposition \
-	    -xcutplanevisible -ycutplanevisible -zcutplanevisible \
+            -xcutplaneposition -ycutplaneposition -zcutplaneposition \
+            -xcutplanevisible -ycutplanevisible -zcutplanevisible \
             -cutplanepreinterp -numcontours
 
         Zoom reset
-	foreach axis { x y z } {
+        foreach axis { x y z } {
             # Another problem fixed by a <view>. We looking into a data
             # object for the name of the axes. This should be global to
             # the viewer itself.
-	    set label [$_first hints ${axis}label]
-	    if { $label == "" } {
+            set label [$_first hints ${axis}label]
+            if { $label == "" } {
                 set label [string toupper $axis]
-	    }
+            }
             # May be a space in the axis label
-	    SendCmd [list axis name $axis $label]
+            SendCmd [list axis name $axis $label]
         }
         if { [array size _fields] < 2 } {
@@ -1100,5 +1100,5 @@
 itcl::body Rappture::VtkIsosurfaceViewer::CurrentDatasets {args} {
     set flag [lindex $args 0]
-    switch -- $flag { 
+    switch -- $flag {
         "-all" {
             if { [llength $args] > 1 } {
@@ -1119,5 +1119,5 @@
                 set dlist [get -visible]
             }
-        }           
+        }
         default {
             set dlist $args
@@ -1238,5 +1238,5 @@
     foreach tag [CurrentDatasets -visible] {
         SendCmd "dataset getscalar pixel $x $y $tag"
-    } 
+    }
 }
 
@@ -1342,13 +1342,13 @@
         "-background" {
             set bgcolor [$itk_component(background) value]
-	    array set fgcolors {
-		"black" "white"
-		"white" "black"
-		"grey"	"black"
-	    }
+            array set fgcolors {
+                "black" "white"
+                "white" "black"
+                "grey"  "black"
+            }
             configure -plotbackground $bgcolor \
-		-plotforeground $fgcolors($bgcolor)
-	    $itk_component(view) delete "legend"
-	    DrawLegend
+                -plotforeground $fgcolors($bgcolor)
+            $itk_component(view) delete "legend"
+            DrawLegend
         }
         "-cutplaneedges" {
@@ -1370,5 +1370,5 @@
         "-cutplanesvisible" {
             set bool $_settings($what)
-	    SendCmd "cutplane visible 0"
+            SendCmd "cutplane visible 0"
             if { $bool } {
                 foreach tag [CurrentDatasets -visible] {
@@ -1393,18 +1393,18 @@
             set color [$itk_component(colormap) value]
             set _settings($what) $color
-	    if { $color == "none" } {
-		if { $_settings(-colormapvisible) } {
-		    SendCmd "contour3d colormode constant {}"
-		    set _settings(-colormapvisible) 0
-		}
-	    } else {
-		if { !$_settings(-colormapvisible) } {
-		    SendCmd "contour3d colormode $_colorMode $_curFldName"
-		    set _settings(-colormapvisible) 1
-		}
-		SetCurrentColormap $color
-	    }
+            if { $color == "none" } {
+                if { $_settings(-colormapvisible) } {
+                    SendCmd "contour3d colormode constant {}"
+                    set _settings(-colormapvisible) 0
+                }
+            } else {
+                if { !$_settings(-colormapvisible) } {
+                    SendCmd "contour3d colormode $_colorMode $_curFldName"
+                    set _settings(-colormapvisible) 1
+                }
+                SetCurrentColormap $color
+            }
             StopBufferingCommands
-	    EventuallyRequestLegend
+            EventuallyRequestLegend
         }
         "-field" {
@@ -1439,22 +1439,22 @@
         "-isolinecolor" {
             set color [$itk_component(isolineColor) value]
-	    set _settings($what) $color
-	    DrawLegend
+            set _settings($what) $color
+            DrawLegend
         }
         "-isosurfaceedges" {
             set bool $_settings($what)
-	    SendCmd "contour3d edges $bool"
+            SendCmd "contour3d edges $bool"
         }
         "-isosurfacelighting" {
             set bool $_settings($what)
-	    SendCmd "contour3d lighting $bool"
+            SendCmd "contour3d lighting $bool"
         }
         "-isosurfaceopacity" {
             set _settings($what) [expr $_widget($what) * 0.01]
-	    SendCmd "contour3d opacity $_settings($what)"
+            SendCmd "contour3d opacity $_settings($what)"
         }
         "-isosurfacevisible" {
             set bool $_settings($what)
-	    SendCmd "contour3d visible 0"
+            SendCmd "contour3d visible 0"
             if { $bool } {
                 foreach tag [CurrentDatasets -visible] {
@@ -1472,11 +1472,11 @@
         "-isosurfacewireframe" {
             set bool $_settings($what)
-	    SendCmd "contour3d wireframe $bool"
+            SendCmd "contour3d wireframe $bool"
         }
         "-legendvisible" {
             if { !$_settings($what) } {
                 $itk_component(view) delete legend
-	    }
-	    DrawLegend
+            }
+            DrawLegend
         }
         "-numcontours" {
@@ -1497,5 +1497,5 @@
         "-outline" {
             set bool $_settings($what)
-	    SendCmd "outline visible 0"
+            SendCmd "outline visible 0"
             if { $bool } {
                 foreach tag [CurrentDatasets -visible] {
@@ -1514,5 +1514,5 @@
                     -troughcolor grey82
             }
-	    SendCmd "cutplane axis $axis $bool"
+            SendCmd "cutplane axis $axis $bool"
         }
         "-xcutplaneposition" - "-ycutplaneposition" - "-zcutplaneposition" {
@@ -1537,12 +1537,12 @@
 #
 #       Request a new legend from the server.  The size of the legend
-#       is determined from the height of the canvas.  
+#       is determined from the height of the canvas.
 #
 # This should be called when
-#	1.  A new current colormap is set.
-#	2.  Window is resized.
-#	3.  The limits of the data have changed.  (Just need a redraw).
-#	4.  Number of isolines have changed. (Just need a redraw).
-#	5.  Legend becomes visible (Just need a redraw).
+#   1.  A new current colormap is set.
+#   2.  Window is resized.
+#   3.  The limits of the data have changed.  (Just need a redraw).
+#   4.  Number of isolines have changed. (Just need a redraw).
+#   5.  Legend becomes visible (Just need a redraw).
 #
 itcl::body Rappture::VtkIsosurfaceViewer::RequestLegend {} {
@@ -1560,23 +1560,23 @@
     }
     if { [string match "component*" $fname] } {
-	set title ""
+        set title ""
     } else {
-	if { [info exists _fields($fname)] } {
-	    foreach { title units } $_fields($fname) break
-	    if { $units != "" } {
-		set title [format "%s (%s)" $title $units]
-	    }
-	} else {
-	    set title $fname
-	}
+        if { [info exists _fields($fname)] } {
+            foreach { title units } $_fields($fname) break
+            if { $units != "" } {
+                set title [format "%s (%s)" $title $units]
+            }
+        } else {
+            set title $fname
+        }
     }
     # If there's a title too, subtract one more line
     if { $title != "" } {
-        incr h -$lineht 
+        incr h -$lineht
     }
     # Set the legend on the first heightmap dataset.
     if { $_currentColormap != ""  } {
-	set cmap $_currentColormap
-	SendCmdNoWait "legend $cmap scalar $_curFldName {} $w $h 0"
+        set cmap $_currentColormap
+        SendCmdNoWait "legend $cmap scalar $_curFldName {} $w $h 0"
     }
 }
@@ -1598,5 +1598,5 @@
     if { [isconnected] } {
         set rgb [Color2RGB $itk_option(-plotforeground)]
-	SendCmd "axis color all $rgb"
+        SendCmd "axis color all $rgb"
         SendCmd "outline color $rgb"
         SendCmd "cutplane color $rgb"
@@ -1650,5 +1650,5 @@
         -font "Arial 9"
 
-    label $inner.linecolor_l -text "Isolines" -font "Arial 9" 
+    label $inner.linecolor_l -text "Isolines" -font "Arial 9"
     itk_component add isolineColor {
         Rappture::Combobox $inner.linecolor -width 10 -editable 0
@@ -1664,11 +1664,11 @@
         "red"                "red"              \
         "white"              "white"            \
-	"none"		     "none"
+        "none"               "none"
 
     $itk_component(isolineColor) value "white"
     bind $inner.linecolor <<Value>> \
-	[itcl::code $this AdjustSetting -isolinecolor]
-
-    label $inner.background_l -text "Background" -font "Arial 9" 
+        [itcl::code $this AdjustSetting -isolinecolor]
+
+    label $inner.background_l -text "Background" -font "Arial 9"
     itk_component add background {
         Rappture::Combobox $inner.background -width 10 -editable 0
@@ -1677,5 +1677,5 @@
         "black"              "black"            \
         "white"              "white"            \
-        "grey"               "grey"             
+        "grey"               "grey"
 
     $itk_component(background) value $_settings(-background)
@@ -1692,5 +1692,5 @@
 
     itk_component add field_l {
-        label $inner.field_l -text "Field" -font "Arial 9" 
+        label $inner.field_l -text "Field" -font "Arial 9"
     } {
         ignore -font
@@ -1702,5 +1702,5 @@
         [itcl::code $this AdjustSetting -field]
 
-    label $inner.colormap_l -text "Colormap" -font "Arial 9" 
+    label $inner.colormap_l -text "Colormap" -font "Arial 9"
     itk_component add colormap {
         Rappture::Combobox $inner.colormap -width 10 -editable 0
@@ -1728,6 +1728,6 @@
         2,0 $inner.linecolor_l  -anchor w -pady 2  \
         2,1 $inner.linecolor    -anchor w -pady 2 -fill x  \
-	3,0 $inner.background_l -anchor w -pady 2 \
-	3,1 $inner.background -anchor w -pady 2  -fill x \
+        3,0 $inner.background_l -anchor w -pady 2 \
+        3,1 $inner.background -anchor w -pady 2  -fill x \
         4,0 $inner.numcontours_l -anchor w -pady 2 \
         4,1 $inner.numcontours -anchor w -pady 2 \
@@ -1765,5 +1765,5 @@
         -command [itcl::code $this AdjustSetting -axislabels] \
         -font "Arial 9"
-    label $inner.grid_l -text "Grid" -font "Arial 9" 
+    label $inner.grid_l -text "Grid" -font "Arial 9"
     checkbutton $inner.xgrid \
         -text "X" \
@@ -1787,5 +1787,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 {
@@ -1796,5 +1796,5 @@
         "closest_triad"   "closest" \
         "furthest_triad"  "farthest" \
-        "outer_edges"     "outer"         
+        "outer_edges"     "outer"
     $itk_component(axisMode) value $_settings(-axismode)
     bind $inner.mode <<Value>> [itcl::code $this AdjustSetting -axismode]
@@ -1871,8 +1871,8 @@
 
     set fg [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
@@ -1933,5 +1933,5 @@
             -command [itcl::code $this EventuallySetCutplane x] \
             -variable [itcl::scope _settings(-xcutplaneposition)] \
-	    -foreground red2 -font "Arial 9 bold"
+            -foreground red2 -font "Arial 9 bold"
     } {
         usual
@@ -1962,5 +1962,5 @@
             -command [itcl::code $this EventuallySetCutplane y] \
             -variable [itcl::scope _settings(-ycutplaneposition)] \
-	    -foreground green3 -font "Arial 9 bold"
+            -foreground green3 -font "Arial 9 bold"
     } {
         usual
@@ -1981,6 +1981,6 @@
             -variable [itcl::scope _settings(-zcutplanevisible)] \
     } {
-	usual
-	ignore -foreground
+        usual
+        ignore -foreground
     }
     Rappture::Tooltip::for $itk_component(zbutton) \
@@ -1994,5 +1994,5 @@
             -command [itcl::code $this EventuallySetCutplane z] \
             -variable [itcl::scope _settings(-zcutplaneposition)] \
-	    -foreground blue3 -font "Arial 9 bold"
+            -foreground blue3 -font "Arial 9 bold"
     } {
         usual
@@ -2012,10 +2012,10 @@
         5,0 $inner.opacity_l            -anchor w -pady 2 -cspan 1 \
         5,1 $inner.opacity              -fill x   -pady 2 -cspan 3 \
-        6,0 $inner.xbutton		-anchor w -padx 2 -pady 2 \
-        7,0 $inner.ybutton		-anchor w -padx 2 -pady 2 \
-        8,0 $inner.zbutton		-anchor w -padx 2 -pady 2 \
-        6,1 $inner.xval			-fill y -rspan 4 \
-        6,2 $inner.yval			-fill y -rspan 4 \
-        6,3 $inner.zval			-fill y -rspan 4 \
+        6,0 $inner.xbutton              -anchor w -padx 2 -pady 2 \
+        7,0 $inner.ybutton              -anchor w -padx 2 -pady 2 \
+        8,0 $inner.zbutton              -anchor w -padx 2 -pady 2 \
+        6,1 $inner.xval                 -fill y -rspan 4 \
+        6,2 $inner.yval                 -fill y -rspan 4 \
+        6,3 $inner.zval                 -fill y -rspan 4 \
 
 
@@ -2025,8 +2025,8 @@
 
 #
-#  camera -- 
+#  camera --
 #
 itcl::body Rappture::VtkIsosurfaceViewer::camera {option args} {
-    switch -- $option { 
+    switch -- $option {
         "show" {
             puts [array get _view]
@@ -2076,5 +2076,5 @@
 
 itcl::body Rappture::VtkIsosurfaceViewer::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"]
@@ -2089,14 +2089,14 @@
         -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 "Arial 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)] \
         -font "Arial 9 " \
-        -value image 
+        -value image
     Rappture::Tooltip::for $inner.image_button \
         "Save as digital image."
@@ -2119,5 +2119,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
@@ -2132,5 +2132,5 @@
     array set style {
         -color                  BCGYR
-        -cutplanesvisible       0 
+        -cutplanesvisible       0
         -edgecolor              black
         -edges                  0
@@ -2184,5 +2184,5 @@
             set _contourList(numLevels) $style(-levels)
         }
-        EventuallyChangeContourLevels 
+        EventuallyChangeContourLevels
     }
     set _settings(-isosurfacevisible) $style(-isosurfacevisible)
@@ -2194,5 +2194,5 @@
     set _settings(-ycutplaneposition) $style(-ycutplaneposition)
     set _settings(-zcutplaneposition) $style(-zcutplaneposition)
- 
+
     SendCmd "cutplane add $tag"
     SendCmd "cutplane color [Color2RGB $itk_option(-plotforeground)] $tag"
@@ -2209,5 +2209,5 @@
     SendCmd "outline visible $style(-outline) $tag"
     set _settings(-outline) $style(-outline)
- 
+
     GenerateContourList
     SendCmd [list contour3d add contourlist $_contourList(values) $tag]
@@ -2222,5 +2222,5 @@
     SendCmd "contour3d opacity $style(-opacity) $tag"
     set _settings(-isosurfaceopacity) $style(-opacity)
-    SetCurrentColormap $style(-color) 
+    SetCurrentColormap $style(-color)
     SendCmd "contour3d wireframe $style(-wireframe) $tag"
     set _settings(-isosurfacewireframe) $style(-wireframe)
@@ -2273,19 +2273,19 @@
     set font "Arial 8"
     set lineht [font metrics $font -linespace]
-    
+
     set ih [image height $_image(legend)]
     set iy [expr $y - ($lineht + 2)]
 
     if { [string match "component*" $fname] } {
-	set title ""
+        set title ""
     } else {
-	if { [info exists _fields($fname)] } {
-	    foreach { title units } $_fields($fname) break
-	    if { $units != "" } {
-		set title [format "%s (%s)" $title $units]
-	    }
-	} else {
-	    set title $fname
-	}
+        if { [info exists _fields($fname)] } {
+            foreach { title units } $_fields($fname) break
+            if { $units != "" } {
+                set title [format "%s (%s)" $title $units]
+            }
+        } else {
+            set title $fname
+        }
     }
     # If there's a legend title, increase the offset by the line height.
@@ -2301,6 +2301,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)
 
@@ -2313,5 +2313,5 @@
         set value 0.0
     }
-    set tx [expr $x + 15] 
+    set tx [expr $x + 15]
     set ty [expr $y - 5]
     if { [info exists _isolines($y)] } {
@@ -2320,5 +2320,5 @@
         Rappture::Tooltip::text $c [format "$title %g" $value]
     }
-    Rappture::Tooltip::tooltip show $c +$tx,+$ty    
+    Rappture::Tooltip::tooltip show $c +$tx,+$ty
 }
 
@@ -2354,14 +2354,14 @@
 
 #
-# ReceiveLegend -- 
-#
-#	Invoked automatically whenever the "legend" command comes in from
-#	the rendering server.  Indicates that binary image data with the
-#	specified <size> will follow.
+# ReceiveLegend --
+#
+#   Invoked automatically whenever the "legend" command comes in from
+#   the rendering server.  Indicates that binary image data with the
+#   specified <size> will follow.
 #
 itcl::body Rappture::VtkIsosurfaceViewer::ReceiveLegend { colormap title min max size } {
     #puts stderr "ReceiveLegend colormap=$colormap title=$title range=$min,$max size=$size"
     set _title $title
-    regsub {\(mag\)} $title "" _title 
+    regsub {\(mag\)} $title "" _title
     if { [IsConnected] } {
         set bytes [ReceiveBytes $size]
@@ -2372,6 +2372,6 @@
         #puts stderr "read $size bytes for [image width $_image(legend)]x[image height $_image(legend)] legend>"
         if { [catch {DrawLegend} errs] != 0 } {
-	    global errorInfo
-	    puts stderr "errs=$errs errorInfo=$errorInfo"
+            global errorInfo
+            puts stderr "errs=$errs errorInfo=$errorInfo"
         }
     }
@@ -2392,47 +2392,47 @@
 
     if { [string match "component*" $fname] } {
-	set title ""
+        set title ""
     } else {
-	if { [info exists _fields($fname)] } {
-	    foreach { title units } $_fields($fname) break
-	    if { $units != "" } {
-		set title [format "%s (%s)" $title $units]
-	    }
-	} else {
-	    set title $fname
-	}
+        if { [info exists _fields($fname)] } {
+            foreach { title units } $_fields($fname) break
+            if { $units != "" } {
+                set title [format "%s (%s)" $title $units]
+            }
+        } else {
+            set title $fname
+        }
     }
     set x [expr $w - 2]
     if { !$_settings(-legendvisible) } {
-	$c delete legend
-	return
-    } 
+        $c delete legend
+        return
+    }
     if { [$c find withtag "legend"] == "" } {
-	set y 2 
-	# If there's a legend title, create a text item for the title.
+        set y 2
+        # If there's a legend title, create a text item for the title.
         $c create text $x $y \
-	    -anchor ne \
-	    -fill $itk_option(-plotforeground) -tags "title legend" \
-	    -font $font 
+            -anchor ne \
+            -fill $itk_option(-plotforeground) -tags "title legend" \
+            -font $font
         if { $title != "" } {
             incr y $lineht
         }
-	$c create text $x $y \
-	    -anchor ne \
-	    -fill $itk_option(-plotforeground) -tags "vmax legend" \
-	    -font $font
-	incr y $lineht
-	$c create image $x $y \
-	    -anchor ne \
-	    -image $_image(legend) -tags "colormap legend"
-	$c create rectangle $x $y 1 1 \
-	    -fill "" -outline "" -tags "sensor legend"
-	$c create text $x [expr {$h-2}] \
-	    -anchor se \
-	    -fill $itk_option(-plotforeground) -tags "vmin legend" \
-	    -font $font
-	$c bind sensor <Enter> [itcl::code $this EnterLegend %x %y]
-	$c bind sensor <Leave> [itcl::code $this LeaveLegend]
-	$c bind sensor <Motion> [itcl::code $this MotionLegend %x %y]
+        $c create text $x $y \
+            -anchor ne \
+            -fill $itk_option(-plotforeground) -tags "vmax legend" \
+            -font $font
+        incr y $lineht
+        $c create image $x $y \
+            -anchor ne \
+            -image $_image(legend) -tags "colormap legend"
+        $c create rectangle $x $y 1 1 \
+            -fill "" -outline "" -tags "sensor legend"
+        $c create text $x [expr {$h-2}] \
+            -anchor se \
+            -fill $itk_option(-plotforeground) -tags "vmin legend" \
+            -font $font
+        $c bind sensor <Enter> [itcl::code $this EnterLegend %x %y]
+        $c bind sensor <Leave> [itcl::code $this LeaveLegend]
+        $c bind sensor <Motion> [itcl::code $this MotionLegend %x %y]
     }
     $c delete isoline
@@ -2453,8 +2453,8 @@
         }
         set tags "isoline legend"
-	set offset [expr 2 + $lineht]
-	if { $title != "" } {
-	    incr offset $lineht
-	}
+        set offset [expr 2 + $lineht]
+        if { $title != "" } {
+            incr offset $lineht
+        }
         foreach value $_contourList(values) {
             set norm [expr 1.0 - (($value - $vmin) / $range)]
@@ -2475,6 +2475,6 @@
     if { [info exists _limits($_curFldName)] } {
         foreach { vmin vmax } $_limits($_curFldName) break
-	$c itemconfigure vmin -text [format %g $vmin]
-	$c itemconfigure vmax -text [format %g $vmax]
+        $c itemconfigure vmin -text [format %g $vmin]
+        $c itemconfigure vmax -text [format %g $vmax]
     }
     set y 2
@@ -2482,6 +2482,6 @@
     if { $title != "" } {
         $c itemconfigure title -text $title
-	$c coords title $x $y
-	incr y $lineht
+        $c coords title $x $y
+        incr y $lineht
         $c raise title
     }
@@ -2506,5 +2506,5 @@
 # ----------------------------------------------------------------------
 itcl::body Rappture::VtkIsosurfaceViewer::Combo {option} {
-    set c $itk_component(view) 
+    set c $itk_component(view)
     switch -- $option {
         post {
@@ -2521,5 +2521,5 @@
         }
         deactivate {
-            $c itemconfigure title -fill $itk_option(-plotforeground) 
+            $c itemconfigure title -fill $itk_option(-plotforeground)
         }
         invoke {
@@ -2539,5 +2539,5 @@
     # Keep track of the colormaps that we build.
     if { ![info exists _colormaps($name)] } {
-        BuildColormap $name 
+        BuildColormap $name
         set _colormaps($name) 1
     }
@@ -2561,5 +2561,5 @@
 }
 
-itcl::body Rappture::VtkIsosurfaceViewer::SetOrientation { side } { 
+itcl::body Rappture::VtkIsosurfaceViewer::SetOrientation { side } {
     array set positions {
         front "1 0 0 0"
@@ -2582,5 +2582,5 @@
 }
 
-itcl::body Rappture::VtkIsosurfaceViewer::GenerateContourList {} { 
+itcl::body Rappture::VtkIsosurfaceViewer::GenerateContourList {} {
     if { ![info exists _limits($_curFldName)] } {
         puts stderr "no _curFldName"
@@ -2605,5 +2605,5 @@
 }
 
-itcl::body Rappture::VtkIsosurfaceViewer::SetCurrentFieldName { dataobj } { 
+itcl::body Rappture::VtkIsosurfaceViewer::SetCurrentFieldName { dataobj } {
     set _first $dataobj
     $itk_component(field) choices delete 0 end
