|
Blender V5.0
|
#include <BLI_array_state.hh>
Public Member Functions | |
| ArrayState ()=default | |
| ArrayState (const VArray< T > &values, const ImplicitSharingInfo *sharing_info) | |
| bool | is_empty () const |
| bool | same_as (const VArray< T > &other_values, const ImplicitSharingInfo *other_sharing_info) const |
Remembers the values in an array and allows checking if another array in the future has exactly the same values. This is useful for checking if the topology of a mesh has changed.
If possible, this class makes use of implicit-sharing to avoid creating unnecessary copies of the data. This also allows detecting that the array is not changed in constant time in common cases.
Definition at line 27 of file BLI_array_state.hh.
|
default |
|
inline |
|
inline |
True when the remembered array does not contain any values.
Definition at line 60 of file BLI_array_state.hh.
Referenced by blender::bke::attribute_reader_matches_array_state().
|
inline |
True when the remembered array contains the same values as the given array. This is O(1) in the case when the array was shared and has not been modified. If determining equality in constant time is not possible, the method falls back to comparing the values individually which will take O(n) time.
Definition at line 71 of file BLI_array_state.hh.
References blender::VArrayCommon< T >::size().
Referenced by blender::bke::attribute_reader_matches_array_state().