Changeset 2845 for trunk/packages
- Timestamp:
- Mar 12, 2012, 10:41:32 AM (13 years ago)
- Location:
- trunk/packages/vizservers/nanovis
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/dxReader2.cpp
r2822 r2845 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 #include <stdio.h> 3 #include <iostream> 4 #include <fstream> 5 6 // rappture headers 7 #include <RpEncode.h> 8 #include <RpOutcome.h> 9 2 10 #include "nvconf.h" 3 11 #ifdef HAVE_DX_DX_H 4 12 #include "RpDX.h" 5 13 #undef ERROR 14 15 #include "nanovis.h" 6 16 #include "dxReaderCommon.h" 17 #include "Volume.h" 7 18 8 #include <stdio.h>9 #include <iostream>10 #include <fstream>11 12 // nanovis headers13 #include "nanovis.h"14 15 // rappture headers16 #include "RpEncode.h"17 #include "RpOutcome.h"18 19 /* Load a 3D volume from a dx-format file the new way 19 20 */ 20 21 Volume * 21 load_volume_stream_odx(Rappture::Outcome &context, const char *tag,22 22 load_volume_stream_odx(Rappture::Outcome& context, const char *tag, 23 const char *buf, int nBytes) 23 24 { 24 25 char dxfilename[128]; … … 30 31 31 32 // write the dx file to disk, because DXImportDX takes a file name 32 33 // You can do it like this. Give34 33 sprintf(dxfilename, "/tmp/dx%d.dx", getpid()); 35 34 … … 61 60 float dz = nz; 62 61 63 const float *data1 = dxObj.data();62 const float *data1 = dxObj.data(); 64 63 float *data = new float[nx*ny*nz*4]; 65 64 memset(data, 0, nx*ny*nz*4); 66 int iz =0, ix=0, iy=0;65 int iz = 0, ix = 0, iy = 0; 67 66 float dv = dxObj.dataMax() - dxObj.dataMin(); 68 67 float vmin = dxObj.dataMin(); 69 68 70 for (int i =0; i < nx*ny*nz; i++) {69 for (int i = 0; i < nx*ny*nz; i++) { 71 70 int nindex = (iz*nx*ny + iy*nx + ix) * 4; 72 71 float v = data1[i]; … … 90 89 computeSimpleGradient(data, nx, ny, nz); 91 90 92 TRACE("nx = %i ny = %i nz = %i\n",nx,ny,nz); 93 TRACE("dx = %lg dy = %lg dz = %lg\n",dx,dy,dz); 94 TRACE("dataMin = %lg\tdataMax = %lg\tnzero_min = %lg\n", dxObj.dataMin(),dxObj.dataMax(),dxObj.nzero_min()); 91 TRACE("nx = %i ny = %i nz = %i\n", nx, ny, nz); 92 TRACE("dx = %lg dy = %lg dz = %lg\n", dx, dy, dz); 93 TRACE("dataMin = %lg\tdataMax = %lg\tnzero_min = %lg\n", 94 dxObj.dataMin(), dxObj.dataMax(), dxObj.nzero_min()); 95 95 96 96 Volume *volPtr; -
trunk/packages/vizservers/nanovis/dxReaderCommon.h
r2798 r2845 1 1 /* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 2 #ifndef _DX_READER_COMMON_H3 #define _DX_READER_COMMON_H2 #ifndef DX_READER_COMMON_H 3 #define DX_READER_COMMON_H 4 4 5 float* merge(float* scalar, float* gradient, int size); 6 void normalizeScalar(float* fdata, int count, float min, float max); 7 float* computeGradient(float* fdata, int width, int height, int depth, 8 float min, float max); 9 void computeSimpleGradient(float* data, int nx, int ny, int nz); 5 extern float * 6 merge(float *scalar, float *gradient, int size); 10 7 11 #endif /*_DX_READER_COMMON_H*/ 8 extern void 9 normalizeScalar(float *fdata, int count, float min, float max); 10 11 extern float * 12 computeGradient(float *fdata, int width, int height, int depth, 13 float min, float max); 14 15 extern void 16 computeSimpleGradient(float *data, int nx, int ny, int nz); 17 18 #endif
Note: See TracChangeset
for help on using the changeset viewer.