Index: trunk/packages/vizservers/nanovis/dxReader.cpp
===================================================================
--- trunk/packages/vizservers/nanovis/dxReader.cpp	(revision 2847)
+++ trunk/packages/vizservers/nanovis/dxReader.cpp	(revision 2849)
@@ -27,4 +27,5 @@
 #include <unistd.h>
 
+#include <RpOutcome.h>
 #include <RpField1D.h>
 #include <RpFieldRect3D.h>
@@ -36,14 +37,20 @@
 #include "nanovis.h"
 #include "Unirect.h"
+#include "Volume.h"
 #include "ZincBlendeVolume.h"
 #include "NvZincBlendeReconstructor.h"
-
-/* Load a 3D volume from a dx-format file
+#ifdef USE_POINTSET_RENDERER
+#include "PointSet.h"
+#endif
+
+/**
+ * \brief Load a 3D volume from a dx-format file
  */
 Volume *
-load_volume_stream2(Rappture::Outcome &result, const char *tag, 
+load_volume_stream2(Rappture::Outcome& result, const char *tag,
                     std::iostream& fin)
 {
     TRACE("load_volume_stream2 %s\n", tag);
+
     Rappture::MeshTri2D xymesh;
     int dummy, nx, ny, nz, nxy, npts;
@@ -52,21 +59,24 @@
 
     int isrect = 1;
-    dx = dy = dz = 0.0;         // Suppress compiler warning.
-    x0 = y0 = z0 = 0.0;		// May not have an origin line.
+
+    dx = dy = dz = 0.0;
+    x0 = y0 = z0 = 0.0; // May not have an origin line.
     nx = ny = nz = npts = nxy = 0;
     do {
-        fin.getline(line,sizeof(line)-1);
-        for (start=&line[0]; *start == ' ' || *start == '\t'; start++)
+        fin.getline(line, sizeof(line) - 1);
+        for (start = line; *start == ' ' || *start == '\t'; start++)
             ;  // skip leading blanks
 
         if (*start != '#') {  // skip comment lines
-            if (sscanf(start, "object %d class gridpositions counts %d %d %d", 
+            if (sscanf(start, "object %d class gridpositions counts %d %d %d",
                        &dummy, &nx, &ny, &nz) == 4) {
                 // found grid size
                 isrect = 1;
-            } else if (sscanf(start, "object %d class array type float rank 1 shape 3 items %d data follows", &dummy, &nxy) == 2) {
+            } else if (sscanf(start, "object %d class array type float rank 1 shape 3 items %d data follows",
+                              &dummy, &nxy) == 2) {
                 isrect = 0;
+
                 double xx, yy, zz;
-                for (int i=0; i < nxy; i++) {
+                for (int i = 0; i < nxy; i++) {
                     fin.getline(line,sizeof(line)-1);
                     if (sscanf(line, "%lg %lg %lg", &xx, &yy, &zz) == 3) {
@@ -91,5 +101,5 @@
                 ftmp << xymesh.rangeMin(Rappture::xaxis) << " "
                      << xymesh.rangeMax(Rappture::yaxis) << std::endl;
-                for (int i=0; i < nxy; i++) {
+                for (int i = 0; i < nxy; i++) {
                     ftmp << xymesh.atNode(i).x() << " " << xymesh.atNode(i).y() << std::endl;
                 }
@@ -115,5 +125,6 @@
                     return NULL;
                 }
-                unlink(fpts), unlink(fcells);
+                unlink(fpts);
+                unlink(fcells);
             } else if (sscanf(start, "object %d class regulararray count %d", &dummy, &nz) == 2) {
                 // found z-grid
@@ -140,18 +151,20 @@
                     return NULL;
                 }
-            } else if (sscanf(start, "object %d class array type %s rank 0 items %d data follows", &dummy, type, &npts) == 3) {
+            } else if (sscanf(start, "object %d class array type %s rank 0 items %d data follows",
+                              &dummy, type, &npts) == 3) {
                 if (isrect && (npts != nx*ny*nz)) {
-                    result.addError("inconsistent data: expected %d points "
+                    result.addError("inconsistent data: expected %d points"
                                     " but found %d points", nx*ny*nz, npts);
                     return NULL;
                 } else if (!isrect && (npts != nxy*nz)) {
-                    result.addError("inconsistent data: expected %d points "
+                    result.addError("inconsistent data: expected %d points"
                                     " but found %d points", nxy*nz, npts);
                     return NULL;
                 }
                 break;
-            } else if (sscanf(start, "object %d class array type %s rank 0 times %d data follows", &dummy, type, &npts) == 3) {
+            } else if (sscanf(start, "object %d class array type %s rank 0 times %d data follows",
+                              &dummy, type, &npts) == 3) {
                 if (npts != nx*ny*nz) {
-                    result.addError("inconsistent data: expected %d points "
+                    result.addError("inconsistent data: expected %d points"
                                     " but found %d points", nx*ny*nz, npts);
                     return NULL;
@@ -171,4 +184,11 @@
     Volume *volPtr = NULL;
     if (isrect) {
+        float *data = new float[nx *  ny *  nz * 4];
+        memset(data, 0, nx*ny*nz*4);
+
+        double vmin = 1e21;
+        double nzero_min = 1e21;
+        double vmax = -1e21;
+
         double dval[6];
         int nread = 0;
@@ -176,19 +196,14 @@
         int iy = 0;
         int iz = 0;
-        float* data = new float[nx *  ny *  nz * 4];
-        memset(data, 0, nx*ny*nz*4);
-        double vmin = 1e21;
-        double nzero_min = 1e21;
-        double vmax = -1e21;
-        
-        
+
         while (!fin.eof() && nread < npts) {
             fin.getline(line,sizeof(line)-1);
-            int n = sscanf(line, "%lg %lg %lg %lg %lg %lg", &dval[0], &dval[1], &dval[2], &dval[3], &dval[4], &dval[5]);
-            
-            for (int p=0; p < n; p++) {
+            int n = sscanf(line, "%lg %lg %lg %lg %lg %lg",
+                           &dval[0], &dval[1], &dval[2], &dval[3], &dval[4], &dval[5]);
+
+            for (int p = 0; p < n; p++) {
                 int nindex = (iz*nx*ny + iy*nx + ix) * 4;
                 data[nindex] = dval[p];
-                
+
                 if (dval[p] < vmin) {
                     vmin = dval[p];
@@ -196,8 +211,8 @@
                     vmax = dval[p];
                 }
-                if (dval[p] != 0.0f && dval[p] < nzero_min) {
+                if (dval[p] != 0.0 && dval[p] < nzero_min) {
                     nzero_min = dval[p];
                 }
-                
+
                 nread++;
                 if (++iz >= nz) {
@@ -210,12 +225,12 @@
             }
         }
-        
+
         // make sure that we read all of the expected points
         if (nread != nx*ny*nz) {
-            result.addError("inconsistent data: expected %d points "
+            result.addError("inconsistent data: expected %d points"
                             " but found %d points", nx*ny*nz, nread);
             return NULL;
         }
-        
+
         double dv = vmax - vmin;
         int count = nx*ny*nz;
@@ -225,21 +240,19 @@
             dv = 1.0;
         }
-        
+
         for (int i = 0; i < count; ++i) {
             v = data[ngen];
             // scale all values [0-1], -1 => out of bounds
-            //
-            // INSOO
             v = (isnan(v)) ? -1.0 : (v - vmin)/dv;
             data[ngen] = v;
             ngen += 4;
         }
-        
+
         computeSimpleGradient(data, nx, ny, nz);
-        
+
         dx = nx;
         dy = ny;
         dz = nz;
-        
+
         volPtr = NanoVis::load_volume(tag, nx, ny, nz, 4, data,
                                       vmin, vmax, nzero_min);
@@ -250,9 +263,8 @@
         volPtr->update_pending = true;
         delete [] data;
-        
     } else {
         Rappture::Mesh1D zgrid(z0, z0+nz*dz, nz);
         Rappture::FieldPrism3D field(xymesh, zgrid);
-        
+
         double dval;
         int nread = 0;
@@ -268,5 +280,5 @@
                 int nid = nxy*iz + ixy;
                 field.define(nid, dval);
-                
+
                 nread++;
                 if (++iz >= nz) {
@@ -276,12 +288,12 @@
             }
         }
-        
+
         // make sure that we read all of the expected points
         if (nread != nxy*nz) {
-            result.addError("inconsistent data: expected %d points "
-                            "but found %d points", nxy*nz, nread);
+            result.addError("inconsistent data: expected %d points"
+                            " but found %d points", nxy*nz, nread);
             return NULL;
         }
-        
+
         // figure out a good mesh spacing
         int nsample = 30;
@@ -293,5 +305,5 @@
         dz = field.rangeMax(Rappture::zaxis) - field.rangeMin(Rappture::zaxis);
         double dmin = pow((dx*dy*dz)/(nsample*nsample*nsample), 0.333);
-        
+
         nx = (int)ceil(dx/dmin);
         ny = (int)ceil(dy/dmin);
@@ -304,22 +316,23 @@
 #endif
         float *data = new float[4*nx*ny*nz];
-        
+
         double vmin = field.valueMin();
         double dv = field.valueMax() - field.valueMin();
         if (dv == 0.0) {
-            dv = 1.0; 
-        }
+            dv = 1.0;
+        }
+
         // generate the uniformly sampled data that we need for a volume
         int ngen = 0;
         double nzero_min = 0.0;
-        for (iz=0; iz < nz; iz++) {
+        for (int iz = 0; iz < nz; iz++) {
             double zval = z0 + iz*dmin;
-            for (int iy=0; iy < ny; iy++) {
+            for (int iy = 0; iy < ny; iy++) {
                 double yval = y0 + iy*dmin;
-                for (int ix=0; ix < nx; ix++) {
+                for (int ix = 0; ix < nx; ix++) {
                     double xval = x0 + ix*dmin;
-                    double v = field.value(xval,yval,zval);
-                    
-                    if (v != 0.0f && v < nzero_min) {
+                    double v = field.value(xval, yval, zval);
+
+                    if (v != 0.0 && v < nzero_min) {
                         nzero_min = v;
                     }
@@ -327,10 +340,10 @@
                     v = (isnan(v)) ? -1.0 : (v - vmin)/dv;
                     data[ngen] = v;
-                    
+
                     ngen += 4;
                 }
             }
         }
-        
+
         // FIXME: This next section of code should be replaced by a
         // call to the computeSimpleGradient() function. There is a slight
@@ -346,6 +359,4 @@
                 for (int ix=0; ix < nx; ix++) {
                     // gradient in x-direction
-                    //double valm1 = (ix == 0) ? 0.0 : data[ngen-4];
-                    //double valp1 = (ix == nx-1) ? 0.0 : data[ngen+4];
                     double valm1 = (ix == 0) ? 0.0 : data[ngen-4];
                     double valp1 = (ix == nx-1) ? 0.0 : data[ngen+4];
@@ -381,7 +392,8 @@
             }
         }
-        
-        volPtr = NanoVis::load_volume(tag, nx, ny, nz, 4, data, 
-                field.valueMin(), field.valueMax(), nzero_min);
+
+        volPtr = NanoVis::load_volume(tag, nx, ny, nz, 4, data,
+                                      field.valueMin(), field.valueMax(),
+                                      nzero_min);
         volPtr->xAxis.SetRange(field.rangeMin(Rappture::xaxis),
                                field.rangeMax(Rappture::xaxis));
@@ -394,4 +406,5 @@
         delete [] data;
     }
+
     //
     // Center this new volume on the origin.
@@ -407,9 +420,12 @@
 }
 
+/**
+ * \brief Load a 3D volume from a dx-format file
+ */
 Volume *
-load_volume_stream(Rappture::Outcome &result, const char *tag, 
+load_volume_stream(Rappture::Outcome& result, const char *tag,
                    std::iostream& fin)
 {
-    TRACE("load_volume_stream\n");
+    TRACE("load_volume_stream %s\n", tag);
 
     Rappture::MeshTri2D xymesh;
@@ -429,16 +445,18 @@
             return NULL;
         }
-        for (start=line; *start == ' ' || *start == '\t'; start++)
+        for (start = line; *start == ' ' || *start == '\t'; start++)
             ;  // skip leading blanks
 
         if (*start != '#') {  // skip comment lines
-            if (sscanf(start, "object %d class gridpositions counts %d %d %d", &dummy, &nx, &ny, &nz) == 4) {
+            if (sscanf(start, "object %d class gridpositions counts %d %d %d",
+                       &dummy, &nx, &ny, &nz) == 4) {
                 // found grid size
                 isrect = 1;
-            } else if (sscanf(start, "object %d class array type float rank 1 shape 3 items %d data follows", &dummy, &nxy) == 2) {
+            } else if (sscanf(start, "object %d class array type float rank 1 shape 3 items %d data follows",
+                              &dummy, &nxy) == 2) {
                 isrect = 0;
 
                 double xx, yy, zz;
-                for (int i=0; i < nxy; i++) {
+                for (int i = 0; i < nxy; i++) {
                     fin.getline(line,sizeof(line)-1);
                     if (sscanf(line, "%lg %lg %lg", &xx, &yy, &zz) == 3) {
@@ -463,7 +481,6 @@
                 ftmp << xymesh.rangeMin(Rappture::xaxis) << " "
                      << xymesh.rangeMax(Rappture::yaxis) << std::endl;
-                for (int i=0; i < nxy; i++) {
+                for (int i = 0; i < nxy; i++) {
                     ftmp << xymesh.atNode(i).x() << " " << xymesh.atNode(i).y() << std::endl;
-
                 }
                 ftmp.close();
@@ -496,8 +513,13 @@
             } else if (sscanf(start, "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; }
-            } else if (sscanf(start, "object %d class array type %s rank 0 items %d data follows", &dummy, type, &npts) == 3) {
+                if (ddx != 0.0) {
+                    dx = ddx;
+                } else if (ddy != 0.0) {
+                    dy = ddy;
+                } else if (ddz != 0.0) {
+                    dz = ddz;
+                }
+            } else if (sscanf(start, "object %d class array type %s rank 0 items %d data follows",
+                              &dummy, type, &npts) == 3) {
                 if (isrect && (npts != nx*ny*nz)) {
                     result.addError("inconsistent data: expected %d points"
@@ -510,5 +532,6 @@
                 }
                 break;
-            } else if (sscanf(start, "object %d class array type %s rank 0 times %d data follows", &dummy, type, &npts) == 3) {
+            } else if (sscanf(start, "object %d class array type %s rank 0 times %d data follows",
+                              &dummy, type, &npts) == 3) {
                 if (npts != nx*ny*nz) {
                     result.addError("inconsistent data: expected %d points"
@@ -525,5 +548,5 @@
         return NULL;
     }
-    Volume *volPtr = 0;
+    Volume *volPtr = NULL;
     if (isrect) {
         Rappture::Mesh1D xgrid(x0, x0+nx*dx, nx);
@@ -537,4 +560,5 @@
         int iy = 0;
         int iz = 0;
+
         while (!fin.eof() && nread < npts) {
             fin.getline(line,sizeof(line)-1);
@@ -543,7 +567,7 @@
                 return NULL;
             }
-            int n = sscanf(line, "%lg %lg %lg %lg %lg %lg", &dval[0], &dval[1], &dval[2], &dval[3], &dval[4], &dval[5]);
-            
-            for (int p=0; p < n; p++) {
+            int n = sscanf(line, "%lg %lg %lg %lg %lg %lg",
+                           &dval[0], &dval[1], &dval[2], &dval[3], &dval[4], &dval[5]);
+            for (int p = 0; p < n; p++) {
                 int nindex = iz*nx*ny + iy*nx + ix;
                 field.define(nindex, dval[p]);
@@ -558,5 +582,5 @@
             }
         }
-        
+
         // make sure that we read all of the expected points
         if (nread != nx*ny*nz) {
@@ -565,5 +589,5 @@
             return NULL;
         }
-        
+
         // figure out a good mesh spacing
         int nsample = 30;
@@ -572,9 +596,9 @@
         dz = field.rangeMax(Rappture::zaxis) - field.rangeMin(Rappture::zaxis);
         double dmin = pow((dx*dy*dz)/(nsample*nsample*nsample), 0.333);
-        
+
         nx = (int)ceil(dx/dmin);
         ny = (int)ceil(dy/dmin);
         nz = (int)ceil(dz/dmin);
-        
+
 #ifndef NV40
         // must be an even power of 2 for older cards
@@ -583,6 +607,6 @@
         nz = (int)pow(2.0, ceil(log10((double)nz)/log10(2.0)));
 #endif
-        
-        //#define _SOBEL
+
+//#define _SOBEL
 #ifdef _SOBEL_
         const int step = 1;
@@ -590,19 +614,19 @@
         int ngen = 0;
         double nzero_min = 0.0;
-        for (int iz=0; iz < nz; iz++) {
+        for (int iz = 0; iz < nz; iz++) {
             double zval = z0 + iz*dmin;
-            for (int iy=0; iy < ny; iy++) {
+            for (int iy = 0; iy < ny; iy++) {
                 double yval = y0 + iy*dmin;
-                for (int ix=0; ix < nx; ix++) {
+                for (int ix = 0; ix < nx; ix++) {
                     double xval = x0 + ix*dmin;
-                    double v = field.value(xval,yval,zval);
-                    
-                    if (v != 0.0f && v < nzero_min) {
+                    double v = field.value(xval, yval, zval);
+
+                    if (v != 0.0 && v < nzero_min) {
                         nzero_min = v;
                     }
-                    
+
                     // scale all values [0-1], -1 => out of bounds
                     v = (isnan(v)) ? -1.0 : v;
-                    
+
                     cdata[ngen] = v;
                     ngen += step;
@@ -610,27 +634,30 @@
             }
         }
-        
-        float* data = computeGradient(cdata, nx, ny, nz, field.valueMin(),
+
+        float *data = computeGradient(cdata, nx, ny, nz,
+                                      field.valueMin(),
                                       field.valueMax());
 #else
         double vmin = field.valueMin();
         double vmax = field.valueMax();
-        double nzero_min = 0;
+        double nzero_min = 0.0;
         float *data = new float[nx*ny*nz * 4];
         double dv = vmax - vmin;
         int ngen = 0;
-        if (dv == 0.0)  dv = 1.0; 
-        
-        for (int iz=0; iz < nz; iz++) {
+        if (dv == 0.0) {
+            dv = 1.0;
+        }
+
+        for (int iz = 0; iz < nz; iz++) {
             double zval = z0 + iz*dmin;
-            for (int iy=0; iy < ny; iy++) {
+            for (int iy = 0; iy < ny; iy++) {
                 double yval = y0 + iy*dmin;
-                for (int ix=0; ix < nx; ix++) {
+                for (int ix = 0; ix < nx; ix++) {
                     double xval = x0 + ix*dmin;
                     double v = field.value(xval,yval,zval);
-                    
+
                     // scale all values [0-1], -1 => out of bounds
                     v = (isnan(v)) ? -1.0 : (v - vmin)/dv;
-                    
+
                     data[ngen] = v;
                     ngen += 4;
@@ -638,20 +665,16 @@
             }
         }
-        
+
         computeSimpleGradient(data, nx, ny, nz);
 #endif
-        
-#ifdef notdef
-        for (int i=0; i<nx*ny*nz; i++) {
-            TRACE("enddata[%i] = %lg\n",i,data[i]);
-        }
-#endif        
+
         TRACE("nx = %i ny = %i nz = %i\n",nx,ny,nz);
         TRACE("dx = %lg dy = %lg dz = %lg\n",dx,dy,dz);
         TRACE("dataMin = %lg\tdataMax = %lg\tnzero_min = %lg\n", 
-               field.valueMin(),field.valueMax(),nzero_min);
-        
+              field.valueMin(), field.valueMax(), nzero_min);
+
         volPtr = NanoVis::load_volume(tag, nx, ny, nz, 4, data,
-                field.valueMin(), field.valueMax(), nzero_min);
+                                      field.valueMin(), field.valueMax(),
+                                      nzero_min);
         volPtr->xAxis.SetRange(field.rangeMin(Rappture::xaxis),
                                field.rangeMax(Rappture::xaxis));
@@ -665,18 +688,17 @@
         // POINTSET
         /*
-          PointSet* pset = new PointSet();
-          pset->initialize(volume[index], (float*) data);
+          PointSet *pset = new PointSet();
+          pset->initialize(volPtr, (float*)data);
           pset->setVisible(true);
           NanoVis::pointSet.push_back(pset);
           updateColor(pset);
-          NanoVis::volume[index]->pointsetIndex = NanoVis::pointSet.size() - 1;
+          volPtr->pointsetIndex = NanoVis::pointSet.size() - 1;
         */
-        
+
         delete [] data;
-        
     } else {
         Rappture::Mesh1D zgrid(z0, z0+nz*dz, nz);
         Rappture::FieldPrism3D field(xymesh, zgrid);
-        
+
         double dval;
         int nread = 0;
@@ -692,5 +714,5 @@
                 int nid = nxy*iz + ixy;
                 field.define(nid, dval);
-                
+
                 nread++;
                 if (++iz >= nz) {
@@ -700,5 +722,5 @@
             }
         }
-        
+
         // make sure that we read all of the expected points
         if (nread != nxy*nz) {
@@ -707,5 +729,5 @@
             return NULL;
         }
-        
+
         // figure out a good mesh spacing
         int nsample = 30;
@@ -717,5 +739,5 @@
         dz = field.rangeMax(Rappture::zaxis) - field.rangeMin(Rappture::zaxis);
         double dmin = pow((dx*dy*dz)/(nsample*nsample*nsample), 0.333);
-        
+
         nx = (int)ceil(dx/dmin);
         ny = (int)ceil(dy/dmin);
@@ -728,21 +750,23 @@
 #endif
         float *data = new float[4*nx*ny*nz];
-        
+
         double vmin = field.valueMin();
         double dv = field.valueMax() - field.valueMin();
-        if (dv == 0.0) { dv = 1.0; }
-        
+        if (dv == 0.0) {
+            dv = 1.0;
+        }
+
         // generate the uniformly sampled data that we need for a volume
         int ngen = 0;
         double nzero_min = 0.0;
-        for (iz=0; iz < nz; iz++) {
+        for (int iz = 0; iz < nz; iz++) {
             double zval = z0 + iz*dmin;
-            for (int iy=0; iy < ny; iy++) {
+            for (int iy = 0; iy < ny; iy++) {
                 double yval = y0 + iy*dmin;
-                for (int ix=0; ix < nx; ix++) {
+                for (int ix = 0; ix < nx; ix++) {
                     double xval = x0 + ix*dmin;
-                    double v = field.value(xval,yval,zval);
-                    
-                    if (v != 0.0f && v < nzero_min) {
+                    double v = field.value(xval, yval, zval);
+
+                    if (v != 0.0 && v < nzero_min) {
                         nzero_min = v;
                     }
@@ -750,10 +774,10 @@
                     v = (isnan(v)) ? -1.0 : (v - vmin)/dv;
                     data[ngen] = v;
-                    
+
                     ngen += 4;
                 }
             }
         }
-        
+
         // Compute the gradient of this data.  BE CAREFUL: center
         // calculation on each node to avoid skew in either direction.
@@ -769,5 +793,5 @@
                     } else {
                         data[ngen+1] = valp1-valm1; // assume dx=1
-                        //data[ngen+1] = ((valp1-valm1) + 1) *  0.5; // assume dx=1 (ISO)
+                        //data[ngen+1] = ((valp1-valm1) + 1.0) * 0.5; // assume dx=1 (ISO)
                     }
                     
@@ -779,5 +803,5 @@
                     } else {
                         data[ngen+2] = valp1-valm1; // assume dy=1
-                        //data[ngen+2] = ((valp1-valm1) + 1) *  0.5; // assume dy=1 (ISO)
+                        //data[ngen+2] = ((valp1-valm1) + 1.0) * 0.5; // assume dy=1 (ISO)
                     }
                     
@@ -789,5 +813,5 @@
                     } else {
                         data[ngen+3] = valp1-valm1; // assume dz=1
-                        //data[ngen+3] = ((valp1-valm1) + 1) *  0.5; // assume dz=1 (ISO)
+                        //data[ngen+3] = ((valp1-valm1) + 1.0) * 0.5; // assume dz=1 (ISO)
                     }
                     
@@ -796,7 +820,8 @@
             }
         }
-        
+
         volPtr = NanoVis::load_volume(tag, nx, ny, nz, 4, data,
-                field.valueMin(), field.valueMax(), nzero_min);
+                                      field.valueMin(), field.valueMax(),
+                                      nzero_min);
         volPtr->xAxis.SetRange(field.rangeMin(Rappture::xaxis),
                                field.rangeMax(Rappture::xaxis));
@@ -810,13 +835,12 @@
         // POINTSET
         /*
-          PointSet* pset = new PointSet();
-          pset->initialize(volume[index], (float*) data);
+          PointSet *pset = new PointSet();
+          pset->initialize(volPtr, (float*)data);
           pset->setVisible(true);
           NanoVis::pointSet.push_back(pset);
           updateColor(pset);
-          NanoVis::volume[index]->pointsetIndex = NanoVis::pointSet.size() - 1;
+          volPtr->pointsetIndex = NanoVis::pointSet.size() - 1;
         */
-        
-        
+
         delete [] data;
     }
