Commit 24abfea6 authored by Ken Martin's avatar Ken Martin

uses new vtkTemplateMacro

parent 35bdf1f7
......@@ -1409,46 +1409,8 @@ static void vtkImageDataCastExecute(vtkImageData *inData, T *inPtr,
switch (outData->GetScalarType())
{
case VTK_DOUBLE:
vtkImageDataCastExecute(inData, (T *)(inPtr),
outData, (double *)(outPtr),outExt);
break;
case VTK_FLOAT:
vtkImageDataCastExecute(inData, (T *)(inPtr),
outData, (float *)(outPtr),outExt);
break;
case VTK_LONG:
vtkImageDataCastExecute(inData, (T *)(inPtr),
outData, (long *)(outPtr),outExt);
break;
case VTK_UNSIGNED_LONG:
vtkImageDataCastExecute(inData, (T *)(inPtr),
outData, (unsigned long *)(outPtr),outExt);
break;
case VTK_INT:
vtkImageDataCastExecute(inData, (T *)(inPtr),
outData, (int *)(outPtr),outExt);
break;
case VTK_UNSIGNED_INT:
vtkImageDataCastExecute(inData, (T *)(inPtr),
outData, (unsigned int *)(outPtr),outExt);
break;
case VTK_SHORT:
vtkImageDataCastExecute(inData, (T *)(inPtr),
outData, (short *)(outPtr),outExt);
break;
case VTK_UNSIGNED_SHORT:
vtkImageDataCastExecute(inData, (T *)(inPtr),
outData, (unsigned short *)(outPtr),outExt);
break;
case VTK_CHAR:
vtkImageDataCastExecute(inData, (T *)(inPtr),
outData, (char *)(outPtr),outExt);
break;
case VTK_UNSIGNED_CHAR:
vtkImageDataCastExecute(inData, (T *)(inPtr),
outData, (unsigned char *)(outPtr),outExt);
break;
vtkTemplateMacro5(vtkImageDataCastExecute, inData, (T *)(inPtr),
outData, (VTK_TT *)(outPtr),outExt);
default:
vtkGenericWarningMacro("Execute: Unknown output ScalarType");
return;
......@@ -1469,46 +1431,8 @@ void vtkImageData::CopyAndCastFrom(vtkImageData *inData, int extent[6])
switch (inData->ScalarType)
{
case VTK_DOUBLE:
vtkImageDataCastExecute(inData, (double *)(inPtr),
this, extent);
break;
case VTK_FLOAT:
vtkImageDataCastExecute(inData, (float *)(inPtr),
this, extent);
break;
case VTK_LONG:
vtkImageDataCastExecute(inData, (long *)(inPtr),
this, extent);
break;
case VTK_UNSIGNED_LONG:
vtkImageDataCastExecute(inData, (unsigned long *)(inPtr),
this, extent);
break;
case VTK_INT:
vtkImageDataCastExecute(inData, (int *)(inPtr),
this, extent);
break;
case VTK_UNSIGNED_INT:
vtkImageDataCastExecute(inData, (unsigned int *)(inPtr),
this, extent);
break;
case VTK_SHORT:
vtkImageDataCastExecute(inData, (short *)(inPtr),
this, extent);
break;
case VTK_UNSIGNED_SHORT:
vtkImageDataCastExecute(inData, (unsigned short *)(inPtr),
this, extent);
break;
case VTK_CHAR:
vtkImageDataCastExecute(inData, (char *)(inPtr),
this, extent);
break;
case VTK_UNSIGNED_CHAR:
vtkImageDataCastExecute(inData, (unsigned char *)(inPtr),
this, extent);
break;
vtkTemplateMacro4(vtkImageDataCastExecute,inData, (VTK_TT *)(inPtr),
this, extent);
default:
vtkErrorMacro(<< "Execute: Unknown input ScalarType");
return;
......
......@@ -238,56 +238,9 @@ void vtkImageAccumulate::Execute(vtkImageData *inData,
switch (inData->GetScalarType())
{
case VTK_DOUBLE:
vtkImageAccumulateExecute(this,
inData, (double *)(inPtr),
outData, (int *)(outPtr));
break;
case VTK_FLOAT:
vtkImageAccumulateExecute(this,
inData, (float *)(inPtr),
outData, (int *)(outPtr));
break;
case VTK_LONG:
vtkImageAccumulateExecute(this,
inData, (long *)(inPtr),
outData, (int *)(outPtr));
break;
case VTK_UNSIGNED_LONG:
vtkImageAccumulateExecute(this,
inData, (unsigned long *)(inPtr),
outData, (int *)(outPtr));
break;
case VTK_INT:
vtkImageAccumulateExecute(this,
inData, (int *)(inPtr),
outData, (int *)(outPtr));
break;
case VTK_UNSIGNED_INT:
vtkImageAccumulateExecute(this,
inData, (unsigned int *)(inPtr),
outData, (int *)(outPtr));
break;
case VTK_SHORT:
vtkImageAccumulateExecute(this,
inData, (short *)(inPtr),
outData, (int *)(outPtr));
break;
case VTK_UNSIGNED_SHORT:
vtkImageAccumulateExecute(this,
inData, (unsigned short *)(inPtr),
outData, (int *)(outPtr));
break;
case VTK_CHAR:
vtkImageAccumulateExecute(this,
inData, (char *)(inPtr),
outData, (int *)(outPtr));
break;
case VTK_UNSIGNED_CHAR:
vtkImageAccumulateExecute(this,
inData, (unsigned char *)(inPtr),
outData, (int *)(outPtr));
break;
vtkTemplateMacro5(vtkImageAccumulateExecute, this,
inData, (VTK_TT *)(inPtr),
outData, (int *)(outPtr));
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
return;
......
......@@ -283,56 +283,9 @@ void vtkImageAppend::ThreadedExecute(vtkImageData **inData,
switch (inData[idx1]->GetScalarType())
{
case VTK_DOUBLE:
vtkImageAppendExecute(this, id, inExt,
inData[idx1], (double *)(inPtr),
cOutExt, outData, (double *)(outPtr));
break;
case VTK_FLOAT:
vtkImageAppendExecute(this, id, inExt,
inData[idx1], (float *)(inPtr),
cOutExt, outData, (float *)(outPtr));
break;
case VTK_UNSIGNED_LONG:
vtkImageAppendExecute(this, id, inExt,
inData[idx1], (unsigned long *)(inPtr),
cOutExt, outData, (unsigned long *)(outPtr));
break;
case VTK_LONG:
vtkImageAppendExecute(this, id, inExt,
inData[idx1], (long *)(inPtr),
cOutExt, outData, (long *)(outPtr));
break;
case VTK_UNSIGNED_INT:
vtkImageAppendExecute(this, id, inExt,
inData[idx1], (unsigned int *)(inPtr),
cOutExt, outData, (unsigned int *)(outPtr));
break;
case VTK_INT:
vtkImageAppendExecute(this, id, inExt,
inData[idx1], (int *)(inPtr),
cOutExt, outData, (int *)(outPtr));
break;
case VTK_SHORT:
vtkImageAppendExecute(this, id, inExt,
inData[idx1], (short *)(inPtr),
cOutExt, outData, (short *)(outPtr));
break;
case VTK_UNSIGNED_SHORT:
vtkImageAppendExecute(this, id, inExt,
inData[idx1], (unsigned short *)(inPtr),
cOutExt, outData,(unsigned short *)(outPtr));
break;
case VTK_CHAR:
vtkImageAppendExecute(this, id, inExt,
inData[idx1], (char *)(inPtr),
cOutExt, outData, (char *)(outPtr));
break;
case VTK_UNSIGNED_CHAR:
vtkImageAppendExecute(this, id, inExt,
inData[idx1], (unsigned char *)(inPtr),
cOutExt, outData, (unsigned char *)(outPtr));
break;
vtkTemplateMacro8(vtkImageAppendExecute, this, id,
inExt, inData[idx1], (VTK_TT *)(inPtr),
cOutExt, outData, (VTK_TT *)(outPtr));
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
return;
......
......@@ -181,66 +181,10 @@ void vtkImageAppendComponents::ThreadedExecute(vtkImageData **inData,
switch (inData[idx1]->GetScalarType())
{
case VTK_DOUBLE:
vtkImageAppendComponentsExecute(this, inData[idx1],
(double *)(inPtr), inComp,
outData, (double *)(outPtr),
outComp, outExt, id);
break;
case VTK_FLOAT:
vtkImageAppendComponentsExecute(this, inData[idx1],
(float *)(inPtr), inComp,
outData, (float *)(outPtr),
outComp, outExt, id);
break;
case VTK_LONG:
vtkImageAppendComponentsExecute(this, inData[idx1],
(long *)(inPtr), inComp,
outData, (long *)(outPtr),
outComp, outExt, id);
break;
case VTK_UNSIGNED_LONG:
vtkImageAppendComponentsExecute(this, inData[idx1],
(unsigned long *)(inPtr), inComp,
outData, (unsigned long *)(outPtr),
outComp, outExt, id);
break;
case VTK_INT:
vtkImageAppendComponentsExecute(this, inData[idx1],
(int *)(inPtr), inComp,
outData, (int *)(outPtr),
outComp, outExt, id);
break;
case VTK_UNSIGNED_INT:
vtkImageAppendComponentsExecute(this, inData[idx1],
(unsigned int *)(inPtr), inComp,
outData, (unsigned int *)(outPtr),
outComp, outExt, id);
break;
case VTK_SHORT:
vtkImageAppendComponentsExecute(this, inData[idx1],
(short *)(inPtr), inComp,
outData, (short *)(outPtr),
outComp, outExt, id);
break;
case VTK_UNSIGNED_SHORT:
vtkImageAppendComponentsExecute(this, inData[idx1],
(unsigned short *)(inPtr), inComp,
outData, (unsigned short *)(outPtr),
outComp, outExt, id);
break;
case VTK_UNSIGNED_CHAR:
vtkImageAppendComponentsExecute(this, inData[idx1],
(unsigned char *)(inPtr), inComp,
outData, (unsigned char *)(outPtr),
outComp, outExt, id);
break;
case VTK_CHAR:
vtkImageAppendComponentsExecute(this, inData[idx1],
(char *)(inPtr), inComp,
outData, (char *)(outPtr),
outComp, outExt, id);
break;
vtkTemplateMacro9(vtkImageAppendComponentsExecute, this,
inData[idx1], (VTK_TT *)(inPtr), inComp,
outData, (VTK_TT *)(outPtr),
outComp, outExt, id);
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
return;
......
......@@ -580,66 +580,9 @@ void vtkImageBlend::ThreadedExecute(vtkImageData **inData,
switch (inData[idx1]->GetScalarType())
{
case VTK_DOUBLE:
vtkImageBlendExecute(this, id, inExt,
inData[idx1], (double *)(inPtr),
outExt, outData, (double *)(outPtr),
opacity);
break;
case VTK_FLOAT:
vtkImageBlendExecute(this, id, inExt,
inData[idx1], (float *)(inPtr),
outExt, outData, (float *)(outPtr),
opacity);
break;
case VTK_UNSIGNED_LONG:
vtkImageBlendExecute(this, id, inExt,
inData[idx1], (unsigned long *)(inPtr),
outExt,outData,(unsigned long *)(outPtr),
opacity);
break;
case VTK_LONG:
vtkImageBlendExecute(this, id, inExt,
inData[idx1], (long *)(inPtr),
outExt, outData, (long *)(outPtr),
opacity);
break;
case VTK_UNSIGNED_INT:
vtkImageBlendExecute(this, id, inExt,
inData[idx1], (unsigned int *)(inPtr),
outExt, outData, (unsigned int *)(outPtr),
opacity);
break;
case VTK_INT:
vtkImageBlendExecute(this, id, inExt,
inData[idx1], (int *)(inPtr),
outExt, outData, (int *)(outPtr),
opacity);
break;
case VTK_SHORT:
vtkImageBlendExecute(this, id, inExt,
inData[idx1], (short *)(inPtr),
outExt, outData, (short *)(outPtr),
opacity);
break;
case VTK_UNSIGNED_SHORT:
vtkImageBlendExecute(this, id, inExt,
inData[idx1], (unsigned short *)(inPtr),
outExt,outData,(unsigned short *)(outPtr),
opacity);
break;
case VTK_CHAR:
vtkImageBlendExecute(this, id, inExt,
inData[idx1], (char *)(inPtr),
outExt,outData,(char *)(outPtr),
opacity);
break;
case VTK_UNSIGNED_CHAR:
vtkImageBlendExecuteChar(this, id, inExt,
inData[idx1], (unsigned char *)(inPtr),
outExt,outData,(unsigned char *)(outPtr),
opacity);
break;
vtkTemplateMacro9(vtkImageBlendExecute, this, id, inExt,
inData[idx1], (VTK_TT *)(inPtr), outExt,
outData, (VTK_TT *)(outPtr), opacity);
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
return;
......
This diff is collapsed.
......@@ -204,51 +204,9 @@ void vtkImageConstantPad::ThreadedExecute(vtkImageData *inData,
switch (inData->GetScalarType())
{
case VTK_DOUBLE:
vtkImageConstantPadExecute(this, inData, (double *)(inPtr),
outData, (double *)(outPtr), outExt, inExt, id);
break;
case VTK_FLOAT:
vtkImageConstantPadExecute(this, inData, (float *)(inPtr),
outData, (float *)(outPtr), outExt, inExt, id);
break;
case VTK_LONG:
vtkImageConstantPadExecute(this, inData, (long *)(inPtr),
outData, (long *)(outPtr), outExt, inExt, id);
break;
case VTK_UNSIGNED_LONG:
vtkImageConstantPadExecute(this, inData, (unsigned long *)(inPtr),
outData, (unsigned long *)(outPtr), outExt,
inExt, id);
break;
case VTK_INT:
vtkImageConstantPadExecute(this, inData, (int *)(inPtr),
outData, (int *)(outPtr), outExt, inExt, id);
break;
case VTK_UNSIGNED_INT:
vtkImageConstantPadExecute(this, inData, (unsigned int *)(inPtr),
outData, (unsigned int *)(outPtr), outExt,
inExt, id);
break;
case VTK_SHORT:
vtkImageConstantPadExecute(this, inData, (short *)(inPtr),
outData, (short *)(outPtr), outExt, inExt, id);
break;
case VTK_UNSIGNED_SHORT:
vtkImageConstantPadExecute(this, inData, (unsigned short *)(inPtr),
outData, (unsigned short *)(outPtr), outExt,
inExt, id);
break;
case VTK_CHAR:
vtkImageConstantPadExecute(this, inData, (char *)(inPtr),
outData, (char *)(outPtr), outExt,
inExt, id);
break;
case VTK_UNSIGNED_CHAR:
vtkImageConstantPadExecute(this, inData, (unsigned char *)(inPtr),
outData, (unsigned char *)(outPtr), outExt,
inExt, id);
break;
vtkTemplateMacro8(vtkImageConstantPadExecute, this,
inData, (VTK_TT *)(inPtr), outData,
(VTK_TT *)(outPtr), outExt, inExt, id);
default:
vtkErrorMacro(<< "Execute: Unknown input ScalarType");
return;
......
......@@ -334,53 +334,9 @@ void vtkImageContinuousDilate3D::ThreadedExecute(vtkImageData *inData,
switch (inData->GetScalarType())
{
case VTK_DOUBLE:
vtkImageContinuousDilate3DExecute(this, mask, inData, (double *)(inPtr),
outData, outExt, (double *)(outPtr), id);
break;
case VTK_FLOAT:
vtkImageContinuousDilate3DExecute(this, mask, inData, (float *)(inPtr),
outData, outExt, (float *)(outPtr), id);
break;
case VTK_LONG:
vtkImageContinuousDilate3DExecute(this, mask, inData, (long *)(inPtr),
outData, outExt, (long*)(outPtr), id);
break;
case VTK_UNSIGNED_LONG:
vtkImageContinuousDilate3DExecute(this, mask, inData,
(unsigned long *)(inPtr),
outData, outExt,
(unsigned long*)(outPtr), id);
break;
case VTK_INT:
vtkImageContinuousDilate3DExecute(this, mask, inData, (int *)(inPtr),
outData, outExt, (int*)(outPtr), id);
break;
case VTK_UNSIGNED_INT:
vtkImageContinuousDilate3DExecute(this, mask, inData,
(unsigned int *)(inPtr),
outData, outExt,
(unsigned int*)(outPtr), id);
break;
case VTK_SHORT:
vtkImageContinuousDilate3DExecute(this, mask, inData, (short *)(inPtr),
outData, outExt, (short *)(outPtr), id);
break;
case VTK_UNSIGNED_SHORT:
vtkImageContinuousDilate3DExecute(this, mask,
inData, (unsigned short *)(inPtr),
outData, outExt, (unsigned short *)(outPtr),id);
break;
case VTK_CHAR:
vtkImageContinuousDilate3DExecute(this, mask,
inData, (char *)(inPtr),
outData, outExt, (char *)(outPtr),id);
break;
case VTK_UNSIGNED_CHAR:
vtkImageContinuousDilate3DExecute(this, mask,
inData, (unsigned char *)(inPtr),
outData, outExt, (unsigned char *)(outPtr),id);
break;
vtkTemplateMacro8(vtkImageContinuousDilate3DExecute, this,
mask, inData, (VTK_TT *)(inPtr),
outData, outExt, (VTK_TT *)(outPtr), id);
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
return;
......
......@@ -335,49 +335,9 @@ void vtkImageContinuousErode3D::ThreadedExecute(vtkImageData *inData,
switch (inData->GetScalarType())
{
case VTK_DOUBLE:
vtkImageContinuousErode3DExecute(this, mask, inData, (double *)(inPtr),
outData, outExt, (double *)(outPtr),id);
break;
case VTK_FLOAT:
vtkImageContinuousErode3DExecute(this, mask, inData, (float *)(inPtr),
outData, outExt, (float *)(outPtr),id);
break;
case VTK_LONG:
vtkImageContinuousErode3DExecute(this, mask, inData, (long *)(inPtr),
outData, outExt, (long *)(outPtr),id);
break;
case VTK_UNSIGNED_LONG:
vtkImageContinuousErode3DExecute(this, mask, inData, (unsigned long *)(inPtr),
outData, outExt, (unsigned long *)(outPtr),id);
break;
case VTK_INT:
vtkImageContinuousErode3DExecute(this, mask, inData, (int *)(inPtr),
outData, outExt, (int *)(outPtr),id);
break;
case VTK_UNSIGNED_INT:
vtkImageContinuousErode3DExecute(this, mask, inData, (unsigned int *)(inPtr),
outData, outExt, (unsigned int *)(outPtr),id);
break;
case VTK_SHORT:
vtkImageContinuousErode3DExecute(this, mask, inData, (short *)(inPtr),
outData, outExt, (short *)(outPtr),id);
break;
case VTK_UNSIGNED_SHORT:
vtkImageContinuousErode3DExecute(this, mask,
inData, (unsigned short *)(inPtr),
outData, outExt, (unsigned short *)(outPtr),id);
break;
case VTK_CHAR:
vtkImageContinuousErode3DExecute(this, mask,
inData, (char *)(inPtr),
outData, outExt, (char *)(outPtr),id);
break;
case VTK_UNSIGNED_CHAR:
vtkImageContinuousErode3DExecute(this, mask,
inData, (unsigned char *)(inPtr),
outData, outExt, (unsigned char *)(outPtr),id);
break;
vtkTemplateMacro8(vtkImageContinuousErode3DExecute, this, mask,
inData, (VTK_TT *)(inPtr), outData, outExt,
(VTK_TT *)(outPtr),id);
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
return;
......
......@@ -277,72 +277,9 @@ void vtkImageCorrelation::ThreadedExecute(vtkImageData **inData,
switch (inData[0]->GetScalarType())
{
case VTK_DOUBLE:
vtkImageCorrelationExecute(this, inData[0],
(double *)(in1Ptr),
inData[1], (double *)(in2Ptr),
outData, outPtr,
outExt, id);
break;
case VTK_FLOAT:
vtkImageCorrelationExecute(this, inData[0],
(float *)(in1Ptr),
inData[1], (float *)(in2Ptr),
outData, outPtr,
outExt, id);
break;
case VTK_LONG:
vtkImageCorrelationExecute(this, inData[0], (long *)(in1Ptr),
inData[1], (long *)(in2Ptr),
outData, outPtr,
outExt, id);
break;
case VTK_UNSIGNED_LONG:
vtkImageCorrelationExecute(this, inData[0], (unsigned long *)(in1Ptr),
inData[1], (unsigned long *)(in2Ptr),
outData, outPtr,
outExt, id);
break;
case VTK_INT:
vtkImageCorrelationExecute(this, inData[0], (int *)(in1Ptr),
inData[1], (int *)(in2Ptr),
outData, outPtr,
outExt, id);
break;
case VTK_UNSIGNED_INT:
vtkImageCorrelationExecute(this, inData[0], (unsigned int *)(in1Ptr),
inData[1], (unsigned int *)(in2Ptr),
outData, outPtr,
outExt, id);
break;
case VTK_SHORT:
vtkImageCorrelationExecute(this, inData[0],
(short *)(in1Ptr),
inData[1], (short *)(in2Ptr),
outData, outPtr,
outExt, id);
break;
case VTK_UNSIGNED_SHORT:
vtkImageCorrelationExecute(this, inData[0],
(unsigned short *)(in1Ptr),
inData[1],
(unsigned short *)(in2Ptr),
outData, outPtr, outExt, id);
break;
case VTK_CHAR:
vtkImageCorrelationExecute(this, inData[0],
(char *)(in1Ptr),
inData[1],
(char *)(in2Ptr),
outData, outPtr, outExt, id);
break;
case VTK_UNSIGNED_CHAR:
vtkImageCorrelationExecute(this, inData[0],
(unsigned char *)(in1Ptr),
inData[1],
(unsigned char *)(in2Ptr),
outData, outPtr, outExt, id);
break;
vtkTemplateMacro9(vtkImageCorrelationExecute, this, inData[0],
(VTK_TT *)(in1Ptr), inData[1], (VTK_TT *)(in2Ptr),
outData, outPtr, outExt, id);
default:
vtkErrorMacro(<< "Execute: Unknown ScalarType");
return;
......
......@@ -156,46 +156,8 @@ void vtkImageCursor3D::Execute(vtkImageData *vtkNotUsed(inData),
switch (outData->GetScalarType())
{
case VTK_DOUBLE:
vtkImageCursor3DExecute(this,
outData, (double *)(ptr));
break;
case VTK_FLOAT:
vtkImageCursor3DExecute(this,
outData, (float *)(ptr));
break;
case VTK_LONG:
vtkImageCursor3DExecute(this,
outData, (long *)(ptr));
break;
case VTK_UNSIGNED_LONG:
vtkImageCursor3DExecute(this,
outData, (unsigned long *)(ptr));
break;
case VTK_INT:
vtkImageCursor3DExecute(this,
outData, (int *)(ptr));
break;
case VTK_UNSIGNED_INT:
vtkImageCursor3DExecute(this,
outData, (unsigned int *)(ptr));
break;
case VTK_SHORT:
vtkImageCursor3DExecute(this,
outData, (short *)(ptr));
break;