|
Blender V5.3
|
Enumerations | |
| enum class | BooleanMix { None , AllFalse , AllTrue , Mixed } |
Functions | |
| constexpr int64_t | calc_copy_grain_size (const exec_mode::Tag auto mode, const int64_t type_size) |
| constexpr int64_t | calc_copy_grain_size (const exec_mode::Mode mode, const int64_t type_size) |
| template<exec_mode::Tag Mode> | |
| constexpr auto | exec_mode_tag_for_copy (const Mode mode, const int64_t type_size) |
| void | copy (const GVArray &src, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel) |
| template<typename T, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | copy (const VArray< T > &src, MutableSpan< T > dst, const Mode mode={}) |
| template<typename T, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | copy (const Span< T > src, MutableSpan< T > dst, const Mode mode={}) |
| void | copy (const GVArray &src, const IndexMask &selection, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel) |
| template<typename T, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | copy (const Span< T > src, const IndexMask &selection, MutableSpan< T > dst, const Mode mode={}) |
| template<typename T> | |
| T | compute_sum (const Span< T > data) |
| template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | scatter (const Span< T > src, const Span< IndexT > indices, MutableSpan< T > dst, const Mode mode={}) |
| template<typename T, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | scatter (const Span< T > src, const IndexMask &indices, MutableSpan< T > dst, const Mode mode={}) |
| void | gather (const GVArray &src, const IndexMask &indices, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel) |
| void | gather (GSpan src, const IndexMask &indices, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel) |
| template<typename T, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | gather (const VArray< T > &src, const IndexMask &indices, MutableSpan< T > dst, const Mode mode={}) |
| template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | gather (const Span< T > src, const Span< IndexT > indices, const IndexMask &dst_mask, MutableSpan< T > dst, const Mode mode={}) |
| template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | gather (const Span< T > src, const Span< IndexT > indices, MutableSpan< T > dst, const Mode mode={}) |
| template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | gather (const VArray< T > &src, const Span< IndexT > indices, const IndexMask &dst_mask, MutableSpan< T > dst, const Mode mode={}) |
| template<typename T, typename IndexT, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | gather (const VArray< T > &src, const Span< IndexT > indices, MutableSpan< T > dst, const Mode mode={}) |
| template<typename T> | |
| void | gather_group_to_group (const OffsetIndices< int > src_offsets, const OffsetIndices< int > dst_offsets, const IndexMask &selection, const Span< T > src, MutableSpan< T > dst) |
| template<typename T> | |
| void | gather_group_to_group (const OffsetIndices< int > src_offsets, const OffsetIndices< int > dst_offsets, const Span< int > selection, const Span< T > src, MutableSpan< T > dst) |
| template<typename T> | |
| void | gather_group_to_group (const OffsetIndices< int > src_offsets, const OffsetIndices< int > dst_offsets, const IndexMask &selection, const VArray< T > src, MutableSpan< T > dst) |
| template<typename T> | |
| void | gather_to_groups (const OffsetIndices< int > dst_offsets, const IndexMask &src_selection, const Span< T > src, MutableSpan< T > dst) |
| void | copy_group_to_group (OffsetIndices< int > src_offsets, OffsetIndices< int > dst_offsets, const IndexMask &selection, GSpan src, GMutableSpan dst) |
| template<typename T> | |
| void | copy_group_to_group (OffsetIndices< int > src_offsets, OffsetIndices< int > dst_offsets, const IndexMask &selection, Span< T > src, MutableSpan< T > dst) |
| void | count_indices (Span< int > indices, MutableSpan< int > counts) |
| int | group_ids_to_indices (Span< int > ids, const IndexMask &mask, MutableSpan< int > r_group_indices, Vector< int > *r_first_indices=nullptr) |
| void | invert_booleans (MutableSpan< bool > span) |
| void | invert_booleans (MutableSpan< bool > span, const IndexMask &mask) |
| int64_t | count_booleans (const VArray< bool > &varray) |
| int64_t | count_booleans (const VArray< bool > &varray, const IndexMask &mask) |
| BooleanMix | booleans_mix_calc (const VArray< bool > &varray, IndexRange range_to_check) |
| BooleanMix | booleans_mix_calc (const VArray< bool > &varray) |
| bool | contains (const VArray< bool > &varray, const IndexMask &indices_to_check, bool value) |
| IndexMask | indices_non_negative (const IndexMask &universe, Span< int > values, LinearAllocator<> &memory) |
| IndexMask | indices_in_range (const IndexMask &universe, Span< int > values, IndexRange range, LinearAllocator<> &memory) |
| template<typename T> | |
| Vector< IndexRange > | find_all_ranges (const Span< T > span, const T &value) |
| template<typename T> | |
| void | fill_index_range (MutableSpan< T > span, const T start=0) |
| template<typename T, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | fill_index_range (const IndexMask &mask, MutableSpan< T > span, const Mode mode={}) |
| template<typename T, exec_mode::Tag Mode = exec_mode::Parallel> | |
| void | fill_index_range (const IndexMask &mask, MutableSpan< T > span, const T start, const Mode mode={}) |
| template<typename T> | |
| bool | indexed_data_equal (const Span< T > all_values, const Span< int > indices, const Span< T > values) |
| bool | indices_are_range (Span< int > indices, IndexRange range) |
| template<typename T> | |
| std::optional< int64_t > | max_element_index (const Span< T > &span, const int64_t grain_size=8192) |
| template<typename T> | |
| std::optional< int64_t > | max_element_index (const VArray< T > &array, const int64_t grain_size=8192) |
| static void | count_indices_serial (const Span< int > indices, MutableSpan< int > counts) |
| static void | count_indices_atomics (const Span< int > indices, MutableSpan< int > counts) |
| static void | count_indices_thread_local (const Span< int > indices, MutableSpan< int > counts, const int64_t max_threads) |
| static int | count_indices_with_table (const Span< int > ids, const IndexMask &mask, const Bounds< int > &id_bounds, MutableSpan< int > r_group_indices, Vector< int > *r_first_indices) |
| static bool | all_equal (const Span< bool > span, const bool test) |
| static bool | all_equal (const VArray< bool > &varray, const IndexRange range, const bool test) |
|
strong |
| Enumerator | |
|---|---|
| None | |
| AllFalse | |
| AllTrue | |
| Mixed | |
Definition at line 380 of file BLI_array_utils.hh.
|
static |
Definition at line 286 of file array_utils.cc.
References all_equal(), blender::Span< T >::begin(), and blender::Span< T >::end().
Referenced by all_equal(), all_equal(), and booleans_mix_calc().
|
static |
Definition at line 291 of file array_utils.cc.
References all_equal(), blender::IndexRange::begin(), and blender::IndexRange::end().
|
inline |
Definition at line 387 of file BLI_array_utils.hh.
References booleans_mix_calc(), and blender::VArrayCommon< T >::index_range().
| BooleanMix blender::array_utils::booleans_mix_calc | ( | const VArray< bool > & | varray, |
| IndexRange | range_to_check ) |
Definition at line 297 of file array_utils.cc.
References all_equal(), AllFalse, AllTrue, b, booleans_mix_calc(), blender::VArrayCommon< T >::common_info(), blender::CommonVArrayInfo::data, blender::Default, blender::IndexRange::first(), blender::Span< T >::first(), blender::bke::subdiv::init(), blender::VArrayCommon< T >::is_empty(), Mixed, None, blender::threading::parallel_reduce(), PRF_scope_with_name, blender::CommonVArrayInfo::Single, blender::VArrayCommon< T >::size(), blender::Span< T >::slice(), blender::CommonVArrayInfo::Span, and blender::CommonVArrayInfo::type.
Referenced by blender::draw::bmesh_normals_domain(), booleans_mix_calc(), booleans_mix_calc(), blender::draw::create_lines_ibo_with_cyclic(), blender::ed::sculpt_paint::face_set::create_op_exec(), blender::io::alembic::ABCCurveWriter::do_write(), blender::io::usd::USDCurvesWriter::do_write(), blender::ed::greasepencil::grease_pencil_cyclical_set_exec(), blender::ed::greasepencil::grease_pencil_set_stroke_type_exec(), and blender::ed::greasepencil::set_start_point().
|
constexpr |
Definition at line 33 of file BLI_array_utils.hh.
References calc_copy_grain_size(), and blender::exec_mode::Mode::grain_size().
|
constexpr |
Definition at line 26 of file BLI_array_utils.hh.
References calc_copy_grain_size().
Referenced by calc_copy_grain_size(), calc_copy_grain_size(), copy(), copy(), and gather().
Definition at line 109 of file BLI_array_utils.hh.
References compute_sum(), blender::data, blender::divide_ceil_ul(), blender::Array< T, InlineBufferCapacity, Allocator >::index_range(), blender::threading::parallel_for(), and T.
Referenced by blender::BKE_mesh_center_median(), compute_sum(), blender::nodes::node_geo_field_average_cc::FieldAverageInput::get_varray_for_context(), and blender::nodes::node_geo_attribute_statistic_cc::node_geo_exec().
| bool blender::array_utils::contains | ( | const VArray< bool > & | varray, |
| const IndexMask & | indices_to_check, | ||
| bool | value ) |
Check if the value exists in the array.
Definition at line 397 of file array_utils.cc.
References blender::VArrayCommon< T >::common_info(), contains(), blender::CommonVArrayInfo::data, blender::Default, blender::if(), blender::index_mask::IndexMask::index_range(), blender::bke::subdiv::init(), blender::threading::parallel_reduce(), PRF_scope_with_name, blender::CommonVArrayInfo::Single, blender::VArrayCommon< T >::size(), blender::index_mask::IndexMask::slice(), blender::CommonVArrayInfo::Span, and blender::CommonVArrayInfo::type.
Referenced by contains(), blender::ed::curves::has_anything_selected(), blender::ed::curves::has_anything_selected(), blender::ed::curves::has_anything_selected(), blender::ed::curves::has_anything_selected(), blender::ed::pointcloud::has_anything_selected(), and blender::bke::CurvesGeometry::has_cyclic_curve().
| void blender::array_utils::copy | ( | const GVArray & | src, |
| const IndexMask & | selection, | ||
| GMutableSpan | dst, | ||
| exec_mode::Mode | mode = exec_mode::parallel ) |
Fill the destination span by copying masked values from the src array.
Definition at line 43 of file array_utils.cc.
References blender::BLI_assert(), calc_copy_grain_size(), copy(), blender::GMutableSpan::data(), blender::Default, blender::index_mask::IndexMask::index_range(), blender::exec_mode::Mode::is_parallel, blender::GVArrayCommon::materialize(), blender::index_mask::IndexMask::min_array_size(), blender::threading::parallel_for(), PRF_scope_with_name, blender::CPPType::size, blender::GMutableSpan::size(), blender::GVArrayCommon::size(), blender::GMutableSpan::type(), and blender::GVArrayCommon::type().
| void blender::array_utils::copy | ( | const GVArray & | src, |
| GMutableSpan | dst, | ||
| exec_mode::Mode | mode = exec_mode::parallel ) |
Fill the destination span by copying all values from the src array.
Definition at line 27 of file array_utils.cc.
References blender::BLI_assert(), calc_copy_grain_size(), copy(), blender::GMutableSpan::data(), blender::Default, blender::GVArrayCommon::index_range(), blender::exec_mode::Mode::is_parallel, blender::GVArrayCommon::materialize(), blender::threading::parallel_for(), PRF_scope_with_name, blender::CPPType::size, blender::GMutableSpan::size(), blender::GVArrayCommon::size(), blender::GMutableSpan::type(), and blender::GVArrayCommon::type().
Referenced by blender::bke::build_mesh_positions(), blender::geometry::construct::build_output_mesh(), copy(), copy(), copy(), copy(), copy(), blender::ed::curves::copy_data_to_geometry(), blender::create_envelope_strokes(), blender::bke::Attribute::data_for_write(), blender::ed::sculpt_paint::face_set::duplicate_face_sets(), blender::ed::curves::duplicate_points(), blender::ed::pointcloud::duplicate_points(), blender::draw::GSplatEvalCache::ensure_attribute(), blender::fn::evaluate_fields(), blender::geometry::execute_instances_tasks(), blender::draw::extract_edge_index_mesh(), blender::draw::extract_face_dot_index(), blender::draw::extract_vert_index_mesh(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), blender::gpu::VertBuf::from_span(), blender::gpu::VertBuf::from_varray(), blender::bke::subdiv::gather_manifold_sharpness(), blender::get_factor_from_draw_speed(), blender::nodes::node_geo_input_cluster_by_connected_cc::ClusterByConnectedFieldInput::get_varray_for_context(), blender::GPU_indexbuf_build_from_memory(), blender::ed::greasepencil::grease_pencil_primitive_load(), blender::ed::greasepencil::grease_pencil_primitive_save(), blender::draw::grease_pencil_weight_batch_ensure(), blender::ed::sculpt_paint::hide::grow_shrink_visibility_mesh(), blender::io::csv::import_csv_as_pointcloud(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::geometry::interpolate_curves_with_samples(), blender::ed::object::mesh_data_to_grease_pencil(), blender::bke::mesh_select_edge_flush(), blender::bke::mesh_select_face_flush(), blender::bke::mesh_select_vert_flush(), blender::draw::pointcloud_extract_attribute(), blender::geometry::remove_points_and_split(), blender::geometry::resample_to_count(), blender::geometry::sort_indices_by_weights(), blender::ed::geometry::store_attributes_to_shape_keys(), blender::io::obj::TEST_F(), blender::io::obj::TEST_F(), blender::io::obj::TEST_F(), blender::io::obj::TEST_F(), blender::io::obj::TEST_F(), blender::io::obj::TEST_F(), blender::io::stl::STLMeshHelper::to_mesh(), blender::nodes::node_geo_transfer_attributes_cc::transfer_attributes(), and blender::bke::try_capture_fields_on_geometry().
|
inline |
Fill the destination span by copying values from the src array.
Definition at line 99 of file BLI_array_utils.hh.
References copy().
|
inline |
Fill the destination span by copying all values from the src array.
Definition at line 73 of file BLI_array_utils.hh.
References copy().
|
inline |
Definition at line 55 of file BLI_array_utils.hh.
References copy().
| void blender::array_utils::copy_group_to_group | ( | OffsetIndices< int > | src_offsets, |
| OffsetIndices< int > | dst_offsets, | ||
| const IndexMask & | selection, | ||
| GSpan | src, | ||
| GMutableSpan | dst ) |
Copy the src data from the groups defined by src_offsets to the groups in dst defined by dst_offsets. Groups to use are masked by selection, and it is assumed that the corresponding groups have the same size.
Definition at line 90 of file array_utils.cc.
References blender::GMutableSpan::copy_from(), copy_group_to_group(), blender::index_mask::IndexMask::foreach_index(), blender::exec_mode::grain_size(), blender::GMutableSpan::slice(), and blender::GSpan::slice().
Referenced by blender::geometry::convert_curves_to_bezier(), blender::geometry::convert_curves_to_catmull_rom_or_poly(), blender::geometry::convert_curves_to_nurbs(), blender::bke::copy_attributes_group_to_group(), copy_group_to_group(), copy_group_to_group(), blender::geometry::copy_or_defaults_for_unselected_curves(), blender::bke::CurvesGeometry::evaluated_positions(), blender::geometry::fit_poly_to_bezier_curves(), blender::ed::curves::resize_curves(), blender::geometry::subdivide_curves(), and blender::bke::greasepencil::update_triangle_and_offsets_changed().
| void blender::array_utils::copy_group_to_group | ( | OffsetIndices< int > | src_offsets, |
| OffsetIndices< int > | dst_offsets, | ||
| const IndexMask & | selection, | ||
| Span< T > | src, | ||
| MutableSpan< T > | dst ) |
Definition at line 341 of file BLI_array_utils.hh.
References copy_group_to_group().
Definition at line 478 of file array_utils.cc.
References count_booleans(), and blender::VArrayCommon< T >::size().
Referenced by count_booleans(), count_booleans(), blender::draw::extract_edit_data(), blender::draw::grease_pencil_edit_batch_ensure(), and blender::draw::grease_pencil_weight_batch_ensure().
| int64_t blender::array_utils::count_booleans | ( | const VArray< bool > & | varray, |
| const IndexMask & | mask ) |
Definition at line 346 of file array_utils.cc.
References blender::VArrayCommon< T >::common_info(), count_booleans(), blender::CommonVArrayInfo::data, blender::Default, blender::VArrayCommon< T >::index_range(), blender::bke::subdiv::init(), blender::VArrayCommon< T >::is_empty(), blender::threading::parallel_reduce(), PRF_scope_with_name, blender::CommonVArrayInfo::Single, blender::VArrayCommon< T >::size(), blender::CommonVArrayInfo::Span, and blender::CommonVArrayInfo::type.
| void blender::array_utils::count_indices | ( | Span< int > | indices, |
| MutableSpan< int > | counts ) |
Count the number of occurrences of each index.
| indices | The indices to count. |
| counts | The number of occurrences of each index. Typically initialized to zero. Must be large enough to contain the maximum index. |
Definition at line 147 of file array_utils.cc.
References blender::BLI_system_thread_count(), count_indices(), count_indices_atomics(), count_indices_serial(), count_indices_thread_local(), blender::Default, PRF_scope_with_name, blender::MutableSpan< T >::size(), and blender::Span< T >::size().
Referenced by blender::offset_indices::build_reverse_offsets(), count_indices(), blender::ed::sculpt_paint::boundary::create_boundary_info(), blender::nodes::node_geo_input_mesh_edge_neighbors_cc::EdgeNeighborCountFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_vertex_neighbors_cc::VertexCountFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_mesh_vertex_neighbors_cc::VertexFaceCountFieldInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_edge_cc::CornersOfEdgeCountInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_vertex_cc::CornersOfVertCountInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_edges_of_vertex_cc::EdgesOfVertCountInput::get_varray_for_context(), blender::run_count_table(), and blender::subdivide_base().
|
static |
Definition at line 109 of file array_utils.cc.
References count_indices_atomics(), blender::Span< T >::index_range(), and blender::threading::parallel_for().
Referenced by count_indices(), and count_indices_atomics().
|
static |
Definition at line 102 of file array_utils.cc.
References count_indices_serial().
Referenced by count_indices(), and count_indices_serial().
|
static |
Definition at line 118 of file array_utils.cc.
References count_indices_thread_local(), blender::Span< T >::index_range(), blender::threading::max_threads_task(), blender::threading::parallel_for(), and blender::MutableSpan< T >::size().
Referenced by count_indices(), and count_indices_thread_local().
|
static |
A lookup table indexed by the IDs avoids hashing and can be filled in parallel, which makes it much faster than a hash table, but the size of the table depends on the range of the IDs, so still use a VectorSet instead of the lookup table would need to be too large.
Definition at line 195 of file array_utils.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::as_mutable_span(), count_indices_with_table(), blender::index_mask::IndexMask::foreach_index_optimized(), blender::IndexMask::from_predicate(), blender::exec_mode::grain_size(), blender::Bounds< T >::max, blender::Bounds< T >::min, blender::Vector< T, InlineBufferCapacity, Allocator >::resize(), blender::index_mask::IndexMask::size(), and blender::index_mask::IndexMask::to_indices().
Referenced by count_indices_with_table(), and group_ids_to_indices().
|
constexpr |
Similar to #Mode::grain_size(int), but also returns a tag type.
Definition at line 40 of file BLI_array_utils.hh.
References exec_mode_tag_for_copy().
Referenced by exec_mode_tag_for_copy().
|
inline |
Definition at line 440 of file BLI_array_utils.hh.
References fill_index_range().
|
inline |
Definition at line 446 of file BLI_array_utils.hh.
References fill_index_range(), and T.
|
inline |
Fill the span with increasing indices: 0, 1, 2, ... Optionally, the start value can be provided.
Definition at line 434 of file BLI_array_utils.hh.
References blender::MutableSpan< T >::begin(), blender::MutableSpan< T >::end(), fill_index_range(), and T.
Referenced by blender::tests::all_indices(), blender::apply_weights_vertex_normal(), blender::BKE_mesh_legacy_convert_polys_to_offsets(), blender::BLI_scanfill_calc_ex(), blender::bpy_bmelemseq_sort(), blender::geometry::build_point_to_sample_map(), blender::build_relax_phases(), blender::io::obj::OBJMesh::calc_face_order(), blender::bke::node_structure_type_inferencing::calc_node_interface(), blender::ed::sculpt_paint::cloth::calc_vert_indices_grids(), blender::geometry::calculate_cone_faces(), blender::bke::compute_local_mesh_groups(), blender::geometry::construct::compute_new_corner_interp_weights(), blender::nodes::node_geo_mesh_primitive_circle_cc::create_circle_mesh(), blender::ed::greasepencil::create_connected_edges_from_fill(), blender::create_dashes(), blender::nodes::node_geo_duplicate_elements_cc::create_duplicate_index_attribute(), blender::create_envelope_strokes(), blender::ed::greasepencil::segment::create_segments_from_intersections_single_curve(), blender::bke::tests::GreasePencilInterpolate::create_test_curves(), blender::geometry::tests::create_test_curves(), blender::geometry::tests::create_test_curves(), blender::nodes::node_geo_points_to_curves_cc::curve_from_points(), blender::ed::greasepencil::curve_merge_by_distance(), blender::draw::overlay::GreasePencil::draw_grease_pencil(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::ensure_orig_index_layer(), blender::draw::extract_face_dot_index(), blender::ed::curves::pen_tool::extrude_curves(), blender::ed::greasepencil::extrude_grease_pencil_curves(), fill_index_range(), fill_index_range(), fill_index_range(), blender::geometry::find_collapsed_and_weld_edges(), blender::ed::sculpt_paint::greasepencil::find_curve_mapping_from_index(), blender::geometry::fit_poly_to_bezier_curves(), blender::io::grease_pencil::GreasePencilExporter::foreach_shape_in_layer(), blender::bke::pbvh::Tree::from_grids(), blender::bke::pbvh::Tree::from_mesh(), blender::bke::greasepencil::gather_next_available_fill_ids(), blender::io::ply::generate_vertex_map(), blender::ed::greasepencil::get_gapless_indices(), blender::ed::greasepencil::get_reordered_indices(), blender::nodes::node_geo_cluster_by_distance_cc::ClusterByDistanceFieldInput::get_varray_for_context(), blender::nodes::node_geo_curve_topology_points_of_curve_cc::PointsOfCurveInput::get_varray_for_context(), blender::nodes::node_geo_input_shortest_edge_paths_cc::ShortestEdgePathsNextVertFieldInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_edge_cc::CornersOfEdgeInput::get_varray_for_context(), blender::nodes::node_geo_mesh_topology_corners_of_face_cc::CornersOfFaceInput::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::draw::grease_pencil_geom_batch_ensure(), blender::geometry::grease_pencil_remove_points_and_split(), blender::geometry::identifiers_to_indices(), blender::ed::curves::pen_tool::insert_point_to_curve(), blender::ed::sculpt_paint::greasepencil::interpolate_between_curves(), blender::ed::transform::make_sorted_index_map(), blender::material_slot_move_exec(), blender::bke::mesh_calc_edges(), blender::bke::mesh_calc_modifiers(), blender::geometry::mesh_merge_by_distance_connected(), blender::geometry::mesh_merge_verts(), blender::mesh_remove_doubles_on_axis(), blender::modify_mesh(), blender::multires_unsubdivide_add_original_index_datalayers(), blender::nodes::node_geo_split_to_instances_cc::node_geo_exec(), blender::reorder_cyclic_curve_points(), blender::index_mask::segments_from_batch_predicate(), blender::bke::greasepencil::shapes_from_fill_ids(), blender::geometry::sort_indices_by_weights(), blender::ed::sculpt_paint::tests::TEST_F(), blender::ed::sculpt_paint::tests::TEST_F(), and blender::bke::Instances::unique_ids().
|
inline |
Finds all the index ranges for which consecutive values in span equal value.
Definition at line 408 of file BLI_array_utils.hh.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::IndexRange::drop_front(), find_all_ranges(), blender::Span< T >::first(), blender::IndexRange::from_end_size(), blender::Span< T >::index_range(), blender::Span< T >::is_empty(), length(), blender::Span< T >::size(), and T.
Referenced by blender::geometry::curve_simplify(), find_all_ranges(), blender::find_all_ranges_test(), blender::geometry::grease_pencil_remove_points_and_split(), blender::geometry::remove_points_and_split(), and blender::TEST().
| void blender::array_utils::gather | ( | const GVArray & | src, |
| const IndexMask & | indices, | ||
| GMutableSpan | dst, | ||
| exec_mode::Mode | mode = exec_mode::parallel ) |
Fill the destination span by gathering indexed values from the src array.
Definition at line 63 of file array_utils.cc.
References blender::BLI_assert(), calc_copy_grain_size(), blender::GMutableSpan::data(), blender::Default, gather(), blender::index_mask::IndexMask::index_range(), blender::exec_mode::Mode::is_parallel, blender::GVArrayCommon::materialize_compressed(), blender::threading::parallel_for(), PRF_scope_with_name, blender::CPPType::size, blender::GMutableSpan::size(), blender::index_mask::IndexMask::size(), blender::GMutableSpan::type(), and blender::GVArrayCommon::type().
Referenced by blender::nodes::node_geo_duplicate_elements_cc::accumulate_counts_to_offsets(), blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::ed::transform::curves::append_positions_to_custom_data(), blender::ed::sculpt_paint::greasepencil::brush_point_influence_mask(), blender::geometry::construct::build_output_mesh(), blender::nodes::node_geo_extrude_mesh_cc::build_vert_to_edge_map(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::geometry::copy_and_reorder_instaces(), blender::geometry::copy_and_reorder_mesh_edges(), blender::geometry::copy_and_reorder_mesh_verts(), blender::geometry::create_merged_mesh(), blender::ed::transform::pointcloud::createTransPointCloudVerts(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::bke::curves_copy_point_selection(), blender::ed::curves::duplicate_curves(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::ed::pointcloud::duplicate_points(), blender::ed::sculpt_paint::AddOperationExecutor::ensure_curve_roots_kdtree(), blender::ed::sculpt_paint::CutOperationExecutor::execute(), blender::ed::sculpt_paint::DensitySubtractOperationExecutor::execute(), blender::geometry::execute_instances_tasks(), blender::draw::extract_edge_index_mesh(), blender::draw::extract_sculpt_data_subdiv(), blender::draw::extract_vert_idx_loose_geom_subdiv(), blender::draw::extract_vert_index_mesh(), blender::draw::extract_vert_normals_mesh(), blender::nodes::node_geo_extrude_mesh_cc::extrude_individual_mesh_faces(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_face_regions(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_vertices(), blender::nodes::node_geo_filter_list_cc::filter_list(), gather(), gather(), gather(), gather(), gather(), gather(), gather(), blender::bke::gather_attributes(), blender::nodes::node_geo_extrude_mesh_cc::gather_attributes(), blender::ed::sculpt_paint::gather_data_mesh(), blender::nodes::node_geo_scale_elements_cc::gather_edge_islands(), blender::nodes::node_geo_scale_elements_cc::gather_face_islands(), blender::bke::subdiv::gather_manifold_sharpness(), blender::nodes::node_geo_extrude_mesh_cc::gather_vert_attributes(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::nodes::node_geo_points_to_vertices_cc::geometry_set_points_to_vertices(), blender::nodes::node_geo_index_of_nearest_cc::IndexOfNearestFieldInput::get_varray_for_context(), blender::draw::grease_pencil_cache_add_nurbs(), blender::draw::grease_pencil_edit_batch_ensure(), blender::ed::sculpt_paint::grease_pencil_fill_extension_lines_from_circles(), blender::bke::subdiv::initialize_manifold_indices(), blender::geometry::join_instances(), blender::geometry::merge_points(), blender::geometry::merge_propagation_map(), blender::bke::mesh_calc_edges(), blender::ed::object::mesh_data_to_grease_pencil(), blender::geometry::mesh_edges_to_curves_convert(), blender::geometry::mesh_triangulate(), blender::nodes::node_geo_attribute_statistic_cc::node_geo_exec(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_sort_list_cc::node_geo_exec(), blender::ed::sculpt_paint::DensityAddOperationExecutor::prepare_curve_roots_kdtrees(), blender::geometry::propagate_edge_attributes(), blender::geometry::propagate_vert_attributes(), blender::bke::remove_invalid_edges(), blender::bke::remove_invalid_faces(), blender::geometry::sort_indices_by_weights(), blender::ed::sculpt_paint::expand::spherical_falloff_create(), blender::io::obj::OBJMesh::store_normal_coords_and_indices(), blender::ed::sculpt_paint::boundary::twist_data_init_grids(), blender::ed::sculpt_paint::boundary::twist_data_init_mesh(), blender::bke::greasepencil::update_triangle_and_offsets_changed(), and blender::bke::mesh::vert_tris_from_corner_tris().
|
inline |
Fill the destination span by gathering indexed values from the src array.
Definition at line 210 of file BLI_array_utils.hh.
References gather().
|
inline |
Fill the destination span by gathering indexed values from the src array.
Definition at line 226 of file BLI_array_utils.hh.
References gather().
|
inline |
Fill the destination span by gathering indexed values from the src array.
Definition at line 188 of file BLI_array_utils.hh.
References gather().
|
inline |
Fill the destination span by gathering indexed values from the src array.
Definition at line 238 of file BLI_array_utils.hh.
References gather().
|
inline |
Fill the destination span by gathering indexed values from the src array.
Definition at line 269 of file BLI_array_utils.hh.
References gather().
| void blender::array_utils::gather | ( | GSpan | src, |
| const IndexMask & | indices, | ||
| GMutableSpan | dst, | ||
| exec_mode::Mode | mode = exec_mode::parallel ) |
Fill the destination span by gathering indexed values from the src array.
Definition at line 82 of file array_utils.cc.
References blender::GVArray::from_span(), and gather().
|
inline |
Definition at line 278 of file BLI_array_utils.hh.
References blender::MutableSpan< T >::copy_from(), blender::index_mask::IndexMask::foreach_index(), gather_group_to_group(), blender::exec_mode::grain_size(), blender::MutableSpan< T >::slice(), and blender::Span< T >::slice().
Referenced by blender::bke::copy_curve_selection_custom_knots(), blender::draw::create_edit_points_position(), blender::draw::create_edit_points_selection(), blender::geometry::create_point_to_vert_map(), blender::bke::curves::nurbs::gather_custom_knots(), gather_group_to_group(), gather_group_to_group(), gather_group_to_group(), blender::nodes::node_geo_extrude_mesh_cc::gather_groups(), and blender::geometry::mesh_triangulate().
|
inline |
Definition at line 306 of file BLI_array_utils.hh.
References blender::index_mask::IndexMask::foreach_index(), gather_group_to_group(), blender::exec_mode::grain_size(), blender::VArrayCommon< T >::materialize_compressed(), and blender::MutableSpan< T >::slice().
|
inline |
Definition at line 292 of file BLI_array_utils.hh.
References gather_group_to_group(), blender::Span< T >::index_range(), and blender::threading::parallel_for().
|
inline |
Definition at line 320 of file BLI_array_utils.hh.
References blender::MutableSpan< T >::fill(), blender::index_mask::IndexMask::foreach_index(), gather_to_groups(), blender::exec_mode::grain_size(), and blender::MutableSpan< T >::slice().
Referenced by blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_mesh(), blender::nodes::node_geo_extrude_mesh_cc::extrude_individual_mesh_faces(), and gather_to_groups().
| int blender::array_utils::group_ids_to_indices | ( | Span< int > | ids, |
| const IndexMask & | mask, | ||
| MutableSpan< int > | r_group_indices, | ||
| Vector< int > * | r_first_indices = nullptr ) |
Find a compact index for every unique arbitrary ID, in the order that the IDs first appear.
| mask | The elements whose IDs are processed. |
| r_group_indices | The group index of every element, for every index in the mask. |
| r_first_indices | Optional. Filled with the first element with each ID, for every group, which can be useful to choose a representative element for each group. |
Definition at line 236 of file array_utils.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::BLI_assert(), count_indices_with_table(), blender::Default, group_ids_to_indices(), blender::bounds::min_max(), PRF_scope, blender::MutableSpan< T >::size(), and blender::Vector< T, InlineBufferCapacity, Allocator >::size().
Referenced by blender::bke::find_duplicate_faces(), blender::index_mask::IndexMask::from_group_ids(), blender::nodes::node_geo_cluster_by_distance_cc::ClusterByDistanceFieldInput::get_varray_for_context(), blender::nodes::node_geo_index_of_nearest_cc::IndexOfNearestFieldInput::get_varray_for_context(), group_ids_to_indices(), blender::group_ids_to_indices_test(), blender::nodes::node_geo_points_to_curves_cc::identifiers_to_indices(), blender::geometry::merge_points(), and blender::geometry::mesh_merge_verts().
| bool blender::array_utils::indexed_data_equal | ( | const Span< T > | all_values, |
| const Span< int > | indices, | ||
| const Span< T > | values ) |
Definition at line 460 of file BLI_array_utils.hh.
References blender::BLI_assert(), blender::Span< T >::index_range(), indexed_data_equal(), and blender::Span< T >::size().
Referenced by blender::ed::sculpt_paint::mask::apply_new_mask_mesh(), blender::ed::sculpt_paint::face_set::face_hide_update(), blender::ed::sculpt_paint::face_set::face_sets_update(), blender::ed::sculpt_paint::hide::flush_face_changes_node(), indexed_data_equal(), blender::ed::sculpt_paint::mask::update_mask_mesh(), and blender::ed::sculpt_paint::hide::vert_hide_update().
| bool blender::array_utils::indices_are_range | ( | Span< int > | indices, |
| IndexRange | range ) |
Definition at line 483 of file array_utils.cc.
References blender::Default, blender::IndexRange::index_range(), indices_are_range(), blender::threading::parallel_reduce(), PRF_scope_with_name, blender::IndexRange::size(), and blender::Span< T >::size().
Referenced by blender::ed::greasepencil::apply_eval_grease_pencil_data(), blender::bke::gather_attributes(), indices_are_range(), and blender::geometry::sort_indices_by_weights().
| IndexMask blender::array_utils::indices_in_range | ( | const IndexMask & | universe, |
| Span< int > | values, | ||
| IndexRange | range, | ||
| LinearAllocator<> & | memory ) |
Return indices in the mask that are not negative and less than the given size.
Definition at line 465 of file array_utils.cc.
References blender::IndexRange::contains(), blender::Default, blender::IndexMask::from_predicate(), blender::exec_mode::grain_size(), indices_in_range(), and PRF_scope_with_name.
Referenced by blender::bke::SampleIndexFunction::call(), blender::nodes::SampleIndexFunction::call(), blender::bke::EvaluateAtIndexInput::get_varray_for_context(), and indices_in_range().
| IndexMask blender::array_utils::indices_non_negative | ( | const IndexMask & | universe, |
| Span< int > | values, | ||
| LinearAllocator<> & | memory ) |
Return indices in the mask that are non-negative.
Definition at line 456 of file array_utils.cc.
References blender::Default, blender::IndexMask::from_predicate(), blender::exec_mode::grain_size(), indices_non_negative(), and PRF_scope_with_name.
Referenced by blender::ed::greasepencil::apply_eval_grease_pencil_data(), blender::geometry::construct::build_output_mesh(), blender::draw::calc_mesh_edge_visibility(), blender::draw::calc_vert_visibility_mesh(), blender::bke::mesh_surface_sample::BaryWeightSampleFn::call(), indices_non_negative(), and blender::nodes::node_geo_transfer_attributes_cc::transfer_attributes().
| void blender::array_utils::invert_booleans | ( | MutableSpan< bool > | span | ) |
Definition at line 270 of file array_utils.cc.
References blender::Default, blender::MutableSpan< T >::index_range(), invert_booleans(), blender::threading::parallel_for(), and PRF_scope_with_name.
Referenced by blender::ed::curves::cyclic_toggle::exec(), blender::ed::greasepencil::grease_pencil_cyclical_set_exec(), invert_booleans(), invert_booleans(), blender::ed::curves::invert_selection(), blender::ed::pointcloud::invert_selection(), and blender::modify_mesh().
| void blender::array_utils::invert_booleans | ( | MutableSpan< bool > | span, |
| const IndexMask & | mask ) |
Definition at line 280 of file array_utils.cc.
References blender::Default, invert_booleans(), and PRF_scope_with_name.
|
inline |
Returns the index of the (first) maximum element in the virtual array or std::nullopt if the array is empty.
Definition at line 478 of file BLI_array_utils.hh.
References blender::Span< T >::begin(), blender::Span< T >::index_range(), max_element_index(), blender::threading::parallel_reduce(), and T.
Referenced by blender::find_max_element_test(), blender::bke::greasepencil::get_next_available_fill_id(), blender::bke::greasepencil::get_next_available_fill_id(), max_element_index(), and max_element_index().
|
inline |
Definition at line 502 of file BLI_array_utils.hh.
References max_element_index(), and blender::threading::parallel_reduce().
|
inline |
Definition at line 156 of file BLI_array_utils.hh.
References scatter().
|
inline |
Fill the specified indices of the destination with the values in the source span.
Definition at line 136 of file BLI_array_utils.hh.
References scatter().
Referenced by blender::ed::transform::curves::copy_positions_from_curves_transform_custom_data(), blender::bke::mesh_calc_edges(), blender::ed::transform::pointcloud::recalcData_pointcloud(), blender::ed::curves::resize_curves(), scatter(), scatter(), blender::ed::sculpt_paint::scatter_data_mesh(), blender::geometry::sort_indices_by_weights(), and blender::bke::greasepencil::update_triangle_and_offsets_changed().