Blender
V3.3
|
#include <BLI_virtual_array.hh>
Public Member Functions | |
VArrayImpl (const int64_t size) | |
virtual | ~VArrayImpl ()=default |
int64_t | size () const |
virtual T | get (int64_t index) const =0 |
virtual CommonVArrayInfo | common_info () const |
virtual void | materialize (IndexMask mask, MutableSpan< T > r_span) const |
virtual void | materialize_to_uninitialized (IndexMask mask, MutableSpan< T > r_span) const |
virtual void | materialize_compressed (IndexMask mask, MutableSpan< T > r_span) const |
virtual void | materialize_compressed_to_uninitialized (IndexMask mask, MutableSpan< T > r_span) const |
virtual bool | try_assign_GVArray (GVArray &UNUSED(varray)) const |
virtual bool | is_same (const VArrayImpl< T > &UNUSED(other)) const |
Protected Attributes | |
int64_t | size_ |
Implements the specifics of how the elements of a virtual array are accessed. It contains a bunch of virtual methods that are wrapped by #VArray.
Definition at line 71 of file BLI_virtual_array.hh.
|
inline |
Definition at line 80 of file BLI_virtual_array.hh.
References BLI_assert, and blender::VArrayImpl< T >::size_.
|
virtualdefault |
|
inlinevirtual |
Reimplemented in blender::VArrayImpl_For_Single< T >, blender::VArrayImpl_For_Span< T >, blender::VArrayImpl_For_Span< typename Container::value_type >, and blender::VArrayImpl_For_GVArray< T >.
Definition at line 98 of file BLI_virtual_array.hh.
Referenced by blender::VArrayCommon< T >::common_info(), blender::VArrayCommon< T >::get_internal_single(), blender::VArrayCommon< T >::get_internal_span(), blender::VArrayCommon< T >::is_single(), blender::VArrayCommon< T >::is_span(), blender::VArrayImpl< T >::materialize(), blender::VArrayImpl< T >::materialize_to_uninitialized(), and blender::VMutableArrayImpl< T >::set_all().
|
pure virtual |
Get the element at #index. This does not return a reference, because the value may be computed on the fly.
Implemented in blender::VArrayImpl_For_GVArray< T >, blender::bke::VArrayImpl_For_VertexWeights, blender::VArrayImpl_For_Span< T >, blender::VArrayImpl_For_Span< typename Container::value_type >, blender::bke::VArrayImpl_For_BezierHandles, blender::bke::VArrayImpl_For_SplinePosition, blender::bke::VArrayImpl_For_SplinePoints< T >, and blender::bke::VArray_For_SplineToPoint< T >.
Referenced by blender::VArrayImpl< T >::materialize(), blender::VArrayImpl< T >::materialize_to_uninitialized(), and blender::VArrayCommon< T >::operator[]().
|
inlinevirtual |
Return true when the other virtual array should be considered to be the same, e.g. because it shares the same underlying memory.
Definition at line 200 of file BLI_virtual_array.hh.
Referenced by blender::VArrayCommon< T >::is_same().
|
inlinevirtual |
Copy values from the virtual array into the provided span. The index of the value in the virtual array is the same as the index in the span.
Reimplemented in blender::VArrayImpl_For_GVArray< T >, blender::bke::VArrayImpl_For_SplinePoints< T >, and blender::bke::VArray_For_SplineToPoint< T >.
Definition at line 107 of file BLI_virtual_array.hh.
References blender::CommonVArrayInfo::Any, blender::VArrayImpl< T >::common_info(), blender::MutableSpan< T >::data(), blender::CommonVArrayInfo::data, blender::VArrayImpl< T >::get(), mask(), blender::CommonVArrayInfo::Single, blender::CommonVArrayInfo::Span, src, T, and blender::CommonVArrayInfo::type.
Referenced by blender::VArrayCommon< T >::materialize().
|
inlinevirtual |
Copy values from the virtual array into the provided span. Contrary to materialize, the index in virtual array is not the same as the index in the output span. Instead, the span is filled without gaps.
Reimplemented in blender::VArrayImpl_For_Single< T >, blender::VArrayImpl_For_Span< T >, and blender::VArrayImpl_For_GVArray< T >.
Definition at line 161 of file BLI_virtual_array.hh.
References BLI_assert, mask(), and blender::MutableSpan< T >::size().
Referenced by blender::VArrayCommon< T >::materialize_compressed().
|
inlinevirtual |
Same as materialize_compressed but #r_span is expected to be uninitialized.
Reimplemented in blender::VArrayImpl_For_Single< T >, blender::VArrayImpl_For_Span< T >, and blender::VArrayImpl_For_GVArray< T >.
Definition at line 174 of file BLI_virtual_array.hh.
References BLI_assert, blender::MutableSpan< T >::data(), mask(), blender::MutableSpan< T >::size(), and T.
Referenced by blender::VArrayCommon< T >::materialize_compressed_to_uninitialized().
|
inlinevirtual |
Same as materialize but #r_span is expected to be uninitialized.
Reimplemented in blender::VArrayImpl_For_GVArray< T >, blender::bke::VArrayImpl_For_SplinePoints< T >, and blender::bke::VArray_For_SplineToPoint< T >.
Definition at line 133 of file BLI_virtual_array.hh.
References blender::CommonVArrayInfo::Any, blender::VArrayImpl< T >::common_info(), blender::MutableSpan< T >::data(), blender::CommonVArrayInfo::data, blender::VArrayImpl< T >::get(), mask(), blender::CommonVArrayInfo::Single, blender::CommonVArrayInfo::Span, src, T, and blender::CommonVArrayInfo::type.
Referenced by blender::VArrayCommon< T >::materialize_to_uninitialized().
|
inline |
Definition at line 87 of file BLI_virtual_array.hh.
References blender::VArrayImpl< T >::size_.
Referenced by blender::VMutableArrayImpl< T >::set_all(), and blender::VArrayCommon< T >::size().
|
inlinevirtual |
If this virtual wraps another #GVArray, this method should assign the wrapped array to the provided reference. This allows losslessly converting between generic and typed virtual arrays in all cases. Return true when the virtual array was assigned and false when nothing was done.
Definition at line 191 of file BLI_virtual_array.hh.
Referenced by blender::VArrayCommon< T >::try_assign_GVArray().
|
protected |
Number of elements in the virtual array. All virtual arrays have a size, but in some cases it may make sense to set it to the max value.
Definition at line 77 of file BLI_virtual_array.hh.
Referenced by blender::VMutableArrayImpl< T >::set_all(), blender::VArrayImpl< T >::size(), and blender::VArrayImpl< T >::VArrayImpl().