Blender
V3.3
|
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) |
|
inline |
Evaluate the #predicate for all indices in #indices_to_check and return a mask that contains all indices where the predicate was true.
#r_indices indices is only used if necessary.
Definition at line 34 of file BLI_index_mask_ops.hh.
References if(), blender::IndexMask::index_range(), and blender::threading::parallel_for().
Referenced by blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), find_indices_from_virtual_array(), blender::bke::curves::indices_for_type(), blender::ed::sculpt_paint::retrieve_selected_curves(), and blender::ed::sculpt_paint::retrieve_selected_points().
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.
parallel_grain_size | The 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().