40 #ifndef vtkArrayListTemplate_h 41 #define vtkArrayListTemplate_h 67 virtual void Copy(vtkIdType inId, vtkIdType outId) = 0;
68 virtual void Interpolate(
int numWeights,
const vtkIdType *ids,
69 const double *weights, vtkIdType outId) = 0;
71 double t, vtkIdType outId) = 0;
73 virtual void Realloc(vtkIdType sze) = 0;
92 void Copy(vtkIdType inId, vtkIdType outId)
override 94 for (
int j=0; j < this->
NumComp; ++j)
96 this->Output[outId*this->NumComp+j] = this->Input[inId*this->NumComp+j];
101 const double *weights, vtkIdType outId)
override 103 for (
int j=0; j < this->
NumComp; ++j)
106 for (vtkIdType i=0; i < numWeights; ++i)
108 v += weights[i] * static_cast<double>(this->Input[ids[i]*this->NumComp+j]);
110 this->Output[outId*this->NumComp+j] = static_cast<T>(v);
117 vtkIdType numComp=this->
NumComp;
118 for (
int j=0; j < numComp; ++j)
120 v = this->Input[v0*numComp+j] +
121 t * (this->Input[v1*numComp+j] - this->Input[v0*numComp+j]);
122 this->Output[outId*numComp+j] = static_cast<T>(v);
128 for (
int j=0; j < this->
NumComp; ++j)
130 this->Output[outId*this->NumComp+j] = this->
NullValue;
144 template <
typename TInput,
typename TOutput>
159 void Copy(vtkIdType inId, vtkIdType outId)
override 161 for (
int j=0; j < this->
NumComp; ++j)
163 this->Output[outId*this->NumComp+j] = static_cast<TOutput>(this->Input[inId*this->NumComp+j]);
168 const double *weights, vtkIdType outId)
override 170 for (
int j=0; j < this->
NumComp; ++j)
173 for (vtkIdType i=0; i < numWeights; ++i)
175 v += weights[i] * static_cast<double>(this->Input[ids[i]*this->NumComp+j]);
177 this->Output[outId*this->NumComp+j] = static_cast<TOutput>(v);
184 vtkIdType numComp=this->
NumComp;
185 for (
int j=0; j < numComp; ++j)
187 v = this->Input[v0*numComp+j] +
188 t * (this->Input[v1*numComp+j] - this->Input[v0*numComp+j]);
189 this->Output[outId*numComp+j] = static_cast<TOutput>(v);
195 for (
int j=0; j < this->
NumComp; ++j)
197 this->Output[outId*this->NumComp+j] = this->
NullValue;
212 template <
typename T>
214 vtkIdType numTuples,
int numComp, T nullValue);
231 double nullValue=0.0);
237 vtkStdString &outArrayName,
double nullValue,
bool promote);
245 void Copy(vtkIdType inId, vtkIdType outId)
247 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin();
250 (*it)->Copy(inId, outId);
255 void Interpolate(
int numWeights,
const vtkIdType *ids,
const double *weights, vtkIdType outId)
257 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin();
260 (*it)->Interpolate(numWeights, ids, weights, outId);
267 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin();
270 (*it)->InterpolateEdge(v0, v1, t, outId);
277 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin();
280 (*it)->AssignNullValue(outId);
287 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin();
297 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin();
307 return static_cast<vtkIdType>(
Arrays.size());
313 #include "vtkArrayListTemplate.txx" void AddArrays(vtkIdType numOutPts, vtkDataSetAttributes *inPD, vtkDataSetAttributes *outPD, double nullValue=0.0, bool promote=true)
Wrapper around std::string to keep symbols short.
bool IsExcluded(vtkDataArray *da)
RealArrayPair(TInput *in, TOutput *out, vtkIdType num, int numComp, vtkDataArray *outArray, TOutput null)
std::vector< BaseArrayPair * > Arrays
ArrayPair(T *in, T *out, vtkIdType num, int numComp, vtkDataArray *outArray, T null)
virtual void * GetVoidPointer(vtkIdType valueIdx)=0
Return a void pointer.
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
void Copy(vtkIdType inId, vtkIdType outId) override
void Copy(vtkIdType inId, vtkIdType outId) override
void AssignNullValue(vtkIdType outId) override
void Realloc(vtkIdType sze) override
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
BaseArrayPair(vtkIdType num, int numComp, vtkDataArray *outArray)
void AssignNullValue(vtkIdType outId) override
virtual void Realloc(vtkIdType sze)=0
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId)
virtual void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId)=0
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId)
void AssignNullValue(vtkIdType outId)
vtkIdType GetNumberOfArrays()
void Copy(vtkIdType inId, vtkIdType outId)
abstract superclass for arrays of numeric data
void Realloc(vtkIdType sze)
represent and manipulate attribute data in a dataset
virtual void Copy(vtkIdType inId, vtkIdType outId)=0
vtkDataArray * AddArrayPair(vtkIdType numTuples, vtkDataArray *inArray, vtkStdString &outArrayName, double nullValue, bool promote)
void ExcludeArray(vtkDataArray *da)
virtual void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId)=0
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
vtkSmartPointer< vtkDataArray > OutputArray
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
void Realloc(vtkIdType sze) override
virtual void * WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues)=0
Get the address of a particular data index.
void CreateArrayPair(ArrayList *list, T *inData, T *outData, vtkIdType numTuples, int numComp, T nullValue)
virtual void AssignNullValue(vtkIdType outId)=0
~RealArrayPair() override
std::vector< vtkDataArray * > ExcludedArrays
void AddSelfInterpolatingArrays(vtkIdType numOutPts, vtkDataSetAttributes *attr, double nullValue=0.0)