45#ifndef vtkArrayListTemplate_h
46#define vtkArrayListTemplate_h
100 for (
int j = 0; j < this->
NumComp; ++j)
102 this->Output[outId * this->NumComp + j] = this->Input[inId * this->NumComp + j];
107 int numWeights,
const vtkIdType* ids,
const double* weights,
vtkIdType outId)
override
109 for (
int j = 0; j < this->
NumComp; ++j)
112 for (
vtkIdType i = 0; i < numWeights; ++i)
114 v += weights[i] *
static_cast<double>(this->Input[ids[i] * this->NumComp + j]);
116 this->Output[outId * this->NumComp + j] =
static_cast<T
>(v);
122 for (
int j = 0; j < this->
NumComp; ++j)
127 v +=
static_cast<double>(this->Input[ids[i] * this->NumComp + j]);
129 v /=
static_cast<double>(numPts);
130 this->Output[outId * this->NumComp + j] =
static_cast<T
>(v);
138 for (
int j = 0; j < numComp; ++j)
140 v = this->Input[v0 * numComp + j] +
141 t * (this->Input[v1 * numComp + j] - this->Input[v0 * numComp + j]);
142 this->Output[outId * numComp + j] =
static_cast<T
>(v);
148 for (
int j = 0; j < this->
NumComp; ++j)
150 this->Output[outId * this->NumComp + j] = this->
NullValue;
163template <
typename TInput,
typename TOutput>
182 for (
int j = 0; j < this->
NumComp; ++j)
184 this->Output[outId * this->NumComp + j] =
185 static_cast<TOutput
>(this->Input[inId * this->NumComp + j]);
190 int numWeights,
const vtkIdType* ids,
const double* weights,
vtkIdType outId)
override
192 for (
int j = 0; j < this->
NumComp; ++j)
195 for (
vtkIdType i = 0; i < numWeights; ++i)
197 v += weights[i] *
static_cast<double>(this->Input[ids[i] * this->NumComp + j]);
199 this->Output[outId * this->NumComp + j] =
static_cast<TOutput
>(v);
205 for (
int j = 0; j < this->
NumComp; ++j)
210 v +=
static_cast<double>(this->Input[ids[i] * this->NumComp + j]);
212 v /=
static_cast<double>(numPts);
213 this->Output[outId * this->NumComp + j] =
static_cast<TOutput
>(v);
221 for (
int j = 0; j < numComp; ++j)
223 v = this->Input[v0 * numComp + j] +
224 t * (this->Input[v1 * numComp + j] - this->Input[v0 * numComp + j]);
225 this->Output[outId * numComp + j] =
static_cast<TOutput
>(v);
231 for (
int j = 0; j < this->
NumComp; ++j)
233 this->Output[outId * this->NumComp + j] = this->
NullValue;
249 ArrayList* list, T* inData, T* outData,
vtkIdType numTuples,
int numComp, T nullValue);
261 double nullValue = 0.0,
vtkTypeBool promote =
true);
282 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
284 (*it)->Copy(inId, outId);
291 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
293 (*it)->Interpolate(numWeights, ids, weights, outId);
300 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
302 (*it)->Average(numPts, ids, outId);
309 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
311 (*it)->InterpolateEdge(v0, v1, t, outId);
318 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
320 (*it)->AssignNullValue(outId);
327 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
336 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
346#include "vtkArrayListTemplate.txx"
virtual void * GetVoidPointer(vtkIdType valueIdx)=0
Return a void pointer.
abstract superclass for arrays of numeric data
virtual void * WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues)=0
Get the address of a particular data index.
represent and manipulate attribute data in a dataset
Wrapper around std::string to keep symbols short.
vtkDataArray * AddArrayPair(vtkIdType numTuples, vtkDataArray *inArray, vtkStdString &outArrayName, double nullValue, vtkTypeBool promote)
void Average(int numPts, const vtkIdType *ids, vtkIdType outId)
void ExcludeArray(vtkDataArray *da)
std::vector< vtkDataArray * > ExcludedArrays
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId)
void AddSelfInterpolatingArrays(vtkIdType numOutPts, vtkDataSetAttributes *attr, double nullValue=0.0)
void AssignNullValue(vtkIdType outId)
vtkIdType GetNumberOfArrays()
void Copy(vtkIdType inId, vtkIdType outId)
void AddArrays(vtkIdType numOutPts, vtkDataSetAttributes *inPD, vtkDataSetAttributes *outPD, double nullValue=0.0, vtkTypeBool promote=true)
vtkTypeBool IsExcluded(vtkDataArray *da)
void Realloc(vtkIdType sze)
std::vector< BaseArrayPair * > Arrays
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId)
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
void AssignNullValue(vtkIdType outId) override
void Average(int numPts, const vtkIdType *ids, vtkIdType outId) override
~ArrayPair() override=default
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
ArrayPair(T *in, T *out, vtkIdType num, int numComp, vtkDataArray *outArray, T null)
void Copy(vtkIdType inId, vtkIdType outId) override
void Realloc(vtkIdType sze) override
vtkSmartPointer< vtkDataArray > OutputArray
virtual void Average(int numPts, const vtkIdType *ids, vtkIdType outId)=0
virtual void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId)=0
virtual void AssignNullValue(vtkIdType outId)=0
virtual void Copy(vtkIdType inId, vtkIdType outId)=0
virtual ~BaseArrayPair()=default
virtual void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId)=0
virtual void Realloc(vtkIdType sze)=0
BaseArrayPair(vtkIdType num, int numComp, vtkDataArray *outArray)
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
~RealArrayPair() override=default
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
void Copy(vtkIdType inId, vtkIdType outId) override
void AssignNullValue(vtkIdType outId) override
void Realloc(vtkIdType sze) override
RealArrayPair(TInput *in, TOutput *out, vtkIdType num, int numComp, vtkDataArray *outArray, TOutput null)
void Average(int numPts, const vtkIdType *ids, vtkIdType outId) override
void CreateArrayPair(ArrayList *list, T *inData, T *outData, vtkIdType numTuples, int numComp, T nullValue)