7 #ifndef vtkDataArrayValueRange_AOS_h
8 #define vtkDataArrayValueRange_AOS_h
13 #include "vtkDebugRangeIterators.h"
18 #include <type_traits>
21 #ifndef VTK_DEBUG_RANGE_ITERATORS
29 VTK_ABI_NAMESPACE_BEGIN
35 template <
typename ValueTypeT, ComponentIdType TupleSize,
typename ForceValueTypeForVtkDataArray>
71 , BeginValue(beginValue)
75 assert(beginValue >= 0 && beginValue <= endValue);
76 assert(endValue >= 0 && endValue <= this->Array->GetNumberOfValues());
79 assert(arr->GetNumberOfComponents() == TupleSize);
87 std::distance(this->Array->GetPointer(0), this->Array->GetPointer(this->BeginValue)) +
90 ? std::distance(this->Array->GetPointer(0), this->Array->GetPointer(this->BeginValue)) +
92 : std::distance(this->Array->GetPointer(0), this->Array->GetPointer(this->EndValue));
108 this->Array->GetPointer(this->BeginValue) - this->Array->GetPointer(0));
115 this->Array->GetPointer(this->EndValue) - this->Array->GetPointer(0));
122 this->Array->GetPointer(this->EndValue) - this->Array->GetPointer(this->BeginValue));
126 iterator begin() noexcept {
return this->Array->GetPointer(this->BeginValue); }
128 iterator end() noexcept {
return this->Array->GetPointer(this->EndValue); }
143 return this->Array->Buffer->GetBuffer()[this->BeginValue + i];
148 return this->Array->Buffer->GetBuffer()[this->BeginValue + i];
160 NumCompsType NumComps{};
166 template <
typename ArrayType,
ComponentIdType TupleSize,
typename ForceValueTypeForVtkDataArray,
168 typename ValueType =
typename ArrayType::ValueType,
175 VTK_ABI_NAMESPACE_END
181 #endif // VTK_DEBUG_RANGE_ITERATORS
182 #endif // vtkDataArrayValueRange_AOS_h
ValueType const & ConstReferenceType
VTK_ITER_INLINE const_iterator cend() const noexcept
VTK_ITER_INLINE const_reference operator[](size_type i) const noexcept
ValueIterator< ArrayType, TupleSize, ForceValueTypeForVtkDataArray > IteratorType
static constexpr ComponentIdType TupleSizeTag
VTK_ITER_INLINE ValueIdType GetEndValueId() const noexcept
ValueReference< ArrayType, TupleSize, ForceValueTypeForVtkDataArray > ReferenceType
Specialization of tuple ranges and iterators for vtkAOSDataArrayTemplate.
ValueType & ReferenceType
GetAPIType< ArrayType, ForceValueTypeForVtkDataArray > ValueType
VTK_ITER_INLINE ComponentIdType GetTupleSize() const noexcept
ConstReferenceType const_reference
VTK_ITER_INLINE const_iterator end() const noexcept
ValueRange< AOSArrayType, TupleSize, ForceValueTypeForVtkDataArray > DeclareValueRangeSpecialization(ArrayType *)
ValueType const * ConstIteratorType
VTK_ITER_INLINE reference operator[](size_type i) noexcept
#define VTK_DEPRECATED_IN_9_6_0(reason)
VTK_ITER_INLINE const_iterator cbegin() const noexcept
VTK_ITER_INLINE ValueRange GetSubRange(ValueIdType beginValue=0, ValueIdType endValue=-1) const noexcept
VTK_ITER_INLINE ArrayType * GetArray() const noexcept
Array-Of-Structs implementation of vtkGenericDataArray.
value_type * data() noexcept
ConstIteratorType const_iterator
ConstValueReference< ArrayType, TupleSize, ForceValueTypeForVtkDataArray > ConstReferenceType
VTK_ITER_INLINE iterator begin() noexcept
VTK_ITER_INLINE ValueRange() noexcept=default
VTK_ITER_INLINE iterator end() noexcept
VTK_ITER_INLINE size_type size() const noexcept
ConstValueIterator< ArrayType, TupleSize, ForceValueTypeForVtkDataArray > ConstIteratorType
VTK_ITER_INLINE const_iterator begin() const noexcept
VTK_ITER_INLINE ValueIdType GetBeginValueId() const noexcept