8#ifndef vtkDataArrayTupleRange_Generic_h
9#define vtkDataArrayTupleRange_Generic_h
26VTK_ABI_NAMESPACE_BEGIN
29template <
typename ArrayType, ComponentIdType>
30struct ConstComponentReference;
31template <
typename ArrayType, ComponentIdType>
32struct ComponentReference;
33template <
typename ArrayType, ComponentIdType>
34struct ConstComponentIterator;
35template <
typename ArrayType, ComponentIdType>
36struct ComponentIterator;
37template <
typename ArrayType, ComponentIdType>
38struct ConstTupleReference;
39template <
typename ArrayType, ComponentIdType>
41template <
typename ArrayType, ComponentIdType>
42struct ConstTupleIterator;
43template <
typename ArrayType, ComponentIdType>
45template <
typename ArrayType, ComponentIdType>
50template <
typename ArrayType, ComponentIdType TupleSize>
83 tuple >= 0 && tuple <= array->GetNumberOfTuples(),
"Invalid tuple accessed by iterator.");
85 "Invalid component accessed by iterator.");
108 this->
Array = o.Array;
119 this->
Array = std::move(o.Array);
120 this->
NumComps = std::move(o.NumComps);
121 this->
TupleId = std::move(o.TupleId);
128 template <
typename AT = ArrayType>
129 typename std::enable_if<std::is_same<AT, vtkDataArray>::value, APIType>::type
VTK_ITER_INLINE
137 template <
typename AT = ArrayType>
138 typename std::enable_if<!std::is_same<AT, vtkDataArray>::value, APIType>::type
VTK_ITER_INLINE
154template <
typename ArrayType, ComponentIdType TupleSize>
187 tuple >= 0 && tuple <= array->GetNumberOfTuples(),
"Invalid tuple accessed by iterator.");
189 "Invalid component accessed by iterator.");
202 return *
this =
static_cast<APIType
>(o);
206 this->
Array = o.Array;
220 return *
this = std::move(
static_cast<APIType
>(o));
224 this->
Array = std::move(o.Array);
225 this->
NumComps = std::move(o.NumComps);
226 this->
TupleId = std::move(o.TupleId);
233 template <
typename OArray, ComponentIdType OSize>
236 const APIType tmp = o;
237 return *
this = std::move(tmp);
242 template <
typename AT = ArrayType>
243 typename std::enable_if<std::is_same<AT, vtkDataArray>::value,
ComponentReference>::type
253 template <
typename AT = ArrayType>
254 typename std::enable_if<!std::is_same<AT, vtkDataArray>::value,
ComponentReference>::type
266 APIType tmp = std::move(
static_cast<APIType
>(lhs));
267 lhs = std::move(
static_cast<APIType
>(rhs));
268 rhs = std::move(tmp);
271 template <
typename OArray, ComponentIdType OSize>
277 std::is_same<APIType, OAPIType>::value,
"Cannot swap components with different types.");
279 APIType tmp = std::move(
static_cast<APIType
>(lhs));
280 lhs = std::move(
static_cast<APIType
>(rhs));
281 rhs = std::move(tmp);
286 APIType tmp = std::move(
static_cast<APIType
>(lhs));
287 lhs = std::move(rhs);
288 rhs = std::move(tmp);
293 APIType tmp = std::move(lhs);
294 lhs = std::move(
static_cast<APIType
>(rhs));
295 rhs = std::move(tmp);
301 const APIType newVal = *
this + 1;
309 const APIType retVal = *
this;
317 const APIType newVal = *
this - 1;
325 const APIType retVal = *
this;
330#define VTK_REF_OP_OVERLOADS(Op, ImplOp) \
331 friend VTK_ITER_INLINE ComponentReference operator Op( \
332 ComponentReference lhs, APIType val) noexcept \
334 const APIType newVal = lhs ImplOp val; \
338 friend VTK_ITER_INLINE ComponentReference operator Op( \
339 ComponentReference lhs, ComponentReference val) noexcept \
341 const APIType newVal = lhs ImplOp val; \
345 friend VTK_ITER_INLINE APIType& operator Op(APIType& lhs, ComponentReference val) noexcept \
347 const APIType newVal = lhs ImplOp val; \
357#undef VTK_REF_OP_OVERLOADS
359 friend struct ConstComponentReference<ArrayType, TupleSize>;
360 friend struct ComponentIterator<ArrayType, TupleSize>;
363 template <
typename AT = ArrayType>
364 typename std::enable_if<std::is_same<AT, vtkDataArray>::value, APIType>::type
VTK_ITER_INLINE
372 template <
typename AT = ArrayType>
373 typename std::enable_if<!std::is_same<AT, vtkDataArray>::value, APIType>::type
VTK_ITER_INLINE
384 this->
Array = o.Array;
398template <
typename ArrayType, ComponentIdType TupleSize>
433 "Const component iterator at invalid tuple id.");
435 "Const component iterator at invalid component id.");
440 : Array{ o.GetArray() }
441 , NumComps{ o.GetNumComps() }
442 , TupleId{ o.GetTupleId() }
443 , ComponentId{ o.GetComponentId() }
456 VTK_ITER_ASSERT(this->ComponentId >= 0 && this->ComponentId <= this->NumComps.value,
457 "Const component iterator at invalid component id.");
465 this->ComponentId++ };
472 VTK_ITER_ASSERT(this->ComponentId >= 0 && this->ComponentId <= this->NumComps.value,
473 "Const component iterator at invalid component id.");
481 this->ComponentId-- };
487 return reference{ this->Array, this->NumComps, this->TupleId, this->ComponentId + i };
493 return reference{ this->Array, this->NumComps, this->TupleId, this->ComponentId };
496#define VTK_TMP_MAKE_OPERATOR(OP) \
497 friend VTK_ITER_INLINE bool operator OP( \
498 const ConstComponentIterator& lhs, const ConstComponentIterator& rhs) noexcept \
500 VTK_ITER_ASSERT(lhs.Array == rhs.Array, "Mismatched arrays in iterator comparison."); \
501 VTK_ITER_ASSERT(lhs.TupleId == rhs.TupleId, "Mismatched tuple ids in iterator comparison."); \
502 VTK_ITER_ASSUME(lhs.NumComps.value > 0); \
503 VTK_ITER_ASSUME(lhs.NumComps.value == rhs.NumComps.value); \
504 return lhs.ComponentId OP rhs.ComponentId; \
514#undef VTK_TMP_MAKE_OPERATOR
519 this->ComponentId += offset;
520 VTK_ITER_ASSERT(this->ComponentId >= 0 && this->ComponentId <= this->NumComps.value,
521 "Const component iterator at invalid component id.");
540 this->ComponentId -= offset;
541 VTK_ITER_ASSERT(this->ComponentId >= 0 && this->ComponentId <= this->NumComps.value,
542 "Const component iterator at invalid component id.");
555 VTK_ITER_ASSERT(it1.Array == it2.Array,
"Cannot do math with iterators from different arrays.");
557 "Cannot do math with component iterators from different "
559 return it1.ComponentId - it2.ComponentId;
566 VTK_ITER_ASSERT(lhs.Array == rhs.Array,
"Cannot swap iterators from different arrays.");
569 swap(lhs.TupleId, rhs.TupleId);
570 swap(lhs.ComponentId, rhs.ComponentId);
574 mutable ArrayType* Array;
575 NumCompsType NumComps;
582template <
typename ArrayType, ComponentIdType TupleSize>
605 :
Ref(array, numComps, tupleId, comp)
610 "Component iterator at invalid tuple id.");
612 comp >= 0 && comp <= numComps.value,
"Component iterator at invalid component id.");
621 this->
Ref.CopyReference(o.Ref);
628 ++this->
Ref.ComponentId;
629 VTK_ITER_ASSERT(this->
Ref.ComponentId >= 0 && this->Ref.ComponentId <= this->Ref.NumComps.value,
630 "Component iterator at invalid component id.");
638 this->
Ref.ComponentId++ };
644 --this->
Ref.ComponentId;
645 VTK_ITER_ASSERT(this->
Ref.ComponentId >= 0 && this->Ref.ComponentId <= this->Ref.NumComps.value,
646 "Component iterator at invalid component id.");
654 this->
Ref.ComponentId-- };
661 this->
Ref.ComponentId + i };
670#define VTK_TMP_MAKE_OPERATOR(OP) \
671 friend VTK_ITER_INLINE bool operator OP( \
672 const ComponentIterator& lhs, const ComponentIterator& rhs) noexcept \
675 lhs.GetArray() == rhs.GetArray(), "Mismatched arrays in iterator comparison."); \
677 lhs.GetTupleId() == rhs.GetTupleId(), "Mismatched tuple ids in iterator comparison."); \
678 VTK_ITER_ASSUME(lhs.GetNumComps().value > 0); \
679 VTK_ITER_ASSUME(lhs.GetNumComps().value == rhs.GetNumComps().value); \
680 return lhs.GetComponentId() OP rhs.GetComponentId(); \
690#undef VTK_TMP_MAKE_OPERATOR
695 this->
Ref.ComponentId += offset;
696 VTK_ITER_ASSERT(this->
Ref.ComponentId >= 0 && this->Ref.ComponentId <= this->Ref.NumComps.value,
697 "Component iterator at invalid component id.");
705 it.GetComponentId() + offset };
712 it.GetComponentId() + offset };
718 this->
Ref.ComponentId -= offset;
719 VTK_ITER_ASSERT(this->
Ref.ComponentId >= 0 && this->Ref.ComponentId <= this->Ref.NumComps.value,
720 "Component iterator at invalid component id.");
728 it.GetComponentId() - offset };
735 "Cannot do math with component iterators from different "
738 "Cannot do math with component iterators from different "
740 return it1.GetComponentId() - it2.GetComponentId();
747 lhs.GetArray() == rhs.GetArray(),
"Cannot swap iterators from different arrays.");
750 swap(lhs.GetTupleId(), rhs.GetTupleId());
751 swap(lhs.GetComponentId(), rhs.GetComponentId());
772template <
typename ArrayType, ComponentIdType TupleSize>
805 "Const tuple reference at invalid tuple id.");
828 template <
typename AT = ArrayType>
830 APIType* tuple)
const noexcept
837 template <
typename AT = ArrayType>
839 APIType* tuple)
const noexcept
846 template <
typename VT = APIType,
typename AT = ArrayType>
847 typename std::enable_if<!std::is_same<VT, double>::value &&
855 tuple[comp] =
static_cast<double>(this->
Array->GetComponent(this->
TupleId, comp));
859 template <
typename VT = APIType,
typename AT = ArrayType>
860 typename std::enable_if<!std::is_same<VT, double>::value &&
868 tuple[comp] =
static_cast<double>(this->
Array->GetTypedComponent(this->
TupleId, comp));
873 template <
typename OArrayType, ComponentIdType OSize>
880 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when comparing tuples.");
883 static_assert(TupleSize == OSize,
"Cannot compare tuples with different sizes.");
885 return std::equal(this->
cbegin(), this->
cend(), other.cbegin());
889 template <
typename OArrayType, ComponentIdType OSize>
896 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when comparing tuples.");
899 other.size() == this->NumComps.value,
"Cannot compare tuples with different sizes.");
901 return std::equal(this->
cbegin(), this->
cend(), other.cbegin());
905 template <
typename OArrayType, ComponentIdType OSize>
912 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when comparing tuples.");
915 static_assert(TupleSize == OSize,
"Cannot compare tuples with different sizes.");
917 return std::equal(this->
cbegin(), this->
cend(), other.cbegin());
921 template <
typename OArrayType, ComponentIdType OSize>
928 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when comparing tuples.");
931 other.size() == this->NumComps.value,
"Cannot compare tuples with different sizes.");
933 return std::equal(this->
cbegin(), this->
cend(), other.cbegin());
936 template <
typename OArrayType, ComponentIdType OSize>
939 return !(*
this == o);
942 template <
typename OArrayT, ComponentIdType OSize>
945 return !(*
this == o);
997template <
typename ArrayType, ComponentIdType TupleSize>
1030 VTK_ITER_ASSERT(tupleId >= 0 && tupleId <= array->GetNumberOfTuples(),
1031 "Tuple reference at invalid tuple id.");
1046 template <
typename AT = ArrayType>
1048 APIType* tuple)
const noexcept
1055 template <
typename AT = ArrayType>
1057 APIType* tuple)
const noexcept
1062 template <
typename VT = APIType,
typename AT = ArrayType>
1063 typename std::enable_if<!std::is_same<VT, double>::value &&
1071 tuple[comp] =
static_cast<double>(this->
Array->GetComponent(this->
TupleId, comp));
1075 template <
typename VT = APIType,
typename AT = ArrayType>
1076 typename std::enable_if<!std::is_same<VT, double>::value &&
1084 tuple[comp] =
static_cast<double>(this->
Array->GetTypedComponent(this->
TupleId, comp));
1089 template <
typename AT = ArrayType>
1091 const APIType* tuple)
noexcept
1098 template <
typename AT = ArrayType>
1100 const APIType* tuple)
noexcept
1107 template <
typename VT = APIType,
typename AT = ArrayType>
1108 typename std::enable_if<!std::is_same<VT, double>::value &&
1116 this->
Array->SetComponent(this->
TupleId, comp, tuple[comp]);
1120 template <
typename VT = APIType,
typename AT = ArrayType>
1121 typename std::enable_if<!std::is_same<VT, double>::value &&
1129 this->
Array->SetTypedComponent(this->
TupleId, comp,
static_cast<APIType
>(tuple[comp]));
1136 std::copy_n(other.cbegin(), this->NumComps.value, this->begin());
1141 template <
typename OArrayType, ComponentIdType OSize>
1148 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when assigning tuples.");
1151 static_assert(TupleSize == OSize,
"Cannot assign tuples with different sizes.");
1153 std::copy_n(other.cbegin(), OSize, this->begin());
1158 template <
typename OArrayType, ComponentIdType OSize>
1165 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when assigning tuples.");
1168 other.size() == this->NumComps.value,
"Cannot assign tuples with different sizes.");
1170 std::copy_n(other.cbegin(), this->NumComps.value, this->begin());
1175 template <
typename OArrayType, ComponentIdType OSize>
1182 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when assigning tuples.");
1185 static_assert(TupleSize == OSize,
"Cannot assign tuples with different sizes.");
1187 std::copy_n(other.cbegin(), OSize, this->begin());
1192 template <
typename OArrayType, ComponentIdType OSize>
1199 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when assigning tuples.");
1202 other.size() == this->NumComps.value,
"Cannot assign tuples with different sizes.");
1204 std::copy_n(other.cbegin(), this->NumComps.value, this->begin());
1209 template <
typename OArrayType, ComponentIdType OSize>
1216 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when comparing tuples.");
1219 static_assert(TupleSize == OSize,
"Cannot compare tuples with different sizes.");
1221 return std::equal(this->
cbegin(), this->
cend(), other.cbegin());
1225 template <
typename OArrayType, ComponentIdType OSize>
1232 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when comparing tuples.");
1235 other.size() == this->NumComps.value,
"Cannot compare tuples with different sizes.");
1237 return std::equal(this->
cbegin(), this->
cend(), other.cbegin());
1241 template <
typename OArrayType, ComponentIdType OSize>
1248 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when comparing tuples.");
1251 static_assert(TupleSize == OSize,
"Cannot compare tuples with different sizes.");
1253 return std::equal(this->
cbegin(), this->
cend(), other.cbegin());
1257 template <
typename OArrayType, ComponentIdType OSize>
1264 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when comparing tuples.");
1267 other.size() == this->NumComps.value,
"Cannot compare tuples with different sizes.");
1269 return std::equal(this->
cbegin(), this->
cend(), other.cbegin());
1272 template <
typename OArrayType, ComponentIdType OSize>
1275 return !(*
this == o);
1278 template <
typename OArray, ComponentIdType OSize>
1281 return !(*
this == o);
1285 template <
typename OArrayType, ComponentIdType OSize>
1292 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when swapping tuples.");
1295 static_assert(TupleSize == OSize,
"Cannot swap tuples with different sizes.");
1297 std::swap_ranges(this->
begin(), this->
end(), other.begin());
1301 template <
typename OArrayType, ComponentIdType OSize>
1308 (std::is_convertible<OAPIType, APIType>{}),
"Incompatible types when swapping tuples.");
1311 other.size() == this->NumComps.value,
"Cannot swap tuples with different sizes.");
1313 std::swap_ranges(this->
begin(), this->
end(), other.begin());
1318 template <
typename OArray, ComponentIdType OSize>
1392template <
typename ArrayType, ComponentIdType TupleSize>
1413 : Ref(array, numComps, tupleId)
1417 VTK_ITER_ASSERT(tupleId >= 0 && tupleId <= array->GetNumberOfTuples(),
1418 "Const tuple iterator at invalid tuple id.");
1432 this->Ref.CopyReference(o.Ref);
1439 ++this->Ref.TupleId;
1441 this->Ref.TupleId >= 0 && this->Ref.TupleId <= this->Ref.Array->GetNumberOfTuples(),
1442 "Const tuple iterator at invalid component id.");
1449 return ConstTupleIterator{ this->Ref.Array, this->Ref.NumComps, this->Ref.TupleId++ };
1455 --this->Ref.TupleId;
1457 this->Ref.TupleId >= 0 && this->Ref.TupleId <= this->Ref.Array->GetNumberOfTuples(),
1458 "Const tuple iterator at invalid component id.");
1465 return ConstTupleIterator{ this->Ref.Array, this->Ref.NumComps, this->Ref.TupleId-- };
1471 return reference{ this->GetArray(), this->GetNumComps(), this->GetTupleId() + i };
1480#define VTK_TMP_MAKE_OPERATOR(OP) \
1481 friend VTK_ITER_INLINE bool operator OP( \
1482 const ConstTupleIterator& lhs, const ConstTupleIterator& rhs) noexcept \
1485 lhs.GetArray() == rhs.GetArray(), "Cannot compare iterators from different arrays."); \
1486 VTK_ITER_ASSUME(lhs.GetNumComps().value > 0); \
1487 VTK_ITER_ASSUME(lhs.GetNumComps().value == rhs.GetNumComps().value); \
1488 return lhs.GetTupleId() OP rhs.GetTupleId(); \
1498#undef VTK_TMP_MAKE_OPERATOR
1503 this->Ref.TupleId += offset;
1505 this->Ref.TupleId >= 0 && this->Ref.TupleId <= this->Ref.Array->GetNumberOfTuples(),
1506 "Const tuple iterator at invalid component id.");
1513 return ConstTupleIterator{ it.GetArray(), it.GetNumComps(), it.GetTupleId() + offset };
1519 return ConstTupleIterator{ it.GetArray(), it.GetNumComps(), it.GetTupleId() + offset };
1525 this->Ref.TupleId -= offset;
1527 this->Ref.TupleId >= 0 && this->Ref.TupleId <= this->Ref.Array->GetNumberOfTuples(),
1528 "Const tuple iterator at invalid component id.");
1535 return ConstTupleIterator{ it.GetArray(), it.GetNumComps(), it.GetTupleId() - offset };
1542 "Cannot do math with tuple iterators from different "
1544 return it1.GetTupleId() - it2.GetTupleId();
1551 lhs.GetArray() == rhs.GetArray(),
"Cannot swap iterators from different arrays.");
1554 swap(lhs.GetTupleId(), rhs.GetTupleId());
1559 ArrayType* GetArray() const noexcept {
return this->Ref.Array; }
1561 ArrayType*& GetArray() noexcept {
return this->Ref.Array; }
1563 NumCompsType GetNumComps() const noexcept {
return this->Ref.NumComps; }
1565 NumCompsType& GetNumComps() noexcept {
return this->Ref.NumComps; }
1567 TupleIdType GetTupleId() const noexcept {
return this->Ref.TupleId; }
1569 TupleIdType& GetTupleId() noexcept {
return this->Ref.TupleId; }
1571 ConstTupleReference<ArrayType, TupleSize> Ref;
1576template <
typename ArrayType, ComponentIdType TupleSize>
1597 :
Ref(array, numComps, tupleId)
1602 tupleId >= 0 && tupleId <= array->GetNumberOfTuples(),
"Tuple iterator at invalid tuple id.");
1611 this->
Ref.CopyReference(o.Ref);
1618 ++this->
Ref.TupleId;
1620 this->
Ref.TupleId >= 0 && this->Ref.TupleId <= this->Ref.Array->GetNumberOfTuples(),
1621 "Tuple iterator at invalid component id.");
1634 --this->
Ref.TupleId;
1636 this->
Ref.TupleId >= 0 && this->Ref.TupleId <= this->Ref.Array->GetNumberOfTuples(),
1637 "Tuple iterator at invalid component id.");
1659#define VTK_TMP_MAKE_OPERATOR(OP) \
1660 friend VTK_ITER_INLINE bool operator OP( \
1661 const TupleIterator& lhs, const TupleIterator& rhs) noexcept \
1664 lhs.GetArray() == rhs.GetArray(), "Cannot compare iterators from different arrays."); \
1665 VTK_ITER_ASSUME(lhs.GetNumComps().value > 0); \
1666 VTK_ITER_ASSUME(lhs.GetNumComps().value == rhs.GetNumComps().value); \
1667 return lhs.GetTupleId() OP rhs.GetTupleId(); \
1677#undef VTK_TMP_MAKE_OPERATOR
1682 this->
Ref.TupleId += offset;
1684 this->
Ref.TupleId >= 0 && this->Ref.TupleId <= this->Ref.Array->GetNumberOfTuples(),
1685 "Tuple iterator at invalid component id.");
1704 this->
Ref.TupleId -= offset;
1706 this->
Ref.TupleId >= 0 && this->Ref.TupleId <= this->Ref.Array->GetNumberOfTuples(),
1707 "Tuple iterator at invalid component id.");
1721 "Cannot do math with tuple iterators from different "
1723 return it1.GetTupleId() - it2.GetTupleId();
1730 lhs.GetArray() == rhs.GetArray(),
"Cannot swap iterators from different arrays.");
1733 swap(lhs.GetTupleId(), rhs.GetTupleId());
1758template <
typename ArrayTypeT, ComponentIdType TupleSize>
1798 , BeginTuple(beginTuple)
1799 , EndTuple(endTuple)
1801 assert(this->Array);
1802 assert(beginTuple >= 0 && beginTuple <= endTuple);
1803 assert(endTuple >= 0 && endTuple <= this->Array->GetNumberOfTuples());
1809 const TupleIdType realBegin = this->BeginTuple + beginTuple;
1810 const TupleIdType realEnd = endTuple >= 0 ? this->BeginTuple + endTuple : this->EndTuple;
1812 return TupleRange{ this->Array, realBegin, realEnd };
1845 return reference{ this->Array, this->NumComps, this->BeginTuple + i };
1851 return const_reference{ this->Array, this->NumComps, this->BeginTuple + i };
1854 template <
typename AT = ArrayType>
1858 this->Array->GetTuple(this->BeginTuple + i, tuple);
1861 template <
typename AT = ArrayType>
1865 this->Array->GetTypedTuple(this->BeginTuple + i, tuple);
1868 template <
typename VT = ValueType,
typename AT = ArrayType>
1869 typename std::enable_if<!std::is_same<VT, double>::value &&
1875 tuple[comp] =
static_cast<double>(this->Array->GetComponent(i, comp));
1879 template <
typename VT = ValueType,
typename AT = ArrayType>
1880 typename std::enable_if<!std::is_same<VT, double>::value &&
1886 tuple[comp] =
static_cast<double>(this->Array->GetTypedComponent(i, comp));
1890 template <
typename AT = ArrayType>
1894 this->Array->SetTuple(this->BeginTuple + i, tuple);
1897 template <
typename AT = ArrayType>
1901 this->Array->SetTypedTuple(this->BeginTuple + i, tuple);
1904 template <
typename VT = ValueType,
typename AT = ArrayType>
1905 typename std::enable_if<!std::is_same<VT, double>::value &&
1911 this->Array->SetComponent(this->BeginTuple + i, comp,
static_cast<ValueType>(tuple[comp]));
1915 template <
typename VT = ValueType,
typename AT = ArrayType>
1916 typename std::enable_if<!std::is_same<VT, double>::value &&
1922 this->Array->SetTypedComponent(
1923 this->BeginTuple + i, comp,
static_cast<ValueType>(tuple[comp]));
1938 NumCompsType NumComps{};
1944template <
typename ArrayType, ComponentIdType TupleSize>
1947VTK_ABI_NAMESPACE_END
abstract superclass for arrays of numeric data
typename std::enable_if< AreStaticTupleSizes< S1, S2 >::value, T >::type EnableIfStaticTupleSizes
TupleRange< AOSArrayType, TupleSize > DeclareTupleRangeSpecialization(ArrayType *)
typename std::enable_if< IsEitherTupleSizeDynamic< S1, S2 >::value, T >::type EnableIfEitherTupleSizeIsDynamic
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
typename detail::GetAPITypeImpl< ArrayType, ForceValueTypeForVtkDataArray >::APIType GetAPIType
const ComponentIdType & GetComponentId() const noexcept
ComponentReference< ArrayType, TupleSize > Ref
TupleIdType & GetTupleId() noexcept
VTK_ITER_INLINE ComponentIterator(const ComponentIterator &o) noexcept=default
VTK_ITER_INLINE reference operator[](difference_type i) const noexcept
friend VTK_ITER_INLINE difference_type operator-(const ComponentIterator &it1, const ComponentIterator &it2) noexcept
VTK_ITER_INLINE ComponentIterator operator++(int) noexcept
VTK_ITER_INLINE const pointer & operator->() const noexcept
VTK_ITER_INLINE ComponentIterator & operator+=(difference_type offset) noexcept
friend VTK_ITER_INLINE void swap(ComponentIterator &lhs, ComponentIterator &rhs) noexcept
ComponentIdType & GetComponentId() noexcept
VTK_ITER_INLINE ComponentIterator operator--(int) noexcept
std::random_access_iterator_tag iterator_category
friend VTK_ITER_INLINE ComponentIterator operator+(const ComponentIterator &it, difference_type offset) noexcept
const TupleIdType & GetTupleId() const noexcept
VTK_ITER_INLINE ComponentIterator() noexcept=default
VTK_ITER_INLINE ComponentIterator & operator--() noexcept
VTK_ITER_INLINE ComponentIterator & operator=(const ComponentIterator &o) noexcept
VTK_ITER_INLINE ComponentIterator & operator-=(difference_type offset) noexcept
VTK_ITER_INLINE reference operator*() const noexcept
NumCompsType & GetNumComps() noexcept
const NumCompsType & GetNumComps() const noexcept
ArrayType * GetArray() const noexcept
VTK_ITER_INLINE ComponentIterator & operator++() noexcept
friend VTK_ITER_INLINE ComponentIterator operator+(difference_type offset, const ComponentIterator &it) noexcept
friend VTK_ITER_INLINE ComponentIterator operator-(const ComponentIterator &it, difference_type offset) noexcept
ComponentIdType difference_type
VTK_ITER_INLINE ComponentReference operator++() noexcept
VTK_ITER_INLINE ComponentReference(ComponentReference &&o) noexcept=default
VTK_ITER_INLINE ComponentReference operator=(ComponentReference &&o) noexcept
VTK_ITER_INLINE APIType operator++(int) noexcept
VTK_ITER_INLINE ComponentReference operator--() noexcept
friend VTK_ITER_INLINE void swap(ComponentReference lhs, ComponentReference rhs) noexcept
ComponentIdType ComponentId
std::enable_if< std::is_same< AT, vtkDataArray >::value, APIType >::type VTK_ITER_INLINE castOperator() const noexcept
std::enable_if< std::is_same< AT, vtkDataArray >::value, ComponentReference >::type VTK_ITER_INLINE operator=(APIType val) noexcept
VTK_ITER_INLINE ComponentReference() noexcept
VTK_ITER_INLINE ComponentReference(const ComponentReference &o) noexcept=default
std::enable_if<!std::is_same< AT, vtkDataArray >::value, ComponentReference >::type VTK_ITER_INLINE operator=(APIType val) noexcept
std::enable_if<!std::is_same< AT, vtkDataArray >::value, APIType >::type VTK_ITER_INLINE castOperator() const noexcept
friend VTK_ITER_INLINE void swap(APIType &lhs, ComponentReference rhs) noexcept
friend VTK_ITER_INLINE void swap(ComponentReference lhs, ComponentReference< OArray, OSize > rhs) noexcept
VTK_ITER_INLINE ComponentReference(ArrayType *array, NumCompsType numComps, TupleIdType tuple, ComponentIdType comp) noexcept
VTK_ITER_INLINE ComponentReference operator=(const ComponentReference< OArray, OSize > &o) noexcept
friend VTK_ITER_INLINE void swap(ComponentReference lhs, APIType &rhs) noexcept
VTK_ITER_INLINE ComponentReference operator=(const ComponentReference &o) noexcept
VTK_ITER_INLINE void CopyReference(const ComponentReference &o) noexcept
friend VTK_ITER_INLINE ConstComponentIterator operator+(difference_type offset, const ConstComponentIterator &it) noexcept
VTK_ITER_INLINE ConstComponentIterator & operator--() noexcept
VTK_ITER_INLINE ConstComponentIterator & operator=(const ConstComponentIterator &o) noexcept=default
VTK_ITER_INLINE ConstComponentIterator(const ConstComponentIterator &o) noexcept=default
friend VTK_ITER_INLINE difference_type operator-(const ConstComponentIterator &it1, const ConstComponentIterator &it2) noexcept
std::random_access_iterator_tag iterator_category
VTK_ITER_INLINE reference operator*() const noexcept
VTK_ITER_INLINE ConstComponentIterator operator--(int) noexcept
VTK_ITER_INLINE ConstComponentIterator & operator+=(difference_type offset) noexcept
VTK_ITER_INLINE ConstComponentIterator & operator++() noexcept
friend VTK_ITER_INLINE void swap(ConstComponentIterator &lhs, ConstComponentIterator &rhs) noexcept
ComponentIdType difference_type
VTK_ITER_INLINE ConstComponentIterator(const ComponentIterator< ArrayType, TupleSize > &o) noexcept
friend VTK_ITER_INLINE ConstComponentIterator operator-(const ConstComponentIterator &it, difference_type offset) noexcept
VTK_ITER_INLINE ConstComponentIterator(ArrayType *array, NumCompsType numComps, TupleIdType tupleId, ComponentIdType comp) noexcept
VTK_ITER_INLINE ConstComponentIterator operator++(int) noexcept
VTK_ITER_INLINE ConstComponentIterator() noexcept
friend VTK_ITER_INLINE ConstComponentIterator operator+(const ConstComponentIterator &it, difference_type offset) noexcept
VTK_ITER_INLINE reference operator[](difference_type i) const noexcept
VTK_ITER_INLINE ConstComponentIterator & operator-=(difference_type offset) noexcept
GetAPIType< ArrayType > value_type
VTK_ITER_INLINE ConstComponentReference(const ConstComponentReference &o) noexcept=default
VTK_ITER_INLINE ConstComponentReference & operator=(ConstComponentReference &&o) noexcept
std::enable_if< std::is_same< AT, vtkDataArray >::value, APIType >::type VTK_ITER_INLINE castOperator() const noexcept
VTK_ITER_INLINE ConstComponentReference(const ComponentReference< ArrayType, TupleSize > &o)
VTK_ITER_INLINE ConstComponentReference & operator=(const ConstComponentReference &o) noexcept
VTK_ITER_INLINE ConstComponentReference(ArrayType *array, NumCompsType numComps, TupleIdType tuple, ComponentIdType comp) noexcept
VTK_ITER_INLINE ConstComponentReference() noexcept
VTK_ITER_INLINE ConstComponentReference(ConstComponentReference &&o) noexcept=default
std::enable_if<!std::is_same< AT, vtkDataArray >::value, APIType >::type VTK_ITER_INLINE castOperator() const noexcept
ComponentIdType ComponentId
VTK_ITER_INLINE ConstTupleIterator & operator+=(difference_type offset) noexcept
VTK_ITER_INLINE ConstTupleIterator & operator=(const ConstTupleIterator &o) noexcept
VTK_ITER_INLINE ConstTupleIterator & operator++() noexcept
TupleIdType difference_type
friend VTK_ITER_INLINE void swap(ConstTupleIterator &lhs, ConstTupleIterator &rhs) noexcept
VTK_ITER_INLINE ConstTupleIterator operator--(int) noexcept
friend VTK_ITER_INLINE ConstTupleIterator operator+(difference_type offset, const ConstTupleIterator &it) noexcept
VTK_ITER_INLINE reference operator*() noexcept
VTK_ITER_INLINE ConstTupleIterator() noexcept=default
VTK_ITER_INLINE pointer operator->() noexcept
std::random_access_iterator_tag iterator_category
friend VTK_ITER_INLINE ConstTupleIterator operator+(const ConstTupleIterator &it, difference_type offset) noexcept
VTK_ITER_INLINE reference operator[](difference_type i) noexcept
friend VTK_ITER_INLINE ConstTupleIterator operator-(const ConstTupleIterator &it, difference_type offset) noexcept
VTK_ITER_INLINE ConstTupleIterator(const ConstTupleIterator &o) noexcept=default
VTK_ITER_INLINE ConstTupleIterator(const TupleIterator< ArrayType, TupleSize > &o) noexcept
VTK_ITER_INLINE ConstTupleIterator & operator-=(difference_type offset) noexcept
friend VTK_ITER_INLINE difference_type operator-(const ConstTupleIterator &it1, const ConstTupleIterator &it2) noexcept
VTK_ITER_INLINE ConstTupleIterator operator++(int) noexcept
VTK_ITER_INLINE ConstTupleIterator & operator--() noexcept
std::enable_if<!std::is_same< VT, double >::value &&std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(double *tuple) const noexcept
VTK_ITER_INLINE bool operator!=(const TupleReference< OArrayType, OSize > &o) const noexcept
VTK_ITER_INLINE EnableIfEitherTupleSizeIsDynamic< TupleSize, OSize, bool > operator==(const ConstTupleReference< OArrayType, OSize > &other) const noexcept
VTK_ITER_INLINE size_type size() const noexcept
VTK_ITER_INLINE const ConstTupleReference * operator->() const noexcept
VTK_ITER_INLINE ConstTupleReference(ConstTupleReference &&) noexcept=default
VTK_ITER_INLINE EnableIfStaticTupleSizes< TupleSize, OSize, bool > operator==(const ConstTupleReference< OArrayType, OSize > &other) const noexcept
VTK_ITER_INLINE EnableIfStaticTupleSizes< TupleSize, OSize, bool > operator==(const TupleReference< OArrayType, OSize > &other) const noexcept
std::enable_if<!std::is_same< VT, double >::value &&!std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(double *tuple) const noexcept
std::enable_if< std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(APIType *tuple) const noexcept
VTK_ITER_INLINE ConstTupleReference() noexcept
VTK_ITER_INLINE const_iterator end() const noexcept
VTK_ITER_INLINE EnableIfEitherTupleSizeIsDynamic< TupleSize, OSize, bool > operator==(const TupleReference< OArrayType, OSize > &other) const noexcept
VTK_ITER_INLINE const_iterator begin() const noexcept
VTK_ITER_INLINE void CopyReference(const ConstTupleReference &o) noexcept
ComponentIdType size_type
std::enable_if<!std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(APIType *tuple) const noexcept
VTK_ITER_INLINE const_reference operator[](size_type i) const noexcept
VTK_ITER_INLINE ConstTupleReference(ArrayType *array, NumCompsType numComps, TupleIdType tupleId) noexcept
VTK_ITER_INLINE ConstTupleReference(const ConstTupleReference &) noexcept=default
VTK_ITER_INLINE bool operator!=(const ConstTupleReference< OArrayT, OSize > &o) const noexcept
VTK_ITER_INLINE const_iterator NewConstIterator(ComponentIdType comp) const noexcept
VTK_ITER_INLINE const_iterator cbegin() const noexcept
VTK_ITER_INLINE ConstTupleReference(const TupleReference< ArrayType, TupleSize > &o) noexcept
VTK_ITER_INLINE const_iterator cend() const noexcept
VTK_ITER_INLINE ConstTupleReference & operator=(const ConstTupleReference &) noexcept=default
VTK_ITER_INLINE TupleIterator & operator=(const TupleIterator &o) noexcept
VTK_ITER_INLINE ArrayType *& GetArray() noexcept
friend VTK_ITER_INLINE TupleIterator operator+(const TupleIterator &it, difference_type offset) noexcept
VTK_ITER_INLINE TupleIdType & GetTupleId() noexcept
TupleIdType difference_type
friend VTK_ITER_INLINE void swap(TupleIterator &lhs, TupleIterator &rhs) noexcept
VTK_ITER_INLINE NumCompsType GetNumComps() const noexcept
VTK_ITER_INLINE TupleIterator(const TupleIterator &o) noexcept=default
VTK_ITER_INLINE ArrayType * GetArray() const noexcept
VTK_ITER_INLINE TupleIterator & operator++() noexcept
VTK_ITER_INLINE TupleIterator & operator--() noexcept
VTK_ITER_INLINE NumCompsType & GetNumComps() noexcept
VTK_ITER_INLINE pointer & operator->() noexcept
friend VTK_ITER_INLINE TupleIterator operator-(const TupleIterator &it, difference_type offset) noexcept
VTK_ITER_INLINE TupleIdType GetTupleId() const noexcept
VTK_ITER_INLINE TupleIterator & operator+=(difference_type offset) noexcept
TupleReference< ArrayType, TupleSize > Ref
VTK_ITER_INLINE reference operator[](difference_type i) noexcept
friend VTK_ITER_INLINE TupleIterator operator+(difference_type offset, const TupleIterator &it) noexcept
VTK_ITER_INLINE reference operator*() noexcept
VTK_ITER_INLINE TupleIterator operator++(int) noexcept
VTK_ITER_INLINE TupleIterator operator--(int) noexcept
VTK_ITER_INLINE TupleIterator & operator-=(difference_type offset) noexcept
friend VTK_ITER_INLINE difference_type operator-(const TupleIterator &it1, const TupleIterator &it2) noexcept
std::random_access_iterator_tag iterator_category
VTK_ITER_INLINE TupleIterator() noexcept=default
VTK_ITER_INLINE const_iterator begin() const noexcept
GetAPIType< ArrayType > APIType
VTK_ITER_INLINE ArrayType * GetArray() const noexcept
VTK_ITER_INLINE TupleIdType GetBeginTupleId() const noexcept
VTK_ITER_INLINE TupleIdType GetEndTupleId() const noexcept
static constexpr ComponentIdType TupleSizeTag
TupleIterator< ArrayType, TupleSize > TupleIteratorType
VTK_ITER_INLINE TupleRange() noexcept=default
std::enable_if< std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE SetTuple(size_type i, const ValueType *tuple) noexcept
VTK_ITER_INLINE const_reference operator[](size_type i) const noexcept
std::enable_if<!std::is_same< VT, double >::value &&std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE SetTuple(size_type i, const double *tuple) noexcept
VTK_ITER_INLINE const_iterator end() const noexcept
VTK_ITER_INLINE size_type size() const noexcept
ConstTupleIterator< ArrayType, TupleSize > ConstTupleIteratorType
VTK_ITER_INLINE reference operator[](size_type i) noexcept
ConstTupleIteratorType const_iterator
VTK_ITER_INLINE const_iterator cend() const noexcept
TupleReference< ArrayType, TupleSize > TupleReferenceType
VTK_ITER_INLINE ComponentIdType GetTupleSize() const noexcept
std::enable_if<!std::is_same< VT, double >::value &&!std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(size_type i, double *tuple) const noexcept
VTK_ITER_INLINE const_iterator cbegin() const noexcept
std::enable_if<!std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE SetTuple(size_type i, const ValueType *tuple) noexcept
VTK_ITER_INLINE iterator end() noexcept
ConstTupleReference< ArrayType, TupleSize > ConstTupleReferenceType
std::enable_if< std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(size_type i, ValueType *tuple) const noexcept
TupleIteratorType iterator
std::enable_if<!std::is_same< VT, double >::value &&std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(size_type i, double *tuple) const noexcept
VTK_ITER_INLINE TupleRange GetSubRange(TupleIdType beginTuple=0, TupleIdType endTuple=-1) const noexcept
std::enable_if<!std::is_same< VT, double >::value &&!std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE SetTuple(size_type i, const double *tuple) noexcept
VTK_ITER_INLINE iterator begin() noexcept
std::enable_if<!std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(size_type i, ValueType *tuple) const noexcept
VTK_ITER_INLINE const_iterator begin() const noexcept
VTK_ITER_INLINE EnableIfEitherTupleSizeIsDynamic< TupleSize, OSize, TupleReference & > operator=(const TupleReference< OArrayType, OSize > &other) noexcept
std::enable_if<!std::is_same< VT, double >::value &&!std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(double *tuple) const noexcept
VTK_ITER_INLINE EnableIfEitherTupleSizeIsDynamic< TupleSize, OSize, bool > operator==(const ConstTupleReference< OArrayType, OSize > &other) const noexcept
VTK_ITER_INLINE const TupleReference * operator->() const noexcept
VTK_ITER_INLINE reference operator[](size_type i) noexcept
VTK_ITER_INLINE TupleReference(const TupleReference &)=default
VTK_ITER_INLINE EnableIfEitherTupleSizeIsDynamic< TupleSize, OSize, void > swap(TupleReference< OArrayType, OSize > other) noexcept
VTK_ITER_INLINE EnableIfEitherTupleSizeIsDynamic< TupleSize, OSize, bool > operator==(const TupleReference< OArrayType, OSize > &other) const noexcept
std::enable_if<!std::is_same< VT, double >::value &&std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE SetTuple(const double *tuple) noexcept
VTK_ITER_INLINE const_iterator cbegin() const noexcept
VTK_ITER_INLINE EnableIfStaticTupleSizes< TupleSize, OSize, bool > operator==(const TupleReference< OArrayType, OSize > &other) const noexcept
friend VTK_ITER_INLINE void swap(TupleReference a, TupleReference b) noexcept
VTK_ITER_INLINE EnableIfStaticTupleSizes< TupleSize, OSize, TupleReference & > operator=(const ConstTupleReference< OArrayType, OSize > &other) noexcept
ComponentIdType size_type
VTK_ITER_INLINE TupleReference(ArrayType *array, NumCompsType numComps, TupleIdType tupleId) noexcept
VTK_ITER_INLINE TupleReference & operator=(const TupleReference &other) noexcept
VTK_ITER_INLINE TupleReference(TupleReference &&) noexcept=default
std::enable_if<!std::is_same< VT, double >::value &&!std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE SetTuple(const double *tuple) noexcept
std::enable_if<!std::is_same< VT, double >::value &&std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(double *tuple) const noexcept
VTK_ITER_INLINE iterator NewIterator(ComponentIdType comp) const noexcept
VTK_ITER_INLINE const_iterator cend() const noexcept
VTK_ITER_INLINE size_type size() const noexcept
VTK_ITER_INLINE bool operator!=(const TupleReference< OArrayType, OSize > &o) const noexcept
VTK_ITER_INLINE void CopyReference(const TupleReference &o) noexcept
VTK_ITER_INLINE iterator begin() noexcept
VTK_ITER_INLINE const_reference operator[](size_type i) const noexcept
VTK_ITER_INLINE TupleReference() noexcept
std::enable_if<!std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(APIType *tuple) const noexcept
VTK_ITER_INLINE EnableIfStaticTupleSizes< TupleSize, OSize, TupleReference & > operator=(const TupleReference< OArrayType, OSize > &other) noexcept
VTK_ITER_INLINE const_iterator end() const noexcept
VTK_ITER_INLINE iterator end() noexcept
std::enable_if< std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE SetTuple(const APIType *tuple) noexcept
std::enable_if< std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE GetTuple(APIType *tuple) const noexcept
VTK_ITER_INLINE void fill(const value_type &v) noexcept
std::enable_if<!std::is_same< AT, vtkDataArray >::value >::type VTK_ITER_INLINE SetTuple(const APIType *tuple) noexcept
VTK_ITER_INLINE EnableIfEitherTupleSizeIsDynamic< TupleSize, OSize, TupleReference & > operator=(const ConstTupleReference< OArrayType, OSize > &other) noexcept
VTK_ITER_INLINE EnableIfStaticTupleSizes< TupleSize, OSize, void > swap(TupleReference< OArrayType, OSize > other) noexcept
VTK_ITER_INLINE EnableIfStaticTupleSizes< TupleSize, OSize, bool > operator==(const ConstTupleReference< OArrayType, OSize > &other) const noexcept
VTK_ITER_INLINE const_iterator NewConstIterator(ComponentIdType comp) const noexcept
VTK_ITER_INLINE bool operator!=(const ConstTupleReference< OArray, OSize > &o) const noexcept
friend VTK_ITER_INLINE void swap(TupleReference a, TupleReference< OArray, OSize > b) noexcept
#define VTK_TMP_MAKE_OPERATOR(OP)
#define VTK_REF_OP_OVERLOADS(Op, ImplOp)