- Timestamp:
- Dec 7, 2011, 4:19:55 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/Makefile.in
r2687 r2721 129 129 $(srcdir)/vtkcontourviewer.tcl \ 130 130 $(srcdir)/vtkstreamlinesviewer.tcl \ 131 $(srcdir)/vtkvolumeviewer.tcl \ 131 132 $(srcdir)/xylegend.tcl \ 132 133 $(srcdir)/xyprint.tcl \ -
trunk/gui/scripts/field.tcl
r2718 r2721 811 811 set _comp2dims($cname) "3D" 812 812 set _comp2dx($cname) [$_field get -decode no $cname.dx] 813 if 0{813 if 1 { 814 814 set data [$_field get -decode yes $cname.dx] 815 815 set file "/tmp/junk.dx" -
trunk/gui/src/RpConvertDxToVtk.c
r2720 r2721 15 15 #include <stdlib.h> 16 16 #include <ctype.h> 17 #include <math.h> 17 18 #include <limits.h> 18 19 #include <float.h> … … 52 53 Tcl_Obj *const *objv) 53 54 { 54 int nx, ny, nz, npts; 55 double x0, y0, z0, dx, dy, dz, ddx, ddy, ddz; 55 Tcl_Obj *objPtr; 56 56 char *p, *pend; 57 int length; 58 double xValueMin, yValueMin, zValueMin; 59 double xValueMax, yValueMax, zValueMax; 60 double xMin, yMin, zMin; 57 char *string; 58 char mesg[2000]; 59 double delta[3]; 60 double origin[3]; 61 double xMax, yMax, zMax, xMin, yMin, zMin; 62 double maxValue[3], minValue[3]; 63 int count[3]; 64 int length, nComponents, nValues, nPoints; 61 65 int xNum, yNum, zNum; 62 double xMax, yMax, zMax;63 int nComponents, nValues;64 char *string;65 Tcl_Obj *objPtr;66 char mesg[2000];67 66 size_t ix; 68 67 69 dx = dy = dz = 0.0; /* Suppress compiler warning. */ 70 x0 = y0 = z0 = 0.0; /* May not have an origin line. */ 71 nx = ny = nz = npts = 0; /* Suppress compiler warning. */ 68 nComponents = nPoints = 0; 69 delta[0] = delta[1] = delta[2] = 0.0; /* Suppress compiler warning. */ 70 origin[0] = origin[1] = origin[2] = 0.0; /* May not have an origin line. */ 71 count[0] = count[1] = count[2] = 0; /* Suppress compiler warning. */ 72 72 73 73 if (objc != 2) { … … 79 79 for (p = string, pend = p + length; p < pend; /*empty*/) { 80 80 char *line; 81 double ddx, ddy, ddz; 81 82 82 83 line = GetLine(&p, pend); … … 88 89 } 89 90 if (sscanf(line, "object %*d class gridpositions counts %d %d %d", 90 &nx, &ny, &nz) == 3) {91 if (( nx < 0) || (ny < 0) || (nz< 0)) {91 count, count + 1, count + 2) == 3) { 92 if ((count[0] < 0) || (count[1] < 0) || (count[2] < 0)) { 92 93 sprintf(mesg, "invalid grid size: x=%d, y=%d, z=%d", 93 nx, ny, nz); 94 Tcl_AppendResult(interp, mesg, (char *)NULL); 95 return TCL_ERROR; 96 } 97 } else if (sscanf(line, "origin %lg %lg %lg", &x0, &y0, &z0) == 3) { 94 count[0], count[1], count[2]); 95 Tcl_AppendResult(interp, mesg, (char *)NULL); 96 return TCL_ERROR; 97 } 98 } else if (sscanf(line, "origin %lg %lg %lg", origin, origin + 1, 99 origin + 2) == 3) { 98 100 /* Found origin. */ 99 101 } else if (sscanf(line, "delta %lg %lg %lg", &ddx, &ddy, &ddz) == 3) { 100 /* Found one of the delta lines. */ 101 if (ddx != 0.0) { 102 dx = ddx; 103 } else if (ddy != 0.0) { 104 dy = ddy; 105 } else if (ddz != 0.0) { 106 dz = ddz; 107 } 102 if (nComponents == 3) { 103 Tcl_AppendResult(interp, "too many delta statements", 104 (char *)NULL); 105 return TCL_ERROR; 106 } 107 delta[nComponents] = sqrt((ddx * ddx) + (ddy * ddy) + (ddz * ddz)); 108 nComponents++; 108 109 } else if (sscanf(line, "object %*d class array type %*s shape 3" 109 " rank 1 items %d data follows", &n pts) == 1) {110 if (n pts < 0) {111 sprintf(mesg, "bad # points %d", n pts);110 " rank 1 items %d data follows", &nPoints) == 1) { 111 if (nPoints < 0) { 112 sprintf(mesg, "bad # points %d", nPoints); 112 113 Tcl_AppendResult(interp, mesg, (char *)NULL); 113 114 return TCL_ERROR; 114 115 } 115 printf("#points=%d\n", n pts);116 if (n pts != nx*ny*nz) {116 printf("#points=%d\n", nPoints); 117 if (nPoints != count[0]*count[1]*count[2]) { 117 118 sprintf(mesg, "inconsistent data: expected %d points" 118 " but found %d points", nx*ny*nz, npts); 119 " but found %d points", count[0]*count[1]*count[2], 120 nPoints); 119 121 Tcl_AppendResult(interp, mesg, (char *)NULL); 120 122 return TCL_ERROR; … … 122 124 break; 123 125 } else if (sscanf(line, "object %*d class array type %*s rank 0" 124 " times %d data follows", &n pts) == 1) {125 if (n pts != nx*ny*nz) {126 " times %d data follows", &nPoints) == 1) { 127 if (nPoints != count[0]*count[1]*count[2]) { 126 128 sprintf(mesg, "inconsistent data: expected %d points" 127 " but found %d points", nx*ny*nz, npts); 129 " but found %d points", count[0]*count[1]*count[2], 130 nPoints); 128 131 Tcl_AppendResult(interp, mesg, (char *)NULL); 129 132 return TCL_ERROR; … … 132 135 } 133 136 } 134 if (n pts != nx*ny*nz) {137 if (nPoints != count[0]*count[1]*count[2]) { 135 138 sprintf(mesg, "inconsistent data: expected %d points" 136 " but found %d points", nx*ny*nz, npts); 139 " but found %d points", count[0]*count[1]*count[2], 140 nPoints); 137 141 Tcl_AppendResult(interp, mesg, (char *)NULL); 138 142 return TCL_ERROR; … … 143 147 Tcl_AppendToObj(objPtr, "ASCII\n", -1); 144 148 Tcl_AppendToObj(objPtr, "DATASET STRUCTURED_POINTS\n", -1); 145 sprintf(mesg, "DIMENSIONS %d %d %d\n", nx, ny, nz);146 Tcl_AppendToObj(objPtr, mesg, -1); 147 sprintf(mesg, "ORIGIN %g %g %g\n", x0, y0, z0);148 Tcl_AppendToObj(objPtr, mesg, -1); 149 sprintf(mesg, "SPACING %g %g %g\n", d x, dy, dx);150 Tcl_AppendToObj(objPtr, mesg, -1); 151 sprintf(mesg, "POINT_DATA %d\n", n pts);152 Tcl_AppendToObj(objPtr, mesg, -1); 153 154 xValueMin = yValueMin = zValueMin = FLT_MAX;155 xValueMax = yValueMax = zValueMax = -FLT_MAX;156 xMin = x0, yMin = y0, zMin = z0;157 xNum = nx, yNum = ny, zNum = nz;158 xMax = xMin + dx * xNum;159 yMax = yMin + dy * yNum;160 zMax = zMin + dz * zNum;149 sprintf(mesg, "DIMENSIONS %d %d %d\n", count[0], count[1], count[2]); 150 Tcl_AppendToObj(objPtr, mesg, -1); 151 sprintf(mesg, "ORIGIN %g %g %g\n", origin[0], origin[1], origin[2]); 152 Tcl_AppendToObj(objPtr, mesg, -1); 153 sprintf(mesg, "SPACING %g %g %g\n", delta[0], delta[1], delta[2]); 154 Tcl_AppendToObj(objPtr, mesg, -1); 155 sprintf(mesg, "POINT_DATA %d\n", nPoints); 156 Tcl_AppendToObj(objPtr, mesg, -1); 157 158 minValue[0] = minValue[1] = minValue[2] = DBL_MAX; 159 maxValue[0] = maxValue[1] = maxValue[2] = -DBL_MAX; 160 xMin = origin[0], yMin = origin[1], zMin = origin[2]; 161 xNum = count[0], yNum = count[1], zNum = count[2]; 162 xMax = origin[0] + delta[0] * count[0]; 163 yMax = origin[1] + delta[1] * count[1]; 164 zMax = origin[2] + delta[2] * count[2]; 161 165 nValues = 0; 162 for (ix = 0; ix < nx; ix++) {166 for (ix = 0; ix < xNum; ix++) { 163 167 size_t iy; 164 168 165 for (iy = 0; iy < ny; iy++) {169 for (iy = 0; iy < yNum; iy++) { 166 170 size_t iz; 167 171 168 for (iz = 0; iz < nz; iz++) {172 for (iz = 0; iz < zNum; iz++) { 169 173 const char *line; 170 174 double vx, vy, vz; 171 175 172 if ((p == pend) || (nValues > (size_t)n pts)) {176 if ((p == pend) || (nValues > (size_t)nPoints)) { 173 177 break; 174 178 } … … 178 182 } 179 183 if (sscanf(line, "%lg %lg %lg", &vx, &vy, &vz) == 3) { 180 if (vx < xValueMin) {181 xValueMin= vx;182 } else if (vx > xValueMax) {183 xValueMax= vx;184 if (vx < minValue[0]) { 185 minValue[0] = vx; 186 } else if (vx > maxValue[0]) { 187 maxValue[0] = vx; 184 188 } 185 if (vy < yValueMin) {186 yValueMin= vy;187 } else if (vy > yValueMax) {188 yValueMax= vy;189 if (vy < minValue[1]) { 190 minValue[1] = vy; 191 } else if (vy > maxValue[1]) { 192 maxValue[1] = vy; 189 193 } 190 if (vz < zValueMin) {191 zValueMin= vz;192 } else if (vz > zValueMax) {193 zValueMax= vz;194 if (vz < minValue[2]) { 195 minValue[2] = vz; 196 } else if (vz > maxValue[2]) { 197 maxValue[2] = vz; 194 198 } 195 199 sprintf(mesg, "%g %g %g\n", vx, vy, vz); … … 201 205 } 202 206 /* Make sure that we read all of the expected points. */ 203 if (nValues != (size_t)n pts) {207 if (nValues != (size_t)nPoints) { 204 208 sprintf(mesg, "inconsistent data: expected %d points" 205 " but found %d points", n pts, nValues);209 " but found %d points", nPoints, nValues); 206 210 Tcl_AppendResult(interp, mesg, (char *)NULL); 207 211 Tcl_DecrRefCount(objPtr); -
trunk/packages/vizservers/nanovis/Command.cpp
r2708 r2721 1227 1227 } 1228 1228 Rappture::Outcome context; 1229 sleep(30); 1229 1230 #if ISO_TEST 1230 1231 volPtr = load_volume_stream2(context, tag, fdata); -
trunk/packages/vizservers/nanovis/config.h
r2096 r2721 45 45 * runtime if mesh decimation is required] 46 46 */ 47 #define ISO_TEST 147 #define ISO_TEST 0 48 48 49 49 /*
Note: See TracChangeset
for help on using the changeset viewer.