Ignore:
Timestamp:
Mar 12, 2012 10:41:32 AM (12 years ago)
Author:
ldelgass
Message:

More cleanups

Location:
trunk/packages/vizservers/nanovis
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/packages/vizservers/nanovis/dxReader2.cpp

    r2822 r2845  
    11/* -*- 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
    210#include "nvconf.h"
    311#ifdef HAVE_DX_DX_H
    412#include "RpDX.h"
    513#undef ERROR
     14
     15#include "nanovis.h"
    616#include "dxReaderCommon.h"
     17#include "Volume.h"
    718
    8 #include <stdio.h>
    9 #include <iostream>
    10 #include <fstream>
    11 
    12 // nanovis headers
    13 #include "nanovis.h"
    14 
    15 // rappture headers
    16 #include "RpEncode.h"
    17 #include "RpOutcome.h"
    1819/* Load a 3D volume from a dx-format file the new way
    1920 */
    2021Volume *
    21 load_volume_stream_odx(Rappture::Outcome &context, const char *tag,
    22                         const char *buf, int nBytes)
     22load_volume_stream_odx(Rappture::Outcome& context, const char *tag,
     23                       const char *buf, int nBytes)
    2324{
    2425    char dxfilename[128];
     
    3031
    3132    // write the dx file to disk, because DXImportDX takes a file name
    32 
    33     // You can do it like this.  Give
    3433    sprintf(dxfilename, "/tmp/dx%d.dx", getpid());
    3534
     
    6160    float dz = nz;
    6261
    63     const float* data1 = dxObj.data();
     62    const float *data1 = dxObj.data();
    6463    float *data = new float[nx*ny*nz*4];
    6564    memset(data, 0, nx*ny*nz*4);
    66     int iz=0, ix=0, iy=0;
     65    int iz = 0, ix = 0, iy = 0;
    6766    float dv = dxObj.dataMax() - dxObj.dataMin();
    6867    float vmin = dxObj.dataMin();
    6968
    70     for (int i=0; i < nx*ny*nz; i++) {
     69    for (int i = 0; i < nx*ny*nz; i++) {
    7170        int nindex = (iz*nx*ny + iy*nx + ix) * 4;
    7271        float v = data1[i];
     
    9089    computeSimpleGradient(data, nx, ny, nz);
    9190
    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());
    9595
    9696    Volume *volPtr;
  • trunk/packages/vizservers/nanovis/dxReaderCommon.h

    r2798 r2845  
    11/* -*- mode: c++; c-basic-offset: 4; indent-tabs-mode: nil -*- */
    2 #ifndef _DX_READER_COMMON_H
    3 #define _DX_READER_COMMON_H
     2#ifndef DX_READER_COMMON_H
     3#define DX_READER_COMMON_H
    44
    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);
     5extern float *
     6merge(float *scalar, float *gradient, int size);
    107
    11 #endif /*_DX_READER_COMMON_H*/
     8extern void
     9normalizeScalar(float *fdata, int count, float min, float max);
     10
     11extern float *
     12computeGradient(float *fdata, int width, int height, int depth,
     13                float min, float max);
     14
     15extern void
     16computeSimpleGradient(float *data, int nx, int ny, int nz);
     17
     18#endif
Note: See TracChangeset for help on using the changeset viewer.