Index: trunk/gui/scripts/Makefile.in
===================================================================
--- trunk/gui/scripts/Makefile.in	(revision 2720)
+++ trunk/gui/scripts/Makefile.in	(revision 2721)
@@ -129,4 +129,5 @@
 		$(srcdir)/vtkcontourviewer.tcl \
 		$(srcdir)/vtkstreamlinesviewer.tcl \
+		$(srcdir)/vtkvolumeviewer.tcl \
 		$(srcdir)/xylegend.tcl \
 		$(srcdir)/xyprint.tcl \
Index: trunk/gui/scripts/field.tcl
===================================================================
--- trunk/gui/scripts/field.tcl	(revision 2720)
+++ trunk/gui/scripts/field.tcl	(revision 2721)
@@ -811,5 +811,5 @@
             set _comp2dims($cname) "3D"
             set _comp2dx($cname)  [$_field get -decode no $cname.dx]
-	    if 0 {
+	    if 1 {
             set data  [$_field get -decode yes $cname.dx]
 	    set file "/tmp/junk.dx"
Index: trunk/gui/src/RpConvertDxToVtk.c
===================================================================
--- trunk/gui/src/RpConvertDxToVtk.c	(revision 2720)
+++ trunk/gui/src/RpConvertDxToVtk.c	(revision 2721)
@@ -15,4 +15,5 @@
 #include <stdlib.h>
 #include <ctype.h>
+#include <math.h>
 #include <limits.h>
 #include <float.h>
@@ -52,22 +53,21 @@
 		  Tcl_Obj *const *objv) 
 {
-    int nx, ny, nz, npts;
-    double x0, y0, z0, dx, dy, dz, ddx, ddy, ddz;
+    Tcl_Obj *objPtr;
     char *p, *pend;
-    int length;
-    double xValueMin, yValueMin, zValueMin;
-    double xValueMax, yValueMax, zValueMax;
-    double xMin, yMin, zMin;
+    char *string;
+    char mesg[2000];
+    double delta[3];
+    double origin[3];
+    double xMax, yMax, zMax, xMin, yMin, zMin;
+    double maxValue[3], minValue[3];
+    int count[3];
+    int length, nComponents, nValues, nPoints;
     int xNum, yNum, zNum;
-    double xMax, yMax, zMax;
-    int nComponents, nValues;
-    char *string;
-    Tcl_Obj *objPtr;
-    char mesg[2000];
     size_t ix;
 
-    dx = dy = dz = 0.0;			/* Suppress compiler warning. */
-    x0 = y0 = z0 = 0.0;			/* May not have an origin line. */
-    nx = ny = nz = npts = 0;		/* Suppress compiler warning. */
+    nComponents = nPoints = 0;
+    delta[0] = delta[1] = delta[2] = 0.0; /* Suppress compiler warning. */
+    origin[0] = origin[1] = origin[2] = 0.0; /* May not have an origin line. */
+    count[0] = count[1] = count[2] = 0; /* Suppress compiler warning. */
 
     if (objc != 2) {
@@ -79,4 +79,5 @@
     for (p = string, pend = p + length; p < pend; /*empty*/) {
 	char *line;
+	double ddx, ddy, ddz;
 
 	line = GetLine(&p, pend);
@@ -88,33 +89,34 @@
 	}
 	if (sscanf(line, "object %*d class gridpositions counts %d %d %d", 
-		   &nx, &ny, &nz) == 3) {
-	    if ((nx < 0) || (ny < 0) || (nz < 0)) {
+		   count, count + 1, count + 2) == 3) {
+	    if ((count[0] < 0) || (count[1] < 0) || (count[2] < 0)) {
 		sprintf(mesg, "invalid grid size: x=%d, y=%d, z=%d", 
-			nx, ny, nz);
-		Tcl_AppendResult(interp, mesg, (char *)NULL);
-		return TCL_ERROR;
-	    }
-	} else if (sscanf(line, "origin %lg %lg %lg", &x0, &y0, &z0) == 3) {
+			count[0], count[1], count[2]);
+		Tcl_AppendResult(interp, mesg, (char *)NULL);
+		return TCL_ERROR;
+	    }
+	} else if (sscanf(line, "origin %lg %lg %lg", origin, origin + 1, 
+		origin + 2) == 3) {
 	    /* Found origin. */
 	} else if (sscanf(line, "delta %lg %lg %lg", &ddx, &ddy, &ddz) == 3) {
-	    /* Found one of the delta lines. */
-	    if (ddx != 0.0) {
-		dx = ddx;
-	    } else if (ddy != 0.0) {
-		dy = ddy;
-	    } else if (ddz != 0.0) {
-		dz = ddz;
-	    }
+	    if (nComponents == 3) {
+		Tcl_AppendResult(interp, "too many delta statements", 
+			(char *)NULL);
+		return TCL_ERROR;
+	    }
+	    delta[nComponents] = sqrt((ddx * ddx) + (ddy * ddy) + (ddz * ddz));
+	    nComponents++;
 	} else if (sscanf(line, "object %*d class array type %*s shape 3"
-		" rank 1 items %d data follows", &npts) == 1) {
-	    if (npts < 0) {
-		sprintf(mesg, "bad # points %d", npts);
+		" rank 1 items %d data follows", &nPoints) == 1) {
+	    if (nPoints < 0) {
+		sprintf(mesg, "bad # points %d", nPoints);
 		Tcl_AppendResult(interp, mesg, (char *)NULL);
 		return TCL_ERROR;
             }	
-	    printf("#points=%d\n", npts);
-	    if (npts != nx*ny*nz) {
+	    printf("#points=%d\n", nPoints);
+	    if (nPoints != count[0]*count[1]*count[2]) {
 		sprintf(mesg, "inconsistent data: expected %d points"
-			" but found %d points", nx*ny*nz, npts);
+			" but found %d points", count[0]*count[1]*count[2], 
+			nPoints);
 		Tcl_AppendResult(interp, mesg, (char *)NULL);
 		return TCL_ERROR;
@@ -122,8 +124,9 @@
 	    break;
 	} else if (sscanf(line, "object %*d class array type %*s rank 0"
-		" times %d data follows", &npts) == 1) {
-	    if (npts != nx*ny*nz) {
+		" times %d data follows", &nPoints) == 1) {
+	    if (nPoints != count[0]*count[1]*count[2]) {
 		sprintf(mesg, "inconsistent data: expected %d points"
-			" but found %d points", nx*ny*nz, npts);
+			" but found %d points", count[0]*count[1]*count[2], 
+			nPoints);
 		Tcl_AppendResult(interp, mesg, (char *)NULL);
 		return TCL_ERROR;
@@ -132,7 +135,8 @@
 	}
     }
-    if (npts != nx*ny*nz) {
+    if (nPoints != count[0]*count[1]*count[2]) {
 	sprintf(mesg, "inconsistent data: expected %d points"
-			" but found %d points", nx*ny*nz, npts);
+			" but found %d points", count[0]*count[1]*count[2], 
+			nPoints);
 	Tcl_AppendResult(interp, mesg, (char *)NULL);
 	return TCL_ERROR;
@@ -143,32 +147,32 @@
     Tcl_AppendToObj(objPtr, "ASCII\n", -1);
     Tcl_AppendToObj(objPtr, "DATASET STRUCTURED_POINTS\n", -1);
-    sprintf(mesg, "DIMENSIONS %d %d %d\n", nx, ny, nz);
-    Tcl_AppendToObj(objPtr, mesg, -1);
-    sprintf(mesg, "ORIGIN %g %g %g\n", x0, y0, z0);
-    Tcl_AppendToObj(objPtr, mesg, -1);
-    sprintf(mesg, "SPACING %g %g %g\n", dx, dy, dx);
-    Tcl_AppendToObj(objPtr, mesg, -1);
-    sprintf(mesg, "POINT_DATA %d\n", npts);
-    Tcl_AppendToObj(objPtr, mesg, -1);
-
-    xValueMin = yValueMin = zValueMin = FLT_MAX;
-    xValueMax = yValueMax = zValueMax = -FLT_MAX;
-    xMin = x0, yMin = y0, zMin = z0;
-    xNum = nx, yNum = ny, zNum = nz;
-    xMax = xMin + dx * xNum;
-    yMax = yMin + dy * yNum;
-    zMax = zMin + dz * zNum;
+    sprintf(mesg, "DIMENSIONS %d %d %d\n", count[0], count[1], count[2]);
+    Tcl_AppendToObj(objPtr, mesg, -1);
+    sprintf(mesg, "ORIGIN %g %g %g\n", origin[0], origin[1], origin[2]);
+    Tcl_AppendToObj(objPtr, mesg, -1);
+    sprintf(mesg, "SPACING %g %g %g\n", delta[0], delta[1], delta[2]);
+    Tcl_AppendToObj(objPtr, mesg, -1);
+    sprintf(mesg, "POINT_DATA %d\n", nPoints);
+    Tcl_AppendToObj(objPtr, mesg, -1);
+
+    minValue[0] = minValue[1] = minValue[2] = DBL_MAX;
+    maxValue[0] = maxValue[1] = maxValue[2] = -DBL_MAX;
+    xMin = origin[0], yMin = origin[1], zMin = origin[2];
+    xNum = count[0], yNum = count[1], zNum = count[2];
+    xMax = origin[0] + delta[0] * count[0];
+    yMax = origin[1] + delta[1] * count[1];
+    zMax = origin[2] + delta[2] * count[2];
     nValues = 0;
-    for (ix = 0; ix < nx; ix++) {
+    for (ix = 0; ix < xNum; ix++) {
 	size_t iy;
 
-	for (iy = 0; iy < ny; iy++) {
+	for (iy = 0; iy < yNum; iy++) {
 	    size_t iz;
 
-	    for (iz = 0; iz < nz; iz++) {
+	    for (iz = 0; iz < zNum; iz++) {
 		const char *line;
 		double vx, vy, vz;
 
-		if ((p == pend) || (nValues > (size_t)npts)) {
+		if ((p == pend) || (nValues > (size_t)nPoints)) {
 		    break;
 		}
@@ -178,18 +182,18 @@
 		}
 		if (sscanf(line, "%lg %lg %lg", &vx, &vy, &vz) == 3) {
-		    if (vx < xValueMin) {
-			xValueMin = vx;
-		    } else if (vx > xValueMax) {
-			xValueMax = vx;
+		    if (vx < minValue[0]) {
+			minValue[0] = vx;
+		    } else if (vx > maxValue[0]) {
+			maxValue[0] = vx;
 		    }
-		    if (vy < yValueMin) {
-			yValueMin = vy;
-		    } else if (vy > yValueMax) {
-			yValueMax = vy;
+		    if (vy < minValue[1]) {
+			minValue[1] = vy;
+		    } else if (vy > maxValue[1]) {
+			maxValue[1] = vy;
 		    }
-		    if (vz < zValueMin) {
-			zValueMin = vz;
-		    } else if (vz > zValueMax) {
-			zValueMax = vz;
+		    if (vz < minValue[2]) {
+			minValue[2] = vz;
+		    } else if (vz > maxValue[2]) {
+			maxValue[2] = vz;
 		    }
 		    sprintf(mesg, "%g %g %g\n", vx, vy, vz);
@@ -201,7 +205,7 @@
     }
     /* Make sure that we read all of the expected points. */
-    if (nValues != (size_t)npts) {
+    if (nValues != (size_t)nPoints) {
 	sprintf(mesg, "inconsistent data: expected %d points"
-			" but found %d points", npts, nValues);
+			" but found %d points", nPoints, nValues);
 	Tcl_AppendResult(interp, mesg, (char *)NULL);
 	Tcl_DecrRefCount(objPtr);
Index: trunk/packages/vizservers/nanovis/Command.cpp
===================================================================
--- trunk/packages/vizservers/nanovis/Command.cpp	(revision 2720)
+++ trunk/packages/vizservers/nanovis/Command.cpp	(revision 2721)
@@ -1227,4 +1227,5 @@
 	}
         Rappture::Outcome context;
+	sleep(30);
 #if ISO_TEST
         volPtr = load_volume_stream2(context, tag, fdata);
Index: trunk/packages/vizservers/nanovis/config.h
===================================================================
--- trunk/packages/vizservers/nanovis/config.h	(revision 2720)
+++ trunk/packages/vizservers/nanovis/config.h	(revision 2721)
@@ -45,5 +45,5 @@
  * runtime if mesh decimation is required]
  */
-#define ISO_TEST                1
+#define ISO_TEST                0
 
 /* 
