|
Blender V5.0
|
#include <BLI_index_mask.hh>
Inherits blender::index_mask::IndexMaskData.
Public Types | |
| using | Initializer = std::variant<IndexRange, Span<int64_t>, Span<int>, int64_t> |
Public Member Functions | |
| std::optional< RawMaskIterator > | find (int64_t query_index) const |
| std::optional< RawMaskIterator > | find_larger_equal (int64_t query_index) const |
| std::optional< RawMaskIterator > | find_smaller_equal (int64_t query_index) const |
| bool | contains (int64_t query_index) const |
| IndexMask | slice (int64_t start, int64_t size) const |
| IndexMask | slice (RawMaskIterator first_it, RawMaskIterator last_it, int64_t size) const |
| IndexMask | slice_content (IndexRange range) const |
| IndexMask | slice_content (int64_t start, int64_t size) const |
| IndexMask | slice_and_shift (IndexRange range, int64_t offset, IndexMaskMemory &memory) const |
| IndexMask | slice_and_shift (int64_t start, int64_t size, int64_t offset, IndexMaskMemory &memory) const |
| IndexMask | shift (const int64_t offset, IndexMaskMemory &memory) const |
| IndexMask | complement (const IndexMask &universe, IndexMaskMemory &memory) const |
| template<typename T> | |
| void | to_indices (MutableSpan< T > r_indices) const |
| void | set_bits (MutableBitSpan r_bits, int64_t offset=0) const |
| void | to_bits (MutableBitSpan r_bits, int64_t offset=0) const |
| void | to_bools (MutableSpan< bool > r_bools) const |
| Vector< IndexRange > | to_ranges () const |
| Vector< IndexRange > | to_ranges_invert (IndexRange universe) const |
Static Public Member Functions | |
| template<typename T> | |
| static IndexMask | from_indices (Span< T > indices, IndexMaskMemory &memory) |
| static IndexMask | from_bits (BitSpan bits, IndexMaskMemory &memory) |
| static IndexMask | from_bits (const IndexMask &universe, BitSpan bits, IndexMaskMemory &memory) |
| static IndexMask | from_bools (Span< bool > bools, IndexMaskMemory &memory) |
| static IndexMask | from_bools (const VArray< bool > &bools, IndexMaskMemory &memory) |
| static IndexMask | from_bools (const IndexMask &universe, Span< bool > bools, IndexMaskMemory &memory) |
| static IndexMask | from_bools (const IndexMask &universe, const VArray< bool > &bools, IndexMaskMemory &memory) |
| static IndexMask | from_bools_inverse (const VArray< bool > &bools, IndexMaskMemory &memory) |
| static IndexMask | from_bools_inverse (const IndexMask &universe, Span< bool > bools, IndexMaskMemory &memory) |
| static IndexMask | from_bools_inverse (const IndexMask &universe, const VArray< bool > &bools, IndexMaskMemory &memory) |
| template<typename T> | |
| static IndexMask | from_ranges (OffsetIndices< T > offsets, const IndexMask &mask, IndexMaskMemory &memory) |
| static IndexMask | from_repeating (const IndexMask &mask_to_repeat, int64_t repetitions, int64_t stride, int64_t initial_offset, IndexMaskMemory &memory) |
| static IndexMask | from_every_nth (int64_t n, int64_t indices_num, const int64_t initial_offset, IndexMaskMemory &memory) |
| static IndexMask | from_segments (Span< IndexMaskSegment > segments, IndexMaskMemory &memory) |
| static IndexMask | from_initializers (const Span< Initializer > initializers, IndexMaskMemory &memory) |
| static IndexMask | from_union (const IndexMask &mask_a, const IndexMask &mask_b, IndexMaskMemory &memory) |
| static IndexMask | from_union (Span< IndexMask > masks, IndexMaskMemory &memory) |
| static IndexMask | from_difference (const IndexMask &mask_a, const IndexMask &mask_b, IndexMaskMemory &memory) |
| static IndexMask | from_intersection (const IndexMask &mask_a, const IndexMask &mask_b, IndexMaskMemory &memory) |
| static IndexMask | from_batch_predicate (const IndexMask &universe, GrainSize grain_size, IndexMaskMemory &memory, FunctionRef< int64_t(const IndexMaskSegment &universe_segment, IndexRangesBuilder< int16_t > &builder)> batch_predicate) |
| static Vector< IndexMask, 4 > | from_group_ids (const VArray< int > &group_ids, IndexMaskMemory &memory, VectorSet< int > &r_index_by_group_id) |
| static Vector< IndexMask, 4 > | from_group_ids (const IndexMask &universe, const VArray< int > &group_ids, IndexMaskMemory &memory, VectorSet< int > &r_index_by_group_id) |
| static void | foreach_segment_zipped (Span< IndexMask > masks, FunctionRef< bool(Span< IndexMaskSegment > segments)> fn) |
Friends | |
| bool | operator== (const IndexMask &a, const IndexMask &b) |
| bool | operator!= (const IndexMask &a, const IndexMask &b) |
#IndexMask Inline Methods | |
| IndexMask () | |
| IndexMask (int64_t size) | |
| IndexMask (IndexRange range) | |
| int64_t | size () const |
| bool | is_empty () const |
| IndexRange | index_range () const |
| int64_t | first () const |
| int64_t | last () const |
| IndexRange | bounds () const |
| int64_t | min_array_size () const |
| RawMaskIterator | index_to_iterator (int64_t index) const |
| int64_t | iterator_to_index (const RawMaskIterator &it) const |
| int64_t | operator[] (int64_t i) const |
| int64_t | operator[] (const RawMaskIterator &it) const |
| IndexMask | slice (IndexRange range) const |
| int64_t | segments_num () const |
| IndexMaskSegment | segment (int64_t segment_i) const |
| template<typename Fn> | |
| void | foreach_index (Fn &&fn) const |
| template<typename Fn> | |
| void | foreach_index (GrainSize grain_size, Fn &&fn) const |
| template<typename IndexT, typename Fn> | |
| void | foreach_index_optimized (Fn &&fn) const |
| template<typename IndexT, typename Fn> | |
| void | foreach_index_optimized (GrainSize grain_size, Fn &&fn) const |
| template<typename Fn> | |
| void | foreach_segment (Fn &&fn) const |
| template<typename Fn> | |
| void | foreach_segment (GrainSize grain_size, Fn &&fn) const |
| template<typename Fn> | |
| void | foreach_segment_optimized (Fn &&fn) const |
| template<typename Fn> | |
| void | foreach_segment_optimized (GrainSize grain_size, Fn &&fn) const |
| template<typename Fn> | |
| void | foreach_range (Fn &&fn) const |
| std::optional< IndexRange > | to_range () const |
| template<int64_t N = 4> | |
| Vector< std::variant< IndexRange, IndexMaskSegment >, N > | to_spans_and_ranges () const |
| IndexMaskData & | data_for_inplace_construction () |
| template<typename Fn> | |
| static IndexMask | from_predicate (const IndexMask &universe, GrainSize grain_size, IndexMaskMemory &memory, Fn &&predicate) |
| template<typename T, typename Fn> | |
| static void | from_groups (const IndexMask &universe, IndexMaskMemory &memory, Fn &&get_group_index, MutableSpan< IndexMask > r_masks) |
An IndexMask is a sequence of unique and sorted indices (BLI_unique_sorted_indices.hh). It's commonly used when a subset of elements in an array has to be processed.
IndexMask is a non-owning container. That data it references is usually either statically allocated or is owned by an IndexMaskMemory.
Internally, an index mask is split into an arbitrary number of ordered segments. Each segment contains up to max_segment_size (2^14 = 16384) indices. The indices in a segment are stored as int16_t, but each segment also has a int64_t offset.
The data structure is designed to satisfy the following key requirements:
Construction: A new index mask is usually created by calling one of its constructors which are O(1), or for more complex masks, by calling various IndexMask::from_* functions that create masks from various sources. Those generally need additional memory which is provided with by an IndexMaskMemory.
Some of the IndexMask::from_* functions have an IndexMask universe input. When provided, the function will only consider the indices in the "universe". The term comes from mathematics: https://en.wikipedia.org/wiki/Universe_(mathematics).
Iteration: To iterate over the indices, one usually has to use one of the foreach_* functions which require a callback function. Due to the internal segmentation of the index mask, this is more efficient than using a normal C++ iterator and range-based for loops.
There are multiple variants of the foreach_* functions which are useful in different scenarios. The callback can generally take one or two arguments. The first is the index stored in the mask and the second is the index that would have to be passed into operator[] to get the first index.
The foreach_* methods also accept an optional GrainSize argument. When that is provided, multi-threading is used when appropriate. Integrating multi-threading at this level works well because mask iteration and parallelism are often used at the same time.
Extraction: An IndexMask can be converted into various other forms using the to_* methods.
Definition at line 188 of file BLI_index_mask.hh.
| using blender::index_mask::IndexMask::Initializer = std::variant<IndexRange, Span<int64_t>, Span<int>, int64_t> |
Construct a mask from some parts. This is mainly meant for more concise testing code. The individual items are unioned together.
Definition at line 251 of file BLI_index_mask.hh.
|
inline |
Construct an empty mask.
Definition at line 660 of file BLI_index_mask.hh.
|
inlineexplicit |
Construct a mask that contains the indices from 0 to size - 1. This takes O(1) time.
Definition at line 665 of file BLI_index_mask.hh.
|
inline |
Construct a mask that contains the indices in the range. This takes O(1) time.
Definition at line 678 of file BLI_index_mask.hh.
|
inline |
Returns the smallest range that contains all indices stored in this mask.
Definition at line 714 of file BLI_index_mask.hh.
| IndexMask blender::index_mask::IndexMask::complement | ( | const IndexMask & | universe, |
| IndexMaskMemory & | memory ) const |
Definition at line 404 of file index_mask.cc.
| bool blender::index_mask::IndexMask::contains | ( | int64_t | query_index | ) | const |
Definition at line 941 of file index_mask.cc.
|
inline |
Is used by some functions to get low level access to the mask in order to construct it.
Definition at line 806 of file BLI_index_mask.hh.
| std::optional< RawMaskIterator > blender::index_mask::IndexMask::find | ( | int64_t | query_index | ) | const |
Definition at line 873 of file index_mask.cc.
| std::optional< RawMaskIterator > blender::index_mask::IndexMask::find_larger_equal | ( | int64_t | query_index | ) | const |
Definition at line 883 of file index_mask.cc.
| std::optional< RawMaskIterator > blender::index_mask::IndexMask::find_smaller_equal | ( | int64_t | query_index | ) | const |
Definition at line 909 of file index_mask.cc.
|
inline |
Definition at line 724 of file BLI_index_mask.hh.
|
inline |
|
inline |
Definition at line 834 of file BLI_index_mask.hh.
|
inline |
Same as foreach_index, but generates more code, increasing compile time and binary size. This is because separate loops are generated for segments that are ranges and those that are not. Only use this when very little processing is done for each index.
Definition at line 898 of file BLI_index_mask.hh.
|
inline |
Definition at line 912 of file BLI_index_mask.hh.
|
inline |
Calls the function once for every range. Note that this might call the function for each index separately in the worst case if there are no consecutive indices.
Support function signatures:
Definition at line 1003 of file BLI_index_mask.hh.
|
inline |
Calls the function once for every segment. This should be used instead of foreach_index if the algorithm can be implemented more efficiently by processing multiple indices at once.
Supported function signatures:
The segment_pos is the position in the mask where the segment starts: segment[0] == mask[segment_pos]
Definition at line 970 of file BLI_index_mask.hh.
|
inline |
Definition at line 986 of file BLI_index_mask.hh.
|
inline |
This is similar to foreach_segment but supports slightly different function signatures:
The segment input is either of type IndexMaskSegment or IndexRange, so the function has to support both cases. This also means that more code is generated by the compiler because the function is instantiated twice. Only use this when very little processing happens per index.
Definition at line 928 of file BLI_index_mask.hh.
|
inline |
Definition at line 953 of file BLI_index_mask.hh.
|
static |
Iterate over the indices in multiple masks which have the same size. The given function is called for groups of segments where each segment has the same size and comes from a different input mask. For example, if the input masks are (both have size 18): A: [0, 15), {20, 24, 25} B: [0, 5), [10, 15], {20, 30, 40, 50, 60, 70, 80, 90} Then the function will be called multiple times, each time with two segments:
Definition at line 1078 of file index_mask.cc.
Referenced by blender::ed::sculpt_paint::greasepencil::find_curve_mapping_from_index().
|
static |
This is a variant of from_predicate that is more efficient if the predicate for many indices can be evaluated at once.
| batch_predicate | A function that finds indices in a certain segment that should become part of the mask. To efficiently handle ranges, this function uses IndexRangesBuilder. It returns an index offset that should be applied to each index in the builder. |
Definition at line 553 of file index_mask.cc.
|
static |
Construct a mask from the indices of set bits.
Definition at line 449 of file index_mask.cc.
Referenced by blender::ed::sculpt_paint::expand::boundary_from_enabled(), blender::draw::calc_mesh_edge_visibility(), blender::bke::pbvh::Tree::flush_bounds_to_parents(), blender::bke::pbvh::Tree::update_bounds_bmesh(), blender::bke::pbvh::Tree::update_bounds_grids(), blender::bke::pbvh::Tree::update_bounds_mesh(), blender::bke::pbvh::Tree::update_normals(), and blender::bke::pbvh::Tree::update_visibility().
|
static |
Construct a mask from the indices of set bits, but limited to the indices in #universe.
Definition at line 482 of file index_mask.cc.
|
static |
Definition at line 637 of file index_mask.cc.
|
static |
Construct a mask from the true indices, but limited by the indices in #universe.
Definition at line 599 of file index_mask.cc.
|
static |
Definition at line 589 of file index_mask.cc.
|
static |
Construct a mask from the true indices.
Definition at line 584 of file index_mask.cc.
Referenced by blender::ed::sculpt_paint::mask::apply_new_mask_bmesh(), blender::ed::sculpt_paint::mask::apply_new_mask_grids(), blender::ed::sculpt_paint::mask::apply_new_mask_mesh(), blender::ed::spreadsheet::GeometryDataSource::apply_selection_filter(), BKE_pbvh_bmesh_after_stroke(), blender::bke::pbvh::bmesh_update_topology(), blender::build_drawing(), blender::ed::spreadsheet::calc_mesh_selection_mask(), blender::ed::sculpt_paint::face_set::clear_face_sets(), blender::ed::transform::pointcloud::createTransPointCloudVerts(), blender::deform_drawing(), blender::ed::sculpt_paint::CombOperationExecutor::execute(), blender::ed::sculpt_paint::DeleteOperationExecutor::execute(), blender::ed::sculpt_paint::PinchOperationExecutor::execute(), blender::ed::sculpt_paint::face_set::face_sets_update(), blender::ed::sculpt_paint::hide::flush_face_changes_node(), blender::ed::sculpt_paint::mask::gesture_apply_for_symmetry_pass(), blender::ed::sculpt_paint::face_set::gesture_apply_mesh(), blender::nodes::node_geo_input_instance_bounds_cc::InstanceBoundsField::get_varray_for_context(), blender::ed::transform::gizmo_3d_foreach_selected(), blender::ed::greasepencil::grease_pencil_dissolve_exec(), blender::ed::sculpt_paint::hide::grid_hide_update(), blender::fn::index_mask_from_selection(), blender::geometry::mapped_corner_selection_from_face(), blender::bke::mesh_select_edge_flush(), blender::bke::mesh_select_vert_flush(), blender::ed::greasepencil::remove_fill_guides(), blender::ed::curves::remove_selection(), blender::ed::sculpt_paint::undo::restore_face_set_from_undo_step(), blender::ed::sculpt_paint::undo::restore_mask_from_undo_step(), blender::ed::curves::retrieve_selected_curves(), blender::ed::curves::retrieve_selected_points(), blender::ed::curves::retrieve_selected_points(), blender::ed::sculpt_paint::mask::sculpt_mask_filter_exec(), blender::ed::sculpt_paint::greasepencil::simplify_stroke(), blender::ed::sculpt_paint::expand::update_for_vert(), blender::ed::sculpt_paint::mask::update_mask_mesh(), and blender::geometry::vert_selection_from_edge().
|
static |
Definition at line 653 of file index_mask.cc.
|
static |
Definition at line 628 of file index_mask.cc.
|
static |
Definition at line 594 of file index_mask.cc.
Referenced by blender::draw::calc_face_visibility_mesh(), blender::draw::calc_mesh_edge_visibility(), blender::ed::sculpt_paint::islands::calc_topology_islands_mesh(), blender::draw::calc_vert_visibility_mesh(), and blender::ed::pointcloud::remove_selection().
|
static |
Construct a mask from the difference of #mask_a and #mask_b.
Definition at line 700 of file index_mask.cc.
Referenced by blender::bke::curves::nurbs::copy_custom_knots(), blender::ed::transform::curves::create_aligned_handles_masks(), and blender::ed::curves::transverts_from_curves_positions_create().
|
static |
Constructs a mask that contains every nth index the given number of times.
Definition at line 1069 of file index_mask.cc.
|
static |
Definition at line 1185 of file index_mask.cc.
|
static |
Creates an index mask for every unique group id.
Definition at line 1216 of file index_mask.cc.
Referenced by blender::nodes::node_geo_split_to_instances_cc::do_common_split(), blender::nodes::node_geo_proximity_cc::ProximityFunction::init_for_mesh(), blender::nodes::node_geo_proximity_cc::ProximityFunction::init_for_pointcloud(), and blender::nodes::node_geo_sample_nearest_surface_cc::SampleNearestSurfaceFunction::SampleNearestSurfaceFunction().
|
static |
Sorts all indices from #universe into the different output masks.
Definition at line 1062 of file BLI_index_mask.hh.
Referenced by blender::nodes::node_geo_index_switch_cc::IndexSwitchFunction::call(), blender::nodes::node_geo_menu_switch_cc::MenuSwitchFn::call(), and blender::nodes::node_geo_index_of_nearest_cc::IndexOfNearestFieldInput::get_varray_for_context().
|
static |
Construct a mask from unique sorted indices.
Definition at line 412 of file index_mask.cc.
Referenced by blender::fn::multi_function::InstructionScheduler::add_owned_indices(), blender::ed::object::apply_grease_pencil_for_modifier_all_keyframes(), blender::geometry::copy_and_reorder_curves(), blender::index_mask::IndexMask::from_groups(), blender::ed::sculpt_paint::expand::geodesic_falloff_create(), blender::nodes::node_geo_mesh_topology_corners_of_edge_cc::CornersOfEdgeInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_vertex_cc::CornersOfVertInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_edges_of_vertex_cc::EdgesOfVertInput::get_varray_for_context(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::ed::greasepencil::polyline_detect_corners(), blender::ed::geometry::store_result_geometry(), blender::ed::curves::tests::TEST(), blender::ed::curves::tests::TEST(), blender::ed::curves::tests::TEST(), blender::ed::curves::tests::TEST(), blender::ed::curves::tests::TEST(), blender::ed::curves::tests::TEST(), blender::ed::curves::tests::TEST(), blender::ed::curves::tests::TEST(), blender::ed::curves::tests::TEST(), blender::ed::curves::tests::TEST(), blender::fn::multi_function::tests::TEST(), blender::fn::multi_function::tests::TEST(), blender::fn::multi_function::tests::TEST(), blender::fn::multi_function::tests::TEST(), blender::fn::tests::TEST(), blender::fn::tests::TEST(), blender::fn::tests::TEST(), blender::fn::tests::TEST(), blender::fn::tests::TEST(), blender::fn::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::ed::sculpt_paint::expand::topology_falloff_create().
|
static |
Definition at line 718 of file index_mask.cc.
Referenced by blender::bke::curves::curve_to_point_selection().
|
static |
Construct a mask from the intersection of #mask_a and #mask_b.
Definition at line 709 of file index_mask.cc.
Referenced by blender::bke::copy_curve_selection_custom_knots(), blender::bke::copy_point_selection_custom_knots(), blender::ed::transform::curves::create_aligned_handles_masks(), blender::ed::transform::greasepencil::createTransGreasePencilVerts(), blender::draw::pbvh::free_batches(), blender::draw::pbvh::free_ibos(), blender::draw::pbvh::free_vbos(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_auto_masking(), blender::ed::greasepencil::retrieve_editable_and_all_selected_points(), blender::ed::greasepencil::retrieve_editable_and_selected_fill_strokes(), blender::ed::greasepencil::retrieve_editable_and_selected_points(), blender::ed::greasepencil::retrieve_editable_and_selected_strokes(), blender::ed::greasepencil::retrieve_editable_fill_strokes(), blender::ed::greasepencil::retrieve_visible_bezier_handle_points(), blender::ed::greasepencil::retrieve_visible_bezier_handle_strokes(), and blender::ed::greasepencil::retrieve_visible_bezier_strokes().
|
inlinestatic |
Construct a mask from all the indices for which the predicate is true.
Definition at line 1031 of file BLI_index_mask.hh.
Referenced by blender::ed::spreadsheet::apply_filter_operation(), BKE_pbvh_sync_visibility_from_verts(), blender::ed::sculpt_paint::expand::boundary_from_enabled(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), blender::draw::calc_face_visibility_mesh(), blender::draw::calc_mesh_edge_visibility(), blender::ed::spreadsheet::calc_mesh_selection_mask(), blender::ed::spreadsheet::calc_mesh_selection_mask_faces(), blender::draw::calc_vert_visibility_mesh(), blender::geometry::convert_bezier_or_catmull_rom_to_poly_before_conversion_to_nurbs(), blender::ed::transform::curves::create_aligned_handles_masks(), blender::ed::curves::curve_mask_from_points(), blender::bke::curves_copy_point_selection(), blender::ed::sculpt_paint::cloth::do_simulation_step(), blender::geometry::edge_selection_from_vert(), blender::ed::sculpt_paint::cloth::ensure_nodes_constraints(), blender::ed::sculpt_paint::CurvesEffectOperationExecutor::execute(), blender::ed::sculpt_paint::PuffOperationExecutor::execute(), blender::io::grease_pencil::SVGExporter::export_scene(), blender::draw::extract_face_dots_bm(), blender::ed::curves::pen_tool::extrude_curves(), blender::geometry::face_selection_from_mapped_corner(), blender::ed::sculpt_paint::greasepencil::InterpolateOpData::from_operator(), blender::modifier::greasepencil::get_filtered_layer_mask(), blender::modifier::greasepencil::get_filtered_stroke_mask(), blender::ed::greasepencil::get_visible_boundary_strokes(), blender::draw::grease_pencil_get_visible_non_nurbs_curves(), blender::draw::grease_pencil_get_visible_nurbs_curves(), blender::draw::grease_pencil_get_visible_nurbs_points(), blender::ed::greasepencil::grease_pencil_stroke_simplify_exec(), blender::ed::sculpt_paint::hide::grids_show_all(), blender::ed::transform::curves::handles_by_type(), blender::bke::curves::indices_for_type(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_auto_masking(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::bke::calc_edges::mask_first_distinct_edges(), blender::ed::sculpt_paint::hide::mesh_show_all(), blender::bke::CurvesGeometry::nurbs_custom_knot_curves(), blender::ed::sculpt_paint::undo::restore_color_from_undo_step(), blender::ed::sculpt_paint::undo::restore_list(), blender::ed::sculpt_paint::undo::restore_position_from_undo_step(), blender::ed::greasepencil::retrieve_editable_fill_strokes(), blender::ed::greasepencil::retrieve_editable_points(), blender::ed::greasepencil::retrieve_editable_strokes(), blender::ed::greasepencil::retrieve_editable_strokes_by_material(), blender::ed::curves::retrieve_selected_curves(), blender::ed::curves::pen_tool::retrieve_visible_bezier_handle_points(), blender::ed::greasepencil::retrieve_visible_bezier_handle_points(), blender::ed::greasepencil::retrieve_visible_points(), blender::ed::greasepencil::retrieve_visible_strokes(), blender::ed::pointcloud::select_box(), blender::ed::pointcloud::select_circle(), blender::ed::pointcloud::select_lasso(), blender::simplify_drawing(), blender::ed::greasepencil::simplify_fixed(), blender::ed::sculpt_paint::simplify_fixed(), blender::simplify_fixed(), and blender::ed::curves::convert_to_particle_system::try_convert_single_object().
|
static |
Construct a mask from the ranges referenced by the offset indices.
Definition at line 670 of file index_mask.cc.
Referenced by blender::ed::transform::greasepencil::createTransGreasePencilVerts(), blender::ed::greasepencil::grease_pencil_stroke_simplify_exec(), blender::ed::sculpt_paint::greasepencil::GreasePencilStrokeOperationCommon::init_auto_masking(), blender::ed::greasepencil::retrieve_visible_bezier_points(), and blender::ed::greasepencil::simplify_fixed().
|
static |
Constructs a mask by repeating the indices in the given mask with a stride. For example, with an input mask containing {3, 5} and a stride of 10 the resulting mask would contain {3, 5, 13, 15, 23, 25, ...}.
Definition at line 994 of file index_mask.cc.
|
static |
Construct a mask from the given segments. The provided segments are expected to be sorted and owned by #memory already.
Definition at line 286 of file index_mask.cc.
|
static |
Construct a mask from the union of #mask_a and #mask_b.
Definition at line 682 of file index_mask.cc.
Referenced by blender::ed::transform::curves::create_aligned_handles_masks(), blender::ed::curves::retrieve_all_selected_points(), and blender::ed::greasepencil::simplify_fixed().
|
static |
Constructs a mask from the union of multiple masks.
Definition at line 689 of file index_mask.cc.
|
inline |
Definition at line 709 of file BLI_index_mask.hh.
|
inline |
Definition at line 746 of file BLI_index_mask.hh.
|
inline |
Definition at line 704 of file BLI_index_mask.hh.
|
inline |
Definition at line 760 of file BLI_index_mask.hh.
|
inline |
Definition at line 730 of file BLI_index_mask.hh.
|
inline |
Definition at line 738 of file BLI_index_mask.hh.
|
inline |
Same as above but takes O(1) time. It's still preferable to use foreach_* methods for iteration.
Definition at line 777 of file BLI_index_mask.hh.
Get the index at the given position. Prefer foreach_* methods for better performance. This takes O(log n) time.
Definition at line 771 of file BLI_index_mask.hh.
|
inline |
Definition at line 787 of file BLI_index_mask.hh.
|
inline |
Definition at line 782 of file BLI_index_mask.hh.
| void blender::index_mask::IndexMask::set_bits | ( | MutableBitSpan | r_bits, |
| int64_t | offset = 0 ) const |
Set the bits at indices in the mask to 1.
Definition at line 757 of file index_mask.cc.
| IndexMask blender::index_mask::IndexMask::shift | ( | const int64_t | offset, |
| IndexMaskMemory & | memory ) const |
Adds an offset to every index in the mask.
Definition at line 203 of file index_mask.cc.
|
inline |
Definition at line 699 of file BLI_index_mask.hh.
|
inline |
Get a new mask that contains a consecutive subset of this mask. Takes O(log n) time but can reuse the memory from the source mask.
Definition at line 801 of file BLI_index_mask.hh.
| IndexMask blender::index_mask::IndexMask::slice | ( | int64_t | start, |
| int64_t | size ) const |
Definition at line 123 of file index_mask.cc.
| IndexMask blender::index_mask::IndexMask::slice | ( | RawMaskIterator | first_it, |
| RawMaskIterator | last_it, | ||
| int64_t | size ) const |
Definition at line 142 of file index_mask.cc.
| IndexMask blender::index_mask::IndexMask::slice_and_shift | ( | IndexRange | range, |
| int64_t | offset, | ||
| IndexMaskMemory & | memory ) const |
Same slice but can also add an offset to every index in the mask. Takes O(log n + range.size()) time but with a very small constant factor.
Definition at line 182 of file index_mask.cc.
| IndexMask blender::index_mask::IndexMask::slice_and_shift | ( | int64_t | start, |
| int64_t | size, | ||
| int64_t | offset, | ||
| IndexMaskMemory & | memory ) const |
Definition at line 189 of file index_mask.cc.
| IndexMask blender::index_mask::IndexMask::slice_content | ( | IndexRange | range | ) | const |
Slices the mask based on the stored indices. The resulting mask only contains the indices that are within the given range.
Definition at line 158 of file index_mask.cc.
| IndexMask blender::index_mask::IndexMask::slice_content | ( | int64_t | start, |
| int64_t | size ) const |
Definition at line 163 of file index_mask.cc.
| void blender::index_mask::IndexMask::to_bits | ( | MutableBitSpan | r_bits, |
| int64_t | offset = 0 ) const |
Set the bits at indices in the mask to 1 and all other bits to 0.
Definition at line 776 of file index_mask.cc.
| void blender::index_mask::IndexMask::to_bools | ( | MutableSpan< bool > | r_bools | ) | const |
Set the bools at indices in the mask to true and all others to false.
Definition at line 783 of file index_mask.cc.
| template void blender::index_mask::IndexMask::to_indices | ( | MutableSpan< T > | r_indices | ) | const |
Fill the provided span with the indices in the mask. The span is expected to have the same size as the mask.
Definition at line 748 of file index_mask.cc.
|
inline |
Try to convert the entire index mask into a range. This only works if there are no gaps between any indices.
Definition at line 1077 of file BLI_index_mask.hh.
| Vector< IndexRange > blender::index_mask::IndexMask::to_ranges | ( | ) | const |
Definition at line 791 of file index_mask.cc.
| Vector< IndexRange > blender::index_mask::IndexMask::to_ranges_invert | ( | IndexRange | universe | ) | const |
Definition at line 798 of file index_mask.cc.
|
inline |
Definition at line 1091 of file BLI_index_mask.hh.
Definition at line 1098 of file BLI_index_mask.hh.
Definition at line 1164 of file index_mask.cc.