 |
VTK
9.1.0
|
Go to the documentation of this file.
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;
163 template <
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;
247 template <
typename T>
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 * WriteVoidPointer(vtkIdType valueIdx, vtkIdType numValues)=0
Get the address of a particular data index.
BaseArrayPair(vtkIdType num, int numComp, vtkDataArray *outArray)
virtual void Copy(vtkIdType inId, vtkIdType outId)=0
vtkTypeBool IsExcluded(vtkDataArray *da)
virtual void Average(int numPts, const vtkIdType *ids, vtkIdType outId)=0
vtkIdType GetNumberOfArrays()
vtkDataArray * AddArrayPair(vtkIdType numTuples, vtkDataArray *inArray, vtkStdString &outArrayName, double nullValue, vtkTypeBool promote)
void AssignNullValue(vtkIdType outId) override
void AddSelfInterpolatingArrays(vtkIdType numOutPts, vtkDataSetAttributes *attr, double nullValue=0.0)
represent and manipulate attribute data in a dataset
virtual void AssignNullValue(vtkIdType outId)=0
void Copy(vtkIdType inId, vtkIdType outId) override
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId)
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
abstract superclass for arrays of numeric data
void Copy(vtkIdType inId, vtkIdType outId)
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
virtual void * GetVoidPointer(vtkIdType valueIdx)=0
Return a void pointer.
~RealArrayPair() override=default
void AssignNullValue(vtkIdType outId) override
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId)
void Realloc(vtkIdType sze) override
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
virtual void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId)=0
void AddArrays(vtkIdType numOutPts, vtkDataSetAttributes *inPD, vtkDataSetAttributes *outPD, double nullValue=0.0, vtkTypeBool promote=true)
void CreateArrayPair(ArrayList *list, T *inData, T *outData, vtkIdType numTuples, int numComp, T nullValue)
vtkSmartPointer< vtkDataArray > OutputArray
void Copy(vtkIdType inId, vtkIdType outId) override
void Realloc(vtkIdType sze)
void Average(int numPts, const vtkIdType *ids, vtkIdType outId)
RealArrayPair(TInput *in, TOutput *out, vtkIdType num, int numComp, vtkDataArray *outArray, TOutput null)
virtual void Realloc(vtkIdType sze)=0
~ArrayPair() override=default
void AssignNullValue(vtkIdType outId)
virtual void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId)=0
void Realloc(vtkIdType sze) override
std::vector< BaseArrayPair * > Arrays
void Average(int numPts, const vtkIdType *ids, vtkIdType outId) override
void ExcludeArray(vtkDataArray *da)
Wrapper around std::string to keep symbols short.
std::vector< vtkDataArray * > ExcludedArrays
ArrayPair(T *in, T *out, vtkIdType num, int numComp, vtkDataArray *outArray, T null)
void Average(int numPts, const vtkIdType *ids, vtkIdType outId) override
virtual ~BaseArrayPair()=default