Blender  V3.3
Namespaces | Functions
blender::index_mask_ops Namespace Reference

Namespaces

 detail
 

Functions

template<typename Predicate >
IndexMask find_indices_based_on_predicate (const IndexMask indices_to_check, const int64_t parallel_grain_size, Vector< int64_t > &r_indices, const Predicate &predicate)
 
IndexMask find_indices_from_virtual_array (IndexMask indices_to_check, const VArray< bool > &virtual_array, int64_t parallel_grain_size, Vector< int64_t > &r_indices)
 

Function Documentation

◆ find_indices_based_on_predicate()

template<typename Predicate >
IndexMask blender::index_mask_ops::find_indices_based_on_predicate ( const IndexMask  indices_to_check,
const int64_t  parallel_grain_size,
Vector< int64_t > &  r_indices,
const Predicate &  predicate 
)
inline

◆ find_indices_from_virtual_array()

IndexMask blender::index_mask_ops::find_indices_from_virtual_array ( IndexMask  indices_to_check,
const VArray< bool > &  virtual_array,
int64_t  parallel_grain_size,
Vector< int64_t > &  r_indices 
)

Find the true indices in a virtual array. This is a version of find_indices_based_on_predicate optimized for a virtual array input.

Parameters
parallel_grain_sizeThe grain size for when the virtual array isn't a span or a single value internally. This should be adjusted based on the expected cost of evaluating the virtual array– more expensive virtual arrays should have smaller grain sizes.

Definition at line 201 of file index_mask.cc.

References find_indices_based_on_predicate(), blender::VArrayCommon< T >::get_internal_single(), blender::VArrayCommon< T >::get_internal_span(), blender::IndexMask::index_range(), blender::VArrayCommon< T >::is_single(), blender::VArrayCommon< T >::is_span(), blender::threading::EnumerableThreadSpecific< T >::local(), and blender::threading::parallel_for().

Referenced by blender::ed::spreadsheet::GeometryDataSource::apply_selection_filter(), get_selected_indices(), and blender::fn::index_mask_from_selection().