40 #ifndef vtkArrayListTemplate_h
41 #define vtkArrayListTemplate_h
96 for (
int j = 0; j < this->
NumComp; ++j)
98 this->Output[outId * this->NumComp + j] = this->Input[inId * this->NumComp + j];
103 int numWeights,
const vtkIdType* ids,
const double* weights,
vtkIdType outId)
override
105 for (
int j = 0; j < this->
NumComp; ++j)
108 for (
vtkIdType i = 0; i < numWeights; ++i)
110 v += weights[i] *
static_cast<double>(this->Input[ids[i] * this->NumComp + j]);
112 this->Output[outId * this->NumComp + j] =
static_cast<T
>(v);
120 for (
int j = 0; j < numComp; ++j)
122 v = this->Input[v0 * numComp + j] +
123 t * (this->Input[v1 * numComp + j] - this->Input[v0 * numComp + j]);
124 this->Output[outId * numComp + j] =
static_cast<T
>(v);
130 for (
int j = 0; j < this->
NumComp; ++j)
132 this->Output[outId * this->NumComp + j] = this->
NullValue;
145 template <
typename TInput,
typename TOutput>
166 for (
int j = 0; j < this->
NumComp; ++j)
168 this->Output[outId * this->NumComp + j] =
169 static_cast<TOutput
>(this->Input[inId * this->NumComp + j]);
174 int numWeights,
const vtkIdType* ids,
const double* weights,
vtkIdType outId)
override
176 for (
int j = 0; j < this->
NumComp; ++j)
179 for (
vtkIdType i = 0; i < numWeights; ++i)
181 v += weights[i] *
static_cast<double>(this->Input[ids[i] * this->NumComp + j]);
183 this->Output[outId * this->NumComp + j] =
static_cast<TOutput
>(v);
191 for (
int j = 0; j < numComp; ++j)
193 v = this->Input[v0 * numComp + j] +
194 t * (this->Input[v1 * numComp + j] - this->Input[v0 * numComp + j]);
195 this->Output[outId * numComp + j] =
static_cast<TOutput
>(v);
201 for (
int j = 0; j < this->
NumComp; ++j)
203 this->Output[outId * this->NumComp + j] = this->
NullValue;
217 template <
typename T>
219 ArrayList* list, T* inData, T* outData,
vtkIdType numTuples,
int numComp, T nullValue);
230 double nullValue = 0.0,
vtkTypeBool promote =
true);
250 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
252 (*it)->Copy(inId, outId);
259 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
261 (*it)->Interpolate(numWeights, ids, weights, outId);
268 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
270 (*it)->InterpolateEdge(v0, v1, t, outId);
277 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
279 (*it)->AssignNullValue(outId);
286 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
295 for (std::vector<BaseArrayPair*>::iterator it =
Arrays.begin(); it !=
Arrays.end(); ++it)
305 #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.
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)
vtkDataArray * AddArrayPair(vtkIdType numTuples, vtkDataArray *inArray, vtkStdString &outArrayName, double nullValue, vtkTypeBool promote)
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 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 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 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
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() override
RealArrayPair(TInput *in, TOutput *out, vtkIdType num, int numComp, vtkDataArray *outArray, TOutput null)
void CreateArrayPair(ArrayList *list, T *inData, T *outData, vtkIdType numTuples, int numComp, T nullValue)