VTK  9.6.20260305
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
33
34#ifndef vtkArrayListTemplate_h
35#define vtkArrayListTemplate_h
36
37#include "vtkAbstractArray.h"
38#include "vtkDataArrayRange.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.
49VTK_ABI_NAMESPACE_BEGIN
51{
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
102template <typename TInputArray, typename TOutputArray, typename T>
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
117protected:
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
206public:
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 }
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 {
293 }
294
295 void Realloc(vtkIdType sze) override
296 {
297 this->OutputArray->Resize(sze);
298 this->OutputArray->SetNumberOfTuples(sze);
299 this->Output = vtk::DataArrayValueRange(TOutputArray::SafeDownCast(this->OutputArray));
300 }
301};
302
303template <>
305{
309
310 ArrayPair(vtkStringArray* inArray, vtkStringArray* outArray, vtkIdType num, int numComp,
311 vtkStdString null)
312 : BaseArrayPair(num, numComp, outArray)
313 , Input(inArray->GetPointer(0))
314 , Output(outArray->GetPointer(0))
315 , NullValue(null)
316 {
317 }
318 ~ArrayPair() override = default; // calm down some finicky compilers
319protected:
320 template <typename IdTypeT>
321 void Copy(IdTypeT inId, IdTypeT outId)
322 {
323 for (int j = 0; j < this->NumComp; ++j)
324 {
325 this->Output[outId * this->NumComp + j] =
326 static_cast<vtkStdString>(this->Input[inId * this->NumComp + j]);
327 }
328 }
329 template <typename IdTypeT>
331 int numWeights, const IdTypeT* ids, const double* vtkNotUsed(weights), IdTypeT outId)
332 {
333 for (int i = 0; i < numWeights; ++i)
334 {
335 this->Copy(ids[i], outId);
336 }
337 }
338 template <typename IdTypeT>
339 void InterpolateOutput(int vtkNotUsed(numWeights), const IdTypeT* vtkNotUsed(ids),
340 const double* vtkNotUsed(weights), IdTypeT vtkNotUsed(outId))
341 {
342 }
343 template <typename IdTypeT>
344 void Average(int numPts, const IdTypeT* ids, IdTypeT outId)
345 {
346 for (int i = 0; i < numPts; ++i)
347 {
348 this->Copy(ids[i], outId);
349 }
350 }
351 template <typename IdTypeT>
353 int numPts, const IdTypeT* ids, const double* vtkNotUsed(weights), IdTypeT outId)
354 {
355 for (int i = 0; i < numPts; ++i)
356 {
357 this->Copy(ids[i], outId);
358 }
359 }
360 template <typename IdTypeT>
361 void InterpolateEdge(IdTypeT v0, IdTypeT v1, double vtkNotUsed(t), IdTypeT outId)
362 {
363 vtkStdString s;
364 for (int j = 0; j < this->NumComp; ++j)
365 {
366 this->Output[outId * this->NumComp + j] =
367 this->Input[v0 * this->NumComp + j] + this->Input[v1 * this->NumComp + j];
368 }
369 }
370
371 template <typename IdTypeT>
372 void AssignNullValue(IdTypeT outId)
373 {
374 for (int j = 0; j < this->NumComp; ++j)
375 {
376 this->Output[outId * this->NumComp + j] = this->NullValue;
377 }
378 }
379
380public:
381 void Copy(vtkIdType inId, vtkIdType outId) override { this->Copy<vtkIdType>(inId, outId); }
383 int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId) override
384 {
385 this->Interpolate<vtkIdType>(numWeights, ids, weights, outId);
386 }
388 int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId) override
389 {
390 this->InterpolateOutput<vtkIdType>(numWeights, ids, weights, outId);
391 }
392 void Average(int numPts, const vtkIdType* ids, vtkIdType outId) override
393 {
394 this->Average<vtkIdType>(numPts, ids, outId);
395 }
397 int numPts, const vtkIdType* ids, const double* weights, vtkIdType outId) override
398 {
399 this->WeightedAverage<vtkIdType>(numPts, ids, weights, outId);
400 }
401 void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
402 {
403 this->InterpolateEdge<vtkIdType>(v0, v1, t, outId);
404 }
405 void AssignNullValue(vtkIdType outId) override { this->AssignNullValue<vtkIdType>(outId); }
406#ifdef VTK_USE_64BIT_IDS
407 void Copy(unsigned int inId, unsigned int outId) override
408 {
409 this->Copy<unsigned int>(inId, outId);
410 }
411 void Interpolate(
412 int numWeights, const unsigned int* ids, const double* weights, unsigned int outId) override
413 {
414 this->Interpolate<unsigned int>(numWeights, ids, weights, outId);
415 }
417 int numWeights, const unsigned int* ids, const double* weights, unsigned int outId) override
418 {
419 this->InterpolateOutput<unsigned int>(numWeights, ids, weights, outId);
420 }
421 void Average(int numPts, const unsigned int* ids, unsigned int outId) override
422 {
423 this->Average<unsigned int>(numPts, ids, outId);
424 }
425 void WeightedAverage(
426 int numPts, const unsigned int* ids, const double* weights, unsigned int outId) override
427 {
428 this->WeightedAverage<unsigned int>(numPts, ids, weights, outId);
429 }
430 void InterpolateEdge(unsigned int v0, unsigned int v1, double t, unsigned int outId) override
431 {
432 this->InterpolateEdge<unsigned int>(v0, v1, t, outId);
433 }
434 void AssignNullValue(unsigned int outId) override { this->AssignNullValue<unsigned int>(outId); }
435#endif
436 void Copy(unsigned short inId, unsigned short outId) override
437 {
438 this->Copy<unsigned short>(inId, outId);
439 }
441 int numWeights, const unsigned short* ids, const double* weights, unsigned short outId) override
442 {
443 this->Interpolate<unsigned short>(numWeights, ids, weights, outId);
444 }
446 int numWeights, const unsigned short* ids, const double* weights, unsigned short outId) override
447 {
448 this->InterpolateOutput<unsigned short>(numWeights, ids, weights, outId);
449 }
450 void Average(int numPts, const unsigned short* ids, unsigned short outId) override
451 {
452 this->Average<unsigned short>(numPts, ids, outId);
453 }
455 int numPts, const unsigned short* ids, const double* weights, unsigned short outId) override
456 {
457 this->WeightedAverage<unsigned short>(numPts, ids, weights, outId);
458 }
460 unsigned short v0, unsigned short v1, double t, unsigned short outId) override
461 {
462 this->InterpolateEdge<unsigned short>(v0, v1, t, outId);
463 }
464 void AssignNullValue(unsigned short outId) override
465 {
467 }
468
469 void Realloc(vtkIdType sze) override
470 {
471 this->OutputArray->Resize(sze);
472 this->OutputArray->SetNumberOfTuples(sze);
473 this->Output = vtkStringArray::FastDownCast(this->OutputArray)->GetPointer(0);
474 }
475};
476
477// Forward declarations. This makes working with vtkTemplateMacro easier.
478struct ArrayList;
479
480template <typename TArray, typename T>
482 ArrayList* list, TArray* inData, TArray* outData, vtkIdType numTuples, int numComp, T nullValue);
483
484// A list of the arrays to interpolate, and a method to invoke interpolation on the list
486{
487 // The list of arrays, and the arrays not to process
488 std::vector<BaseArrayPair*> Arrays;
489 std::vector<vtkAbstractArray*> ExcludedArrays;
490
491 // Add the arrays to interpolate here (from attribute data). Note that this method is
492 // not thread-safe due to its use of vtkDataSetAttributes.
494 double nullValue = 0.0, vtkTypeBool promote = true);
495
496 // Add an array that interpolates from its own attribute values
498 vtkIdType numOutPts, vtkDataSetAttributes* attr, double nullValue = 0.0);
499
500 // Add a pair of arrays (manual insertion). Returns the output array created,
501 // if any. No array may be created if \c inArray was previously marked as
502 // excluded using ExcludeArray().
504 vtkStdString& outArrayName, double nullValue, vtkTypeBool promote);
505
506 // Any array excluded here is not added by AddArrays() or AddArrayPair, hence not
507 // processed. Also check whether an array is excluded.
510
511 // Only you can prevent memory leaks!
513 {
514 for (auto& array : this->Arrays)
515 {
516 delete array;
517 }
518 }
519
520protected:
521 template <typename TIdType>
522 void Copy(TIdType inId, TIdType outId)
523 {
524 for (auto& array : this->Arrays)
525 {
526 array->Copy(inId, outId);
527 }
528 }
529
530 template <typename TIdType>
531 void Interpolate(int numWeights, const TIdType* ids, const double* weights, TIdType outId)
532 {
533 for (auto& array : this->Arrays)
534 {
535 array->Interpolate(numWeights, ids, weights, outId);
536 }
537 }
538
539 template <typename TIdType>
540 void InterpolateOutput(int numWeights, const TIdType* ids, const double* weights, TIdType outId)
541 {
542 for (auto& array : this->Arrays)
543 {
544 array->InterpolateOutput(numWeights, ids, weights, outId);
545 }
546 }
547
548 template <typename TIdType>
549 void Average(int numPts, const TIdType* ids, TIdType outId)
550 {
551 for (auto& array : this->Arrays)
552 {
553 array->Average(numPts, ids, outId);
554 }
555 }
556
557 template <typename TIdType>
558 void WeightedAverage(int numPts, const TIdType* ids, const double* weights, TIdType outId)
559 {
560 for (auto& array : this->Arrays)
561 {
562 array->WeightedAverage(numPts, ids, weights, outId);
563 }
564 }
565
566 template <typename TIdType>
567 void InterpolateEdge(TIdType v0, TIdType v1, double t, TIdType outId)
568 {
569 for (auto& array : this->Arrays)
570 {
571 array->InterpolateEdge(v0, v1, t, outId);
572 }
573 }
574
575 template <typename TIdType>
576 void AssignNullValue(TIdType outId)
577 {
578 for (auto& array : this->Arrays)
579 {
580 array->AssignNullValue(outId);
581 }
582 }
583
584public:
589 void Copy(vtkIdType inId, vtkIdType outId) { this->Copy<vtkIdType>(inId, outId); }
593 void Interpolate(int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId)
594 {
595 this->Interpolate<vtkIdType>(numWeights, ids, weights, outId);
596 }
597
601 int numWeights, const vtkIdType* ids, const double* weights, vtkIdType outId)
602 {
603 this->InterpolateOutput<vtkIdType>(numWeights, ids, weights, outId);
604 }
605
608 void Average(int numPts, const vtkIdType* ids, vtkIdType outId)
609 {
610 this->Average<vtkIdType>(numPts, ids, outId);
611 }
612
615 void WeightedAverage(int numPts, const vtkIdType* ids, const double* weights, vtkIdType outId)
616 {
617 this->WeightedAverage<vtkIdType>(numPts, ids, weights, outId);
618 }
619
622 void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId)
623 {
624 this->InterpolateEdge<vtkIdType>(v0, v1, t, outId);
625 }
626
630#ifdef VTK_USE_64BIT_IDS
635 void Copy(unsigned int inId, unsigned int outId) { this->Copy<unsigned int>(inId, outId); }
639 void Interpolate(
640 int numWeights, const unsigned int* ids, const double* weights, unsigned int outId)
641 {
642 this->Interpolate<unsigned int>(numWeights, ids, weights, outId);
643 }
648 int numWeights, const unsigned int* ids, const double* weights, unsigned int outId)
649 {
650 this->InterpolateOutput<unsigned int>(numWeights, ids, weights, outId);
651 }
655 void Average(int numPts, const unsigned int* ids, unsigned int outId)
656 {
657 this->Average<unsigned int>(numPts, ids, outId);
658 }
662 void WeightedAverage(
663 int numPts, const unsigned int* ids, const double* weights, unsigned int outId)
664 {
665 this->WeightedAverage<unsigned int>(numPts, ids, weights, outId);
666 }
670 void InterpolateEdge(unsigned int v0, unsigned int v1, double t, unsigned int outId)
671 {
672 this->InterpolateEdge<unsigned int>(v0, v1, t, outId);
673 }
677 void AssignNullValue(unsigned int outId) { this->AssignNullValue<unsigned int>(outId); }
678#endif
683 void Copy(unsigned short inId, unsigned short outId) { this->Copy<unsigned short>(inId, outId); }
688 int numWeights, const unsigned short* ids, const double* weights, unsigned short outId)
689 {
690 this->Interpolate<unsigned short>(numWeights, ids, weights, outId);
691 }
692
696 int numWeights, const unsigned short* ids, const double* weights, unsigned short outId)
697 {
698 this->InterpolateOutput<unsigned short>(numWeights, ids, weights, outId);
699 }
700
703 void Average(int numPts, const unsigned short* ids, unsigned short outId)
704 {
705 this->Average<unsigned short>(numPts, ids, outId);
706 }
707
711 int numPts, const unsigned short* ids, const double* weights, unsigned short outId)
712 {
713 this->WeightedAverage<unsigned short>(numPts, ids, weights, outId);
714 }
715
718 void InterpolateEdge(unsigned short v0, unsigned short v1, double t, unsigned short outId)
719 {
720 this->InterpolateEdge<unsigned short>(v0, v1, t, outId);
721 }
722
725 void AssignNullValue(unsigned short outId) { this->AssignNullValue<unsigned short>(outId); }
726
731 {
732 for (auto& array : this->Arrays)
733 {
734 array->Realloc(sze);
735 }
736 }
737
741 vtkIdType GetNumberOfArrays() { return static_cast<vtkIdType>(this->Arrays.size()); }
742};
743
744VTK_ABI_NAMESPACE_END
745#include "vtkArrayListTemplate.txx"
746
747#endif
748// VTK-HeaderTest-Exclude: vtkArrayListTemplate.h
Abstract superclass for all arrays.
represent and manipulate attribute data in a dataset
Hold a reference to a vtkObjectBase instance.
Wrapper around std::string to keep symbols short.
a vtkAbstractArray subclass for strings
static vtkStringArray * FastDownCast(vtkAbstractArray *source)
Perform a fast, safe cast from a vtkAbstractArray to a vtkStringArray.
ValueType * GetPointer(vtkIdType id)
Get the address of a particular data index.
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
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.
vtkAbstractArray * AddArrayPair(vtkIdType numTuples, vtkAbstractArray *inArray, vtkStdString &outArrayName, double nullValue, vtkTypeBool promote)
void Average(int numPts, const vtkIdType *ids, vtkIdType outId)
Loop over the arrays and have them averaged.
void Copy(unsigned short inId, unsigned short outId)
Loop over the array pairs and copy data from one to another.
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId)
Loop over the arrays perform edge interpolation.
void InterpolateEdge(TIdType v0, TIdType v1, double t, TIdType outId)
void AddSelfInterpolatingArrays(vtkIdType numOutPts, vtkDataSetAttributes *attr, double nullValue=0.0)
void Interpolate(int numWeights, const TIdType *ids, const double *weights, TIdType outId)
void AssignNullValue(vtkIdType outId)
Loop over the arrays and assign the null value.
void WeightedAverage(int numPts, const vtkIdType *ids, const double *weights, vtkIdType outId)
Loop over the arrays and weighted average the attributes.
void Interpolate(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId)
Loop over the arrays and have them interpolate themselves.
vtkTypeBool IsExcluded(vtkAbstractArray *da)
std::vector< vtkAbstractArray * > ExcludedArrays
void InterpolateEdge(unsigned short v0, unsigned short v1, double t, unsigned short outId)
Loop over the arrays perform edge interpolation.
vtkIdType GetNumberOfArrays()
Return the number of arrays.
void Copy(vtkIdType inId, vtkIdType outId)
Loop over the array pairs and copy data from one to another.
void AddArrays(vtkIdType numOutPts, vtkDataSetAttributes *inPD, vtkDataSetAttributes *outPD, double nullValue=0.0, vtkTypeBool promote=true)
void AssignNullValue(TIdType outId)
void Average(int numPts, const TIdType *ids, TIdType outId)
void WeightedAverage(int numPts, const unsigned short *ids, const double *weights, unsigned short outId)
Loop over the arrays and weighted average the attributes.
void ExcludeArray(vtkAbstractArray *da)
void Average(int numPts, const unsigned short *ids, unsigned short outId)
Loop over the arrays and have them averaged.
void InterpolateOutput(int numWeights, const TIdType *ids, const double *weights, TIdType outId)
void Realloc(vtkIdType sze)
Extend (realloc) the arrays.
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 WeightedAverage(int numPts, const TIdType *ids, const double *weights, TIdType outId)
void Copy(TIdType inId, TIdType outId)
std::vector< BaseArrayPair * > Arrays
void AssignNullValue(unsigned short outId)
Loop over the arrays and assign the null value.
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 vtkIdType *ids, const double *weights, vtkIdType outId)
Loop over the arrays and have them interpolate themselves.
void Average(int numPts, const unsigned short *ids, unsigned short outId) override
void Interpolate(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId) override
void InterpolateOutput(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId) override
void InterpolateEdge(IdTypeT v0, IdTypeT v1, double t, IdTypeT outId)
void InterpolateEdge(unsigned short v0, unsigned short v1, double t, unsigned short outId) override
void Copy(unsigned short inId, unsigned short outId) override
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
void Average(int numPts, const IdTypeT *ids, IdTypeT outId)
void Copy(vtkIdType inId, vtkIdType outId) override
void Average(int numPts, const vtkIdType *ids, vtkIdType outId) override
ArrayPair(vtkStringArray *inArray, vtkStringArray *outArray, vtkIdType num, int numComp, vtkStdString null)
void WeightedAverage(int numPts, const unsigned short *ids, const double *weights, unsigned short outId) override
void InterpolateOutput(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
void WeightedAverage(int numPts, const vtkIdType *ids, const double *weights, vtkIdType outId) override
void InterpolateOutput(int numWeights, const IdTypeT *ids, const double *weights, IdTypeT outId)
void Interpolate(int numWeights, const IdTypeT *ids, const double *weights, IdTypeT outId)
void WeightedAverage(int numPts, const IdTypeT *ids, const double *weights, IdTypeT outId)
void Copy(unsigned short inId, unsigned short outId) override
void Copy(IdTypeT inId, IdTypeT outId)
void WeightedAverage(int numPts, const unsigned short *ids, const double *weights, unsigned short outId) override
void Average(int numPts, const unsigned short *ids, unsigned short outId) override
vtk::detail::ValueRange< TOutputArray, vtk::detail::DynamicTupleSize > Output
void InterpolateEdge(IdTypeT v0, IdTypeT v1, double t, IdTypeT outId)
void AssignNullValue(IdTypeT outId)
void InterpolateOutput(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId) override
void Interpolate(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
void Copy(vtkIdType inId, vtkIdType outId) override
ArrayPair(TInputArray *inArray, TOutputArray *outArray, vtkIdType num, int numComp, T null)
void InterpolateOutput(int numWeights, const IdTypeT *ids, const double *weights, IdTypeT outId)
void InterpolateEdge(unsigned short v0, unsigned short v1, double t, unsigned short outId) override
void InterpolateOutput(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId) override
void AssignNullValue(unsigned short outId) override
void InterpolateEdge(vtkIdType v0, vtkIdType v1, double t, vtkIdType outId) override
void AssignNullValue(vtkIdType outId) override
void Average(int numPts, const IdTypeT *ids, IdTypeT outId)
void Average(int numPts, const vtkIdType *ids, vtkIdType outId) override
void WeightedAverage(int numPts, const IdTypeT *ids, const double *weights, IdTypeT outId)
void WeightedAverage(int numPts, const vtkIdType *ids, const double *weights, vtkIdType outId) override
void Interpolate(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId) override
vtk::detail::ValueRange< TInputArray, vtk::detail::DynamicTupleSize > Input
~ArrayPair() override=default
void Realloc(vtkIdType sze) override
void Interpolate(int numWeights, const IdTypeT *ids, const double *weights, IdTypeT outId)
virtual void WeightedAverage(int numPts, const unsigned short *ids, const double *weights, unsigned short outId)=0
virtual void InterpolateOutput(int numWeights, const vtkIdType *ids, const double *weights, vtkIdType outId)=0
BaseArrayPair(vtkIdType num, int numComp, vtkAbstractArray *outArray)
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 Average(int numPts, const unsigned short *ids, unsigned short outId)=0
virtual void InterpolateEdge(unsigned short v0, unsigned short v1, double t, unsigned short outId)=0
virtual void AssignNullValue(unsigned short 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 WeightedAverage(int numPts, const vtkIdType *ids, const double *weights, vtkIdType outId)=0
virtual void Realloc(vtkIdType sze)=0
virtual void Copy(unsigned short inId, unsigned short outId)=0
vtkSmartPointer< vtkAbstractArray > OutputArray
virtual void InterpolateOutput(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId)=0
virtual void Interpolate(int numWeights, const unsigned short *ids, const double *weights, unsigned short outId)=0
int vtkTypeBool
Definition vtkABI.h:64
void CreateArrayPair(ArrayList *list, TArray *inData, TArray *outData, vtkIdType numTuples, int numComp, T nullValue)
STL-compatible iterable ranges that provide access to vtkDataArray elements.
Optimized C++ utilities for formatting values to strings and files.
int vtkIdType
Definition vtkType.h:363