VTK  9.7.1
vtkArrayListTemplate.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Kitware, Inc.
3 // SPDX-License-Identifier: BSD-3-Clause
34 #ifndef vtkArrayListTemplate_h
35 #define vtkArrayListTemplate_h
36 
37 #include "vtkAbstractArray.h"
38 #include "vtkDataArrayRange.h"
39 #include "vtkDataSetAttributes.h"
40 #include "vtkSmartPointer.h"
41 #include "vtkStringArray.h"
42 #include "vtkStringFormatter.h"
43 
44 #include <algorithm>
45 #include <vector>
46 
47 // Create a generic class supporting virtual dispatch to type-specific
48 // subclasses.
49 VTK_ABI_NAMESPACE_BEGIN
51 {
53  int NumComp;
55 
56  BaseArrayPair(vtkIdType num, int numComp, vtkAbstractArray* outArray)
57  : Num(num)
58  , NumComp(numComp)
59  , OutputArray(outArray)
60  {
61  }
62  virtual ~BaseArrayPair() = default;
63 
64  virtual void Copy(vtkIdType inId, vtkIdType outId) = 0;
65  virtual void Interpolate(
66  int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId) = 0;
67  virtual void InterpolateOutput(
68  int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId) = 0;
69  virtual void Average(int numPts, const vtkIdType* ids, vtkIdType outId) = 0;
70  virtual void WeightedAverage(
71  int numPts, const vtkIdType* ids, const double* weights, vtkIdType outId) = 0;
72  virtual void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) = 0;
73  virtual void AssignNullValue(vtkIdType outId) = 0;
74 #ifdef VTK_USE_64BIT_IDS
75  virtual void Copy(unsigned int inId, unsigned int outId) = 0;
76  virtual void Interpolate(
77  int numWeights, const unsigned int* ids, const double* weights, unsigned int outId) = 0;
78  virtual void InterpolateOutput(
79  int numWeights, const unsigned int* ids, const double* weights, unsigned int outId) = 0;
80  virtual void Average(int numPts, const unsigned int* ids, unsigned int outId) = 0;
81  virtual void WeightedAverage(
82  int numPts, const unsigned int* ids, const double* weights, unsigned int outId) = 0;
83  virtual void InterpolateEdge(unsigned int v0, unsigned int v1, double t, unsigned int outId) = 0;
84  virtual void AssignNullValue(unsigned int outId) = 0;
85 #endif
86  virtual void Copy(unsigned short inId, unsigned short outId) = 0;
87  virtual void Interpolate(
88  int numWeights, const unsigned short* ids, const double* weights, unsigned short outId) = 0;
89  virtual void InterpolateOutput(
90  int numWeights, const unsigned short* ids, const double* weights, unsigned short outId) = 0;
91  virtual void Average(int numPts, const unsigned short* ids, unsigned short outId) = 0;
92  virtual void WeightedAverage(
93  int numPts, const unsigned short* ids, const double* weights, unsigned short outId) = 0;
94  virtual void InterpolateEdge(
95  unsigned short v0, unsigned short v1, double t, unsigned short outId) = 0;
96  virtual void AssignNullValue(unsigned short outId) = 0;
97 
98  virtual void Realloc(vtkIdType sze) = 0;
99 };
100 
101 // Type specific interpolation on a matched pair of data arrays
102 template <typename TInputArray, typename TOutputArray, typename T>
103 struct ArrayPair : public BaseArrayPair
104 {
108 
109  ArrayPair(TInputArray* inArray, TOutputArray* outArray, vtkIdType num, int numComp, T null)
110  : BaseArrayPair(num, numComp, outArray)
111  , Input(vtk::DataArrayValueRange(inArray))
112  , Output(vtk::DataArrayValueRange(outArray))
113  , NullValue(null)
114  {
115  }
116  ~ArrayPair() override = default; // calm down some finicky compilers
117 protected:
118  template <typename IdTypeT>
119  void Copy(IdTypeT inId, IdTypeT outId)
120  {
121  for (int j = 0; j < this->NumComp; ++j)
122  {
123  this->Output[outId * this->NumComp + j] =
124  static_cast<T>(this->Input[inId * this->NumComp + j]);
125  }
126  }
127 
128  template <typename IdTypeT>
129  void Interpolate(int numWeights, const IdTypeT* ids, const double* weights, IdTypeT outId)
130  {
131  for (int j = 0; j < this->NumComp; ++j)
132  {
133  double v = 0.0;
134  for (int i = 0; i < numWeights; ++i)
135  {
136  v += weights[i] * static_cast<double>(this->Input[ids[i] * this->NumComp + j]);
137  }
138  this->Output[outId * this->NumComp + j] = static_cast<T>(v);
139  }
140  }
141 
142  template <typename IdTypeT>
143  void InterpolateOutput(int numWeights, const IdTypeT* ids, const double* weights, IdTypeT outId)
144  {
145  for (int j = 0; j < this->NumComp; ++j)
146  {
147  double v = 0.0;
148  for (int i = 0; i < numWeights; ++i)
149  {
150  v += weights[i] * static_cast<double>(this->Output[ids[i] * this->NumComp + j]);
151  }
152  this->Output[outId * this->NumComp + j] = static_cast<T>(v);
153  }
154  }
155 
156  template <typename IdTypeT>
157  void Average(int numPts, const IdTypeT* ids, IdTypeT outId)
158  {
159  for (int j = 0; j < this->NumComp; ++j)
160  {
161  double v = 0.0;
162  for (int i = 0; i < numPts; ++i)
163  {
164  v += static_cast<double>(this->Input[ids[i] * this->NumComp + j]);
165  }
166  v /= static_cast<double>(numPts);
167  this->Output[outId * this->NumComp + j] = static_cast<T>(v);
168  }
169  }
170 
171  template <typename IdTypeT>
172  void WeightedAverage(int numPts, const IdTypeT* ids, const double* weights, IdTypeT outId)
173  {
174  for (int j = 0; j < this->NumComp; ++j)
175  {
176  double v = 0.0;
177  for (int i = 0; i < numPts; ++i)
178  {
179  v += (weights[i] * static_cast<double>(this->Input[ids[i] * this->NumComp + j]));
180  }
181  this->Output[outId * this->NumComp + j] = static_cast<T>(v);
182  }
183  }
184 
185  template <typename IdTypeT>
186  void InterpolateEdge(IdTypeT v0, IdTypeT v1, double t, IdTypeT outId)
187  {
188  double v;
189  for (int j = 0; j < this->NumComp; ++j)
190  {
191  v = this->Input[v0 * this->NumComp + j] +
192  t * (this->Input[v1 * this->NumComp + j] - this->Input[v0 * this->NumComp + j]);
193  this->Output[outId * this->NumComp + j] = static_cast<T>(v);
194  }
195  }
196 
197  template <typename IdTypeT>
198  void AssignNullValue(IdTypeT outId)
199  {
200  for (int j = 0; j < this->NumComp; ++j)
201  {
202  this->Output[outId * this->NumComp + j] = this->NullValue;
203  }
204  }
205 
206 public:
207  void Copy(vtkIdType inId, vtkIdType outId) override { this->Copy<vtkIdType>(inId, outId); }
209  int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId) override
210  {
211  this->Interpolate<vtkIdType>(numWeights, ids, weights, outId);
212  }
214  int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId) override
215  {
216  this->InterpolateOutput<vtkIdType>(numWeights, ids, weights, outId);
217  }
218  void Average(int numPts, const vtkIdType* ids, vtkIdType outId) override
219  {
220  this->Average<vtkIdType>(numPts, ids, outId);
221  }
223  int numPts, const vtkIdType* ids, const double* weights, vtkIdType outId) override
224  {
225  this->WeightedAverage<vtkIdType>(numPts, ids, weights, outId);
226  }
227  void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
228  {
229  this->InterpolateEdge<vtkIdType>(v0, v1, t, outId);
230  }
231  void AssignNullValue(vtkIdType outId) override { this->AssignNullValue<vtkIdType>(outId); }
232 #ifdef VTK_USE_64BIT_IDS
233  void Copy(unsigned int inId, unsigned int outId) override
234  {
235  this->Copy<unsigned int>(inId, outId);
236  }
237  void Interpolate(
238  int numWeights, const unsigned int* ids, const double* weights, unsigned int outId) override
239  {
240  this->Interpolate<unsigned int>(numWeights, ids, weights, outId);
241  }
242  void InterpolateOutput(
243  int numWeights, const unsigned int* ids, const double* weights, unsigned int outId) override
244  {
245  this->InterpolateOutput<unsigned int>(numWeights, ids, weights, outId);
246  }
247  void Average(int numPts, const unsigned int* ids, unsigned int outId) override
248  {
249  this->Average<unsigned int>(numPts, ids, outId);
250  }
251  void WeightedAverage(
252  int numPts, const unsigned int* ids, const double* weights, unsigned int outId) override
253  {
254  this->WeightedAverage<unsigned int>(numPts, ids, weights, outId);
255  }
256  void InterpolateEdge(unsigned int v0, unsigned int v1, double t, unsigned int outId) override
257  {
258  this->InterpolateEdge<unsigned int>(v0, v1, t, outId);
259  }
260  void AssignNullValue(unsigned int outId) override { this->AssignNullValue<unsigned int>(outId); }
261 #endif
262  void Copy(unsigned short inId, unsigned short outId) override
263  {
264  this->Copy<unsigned short>(inId, outId);
265  }
267  int numWeights, const unsigned short* ids, const double* weights, unsigned short outId) override
268  {
269  this->Interpolate<unsigned short>(numWeights, ids, weights, outId);
270  }
272  int numWeights, const unsigned short* ids, const double* weights, unsigned short outId) override
273  {
274  this->InterpolateOutput<unsigned short>(numWeights, ids, weights, outId);
275  }
276  void Average(int numPts, const unsigned short* ids, unsigned short outId) override
277  {
278  this->Average<unsigned short>(numPts, ids, outId);
279  }
281  int numPts, const unsigned short* ids, const double* weights, unsigned short outId) override
282  {
283  this->WeightedAverage<unsigned short>(numPts, ids, weights, outId);
284  }
286  unsigned short v0, unsigned short v1, double t, unsigned short outId) override
287  {
288  this->InterpolateEdge<unsigned short>(v0, v1, t, outId);
289  }
290  void AssignNullValue(unsigned short outId) override
291  {
292  this->AssignNullValue<unsigned short>(outId);
293  }
294 
295  void Realloc(vtkIdType sze) override
296  {
297  this->OutputArray->SetNumberOfTuples(sze);
298  this->Output = vtk::DataArrayValueRange(TOutputArray::SafeDownCast(this->OutputArray));
299  }
300 };
301 
302 template <>
304 {
308 
309  ArrayPair(vtkStringArray* inArray, vtkStringArray* outArray, vtkIdType num, int numComp,
310  vtkStdString null)
311  : BaseArrayPair(num, numComp, outArray)
312  , Input(inArray->GetPointer(0))
313  , Output(outArray->GetPointer(0))
314  , NullValue(null)
315  {
316  }
317  ~ArrayPair() override = default; // calm down some finicky compilers
318 protected:
319  template <typename IdTypeT>
320  void Copy(IdTypeT inId, IdTypeT outId)
321  {
322  for (int j = 0; j < this->NumComp; ++j)
323  {
324  this->Output[outId * this->NumComp + j] =
325  static_cast<vtkStdString>(this->Input[inId * this->NumComp + j]);
326  }
327  }
328  template <typename IdTypeT>
330  int numWeights, const IdTypeT* ids, const double* vtkNotUsed(weights), IdTypeT outId)
331  {
332  for (int i = 0; i < numWeights; ++i)
333  {
334  this->Copy(ids[i], outId);
335  }
336  }
337  template <typename IdTypeT>
338  void InterpolateOutput(int vtkNotUsed(numWeights), const IdTypeT* vtkNotUsed(ids),
339  const double* vtkNotUsed(weights), IdTypeT vtkNotUsed(outId))
340  {
341  }
342  template <typename IdTypeT>
343  void Average(int numPts, const IdTypeT* ids, IdTypeT outId)
344  {
345  for (int i = 0; i < numPts; ++i)
346  {
347  this->Copy(ids[i], outId);
348  }
349  }
350  template <typename IdTypeT>
352  int numPts, const IdTypeT* ids, const double* vtkNotUsed(weights), IdTypeT outId)
353  {
354  for (int i = 0; i < numPts; ++i)
355  {
356  this->Copy(ids[i], outId);
357  }
358  }
359  template <typename IdTypeT>
360  void InterpolateEdge(IdTypeT v0, IdTypeT v1, double vtkNotUsed(t), IdTypeT outId)
361  {
362  vtkStdString s;
363  for (int j = 0; j < this->NumComp; ++j)
364  {
365  this->Output[outId * this->NumComp + j] =
366  this->Input[v0 * this->NumComp + j] + this->Input[v1 * this->NumComp + j];
367  }
368  }
369 
370  template <typename IdTypeT>
371  void AssignNullValue(IdTypeT outId)
372  {
373  for (int j = 0; j < this->NumComp; ++j)
374  {
375  this->Output[outId * this->NumComp + j] = this->NullValue;
376  }
377  }
378 
379 public:
380  void Copy(vtkIdType inId, vtkIdType outId) override { this->Copy<vtkIdType>(inId, outId); }
382  int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId) override
383  {
384  this->Interpolate<vtkIdType>(numWeights, ids, weights, outId);
385  }
387  int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId) override
388  {
389  this->InterpolateOutput<vtkIdType>(numWeights, ids, weights, outId);
390  }
391  void Average(int numPts, const vtkIdType* ids, vtkIdType outId) override
392  {
393  this->Average<vtkIdType>(numPts, ids, outId);
394  }
396  int numPts, const vtkIdType* ids, const double* weights, vtkIdType outId) override
397  {
398  this->WeightedAverage<vtkIdType>(numPts, ids, weights, outId);
399  }
400  void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
401  {
402  this->InterpolateEdge<vtkIdType>(v0, v1, t, outId);
403  }
404  void AssignNullValue(vtkIdType outId) override { this->AssignNullValue<vtkIdType>(outId); }
405 #ifdef VTK_USE_64BIT_IDS
406  void Copy(unsigned int inId, unsigned int outId) override
407  {
408  this->Copy<unsigned int>(inId, outId);
409  }
410  void Interpolate(
411  int numWeights, const unsigned int* ids, const double* weights, unsigned int outId) override
412  {
413  this->Interpolate<unsigned int>(numWeights, ids, weights, outId);
414  }
415  void InterpolateOutput(
416  int numWeights, const unsigned int* ids, const double* weights, unsigned int outId) override
417  {
418  this->InterpolateOutput<unsigned int>(numWeights, ids, weights, outId);
419  }
420  void Average(int numPts, const unsigned int* ids, unsigned int outId) override
421  {
422  this->Average<unsigned int>(numPts, ids, outId);
423  }
424  void WeightedAverage(
425  int numPts, const unsigned int* ids, const double* weights, unsigned int outId) override
426  {
427  this->WeightedAverage<unsigned int>(numPts, ids, weights, outId);
428  }
429  void InterpolateEdge(unsigned int v0, unsigned int v1, double t, unsigned int outId) override
430  {
431  this->InterpolateEdge<unsigned int>(v0, v1, t, outId);
432  }
433  void AssignNullValue(unsigned int outId) override { this->AssignNullValue<unsigned int>(outId); }
434 #endif
435  void Copy(unsigned short inId, unsigned short outId) override
436  {
437  this->Copy<unsigned short>(inId, outId);
438  }
440  int numWeights, const unsigned short* ids, const double* weights, unsigned short outId) override
441  {
442  this->Interpolate<unsigned short>(numWeights, ids, weights, outId);
443  }
445  int numWeights, const unsigned short* ids, const double* weights, unsigned short outId) override
446  {
447  this->InterpolateOutput<unsigned short>(numWeights, ids, weights, outId);
448  }
449  void Average(int numPts, const unsigned short* ids, unsigned short outId) override
450  {
451  this->Average<unsigned short>(numPts, ids, outId);
452  }
454  int numPts, const unsigned short* ids, const double* weights, unsigned short outId) override
455  {
456  this->WeightedAverage<unsigned short>(numPts, ids, weights, outId);
457  }
459  unsigned short v0, unsigned short v1, double t, unsigned short outId) override
460  {
461  this->InterpolateEdge<unsigned short>(v0, v1, t, outId);
462  }
463  void AssignNullValue(unsigned short outId) override
464  {
465  this->AssignNullValue<unsigned short>(outId);
466  }
467 
468  void Realloc(vtkIdType sze) override
469  {
470  this->OutputArray->ReserveTuples(sze);
471  this->OutputArray->SetNumberOfTuples(sze);
472  this->Output = vtkStringArray::FastDownCast(this->OutputArray)->GetPointer(0);
473  }
474 };
475 
476 // Forward declarations. This makes working with vtkTemplateMacro easier.
477 struct ArrayList;
478 
479 template <typename TArray, typename T>
480 void CreateArrayPair(
481  ArrayList* list, TArray* inData, TArray* outData, vtkIdType numTuples, int numComp, T nullValue);
482 
483 // A list of the arrays to interpolate, and a method to invoke interpolation on the list
484 struct ArrayList
485 {
486  // The list of arrays, and the arrays not to process
487  std::vector<BaseArrayPair*> Arrays;
488  std::vector<vtkAbstractArray*> ExcludedArrays;
489 
490  // Add the arrays to interpolate here (from attribute data). Note that this method is
491  // not thread-safe due to its use of vtkDataSetAttributes.
492  void AddArrays(vtkIdType numOutPts, vtkDataSetAttributes* inPD, vtkDataSetAttributes* outPD,
493  double nullValue = 0.0, vtkTypeBool promote = true);
494 
495  // Add an array that interpolates from its own attribute values
497  vtkIdType numOutPts, vtkDataSetAttributes* attr, double nullValue = 0.0);
498 
499  // Add a pair of arrays (manual insertion). Returns the output array created,
500  // if any. No array may be created if \c inArray was previously marked as
501  // excluded using ExcludeArray().
503  vtkStdString& outArrayName, double nullValue, vtkTypeBool promote);
504 
505  // Any array excluded here is not added by AddArrays() or AddArrayPair, hence not
506  // processed. Also check whether an array is excluded.
507  void ExcludeArray(vtkAbstractArray* da);
509 
510  // Only you can prevent memory leaks!
512  {
513  for (auto& array : this->Arrays)
514  {
515  delete array;
516  }
517  }
518 
519 protected:
520  template <typename TIdType>
521  void Copy(TIdType inId, TIdType outId)
522  {
523  for (auto& array : this->Arrays)
524  {
525  array->Copy(inId, outId);
526  }
527  }
528 
529  template <typename TIdType>
530  void Interpolate(int numWeights, const TIdType* ids, const double* weights, TIdType outId)
531  {
532  for (auto& array : this->Arrays)
533  {
534  array->Interpolate(numWeights, ids, weights, outId);
535  }
536  }
537 
538  template <typename TIdType>
539  void InterpolateOutput(int numWeights, const TIdType* ids, const double* weights, TIdType outId)
540  {
541  for (auto& array : this->Arrays)
542  {
543  array->InterpolateOutput(numWeights, ids, weights, outId);
544  }
545  }
546 
547  template <typename TIdType>
548  void Average(int numPts, const TIdType* ids, TIdType outId)
549  {
550  for (auto& array : this->Arrays)
551  {
552  array->Average(numPts, ids, outId);
553  }
554  }
555 
556  template <typename TIdType>
557  void WeightedAverage(int numPts, const TIdType* ids, const double* weights, TIdType outId)
558  {
559  for (auto& array : this->Arrays)
560  {
561  array->WeightedAverage(numPts, ids, weights, outId);
562  }
563  }
564 
565  template <typename TIdType>
566  void InterpolateEdge(TIdType v0, TIdType v1, double t, TIdType outId)
567  {
568  for (auto& array : this->Arrays)
569  {
570  array->InterpolateEdge(v0, v1, t, outId);
571  }
572  }
573 
574  template <typename TIdType>
575  void AssignNullValue(TIdType outId)
576  {
577  for (auto& array : this->Arrays)
578  {
579  array->AssignNullValue(outId);
580  }
581  }
582 
583 public:
588  void Copy(vtkIdType inId, vtkIdType outId) { this->Copy<vtkIdType>(inId, outId); }
592  void Interpolate(int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId)
593  {
594  this->Interpolate<vtkIdType>(numWeights, ids, weights, outId);
595  }
600  int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId)
601  {
602  this->InterpolateOutput<vtkIdType>(numWeights, ids, weights, outId);
603  }
607  void Average(int numPts, const vtkIdType* ids, vtkIdType outId)
608  {
609  this->Average<vtkIdType>(numPts, ids, outId);
610  }
614  void WeightedAverage(int numPts, const vtkIdType* ids, const double* weights, vtkIdType outId)
615  {
616  this->WeightedAverage<vtkIdType>(numPts, ids, weights, outId);
617  }
621  void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId)
622  {
623  this->InterpolateEdge<vtkIdType>(v0, v1, t, outId);
624  }
628  void AssignNullValue(vtkIdType outId) { this->AssignNullValue<vtkIdType>(outId); }
629 #ifdef VTK_USE_64BIT_IDS
630 
634  void Copy(unsigned int inId, unsigned int outId) { this->Copy<unsigned int>(inId, outId); }
638  void Interpolate(
639  int numWeights, const unsigned int* ids, const double* weights, unsigned int outId)
640  {
641  this->Interpolate<unsigned int>(numWeights, ids, weights, outId);
642  }
646  void InterpolateOutput(
647  int numWeights, const unsigned int* ids, const double* weights, unsigned int outId)
648  {
649  this->InterpolateOutput<unsigned int>(numWeights, ids, weights, outId);
650  }
654  void Average(int numPts, const unsigned int* ids, unsigned int outId)
655  {
656  this->Average<unsigned int>(numPts, ids, outId);
657  }
661  void WeightedAverage(
662  int numPts, const unsigned int* ids, const double* weights, unsigned int outId)
663  {
664  this->WeightedAverage<unsigned int>(numPts, ids, weights, outId);
665  }
669  void InterpolateEdge(unsigned int v0, unsigned int v1, double t, unsigned int outId)
670  {
671  this->InterpolateEdge<unsigned int>(v0, v1, t, outId);
672  }
676  void AssignNullValue(unsigned int outId) { this->AssignNullValue<unsigned int>(outId); }
677 #endif
678 
682  void Copy(unsigned short inId, unsigned short outId) { this->Copy<unsigned short>(inId, outId); }
687  int numWeights, const unsigned short* ids, const double* weights, unsigned short outId)
688  {
689  this->Interpolate<unsigned short>(numWeights, ids, weights, outId);
690  }
695  int numWeights, const unsigned short* ids, const double* weights, unsigned short outId)
696  {
697  this->InterpolateOutput<unsigned short>(numWeights, ids, weights, outId);
698  }
702  void Average(int numPts, const unsigned short* ids, unsigned short outId)
703  {
704  this->Average<unsigned short>(numPts, ids, outId);
705  }
710  int numPts, const unsigned short* ids, const double* weights, unsigned short outId)
711  {
712  this->WeightedAverage<unsigned short>(numPts, ids, weights, outId);
713  }
717  void InterpolateEdge(unsigned short v0, unsigned short v1, double t, unsigned short outId)
718  {
719  this->InterpolateEdge<unsigned short>(v0, v1, t, outId);
720  }
724  void AssignNullValue(unsigned short outId) { this->AssignNullValue<unsigned short>(outId); }
725 
729  void Realloc(vtkIdType sze)
730  {
731  for (auto& array : this->Arrays)
732  {
733  array->Realloc(sze);
734  }
735  }
736 
740  vtkIdType GetNumberOfArrays() { return static_cast<vtkIdType>(this->Arrays.size()); }
741 };
742 
743 VTK_ABI_NAMESPACE_END
744 #include "vtkArrayListTemplate.txx"
745 
746 #endif
747 // VTK-HeaderTest-Exclude: vtkArrayListTemplate.h
void Interpolate(int numWeights, const IdTypeT *ids, const double *weights, IdTypeT outId)
void WeightedAverage(int numPts, const TIdType *ids, const double *weights, TIdType outId)
void Interpolate(int numWeights, const IdTypeT *ids, const double *weights, IdTypeT outId)
vtkSmartPointer< vtkAbstractArray > OutputArray
void Copy(unsigned short inId, unsigned short outId) override
Wrapper around std::string to keep symbols short.
Definition: vtkStdString.h:27
void Interpolate(int numWeights, const TIdType *ids, const double *weights, TIdType outId)
virtual void SetNumberOfTuples(vtkIdType numTuples)
Set the number of tuples (a component group) in the array.
std::vector< BaseArrayPair * > Arrays
void AssignNullValue(unsigned short outId)
Loop over the arrays and assign the null value.
void InterpolateOutput(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId)
Loop over the arrays and have them interpolate themselves based on the output arrays.
void AssignNullValue(unsigned short outId) override
void Copy(unsigned short inId, unsigned short outId) override
void Average(int numPts, const unsigned short *ids, unsigned short outId)
Loop over the arrays and have them averaged.
void ExcludeArray(vtkAbstractArray *da)
std::vector< vtkAbstractArray * > ExcludedArrays
void CreateArrayPair(ArrayList *list, TArray *inData, TArray *outData, vtkIdType numTuples, int numComp, T nullValue)
vtkAbstractArray * AddArrayPair(vtkIdType numTuples, vtkAbstractArray *inArray, vtkStdString &outArrayName, double nullValue, vtkTypeBool promote)
void WeightedAverage(int numPts, const IdTypeT *ids, const double *weights, IdTypeT outId)
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
void Realloc(vtkIdType sze) override
void Average(int numPts, const IdTypeT *ids, IdTypeT outId)
void Average(int numPts, const TIdType *ids, TIdType outId)
Abstract superclass for all arrays.
void Copy(unsigned short inId, unsigned short outId)
Loop over the array pairs and copy data from one to another.
void WeightedAverage(int numPts, const unsigned short *ids, const double *weights, unsigned short outId) override
virtual vtkTypeBool ReserveTuples(vtkIdType numTuples)=0
Reserve the array to the requested number of tuples and preserve data.
a vtkAbstractArray subclass for strings
void InterpolateOutput(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
void Average(int numPts, const vtkIdType *ids, vtkIdType outId)
Loop over the arrays and have them averaged.
void Interpolate(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId) override
virtual void Average(int numPts, const vtkIdType *ids, vtkIdType outId)=0
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
void WeightedAverage(int numPts, const vtkIdType *ids, const double *weights, vtkIdType outId) override
void InterpolateOutput(int numWeights, const TIdType *ids, const double *weights, TIdType outId)
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
void AssignNullValue(vtkIdType outId) override
int vtkIdType
Definition: vtkType.h:363
virtual void Realloc(vtkIdType sze)=0
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
void AssignNullValue(IdTypeT outId)
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId)
Loop over the arrays and have them interpolate themselves.
virtual void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId)=0
void InterpolateEdge(TIdType v0, TIdType v1, double t, TIdType outId)
ArrayPair(TInputArray *inArray, TOutputArray *outArray, vtkIdType num, int numComp, T null)
virtual void WeightedAverage(int numPts, const vtkIdType *ids, const double *weights, vtkIdType outId)=0
void AssignNullValue(TIdType outId)
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId)
Loop over the arrays perform edge interpolation.
void Average(int numPts, const vtkIdType *ids, vtkIdType outId) override
int vtkTypeBool
Definition: vtkABI.h:64
void WeightedAverage(int numPts, const unsigned short *ids, const double *weights, unsigned short outId) override
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
virtual void InterpolateOutput(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId)=0
void AssignNullValue(vtkIdType outId)
Loop over the arrays and assign the null value.
vtkIdType GetNumberOfArrays()
Return the number of arrays.
ArrayPair(vtkStringArray *inArray, vtkStringArray *outArray, vtkIdType num, int numComp, vtkStdString null)
void Copy(vtkIdType inId, vtkIdType outId)
Loop over the array pairs and copy data from one to another.
void InterpolateEdge(unsigned short v0, unsigned short v1, double t, unsigned short outId) override
void Average(int numPts, const unsigned short *ids, unsigned short outId) override
void InterpolateEdge(IdTypeT v0, IdTypeT v1, double t, IdTypeT outId)
void Copy(vtkIdType inId, vtkIdType outId) override
void InterpolateOutput(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
vtk::detail::ValueRange< TInputArray, vtk::detail::DynamicTupleSize > Input
void Realloc(vtkIdType sze)
Extend (realloc) the arrays.
void Copy(vtkIdType inId, vtkIdType outId) override
void Interpolate(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId) override
void Copy(IdTypeT inId, IdTypeT outId)
void AddArrays(vtkIdType numOutPts, vtkDataSetAttributes *inPD, vtkDataSetAttributes *outPD, double nullValue=0.0, vtkTypeBool promote=true)
void WeightedAverage(int numPts, const IdTypeT *ids, const double *weights, IdTypeT outId)
represent and manipulate attribute data in a dataset
ValueType * GetPointer(vtkIdType id)
Get the address of a particular data index.
void InterpolateEdge(unsigned short v0, unsigned short v1, double t, unsigned short outId)
Loop over the arrays perform edge interpolation.
virtual void Copy(vtkIdType inId, vtkIdType outId)=0
VTK_ITER_INLINE auto DataArrayValueRange(const ArrayTypePtr &array, ValueIdType start=-1, ValueIdType end=-1) -> typename detail::SelectValueRange< ArrayTypePtr, TupleSize, ForceValueTypeForVtkDataArray >::type
Generate an stl and for-range compatible range of flat AOS iterators from a vtkDataArray.
vtkTypeBool IsExcluded(vtkAbstractArray *da)
void WeightedAverage(int numPts, const unsigned short *ids, const double *weights, unsigned short outId)
Loop over the arrays and weighted average the attributes.
void InterpolateEdge(IdTypeT v0, IdTypeT v1, double t, IdTypeT outId)
void InterpolateOutput(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId) override
void Average(int numPts, const vtkIdType *ids, vtkIdType outId) override
void InterpolateOutput(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId) override
virtual void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId)=0
void InterpolateOutput(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId)
Loop over the arrays and have them interpolate themselves based on the output arrays.
void Interpolate(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId)
Loop over the arrays and have them interpolate themselves.
BaseArrayPair(vtkIdType num, int numComp, vtkAbstractArray *outArray)
void WeightedAverage(int numPts, const vtkIdType *ids, const double *weights, vtkIdType outId) override
void InterpolateEdge(unsigned short v0, unsigned short v1, double t, unsigned short outId) override
void Average(int numPts, const unsigned short *ids, unsigned short outId) override
void InterpolateOutput(int numWeights, const IdTypeT *ids, const double *weights, IdTypeT outId)
vtk::detail::ValueRange< TOutputArray, vtk::detail::DynamicTupleSize > Output
virtual void AssignNullValue(vtkIdType outId)=0
void Copy(TIdType inId, TIdType outId)
Optimized C++ utilities for formatting values to strings and files.
void WeightedAverage(int numPts, const vtkIdType *ids, const double *weights, vtkIdType outId)
Loop over the arrays and weighted average the attributes.
static vtkStringArray * FastDownCast(vtkAbstractArray *source)
Perform a fast, safe cast from a vtkAbstractArray to a vtkStringArray.
void Average(int numPts, const IdTypeT *ids, IdTypeT outId)
void InterpolateOutput(int numWeights, const IdTypeT *ids, const double *weights, IdTypeT outId)
void AddSelfInterpolatingArrays(vtkIdType numOutPts, vtkDataSetAttributes *attr, double nullValue=0.0)
virtual ~BaseArrayPair()=default
STL-compatible iterable ranges that provide access to vtkDataArray elements.
~ArrayPair() override=default