Index: trunk/gui/scripts/vtkstreamlinesviewer.tcl
===================================================================
--- trunk/gui/scripts/vtkstreamlinesviewer.tcl	(revision 3394)
+++ trunk/gui/scripts/vtkstreamlinesviewer.tcl	(revision 3400)
@@ -614,5 +614,4 @@
         # Remove it from the dataobj list.
         set _dlist [lreplace $_dlist $pos $pos]
-        SendCmd "dataset visible 0"
         array unset _obj2ovride $dataobj-*
         array unset _settings $dataobj-*
@@ -1029,11 +1028,15 @@
 	DoResize
 	InitSettings axisXGrid axisYGrid axisZGrid axis-mode \
-	    axesVisible axisLabelsVisible \
-    }
-    #SendCmd "imgflush"
+	    axesVisible axisLabelsVisible 
+        # This "imgflush" is to force an image returned before vtkvis starts
+        # reading a (big) dataset.  This will display an empty plot with axes
+        # at the correct image size.
+        SendCmd "imgflush"
+    }
 
     set _limits(zmin) ""
     set _limits(zmax) ""
     set _first ""
+    SendCmd "dataset visible 0"
     foreach dataobj [get -objects] {
         if { [info exists _obj2ovride($dataobj-raise)] &&  $_first == "" } {
@@ -1065,6 +1068,4 @@
             if { [info exists _obj2ovride($dataobj-raise)] } {
                 SendCmd "dataset visible 1 $tag"
-            } else {
-                SendCmd "dataset visible 0 $tag"
             }
         }
@@ -1118,17 +1119,20 @@
     }
 
-    InitSettings streamlinesVisible streamlines-palette volumeVisible 
-
     if { $_reset } {
         InitSettings streamlinesSeedsVisible streamlinesOpacity \
-            streamlinesNumSeeds streamlinesLighting \
-            streamlines-palette streamlines-field \
-            volumeEdges volumeLighting volumeOpacity volumeWireframe \
+            streamlinesVisible streamlinesPalette \
+            streamlinesLighting \
+            streamlinesPalette streamlinesField \
+            volumeVisible volumeEdges volumeLighting volumeOpacity \
+            volumeWireframe \
 	    cutplaneVisible \
 	    cutplaneXPosition cutplaneYPosition cutplaneZPosition \
 	    cutplaneXVisible cutplaneYVisible cutplaneZVisible
-	#
+
+        # FIXME: Don't know exactly why this "imgflush" is needed. 
+        #        But this makes the "camera reset" below to work correctly
+        SendCmd "imgflush"
+
 	# Reset the camera and other view parameters
-	#
 	set q [list $_view(qw) $_view(qx) $_view(qy) $_view(qz)]
 	$_arcball quaternion $q
@@ -1390,19 +1394,13 @@
             set val $_settings(volumeOpacity)
             set sval [expr { 0.01 * double($val) }]
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "polydata opacity $sval $dataset"
-            }
+            SendCmd "polydata opacity $sval"
         }
         "volumeWireframe" {
             set bool $_settings(volumeWireframe)
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "polydata wireframe $bool $dataset"
-            }
+            SendCmd "polydata wireframe $bool"
         }
         "volumeVisible" {
             set bool $_settings(volumeVisible)
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "polydata visible $bool $dataset"
-            }
+            SendCmd "polydata visible $bool"
             if { $bool } {
                 Rappture::Tooltip::for $itk_component(volume) \
@@ -1415,13 +1413,9 @@
         "volumeLighting" {
             set bool $_settings(volumeLighting)
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "polydata lighting $bool $dataset"
-            }
+            SendCmd "polydata lighting $bool"
         }
         "volumeEdges" {
             set bool $_settings(volumeEdges)
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "polydata edges $bool $dataset"
-            }
+            SendCmd "polydata edges $bool"
         }
         "axesVisible" {
@@ -1446,32 +1440,22 @@
         "cutplaneEdges" {
             set bool $_settings($what)
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "cutplane edges $bool $dataset"
-            }
+            SendCmd "cutplane edges $bool"
         }
         "cutplaneVisible" {
             set bool $_settings($what)
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "cutplane visible $bool $dataset"
-            }
+            SendCmd "cutplane visible $bool"
         }
         "cutplaneWireframe" {
             set bool $_settings($what)
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "cutplane wireframe $bool $dataset"
-            }
+            SendCmd "cutplane wireframe $bool"
         }
         "cutplaneLighting" {
             set bool $_settings($what)
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "cutplane lighting $bool $dataset"
-            }
+            SendCmd "cutplane lighting $bool"
         }
         "cutplaneOpacity" {
             set val $_settings($what)
             set sval [expr { 0.01 * double($val) }]
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "cutplane opacity $sval $dataset"
-            }
+            SendCmd "cutplane opacity $sval"
         }
         "cutplaneXVisible" - "cutplaneYVisible" - "cutplaneZVisible" {
@@ -1485,21 +1469,15 @@
                     -troughcolor grey82
             }
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "cutplane axis $axis $bool $dataset"
-            }
+            SendCmd "cutplane axis $axis $bool"
         }
         "cutplaneXPosition" - "cutplaneYPosition" - "cutplaneZPosition" {
             set axis [string tolower [string range $what 8 8]]
             set pos [expr $_settings($what) * 0.01]
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "cutplane slice ${axis} ${pos} $dataset"
-            }
+            SendCmd "cutplane slice ${axis} ${pos}"
             set _cutplanePending 0
         }
         "streamlinesSeedsVisible" {
             set bool $_settings($what)
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "streamlines seed visible $bool $dataset"
-            }
+            SendCmd "streamlines seed visible $bool"
         }
         "streamlinesNumSeeds" {
@@ -1509,7 +1487,5 @@
         "streamlinesVisible" {
             set bool $_settings($what)
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "streamlines visible $bool $dataset"
-            }
+            SendCmd "streamlines visible $bool"
             if { $bool } {
                 Rappture::Tooltip::for $itk_component(streamlines) \
@@ -1523,21 +1499,19 @@
             set mode [$itk_component(streammode) value]
             set _settings(streamlinesMode) $mode
-            foreach dataset [CurrentDatasets -visible] {
-                switch -- $mode {
-                    "lines" {
-                        SendCmd "streamlines lines $dataset"
-                    }
-                    "ribbons" {
-                        SendCmd "streamlines ribbons 3 0 $dataset"
-                    }
-                    "tubes" {
-                        SendCmd "streamlines tubes 5 3 $dataset"
-                    }
-                }
-            }
-        }
-        "streamlines-palette" {
+            switch -- $mode {
+                "lines" {
+                    SendCmd "streamlines lines"
+                }
+                "ribbons" {
+                    SendCmd "streamlines ribbons 3 0"
+                }
+                "tubes" {
+                    SendCmd "streamlines tubes 5 3"
+                }
+            }
+        }
+        "streamlinesPalette" {
             set palette [$itk_component(palette) value]
-            set _settings(streamlines-palette) $palette
+            set _settings(streamlinesPalette) $palette
             foreach dataset [CurrentDatasets -visible $_first] {
                 foreach {dataobj comp} [split $dataset -] break
@@ -1549,25 +1523,19 @@
             set val $_settings(streamlinesOpacity)
             set sval [expr { 0.01 * double($val) }]
-            foreach dataset [CurrentDatasets -visible $_first] {
-                SendCmd "streamlines opacity $sval $dataset"
-            }
+            SendCmd "streamlines opacity $sval"
         }
         "streamlinesScale" {
             set val $_settings(streamlinesScale)
             set sval [expr { 0.01 * double($val) }]
-            foreach dataset [CurrentDatasets -visible $_first] {
-                SendCmd "streamlines scale $sval $sval $sval $dataset"
-            }
+            SendCmd "streamlines scale $sval $sval $sval"
         }
         "streamlinesLighting" {
             set bool $_settings(streamlinesLighting)
-            foreach dataset [CurrentDatasets -visible $_first] {
-                SendCmd "streamlines lighting $bool $dataset"
-            }
-        }
-        "streamlines-field" {
+            SendCmd "streamlines lighting $bool"
+        }
+        "streamlinesField" {
             set new [$itk_component(field) value]
             set value [$itk_component(field) translate $new]
-            set _settings(streamlines-field) $value
+            set _settings(streamlinesField) $value
             if { [info exists _scalarFields($new)] } {
                 set name $_scalarFields($new)
@@ -1582,8 +1550,6 @@
                 return
             }
-            foreach dataset [CurrentDatasets -visible] {
-                SendCmd "streamlines colormode $_colorMode ${name} $dataset"
-                SendCmd "cutplane colormode $_colorMode ${name} $dataset"
-            }
+            SendCmd "streamlines colormode $_colorMode ${name}"
+            SendCmd "cutplane colormode $_colorMode ${name}"
             set _legendPending 1
         }
@@ -1907,5 +1873,5 @@
     }
     bind $inner.field <<Value>> \
-        [itcl::code $this AdjustSetting streamlines-field]
+        [itcl::code $this AdjustSetting streamlinesField]
 
     label $inner.palette_l -text "Palette" -font "Arial 9" 
@@ -1933,5 +1899,5 @@
     $itk_component(palette) value "BCGYR"
     bind $inner.palette <<Value>> \
-        [itcl::code $this AdjustSetting streamlines-palette]
+        [itcl::code $this AdjustSetting streamlinesPalette]
 
     blt::table $inner \
@@ -2353,26 +2319,8 @@
     }
     SendCmd "cutplane add $tag"
-    SendCmd "cutplane edges 0 $tag"
-    SendCmd "cutplane wireframe 0 $tag"
-    SendCmd "cutplane lighting 1 $tag"
-    SendCmd "cutplane linewidth 1 $tag"
-    #SendCmd "cutplane linecolor 1 1 1 $tag"
-    #SendCmd "cutplane visible $tag"
-    foreach axis { x y z } {
-        SendCmd "cutplane slice $axis 0.5 $tag"
-        SendCmd "cutplane axis $axis 0 $tag"
-    }
-
     SendCmd "polydata add $tag"
-    SendCmd "polydata edges $settings(-edges) $tag"
     set _settings(volumeEdges) $settings(-edges)
-    SendCmd "polydata color [Color2RGB $settings(-color)] $tag"
-    SendCmd "polydata lighting $settings(-lighting) $tag"
     set _settings(volumeLighting) $settings(-lighting)
-    SendCmd "polydata linecolor [Color2RGB $settings(-edgecolor)] $tag"
-    SendCmd "polydata linewidth $settings(-linewidth) $tag"
-    SendCmd "polydata opacity $settings(-opacity) $tag"
     set _settings(volumeOpacity) $settings(-opacity)
-    SendCmd "polydata wireframe $settings(-wireframe) $tag"
     set _settings(volumeWireframe) $settings(-wireframe)
     set _settings(volumeOpacity) [expr $settings(-opacity) * 100.0]
@@ -2615,5 +2563,5 @@
         invoke {
             $itk_component(field) value $_currentField
-            AdjustSetting streamlines-field
+            AdjustSetting streamlinesField
         }
         default {
