Commit ded0f615 authored by bonnell's avatar bonnell

Double-precision support for ResampleFilter and its dependencies.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@18363 18c085ea-50e0-402c-830e-de6fd14e8384
parent f1b95711
......@@ -492,7 +492,7 @@ avtRayCompositer::Execute(void)
//
unsigned char *data = (unsigned char *)image->GetScalarPointer(0, 0, 0);
int nPixels = width*height;
float *zbuffer = new float[nPixels];
double *zbuffer = new double[nPixels];
for (i = 0 ; i < nPixels ; i++)
{
zbuffer[i] = 1.;
......
......@@ -46,7 +46,7 @@
#include <vtkCellData.h>
#include <vtkFieldData.h>
#include <vtkFloatArray.h>
#include <vtkDoubleArray.h>
#include <vtkPointData.h>
#include <vtkRectilinearGrid.h>
......@@ -73,7 +73,7 @@ static vtkRectilinearGrid *CreateGrid(const double *, int, int, int,
int, int, int, int, bool, bool);
static void CreateViewFromBounds(avtViewInfo &, const double *,
double [3]);
static vtkDataArray *GetCoordinates(float, float, int, int, int);
static vtkDataArray *GetCoordinates(double, double, int, int, int);
#ifndef MAX
......@@ -504,7 +504,7 @@ avtResampleFilter::ResampleInput(void)
// here is some dummied up code to match collective calls below
int effectiveVars = samples->GetNumberOfRealVariables();
float *ptrtmp = new float[width*height*depth];
double *ptrtmp = new double[width*height*depth];
for (int jj = 0; jj < width*height*depth; jj++)
ptrtmp[jj] = -FLT_MAX;
for (i = 0 ; i < effectiveVars ; i++)
......@@ -589,7 +589,7 @@ avtResampleFilter::ResampleInput(void)
vtkDataArray **vars = new vtkDataArray*[numArrays];
for (i = 0 ; i < numArrays ; i++)
{
vars[i] = vtkFloatArray::New();
vars[i] = vtkDoubleArray::New();
if (doKernel && (i == numArrays-1))
vars[i]->SetNumberOfComponents(1);
else
......@@ -611,7 +611,7 @@ avtResampleFilter::ResampleInput(void)
// default value is large, then it will screw up the collect call below,
// which uses MPI_MAX for an all reduce. So give uncovered regions very
// small values now (-FLT_MAX) and then replace them later.
float defaultPlaceholder = -FLT_MAX;
double defaultPlaceholder = -FLT_MAX;
samples->GetVolume()->GetVariables(defaultPlaceholder, vars,
numArrays, ip);
......@@ -623,7 +623,7 @@ avtResampleFilter::ResampleInput(void)
//
for (i = 0 ; i < numArrays ; i++)
{
float *ptr = (float *) vars[i]->GetVoidPointer(0);
double *ptr = (double *) vars[i]->GetVoidPointer(0);
Collect(ptr, vars[i]->GetNumberOfComponents()*width*height*depth);
}
}
......@@ -635,7 +635,7 @@ avtResampleFilter::ResampleInput(void)
* vars[i]->GetNumberOfTuples();
if (numTups > 0)
{
float *ptr = (float *) vars[i]->GetVoidPointer(0);
double *ptr = (double *) vars[i]->GetVoidPointer(0);
for (j = 0 ; j < numTups ; j++)
ptr[j] = (ptr[j] == defaultPlaceholder
? atts.GetDefaultVal()
......@@ -658,7 +658,7 @@ avtResampleFilter::ResampleInput(void)
if (doKernel)
{
float min_weight = avtPointExtractor::GetMinimumWeightCutoff();
double min_weight = avtPointExtractor::GetMinimumWeightCutoff();
vtkDataArray *weights = vars[numArrays-1];
int numVals = weights->GetNumberOfTuples();
for (i = 0 ; i < realVars ; i++)
......@@ -667,7 +667,7 @@ avtResampleFilter::ResampleInput(void)
{
for (k = 0 ; k < numVals ; k++)
{
float weight = weights->GetTuple1(k);
double weight = weights->GetTuple1(k);
if (weight <= min_weight)
vars[i]->SetComponent(k, j, atts.GetDefaultVal());
else
......@@ -824,9 +824,9 @@ avtResampleFilter::GetDimensions(int &width, int &height, int &depth,
// everything in terms of the number of sample points in the width.
// Once that is solved, everything falls out.
//
float X = bounds[1] - bounds[0];
float Y = bounds[3] - bounds[2];
float Z = bounds[5] - bounds[4];
double X = bounds[1] - bounds[0];
double Y = bounds[3] - bounds[2];
double Z = bounds[5] - bounds[4];
ratioX = 1.;
ratioY = Y / X;
......@@ -994,8 +994,8 @@ CreateViewFromBounds(avtViewInfo &view, const double *bounds, double scale[3])
//
view.orthographic = true;
view.setScale = true;
float width = bounds[1] - bounds[0];
float height = bounds[3] - bounds[2];
double width = bounds[1] - bounds[0];
double height = bounds[3] - bounds[2];
view.parallelScale = (width > height ? width/2. : height/2.);
//
......@@ -1105,9 +1105,9 @@ CreateGrid(const double *bounds, int numX, int numY, int numZ, int minX,
vtkDataArray *yc = NULL;
vtkDataArray *zc = NULL;
float width = bounds[1] - bounds[0];
float height = bounds[3] - bounds[2];
float depth = bounds[5] - bounds[4];
double width = bounds[1] - bounds[0];
double height = bounds[3] - bounds[2];
double depth = bounds[5] - bounds[4];
int numX2 = (cellCenteredOutput ? numX+1 : numX);
int maxX2 = (cellCenteredOutput ? maxX+1 : maxX);
......@@ -1168,9 +1168,9 @@ CreateGrid(const double *bounds, int numX, int numY, int numZ, int minX,
// ****************************************************************************
vtkDataArray *
GetCoordinates(float start, float length, int numEls, int myStart, int myStop)
GetCoordinates(double start, double length, int numEls, int myStart, int myStop)
{
vtkFloatArray *rv = vtkFloatArray::New();
vtkDoubleArray *rv = vtkDoubleArray::New();
//
// Make sure we don't have any degenerate cases here.
......@@ -1184,7 +1184,7 @@ GetCoordinates(float start, float length, int numEls, int myStart, int myStop)
int realNumEls = myStop - myStart;
rv->SetNumberOfValues(realNumEls);
float offset = length / (numEls-1);
double offset = length / (numEls-1);
for (int i = myStart ; i < myStop ; i++)
{
rv->SetValue(i-myStart, start + i*offset);
......
......@@ -811,7 +811,7 @@ avtSamplePointExtractor::KernelBasedSample(vtkDataSet *ds)
pointExtractor->Extract(pt);
int currentMilestone = (int)(((float) j) / numCells * 10);
int currentMilestone = (int)(((double) j) / numCells * 10);
if (currentMilestone > lastMilestone)
{
UpdateProgress(10*currentNode+currentMilestone, 10*totalNodes);
......@@ -933,7 +933,7 @@ avtSamplePointExtractor::RasterBasedSample(vtkDataSet *ds)
EXCEPTION1(InvalidCellTypeException, "surfaces or anything outside"
" the finite element zoo.");
}
int currentMilestone = (int)(((float) j) / numCells * 10);
int currentMilestone = (int)(((double) j) / numCells * 10);
if (currentMilestone > lastMilestone)
{
UpdateProgress(10*currentNode+currentMilestone, 10*totalNodes);
......@@ -994,7 +994,7 @@ avtSamplePointExtractor::ExtractHex(vtkHexahedron *hex, vtkDataSet *ds,
int idx = li.cellDataIndex[v];
for (j = 0 ; j < li.cellDataSize[v] ; j++)
{
float val = arr->GetComponent(hexind, j);
double val = arr->GetComponent(hexind, j);
for (i = 0 ; i < 8 ; i++)
h.val[i][idx+j] = val;
}
......@@ -1084,7 +1084,7 @@ avtSamplePointExtractor::ExtractHex20(vtkQuadraticHexahedron *hex20,
int idx = li.cellDataIndex[v];
for (j = 0 ; j < li.cellDataSize[v] ; j++)
{
float val = arr->GetComponent(hexind, j);
double val = arr->GetComponent(hexind, j);
for (i = 0 ; i < 20 ; i++)
h.val[i][idx+j] = val;
}
......@@ -1187,7 +1187,7 @@ avtSamplePointExtractor::ExtractWedge(vtkWedge *wedge, vtkDataSet *ds,
int idx = li.cellDataIndex[v];
for (j = 0 ; j < li.cellDataSize[v] ; j++)
{
float val = arr->GetComponent(wedgeind, j);
double val = arr->GetComponent(wedgeind, j);
for (i = 0 ; i < 6 ; i++)
w.val[i][idx+j] = val;
}
......@@ -1290,7 +1290,7 @@ avtSamplePointExtractor::ExtractTet(vtkTetra *tet, vtkDataSet *ds,
int idx = li.cellDataIndex[v];
for (j = 0 ; j < li.cellDataSize[v] ; j++)
{
float val = arr->GetComponent(tetind, j);
double val = arr->GetComponent(tetind, j);
for (i = 0 ; i < 4 ; i++)
t.val[i][idx+j] = val;
}
......@@ -1393,7 +1393,7 @@ avtSamplePointExtractor::ExtractPyramid(vtkPyramid *pyr, vtkDataSet *ds,
int idx = li.cellDataIndex[v];
for (j = 0 ; j < li.cellDataSize[v] ; j++)
{
float val = arr->GetComponent(pyrind, j);
double val = arr->GetComponent(pyrind, j);
for (i = 0 ; i < 5 ; i++)
p.val[i][idx+j] = val;
}
......@@ -1493,7 +1493,7 @@ avtSamplePointExtractor::ExtractVoxel(vtkVoxel *voxel, vtkDataSet *ds,
int idx = li.cellDataIndex[v];
for (j = 0 ; j < li.cellDataSize[v] ; j++)
{
float val = arr->GetComponent(voxind, j);
double val = arr->GetComponent(voxind, j);
for (i = 0 ; i < 8 ; i++)
h.val[i][idx+j] = val;
}
......@@ -1592,7 +1592,7 @@ avtSamplePointExtractor::ExtractTriangle(vtkTriangle *tri, vtkDataSet *ds,
int idx = li.cellDataIndex[v];
for (j = 0 ; j < li.cellDataSize[v] ; j++)
{
float val = arr->GetComponent(triind, j);
double val = arr->GetComponent(triind, j);
for (i = 0 ; i < 6 ; i++)
w.val[i][idx+j] = val;
}
......@@ -1614,9 +1614,9 @@ avtSamplePointExtractor::ExtractTriangle(vtkTriangle *tri, vtkDataSet *ds,
for (j = 0 ; j < li.pointDataSize[v] ; j++)
{
float val0 = arr->GetComponent(ids->GetId(0), j);
float val1 = arr->GetComponent(ids->GetId(1), j);
float val2 = arr->GetComponent(ids->GetId(2), j);
double val0 = arr->GetComponent(ids->GetId(0), j);
double val1 = arr->GetComponent(ids->GetId(1), j);
double val2 = arr->GetComponent(ids->GetId(2), j);
w.val[0][idx+j] = val0;
w.val[1][idx+j] = val1;
w.val[2][idx+j] = val2;
......@@ -1699,7 +1699,7 @@ avtSamplePointExtractor::ExtractQuad(vtkQuad *quad, vtkDataSet *ds,
int idx = li.cellDataIndex[v];
for (j = 0 ; j < li.cellDataSize[v] ; j++)
{
float val = arr->GetComponent(quadind, j);
double val = arr->GetComponent(quadind, j);
for (i = 0 ; i < 8 ; i++)
h.val[i][idx+j] = val;
}
......@@ -1720,10 +1720,10 @@ avtSamplePointExtractor::ExtractQuad(vtkQuad *quad, vtkDataSet *ds,
for (j = 0 ; j < li.pointDataSize[v] ; j++)
{
float val0 = arr->GetComponent(ids->GetId(0), j);
float val1 = arr->GetComponent(ids->GetId(1), j);
float val2 = arr->GetComponent(ids->GetId(2), j);
float val3 = arr->GetComponent(ids->GetId(3), j);
double val0 = arr->GetComponent(ids->GetId(0), j);
double val1 = arr->GetComponent(ids->GetId(1), j);
double val2 = arr->GetComponent(ids->GetId(2), j);
double val3 = arr->GetComponent(ids->GetId(3), j);
h.val[0][idx+j] = val0;
h.val[1][idx+j] = val1;
h.val[2][idx+j] = val2;
......@@ -1808,7 +1808,7 @@ avtSamplePointExtractor::ExtractPixel(vtkPixel *pixel, vtkDataSet *ds,
int idx = li.cellDataIndex[v];
for (j = 0 ; j < li.cellDataSize[v] ; j++)
{
float val = arr->GetComponent(pixind, j);
double val = arr->GetComponent(pixind, j);
for (i = 0 ; i < 8 ; i++)
h.val[i][idx+j] = val;
}
......@@ -1829,10 +1829,10 @@ avtSamplePointExtractor::ExtractPixel(vtkPixel *pixel, vtkDataSet *ds,
for (j = 0 ; j < li.pointDataSize[v] ; j++)
{
float val0 = arr->GetComponent(ids->GetId(0), j);
float val1 = arr->GetComponent(ids->GetId(1), j);
float val2 = arr->GetComponent(ids->GetId(2), j);
float val3 = arr->GetComponent(ids->GetId(3), j);
double val0 = arr->GetComponent(ids->GetId(0), j);
double val1 = arr->GetComponent(ids->GetId(1), j);
double val2 = arr->GetComponent(ids->GetId(2), j);
double val3 = arr->GetComponent(ids->GetId(3), j);
h.val[0][idx+j] = val0;
h.val[1][idx+j] = val1;
h.val[2][idx+j] = val3; // Swap for pixel
......
......@@ -128,7 +128,7 @@ avtSamplePointToSurfaceFilter::Execute(void)
int height = imagePartition->GetHeight();
int buff_size = width*height;
int num_samples = -1;
float *vals = new float[buff_size];
double *vals = new double[buff_size];
for (i = 0 ; i < buff_size ; i++)
{
vals[i] = -FLT_MAX;
......@@ -140,7 +140,7 @@ avtSamplePointToSurfaceFilter::Execute(void)
}
avtVolume *volume = GetTypedInput()->GetVolume();
float samples[AVT_VARIABLE_LIMIT];
double samples[AVT_VARIABLE_LIMIT];
for (i = minX ; i <= maxX ; i++)
{
for (j = minY ; j <= maxY ; j++)
......@@ -187,11 +187,11 @@ avtSamplePointToSurfaceFilter::Execute(void)
for (j = 0 ; j < height ; j++)
{
int index = i*height + j;
float x = (((float)i) / (width-1.)) * 2. - 1.;
float y = (((float)j) /(height-1.)) * 2. - 1.;
float z;
double x = (((double)i) / (width-1.)) * 2. - 1.;
double y = (((double)j) /(height-1.)) * 2. - 1.;
double z;
if (depths[index] >= 0)
z = ((float)depths[index]) / (num_samples-1.);
z = ((double)depths[index]) / (num_samples-1.);
else
z = 0.;
pts->SetPoint(index, x, y, z);
......@@ -202,9 +202,9 @@ avtSamplePointToSurfaceFilter::Execute(void)
for (j = 0 ; j < height-1 ; j++)
{
int index = i*(height-1) + j + norigpts;
float x = ((i+0.5) / (width-1.)) * 2. - 1.;
float y = ((j+0.5) /(height-1.)) * 2. - 1.;
float z = 0.;
double x = ((i+0.5) / (width-1.)) * 2. - 1.;
double y = ((j+0.5) /(height-1.)) * 2. - 1.;
double z = 0.;
int numvalid = 0;
int i0 = i*height + j;
int i1 = (i+1)*height + j;
......@@ -212,22 +212,22 @@ avtSamplePointToSurfaceFilter::Execute(void)
int i3 = i*height + j+1;
if (depths[i0] >= 0)
{
z += ((float)depths[i0]) / (num_samples-1.);
z += ((double)depths[i0]) / (num_samples-1.);
numvalid++;
}
if (depths[i1] >= 0)
{
z += ((float)depths[i1]) / (num_samples-1.);
z += ((double)depths[i1]) / (num_samples-1.);
numvalid++;
}
if (depths[i2] >= 0)
{
z += ((float)depths[i2]) / (num_samples-1.);
z += ((double)depths[i2]) / (num_samples-1.);
numvalid++;
}
if (depths[i3] >= 0)
{
z += ((float)depths[i3]) / (num_samples-1.);
z += ((double)depths[i3]) / (num_samples-1.);
numvalid++;
}
if (numvalid > 0)
......@@ -249,7 +249,7 @@ avtSamplePointToSurfaceFilter::Execute(void)
for (j = 0 ; j < height-1 ; j++)
{
int index = i*(height-1) + j + norigpts;
float val = 0.;
double val = 0.;
int numvalid = 0;
int i0 = i*height + j;
int i1 = (i+1)*height + j;
......
......@@ -127,7 +127,7 @@ avtAverageValueRF::~avtAverageValueRF()
void
avtAverageValueRF::GetRayValue(const avtRay *ray,
unsigned char rgb[3], float depth)
unsigned char rgb[3], double depth)
{
//
// Some compilers do very poor optimizations, so make sure that we don't
......@@ -138,7 +138,7 @@ avtAverageValueRF::GetRayValue(const avtRay *ray,
const bool *validSample = ray->validSample;
// Only handle one variable, even if there is more.
const float *sample = ray->sample[0];
const double *sample = ray->sample[0];
int depthIndex = IndexOfDepth(depth, numSamples);
......
......@@ -84,7 +84,7 @@ class PIPELINE_API avtAverageValueRF : public avtRayFunction
virtual ~avtAverageValueRF();
virtual void GetRayValue(const avtRay *,
unsigned char rgb[3], float);
unsigned char rgb[3], double);
protected:
double noSampleValue;
......
......@@ -349,18 +349,18 @@ avtCellList::Store(char *cell, int minx, int maxx, int miny, int maxy,int size)
// ****************************************************************************
char *
avtCellList::Serialize(const float (*pts)[3],
const float (*var)[AVT_VARIABLE_LIMIT], int nvals)
avtCellList::Serialize(const double (*pts)[3],
const double (*var)[AVT_VARIABLE_LIMIT], int nvals)
{
int numPoints = 3;
int bytesPerNode = (numPoints+nVars)*sizeof(float);
int bytesPerNode = (numPoints+nVars)*sizeof(double);
char *serialized = new char[bytesPerNode*nvals];
char *tmp = serialized;
InlineCopy(tmp, (char *)pts, sizeof(float)*3*nvals);
InlineCopy(tmp, (char *)pts, sizeof(double)*3*nvals);
for (int i = 0 ; i < nvals ; i++)
{
InlineCopy(tmp, (char *)var[i], sizeof(float)*nVars);
InlineCopy(tmp, (char *)var[i], sizeof(double)*nVars);
}
return serialized;
......@@ -385,15 +385,15 @@ avtCellList::Serialize(const float (*pts)[3],
// ****************************************************************************
char *
avtCellList::SerializePoint(const float *bbox, const float *var)
avtCellList::SerializePoint(const double *bbox, const double *var)
{
int bboxSize = 6;
int bytesPerPt = (bboxSize+nVars)*sizeof(float);
int bytesPerPt = (bboxSize+nVars)*sizeof(double);
char *serialized = new char[bytesPerPt];
char *tmp = serialized;
InlineCopy(tmp, (char *)bbox, sizeof(float)*bboxSize);
InlineCopy(tmp, (char *)var, sizeof(float)*nVars);
InlineCopy(tmp, (char *)bbox, sizeof(double)*bboxSize);
InlineCopy(tmp, (char *)var, sizeof(double)*nVars);
return serialized;
}
......@@ -432,9 +432,9 @@ avtCellList::ConstructMessages(avtImagePartition *part, char **msgs, int *lens)
int numPartitions = part->GetNumPartitions();
int storageForCoord = 3;
const int bytesPerNode = (storageForCoord+nVars)*sizeof(float);
const int bytesPerNode = (storageForCoord+nVars)*sizeof(double);
int storageForBBox = 6;
const int bytesForCellThatIsAPt = (storageForBBox+nVars)*sizeof(float);
const int bytesForCellThatIsAPt = (storageForBBox+nVars)*sizeof(double);
//
// Set up memory to put our messages into.
......@@ -645,13 +645,13 @@ avtCellList::ExtractCells(const char * const *msgs, const int *lens, int np,
// ****************************************************************************
void
avtCellList::Unserialize(float (*pts)[3], float (*var)[AVT_VARIABLE_LIMIT],
avtCellList::Unserialize(double (*pts)[3], double (*var)[AVT_VARIABLE_LIMIT],
int nvals, const char *&str)
{
InlineExtract((char *)pts, str, nvals*3*sizeof(float));
InlineExtract((char *)pts, str, nvals*3*sizeof(double));
for (int i = 0 ; i < nvals ; i++)
{
InlineExtract((char *)var[i], str, nVars*sizeof(float));
InlineExtract((char *)var[i], str, nVars*sizeof(double));
}
}
......@@ -672,10 +672,10 @@ avtCellList::Unserialize(float (*pts)[3], float (*var)[AVT_VARIABLE_LIMIT],
// ****************************************************************************
void
avtCellList::UnserializePoint(float *bbox, float *var, const char *&str)
avtCellList::UnserializePoint(double *bbox, double *var, const char *&str)
{
InlineExtract((char *)bbox, str, 6*sizeof(float));
InlineExtract((char *)var, str, nVars*sizeof(float));
InlineExtract((char *)bbox, str, 6*sizeof(double));
InlineExtract((char *)var, str, nVars*sizeof(double));
}
......
......@@ -136,14 +136,14 @@ class PIPELINE_API avtCellList
bool jittering;
char *Serialize(const float (*)[3],
const float (*)[AVT_VARIABLE_LIMIT],int);
char *SerializePoint(const float *, const float *);
char *Serialize(const double (*)[3],
const double (*)[AVT_VARIABLE_LIMIT],int);
char *SerializePoint(const double *, const double *);
void Store(char *, int, int, int, int, int);
void Unserialize(float (*)[3],
float (*)[AVT_VARIABLE_LIMIT], int,
void Unserialize(double (*)[3],
double (*)[AVT_VARIABLE_LIMIT], int,
const char *&);
void UnserializePoint(float *, float *, const char *&);
void UnserializePoint(double *, double *, const char *&);
private:
// These methods are defined to prevent accidental use of bitwise copy
......
......@@ -63,31 +63,31 @@
typedef struct
{
float pts[8][3];
float val[8][AVT_VARIABLE_LIMIT];
double pts[8][3];
double val[8][AVT_VARIABLE_LIMIT];
int nVars;
} avtHexahedron;
typedef struct
{
float pts[20][3];
float val[20][AVT_VARIABLE_LIMIT];
double pts[20][3];
double val[20][AVT_VARIABLE_LIMIT];
int nVars;
} avtHexahedron20;
typedef struct
{
float pts[27][3];
float val[27][AVT_VARIABLE_LIMIT];
double pts[27][3];
double val[27][AVT_VARIABLE_LIMIT];
int nVars;
} avtHexahedron27;
typedef struct
{
float pts[4][3];
float val[4][AVT_VARIABLE_LIMIT];
double pts[4][3];
double val[4][AVT_VARIABLE_LIMIT];
int nVars;
} avtTetrahedron;
......@@ -98,8 +98,8 @@ typedef struct
//
typedef struct
{
float pts[5][3];
float val[5][AVT_VARIABLE_LIMIT];
double pts[5][3];
double val[5][AVT_VARIABLE_LIMIT];
int nVars;
} avtPyramid;
......@@ -110,16 +110,16 @@ typedef struct
//
typedef struct
{
float pts[6][3];
float val[6][AVT_VARIABLE_LIMIT];
double pts[6][3];
double val[6][AVT_VARIABLE_LIMIT];
int nVars;
} avtWedge;
typedef struct
{
float bbox[6];
float val[AVT_VARIABLE_LIMIT];
double bbox[6];
double val[AVT_VARIABLE_LIMIT];
int nVars;
} avtPoint;
......
......@@ -84,7 +84,7 @@ avtCompositeRF::avtCompositeRF(avtLightingModel *l, avtOpacityMap *m,
weightVariableIndex = -1;
int entries = secondaryMap->GetNumberOfTableEntries();
float *opacities = new float[entries];
double *opacities = new double[entries];
const RGBA *table = secondaryMap->GetTable();
for (int i = 0 ; i < entries ; i++)
{
......@@ -166,7 +166,7 @@ avtCompositeRF::~avtCompositeRF()
void
avtCompositeRF::GetRayValue(const avtRay *ray,
unsigned char rgb[3], float depth)
unsigned char rgb[3], double depth)
{
//
// Some compilers do very poor optimizations, so make sure that we don't
......@@ -177,9 +177,9 @@ avtCompositeRF::GetRayValue(const avtRay *ray,
const bool *validSample = ray->validSample;
// For right now, only work with one variable.
const float *sample = ray->sample[colorVariableIndex];
const float *sample2 = ray->sample[opacityVariableIndex];
const float *weight = NULL;
const double *sample = ray->sample[colorVariableIndex];
const double *sample2 = ray->sample[opacityVariableIndex];
const double *weight = NULL;
double min_weight = 0.;
double min_weight_denom = 0.;
if (weightVariableIndex >= 0)
......@@ -280,10 +280,10 @@ avtCompositeRF::GetRayValue(const avtRay *ray,
bool
avtCompositeRF::CanContributeToPicture(int nVerts,
const float (*vals)[AVT_VARIABLE_LIMIT])
const double (*vals)[AVT_VARIABLE_LIMIT])
{
float min = +FLT_MAX;
float max = -FLT_MIN;
double min = +FLT_MAX;
double max = -FLT_MIN;
for (int i = 0 ; i < nVerts ; i++)
{
if (vals[i][opacityVariableIndex] < min)
......@@ -298,7 +298,7 @@ avtCompositeRF::CanContributeToPicture(int nVerts,
int minIndex = secondaryMap->Quantize(min);
int maxIndex = secondaryMap->Quantize(max);
float opacMax = rangeMaxTable.GetMaximumOverRange(minIndex, maxIndex);
double opacMax = rangeMaxTable.GetMaximumOverRange(minIndex, maxIndex);
return (opacMax > 0. ? true : false);
}
......
......@@ -92,7 +92,7 @@ class PIPELINE_API avtCompositeRF : public avtRayFunction
virtual ~avtCompositeRF();
virtual void GetRayValue(const avtRay *,
unsigned char rgb[3], float);
unsigned char rgb[3], double);
void SetColorVariableIndex(int cvi)
{ colorVariableIndex = cvi; };
......@@ -101,7 +101,7 @@ class PIPELINE_API avtCompositeRF : public avtRayFunction
void SetWeightVariableIndex(int wvi)
{ weightVariableIndex = wvi; };
virtual bool CanContributeToPicture(int,
const float (*)[AVT_VARIABLE_LIMIT]);
const double (*)[AVT_VARIABLE_LIMIT]);
protected:
avtOpacityMap *map;
......
......@@ -120,7 +120,7 @@ avtDistanceToValueRF::~avtDistanceToValueRF()
void
avtDistanceToValueRF::GetRayValue(const avtRay *ray,
unsigned char rgb[3], float depth)
unsigned char rgb[3], double depth)
{
//
// Some compilers do very poor optimizations, so make sure that we don't
......@@ -131,7 +131,7 @@ avtDistanceToValueRF::GetRayValue(const avtRay *ray,
const bool *validSample = ray->validSample;
// Only handle one variable, even if there is more.
const float *sample = ray->sample[0];
const double *sample = ray->sample[0];
int depthIndex = IndexOfDepth(depth, numSamples);
......
......@@ -79,7 +79,7 @@ class PIPELINE_API avtDistanceToValueRF : public avtRayFunction
virtual ~avtDistanceToValueRF();
virtual void GetRayValue(const avtRay *,
unsigned char rgb[3], float);