Commit bcc19516 authored by Ken Martin's avatar Ken Martin
Browse files

parallels next double changes

parent ee1ce0fe
......@@ -25,7 +25,7 @@
#include "vtkThreshold.h"
#include "vtkUnstructuredGrid.h"
vtkCxxRevisionMacro(vtkCutMaterial, "1.13");
vtkCxxRevisionMacro(vtkCutMaterial, "1.14");
vtkStandardNewMacro(vtkCutMaterial);
// Instantiate object with no input and no defined output.
......@@ -69,7 +69,7 @@ void vtkCutMaterial::Execute()
vtkDataSet *input = this->GetInput();
vtkThreshold *thresh;
vtkCutter *cutter;
float *bds;
double *bds;
// Check to see if we have the required field arrays.
if (this->MaterialArrayName == NULL || this->ArrayName == NULL)
......@@ -127,8 +127,8 @@ void vtkCutMaterial::Execute()
void vtkCutMaterial::ComputeNormal()
{
float tmp[3];
float mag;
double tmp[3];
double mag;
if (this->UpVector[0] == 0.0 && this->UpVector[1] == 0.0 && this->UpVector[2] == 0.0)
{
......@@ -156,9 +156,9 @@ void vtkCutMaterial::ComputeMaximumPoint(vtkDataSet *input)
{
vtkDataArray *data;
vtkIdType idx, bestIdx, num;
float comp, best;
double comp, best;
vtkCell *cell;
float *bds;
double *bds;
// Find the maximum value.
data = input->GetCellData()->GetArray(this->ArrayName);
......
......@@ -52,15 +52,15 @@ public:
// Description:
// The last piece of information that specifies the plane.
vtkSetVector3Macro(UpVector, float);
vtkGetVector3Macro(UpVector, float);
vtkSetVector3Macro(UpVector, double);
vtkGetVector3Macro(UpVector, double);
// Description:
// Accesses to the values computed during the execute method. They
// could be used to get a good camera view for the resulting plane.
vtkGetVector3Macro(MaximumPoint, float);
vtkGetVector3Macro(CenterPoint, float);
vtkGetVector3Macro(Normal, float);
vtkGetVector3Macro(MaximumPoint, double);
vtkGetVector3Macro(CenterPoint, double);
vtkGetVector3Macro(Normal, double);
protected:
vtkCutMaterial();
......@@ -73,10 +73,10 @@ protected:
char *MaterialArrayName;
int Material;
char *ArrayName;
float UpVector[3];
float MaximumPoint[3];
float CenterPoint[3];
float Normal[3];
double UpVector[3];
double MaximumPoint[3];
double CenterPoint[3];
double Normal[3];
vtkPlane *PlaneFunction;
......
......@@ -26,7 +26,7 @@
#include "vtkPolyData.h"
#include "vtkRungeKutta2.h"
vtkCxxRevisionMacro(vtkDistributedStreamTracer, "1.5");
vtkCxxRevisionMacro(vtkDistributedStreamTracer, "1.6");
vtkStandardNewMacro(vtkDistributedStreamTracer);
vtkDistributedStreamTracer::vtkDistributedStreamTracer()
......@@ -37,13 +37,13 @@ vtkDistributedStreamTracer::~vtkDistributedStreamTracer()
{
}
void vtkDistributedStreamTracer::ForwardTask(float seed[3],
void vtkDistributedStreamTracer::ForwardTask(double seed[3],
int direction,
int isNewSeed,
int lastId,
int lastCellId,
int currentLine,
float* firstNormal)
double* firstNormal)
{
int myid = this->Controller->GetLocalProcessId();
int numProcs = this->Controller->GetNumberOfProcesses();
......@@ -65,11 +65,11 @@ void vtkDistributedStreamTracer::ForwardTask(float seed[3],
this->Controller->Send(seed, 3, nextid, 333);
this->Controller->Send(&direction, 1, nextid, 344);
this->Controller->Send(&currentLine, 1, nextid, 355);
float tmpNormal[4];
double tmpNormal[4];
if (firstNormal)
{
tmpNormal[0] = 1;
memcpy(tmpNormal+1, firstNormal, 3*sizeof(float));
memcpy(tmpNormal+1, firstNormal, 3*sizeof(double));
}
else
{
......@@ -86,7 +86,7 @@ int vtkDistributedStreamTracer::ReceiveAndProcessTask()
int lastCellId = 0;
int currentLine = 0;
int direction=FORWARD;
float seed[3] = {0.0, 0.0, 0.0};
double seed[3] = {0.0, 0.0, 0.0};
int myid = this->Controller->GetLocalProcessId();
int numProcs = this->Controller->GetNumberOfProcesses();
......@@ -128,12 +128,12 @@ int vtkDistributedStreamTracer::ReceiveAndProcessTask()
1,
vtkMultiProcessController::ANY_SOURCE,
355);
float tmpNormal[4];
double tmpNormal[4];
this->Controller->Receive(tmpNormal,
4,
vtkMultiProcessController::ANY_SOURCE,
366);
float* firstNormal=0;
double* firstNormal=0;
if (tmpNormal[0] != 0)
{
firstNormal = &(tmpNormal[1]);
......@@ -158,20 +158,20 @@ int vtkDistributedStreamTracer::ProcessNextLine(int currentLine)
}
// All done. Tell everybody to stop.
float seed[3] = {0.0, 0.0, 0.0};
double seed[3] = {0.0, 0.0, 0.0};
this->ForwardTask(seed, 0, 2, myid, 0, 0, 0);
return 0;
}
// Integrate a streamline
int vtkDistributedStreamTracer::ProcessTask(float seed[3],
int vtkDistributedStreamTracer::ProcessTask(double seed[3],
int direction,
int isNewSeed,
int lastId,
int lastCellId,
int currentLine,
float* firstNormal)
double* firstNormal)
{
int myid = this->Controller->GetLocalProcessId();
......@@ -182,7 +182,7 @@ int vtkDistributedStreamTracer::ProcessTask(float seed[3],
return this->ProcessNextLine(currentLine);
}
float velocity[3];
double velocity[3];
// We don't have it, let's forward it to the next guy
this->Interpolator->ClearLastCellId();
int retVal = this->Interpolator->FunctionValues(seed, velocity);
......@@ -194,7 +194,7 @@ int vtkDistributedStreamTracer::ProcessTask(float seed[3],
}
// We have it, let's integrate
float lastPoint[3];
double lastPoint[3];
vtkFloatArray* seeds = vtkFloatArray::New();
seeds->SetNumberOfComponents(3);
......@@ -279,19 +279,19 @@ int vtkDistributedStreamTracer::ProcessTask(float seed[3],
this->SetIntegrator(tmpSolver);
tmpSolver->Delete();
float tmpseed[3];
memcpy(tmpseed, lastPoint, 3*sizeof(float));
double tmpseed[3];
memcpy(tmpseed, lastPoint, 3*sizeof(double));
this->SimpleIntegrate(tmpseed, lastPoint, this->LastUsedTimeStep, func);
func->Delete();
this->SetIntegrator(ivp);
ivp->UnRegister(this);
float* lastNormal = 0;
double* lastNormal = 0;
vtkDataArray* normals = tmpOutput->GetPointData()->GetArray("Normals");
if (normals)
{
lastNormal = new float[3];
lastNormal = new double[3];
normals->GetTuple(normals->GetNumberOfTuples()-1, lastNormal);
}
......
......@@ -42,20 +42,20 @@ protected:
vtkDistributedStreamTracer();
~vtkDistributedStreamTracer();
void ForwardTask(float seed[3],
void ForwardTask(double seed[3],
int direction,
int isNewSeed,
int lastid,
int lastCellId,
int currentLine,
float* firstNormal);
int ProcessTask(float seed[3],
double* firstNormal);
int ProcessTask(double seed[3],
int direction,
int isNewSeed,
int lastid,
int lastCellId,
int currentLine,
float* firstNormal);
double* firstNormal);
int ProcessNextLine(int currentLine);
int ReceiveAndProcessTask();
......
......@@ -24,7 +24,7 @@
#include "vtkPolyData.h"
#include "vtkUnsignedCharArray.h"
vtkCxxRevisionMacro(vtkExtractPolyDataPiece, "1.14");
vtkCxxRevisionMacro(vtkExtractPolyDataPiece, "1.15");
vtkStandardNewMacro(vtkExtractPolyDataPiece);
vtkExtractPolyDataPiece::vtkExtractPolyDataPiece()
......@@ -127,7 +127,7 @@ void vtkExtractPolyDataPiece::Execute()
vtkUnsignedCharArray* pointGhostLevels = 0;
vtkIdType ptId, newId, numPts, i;
int numCellPts;
float *x;
double *x;
// Pipeline update piece will tell us what to generate.
ghostLevel = output->GetUpdateGhostLevel();
......
......@@ -25,7 +25,7 @@
#include "vtkUnsignedCharArray.h"
#include "vtkUnstructuredGrid.h"
vtkCxxRevisionMacro(vtkExtractUnstructuredGridPiece, "1.14");
vtkCxxRevisionMacro(vtkExtractUnstructuredGridPiece, "1.15");
vtkStandardNewMacro(vtkExtractUnstructuredGridPiece);
vtkExtractUnstructuredGridPiece::vtkExtractUnstructuredGridPiece()
......@@ -133,7 +133,7 @@ void vtkExtractUnstructuredGridPiece::Execute()
int numCellPts;
vtkIdType *cellPointer;
vtkIdType *ids;
float *x;
double *x;
// Pipeline update piece will tell us what to generate.
ghostLevel = output->GetUpdateGhostLevel();
......
......@@ -31,7 +31,7 @@
#include "vtkUnstructuredGrid.h"
#include "vtkExtentTranslator.h"
vtkCxxRevisionMacro(vtkPDataSetReader, "1.28");
vtkCxxRevisionMacro(vtkPDataSetReader, "1.29");
vtkStandardNewMacro(vtkPDataSetReader);
//----------------------------------------------------------------------------
......@@ -518,7 +518,7 @@ void vtkPDataSetReader::ReadPVTKFileInformation(ifstream *file)
int type;
vtkDataSet *output = NULL;
int ext[6];
float vect[3];
double vect[3];
int i;
char *pfn, *pdir;
int count, dirLength;
......@@ -621,7 +621,7 @@ void vtkPDataSetReader::ReadPVTKFileInformation(ifstream *file)
vtkErrorMacro("Expecting an image.");
return;
}
sscanf(val, "%f %f %f", vect, vect+1, vect+2);
sscanf(val, "%lf %lf %lf", vect, vect+1, vect+2);
image->SetSpacing(vect);
}
......@@ -634,7 +634,7 @@ void vtkPDataSetReader::ReadPVTKFileInformation(ifstream *file)
vtkErrorMacro("Expecting an image.");
return;
}
sscanf(val, "%f %f %f", vect, vect+1, vect+2);
sscanf(val, "%lf %lf %lf", vect, vect+1, vect+2);
image->SetOrigin(vect);
}
......@@ -1254,7 +1254,7 @@ void vtkPDataSetReader::StructuredGridExecute()
int i;
int pIncY, pIncZ, cIncY, cIncZ;
int ix, iy, iz;
float *pt;
double *pt;
vtkIdType inId, outId;
vtkIdType numPts, numCells;
......@@ -1292,11 +1292,15 @@ void vtkPDataSetReader::StructuredGridExecute()
pieces[count] = tmp;
// Sanity check: extent is correct. Ignore electric slide.
tmp->GetExtent(ext);
if (ext[1] - ext[0] != this->PieceExtents[i][1] - this->PieceExtents[i][0] ||
ext[3] - ext[2] != this->PieceExtents[i][3] - this->PieceExtents[i][2] ||
ext[5] - ext[4] != this->PieceExtents[i][5] - this->PieceExtents[i][4])
if (ext[1] - ext[0] !=
this->PieceExtents[i][1] - this->PieceExtents[i][0] ||
ext[3] - ext[2] !=
this->PieceExtents[i][3] - this->PieceExtents[i][2] ||
ext[5] - ext[4] !=
this->PieceExtents[i][5] - this->PieceExtents[i][4])
{
vtkErrorMacro("Unexpected extent in VTK file: " << this->PieceFileNames[i]);
vtkErrorMacro("Unexpected extent in VTK file: " <<
this->PieceFileNames[i]);
}
else
{
......@@ -1365,7 +1369,8 @@ void vtkPDataSetReader::StructuredGridExecute()
outId = (ix-uExt[0]) + pIncY*(iy-uExt[2]) + pIncZ*(iz-uExt[4]);
pt = pieces[i]->GetPoint(inId);
newPts->SetPoint(outId, pt);
output->GetPointData()->CopyData(ptList, pieces[i]->GetPointData(), i,
output->GetPointData()->CopyData(ptList,
pieces[i]->GetPointData(), i,
inId, outId);
}
++inId;
......
......@@ -22,7 +22,7 @@
#include "vtkRectilinearGrid.h"
#include "vtkErrorCode.h"
vtkCxxRevisionMacro(vtkPDataSetWriter, "1.11");
vtkCxxRevisionMacro(vtkPDataSetWriter, "1.12");
vtkStandardNewMacro(vtkPDataSetWriter);
//----------------------------------------------------------------------------
......@@ -306,18 +306,21 @@ int vtkPDataSetWriter::WriteImageMetaData(vtkImageData *input,
{
int i;
int *pi;
float *pf;
double *pf;
// We should indicate the type of data that is being saved.
*fptr << " dataType=\"" << input->GetClassName() << "\"" << endl;
// Image data has a buch of meta data.
*fptr << " scalarType=\"" << input->GetScalarType() << "\"" << endl;
pf = input->GetOrigin();
*fptr << " origin=\"" << pf[0] << " " << pf[1] << " " << pf[2] << "\"" << endl;
*fptr << " origin=\""
<< pf[0] << " " << pf[1] << " " << pf[2] << "\"" << endl;
pf = input->GetSpacing();
*fptr << " spacing=\"" << pf[0] << " " << pf[1] << " " << pf[2] << "\"" << endl;
*fptr << " spacing=\""
<< pf[0] << " " << pf[1] << " " << pf[2] << "\"" << endl;
pi = input->GetWholeExtent();
*fptr << " wholeExtent=\"" << pi[0] << " " << pi[1] << " " << pi[2] << " "
*fptr << " wholeExtent=\""
<< pi[0] << " " << pi[1] << " " << pi[2] << " "
<< pi[3] << " " << pi[4] << " " << pi[5] << "\"" << endl;
// This is making the assumption that all the files will be written out by
......
......@@ -27,7 +27,7 @@
#include <ctype.h>
#include <math.h>
vtkCxxRevisionMacro(vtkPOPReader, "1.16");
vtkCxxRevisionMacro(vtkPOPReader, "1.17");
vtkStandardNewMacro(vtkPOPReader);
//----------------------------------------------------------------------------
......@@ -401,8 +401,8 @@ vtkPoints *vtkPOPReader::ReadPoints(vtkImageData *image)
{
for (i = ext[0]; i <= ext[1]; ++i)
{
phi = (double)(image->GetScalarComponentAsFloat(i, j, 0, 0));
theta = (double)(image->GetScalarComponentAsFloat(i, j, 1, 0));
phi = image->GetScalarComponentAsDouble(i, j, 0, 0);
theta = image->GetScalarComponentAsDouble(i, j, 1, 0);
phi += vtkMath::Pi()/2.0;
y = -cos(phi)*radius;
x = sin(theta)*sin(phi)*radius;
......@@ -805,7 +805,7 @@ void vtkPOPReader::ReadFlow()
// Now do the computation from bottom to top.
// Since dw is uniform across a level, forget about traversing the points
// back to front. Just do the first slice always.
pp = pts->GetPoint(0);
pp = vtkFloatArray::SafeDownCast(pts)->GetPointer(0);
for (v = updateExt[2]; v <= updateExt[3]; ++v)
{
for (u = updateExt[0]; u <= updateExt[1]; ++u)
......
......@@ -20,7 +20,7 @@
#include "vtkOutlineCornerSource.h"
#include "vtkPolyData.h"
vtkCxxRevisionMacro(vtkPOutlineCornerFilter, "1.4");
vtkCxxRevisionMacro(vtkPOutlineCornerFilter, "1.5");
vtkStandardNewMacro(vtkPOutlineCornerFilter);
vtkCxxSetObjectMacro(vtkPOutlineCornerFilter, Controller, vtkMultiProcessController);
......@@ -45,7 +45,7 @@ vtkPOutlineCornerFilter::~vtkPOutlineCornerFilter ()
void vtkPOutlineCornerFilter::Execute()
{
vtkPolyData *output = this->GetOutput();
float bds[6];
double bds[6];
if ( !this->Controller )
{
......@@ -68,7 +68,7 @@ void vtkPOutlineCornerFilter::Execute()
{
int numProcs = this->Controller->GetNumberOfProcesses();
int idx;
float tmp[6];
double tmp[6];
for (idx = 1; idx < numProcs; ++idx)
{
......
......@@ -41,8 +41,8 @@ public:
// Description:
// Set/Get the factor that controls the relative size of the corners
// to the length of the corresponding bounds
vtkSetClampMacro(CornerFactor, float, 0.001, 0.5);
vtkGetMacro(CornerFactor, float);
vtkSetClampMacro(CornerFactor, double, 0.001, 0.5);
vtkGetMacro(CornerFactor, double);
// Description:
// Set and get the controller.
......@@ -58,7 +58,7 @@ protected:
void Execute();
void ExecuteInformation();
float CornerFactor;
double CornerFactor;
private:
vtkPOutlineCornerFilter(const vtkPOutlineCornerFilter&); // Not implemented.
void operator=(const vtkPOutlineCornerFilter&); // Not implemented.
......
......@@ -20,7 +20,7 @@
#include "vtkOutlineSource.h"
#include "vtkPolyData.h"
vtkCxxRevisionMacro(vtkPOutlineFilter, "1.5");
vtkCxxRevisionMacro(vtkPOutlineFilter, "1.6");
vtkStandardNewMacro(vtkPOutlineFilter);
vtkCxxSetObjectMacro(vtkPOutlineFilter, Controller, vtkMultiProcessController);
......@@ -44,7 +44,7 @@ vtkPOutlineFilter::~vtkPOutlineFilter ()
void vtkPOutlineFilter::Execute()
{
vtkPolyData *output = this->GetOutput();
float bds[6];
double bds[6];
int procid = 0;
int numProcs = 1;
......@@ -64,7 +64,7 @@ void vtkPOutlineFilter::Execute()
else
{
int idx;
float tmp[6];
double tmp[6];
for (idx = 1; idx < numProcs; ++idx)
{
......
......@@ -21,7 +21,7 @@
#include "vtkCellData.h"
#include "vtkPolyData.h"
vtkCxxRevisionMacro(vtkPProbeFilter, "1.7");
vtkCxxRevisionMacro(vtkPProbeFilter, "1.8");
vtkStandardNewMacro(vtkPProbeFilter);
vtkCxxSetObjectMacro(vtkPProbeFilter, Controller, vtkMultiProcessController);
......@@ -85,7 +85,7 @@ void vtkPProbeFilter::ExecuteData(vtkDataObject *)
vtkIdType k;
vtkIdType pointId;
vtkIdType numComponents = pointData->GetNumberOfComponents();
float *tuple = new float[numComponents];
double *tuple = new double[numComponents];
for (i = 1; i < numProcs; i++)
{
this->Controller->Receive(&numRemotePoints, 1, i, 1970);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment