|
Blender V5.3
|
#include <BLI_virtual_array.hh>
Inherited by blender::VArray< T >, and blender::VMutableArray< T >.
Public Member Functions | |
| operator bool () const | |
| T | operator[] (const int64_t index) const |
| T | get (const int64_t index) const |
| int64_t | size () const |
| T | first () const |
| T | last (const int64_t n=0) const |
| bool | is_empty () const |
| IndexRange | index_range () const |
| CommonVArrayInfo | common_info () const |
| bool | is_span () const |
| Span< T > | get_internal_span () const |
| bool | is_single () const |
| T | get_internal_single () const |
| std::optional< T > | get_if_single () const |
| void | materialize (MutableSpan< T > r_span) const |
| void | materialize (const IndexMask &mask, MutableSpan< T > r_span) const |
| void | materialize_to_uninitialized (MutableSpan< T > r_span) const |
| void | materialize_to_uninitialized (const IndexMask &mask, MutableSpan< T > r_span) const |
| void | materialize_compressed (const IndexMask &mask, MutableSpan< T > r_span) const |
| void | materialize_compressed_to_uninitialized (const IndexMask &mask, MutableSpan< T > r_span) const |
| bool | try_assign_GVArray (GVArray &varray) const |
| const VArrayImpl< T > * | get_implementation () const |
Protected Member Functions | |
| VArrayCommon ()=default | |
| VArrayCommon (const VArrayImpl< T > *impl) | |
| VArrayCommon (std::shared_ptr< const VArrayImpl< T > > impl) | |
| template<typename ImplT, typename... Args> | |
| void | emplace (Args &&...args) |
Protected Attributes | |
| AnyDerived< const VArrayImpl< T > > | impl_ |
Utility class to reduce code duplication for methods available on VArray and VMutableArray. Deriving VMutableArray from VArray would have some issues:
Definition at line 511 of file BLI_virtual_array.hh.
|
protecteddefault |
|
inlineprotected |
Wrap an existing VArrayImpl and don't take ownership of it. This should rarely be used in practice.
Definition at line 521 of file BLI_virtual_array.hh.
References impl_.
|
inlineprotected |
Wrap an existing VArrayImpl that is contained in a #std::shared_ptr. This takes ownership.
Definition at line 526 of file BLI_virtual_array.hh.
References impl_.
|
inline |
Definition at line 602 of file BLI_virtual_array.hh.
References blender::BLI_assert(), and impl_.
Referenced by blender::array_utils::booleans_mix_calc(), blender::GVArrayImpl_For_VArray< T >::common_info(), blender::GVMutableArrayImpl_For_VMutableArray< T >::common_info(), blender::array_utils::contains(), blender::array_utils::count_booleans(), blender::VArrayDevirtualizer< T, UseSingle, UseSpan >::devirtualize(), blender::index_mask::IndexMask::from_bools(), blender::index_mask::IndexMask::from_bools_inverse(), blender::GVMutableArray::GVMutableArray(), and blender::bounds::min_max().
|
inlineprotected |
Replace the contained VArrayImpl.
Definition at line 531 of file BLI_virtual_array.hh.
References emplace(), and impl_.
Referenced by emplace(), blender::VArray< T >::from(), blender::VMutableArray< T >::from(), blender::VArray< T >::VArray(), and blender::VArray< T >::VArray().
|
inline |
Get the first element.
Definition at line 579 of file BLI_virtual_array.hh.
References T.
Referenced by blender::bounds::min_max().
|
inline |
Same as the operator[] but is sometimes easier to use when one has a pointer to a virtual array.
Definition at line 560 of file BLI_virtual_array.hh.
References T.
Referenced by blender::modifier::greasepencil::get_filtered_layer_mask(), blender::modifier::greasepencil::get_filtered_stroke_mask(), blender::fn::tests::TEST_F(), blender::fn::tests::TEST_F(), blender::tests::TEST_F(), and blender::tests::TEST_F().
|
inline |
Return the value that is returned for every index, if the array is stored as a single value.
Definition at line 649 of file BLI_virtual_array.hh.
References blender::CommonVArrayInfo::data, impl_, blender::CommonVArrayInfo::Single, T, and blender::CommonVArrayInfo::type.
Referenced by blender::nodes::node_geo_duplicate_elements_cc::accumulate_counts_to_offsets(), blender::ed::greasepencil::attributes_elements_are_equal(), blender::bke::build_mesh_positions(), blender::geometry::calc_radius_without_interpolation(), blender::geometry::calc_single_value_material_index(), blender::bke::calculate_type_counts(), blender::nodes::node_fn_combine_transform_cc::CombineTransformFunction::call(), blender::nodes::node_fn_format_string_cc::FormatStringMultiFunction::call(), blender::nodes::node_fn_separate_matrix_cc::SeparateMatrixFunction::call(), blender::nodes::node_geo_index_switch_cc::IndexSwitchFunction::call(), blender::nodes::node_geo_menu_switch_cc::MenuSwitchBoolsFn::call(), blender::nodes::node_geo_menu_switch_cc::MenuSwitchFn::call(), blender::io::usd::copy_blender_buffer_to_primvar(), blender::bke::curve_types_are_valid(), blender::geometry::gather_attributes_to_propagate(), blender::nodes::node_geo_scale_elements_cc::gather_means(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::ed::greasepencil::grease_pencil_material_lock_unselected_exec(), blender::ed::transform::curves::handles_by_type(), blender::bounds::max(), blender::geometry::mesh_copy_selection(), blender::ed::greasepencil::retrieve_visible_points(), blender::nodes::node_geo_material_selection_cc::select_by_material(), and blender::bke::validate_material_indices().
|
inline |
Definition at line 699 of file BLI_virtual_array.hh.
References blender::AnyDerived< Base, InlineBufferCapacity >::get(), and impl_.
Referenced by blender::GVArrayImpl_For_VArray< T >::materialize(), blender::GVMutableArrayImpl_For_VMutableArray< T >::materialize(), blender::GVArrayImpl_For_VArray< T >::materialize_compressed(), and blender::GVMutableArrayImpl_For_VMutableArray< T >::materialize_compressed().
|
inline |
Return the value that is returned for every index. This invokes undefined behavior if the virtual array would not return the same value for every index.
Definition at line 639 of file BLI_virtual_array.hh.
References blender::BLI_assert(), blender::CommonVArrayInfo::data, impl_, is_single(), and T.
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::BKE_mesh_material_index_used(), blender::BKE_sculpt_sync_face_visibility_to_grids(), blender::io::obj::OBJMesh::calc_face_order(), blender::geometry::convert_curves_to_nurbs(), blender::ed::curves::duplicate_points(), blender::bke::CurvesGeometry::evaluated_normals(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::geometry::gather_all_fill_ids(), blender::fn::FieldEvaluator::get_evaluated_as_mask(), blender::nodes::node_geo_input_curve_handles_cc::HandlePositionFieldInput::get_varray_for_context(), blender::bke::curves::indices_for_type(), blender::draw::interpolate_corners(), blender::bke::mesh_hide_face_flush(), blender::bke::mesh_hide_vert_flush(), blender::bke::mesh_select_edge_flush(), blender::bke::mesh_select_face_flush(), blender::bke::mesh_select_vert_flush(), blender::ed::curves::retrieve_selected_curves(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_curves(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_grease_pencil_curves(), and blender::tests::TEST_F().
|
inline |
Returns the internally used span of the virtual array. This invokes undefined behavior if the virtual array is not stored as a span internally.
Definition at line 620 of file BLI_virtual_array.hh.
References blender::BLI_assert(), blender::CommonVArrayInfo::data, impl_, is_span(), blender::Span< T >::Span(), and T.
Referenced by blender::ArrayState< T >::ArrayState(), blender::bke::calculate_type_counts(), blender::bke::curve_types_are_valid(), blender::geometry::gather_all_fill_ids(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::bke::curves::indices_for_type(), blender::geometry::preprocess_pointclouds(), blender::ed::sculpt_paint::greasepencil::simplify_stroke(), blender::tests::TEST_F(), and blender::ed::sculpt_paint::greasepencil::trim_stroke_ends().
|
inline |
Definition at line 597 of file BLI_virtual_array.hh.
References blender::IndexRange::IndexRange(), and size().
Referenced by blender::array_utils::booleans_mix_calc(), blender::bke::calculate_type_counts(), blender::array_utils::count_booleans(), blender::io::alembic::ABCPointCloudWriter::do_write(), blender::draw::GSplatEvalCache::ensure_builtin_buffers(), blender::bke::greasepencil::fill_cache_from_fill_ids(), blender::index_mask::IndexMask::from_bools(), blender::index_mask::IndexMask::from_bools_inverse(), blender::geometry::gather_all_fill_ids(), blender::nodes::node_geo_accumulate_field_cc::AccumulateFieldInput::get_varray_for_context(), blender::nodes::node_geo_accumulate_field_cc::TotalFieldInput::get_varray_for_context(), blender::nodes::node_geo_field_min_and_max_cc::FieldMinMaxInput::get_varray_for_context(), blender::ed::greasepencil::grease_pencil_weight_invert_exec(), blender::ed::curves::has_anything_selected(), blender::ed::pointcloud::has_anything_selected(), blender::bke::mesh_select_edge_flush(), blender::bke::mesh_select_vert_flush(), blender::bounds::min_max(), blender::paintface_reveal(), blender::io::usd::populate_curve_widths(), and blender::bke::validate_material_indices().
|
inline |
True when the size is zero or when there is no virtual array.
Definition at line 592 of file BLI_virtual_array.hh.
References size().
Referenced by blender::array_utils::booleans_mix_calc(), blender::bke::build_mesh_positions(), blender::nodes::node_shader_tex_gabor_cc::GaborNoiseFunction::call(), blender::array_utils::count_booleans(), blender::geometry::create_result_ids(), blender::io::alembic::ABCCurveWriter::do_write(), blender::io::alembic::ABCPointCloudWriter::do_write(), blender::geometry::execute_realize_curve_task(), blender::bke::greasepencil::fill_cache_from_fill_ids(), blender::geometry::gather_all_fill_ids(), blender::geometry::gather_realize_tasks_for_instances(), blender::ed::mesh::join_materials(), blender::io::ply::load_plydata(), blender::bounds::max(), blender::geometry::mesh_copy_selection(), blender::geometry::mesh_copy_selection_keep_edges(), blender::geometry::mesh_copy_selection_keep_verts(), blender::bounds::min_max(), blender::bke::greasepencil::shapes_from_fill_ids(), and blender::tests::TEST_F().
|
inline |
Return true when the virtual array returns the same value for every index.
Definition at line 628 of file BLI_virtual_array.hh.
References blender::BLI_assert(), impl_, blender::CommonVArrayInfo::Single, and blender::CommonVArrayInfo::type.
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::BKE_mesh_material_index_used(), blender::BKE_sculpt_sync_face_visibility_to_grids(), blender::io::obj::OBJMesh::calc_face_order(), blender::geometry::convert_curves_to_nurbs(), blender::io::alembic::create_geom_param_for_attribute(), blender::nodes::node_geo_points_to_curves_cc::curve_from_points(), blender::nodes::node_geo_points_to_curves_cc::curves_from_points(), blender::nodes::node_geo_curve_fill_cc::do_group_aware_cdt(), blender::io::alembic::ABCCurveWriter::do_write(), blender::io::alembic::ABCPointCloudWriter::do_write(), blender::ed::curves::duplicate_points(), blender::bke::CurvesGeometry::evaluated_normals(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_face_regions(), blender::index_mask::IndexMask::from_group_ids(), blender::geometry::gather_all_fill_ids(), blender::fn::FieldEvaluator::get_evaluated_as_mask(), get_internal_single(), blender::io::usd::get_loops_polys(), blender::nodes::node_geo_accumulate_field_cc::AccumulateFieldInput::get_varray_for_context(), blender::nodes::node_geo_accumulate_field_cc::TotalFieldInput::get_varray_for_context(), blender::nodes::node_geo_curve_topology_points_of_curve_cc::PointsOfCurveInput::get_varray_for_context(), blender::nodes::node_geo_field_average_cc::FieldAverageInput::get_varray_for_context(), blender::nodes::node_geo_field_min_and_max_cc::FieldMinMaxInput::get_varray_for_context(), blender::nodes::node_geo_field_variance_cc::FieldVarianceInput::get_varray_for_context(), blender::nodes::node_geo_index_of_nearest_cc::HasNeighborFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_curve_handles_cc::HandlePositionFieldInput::get_varray_for_context(), blender::nodes::node_geo_mesh_face_group_boundaries_cc::BoundaryFieldInput::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::bke::curves::indices_for_type(), blender::draw::interpolate_corners(), blender::bke::mesh_hide_face_flush(), blender::bke::mesh_hide_vert_flush(), blender::bke::mesh_select_edge_flush(), blender::bke::mesh_select_face_flush(), blender::bke::mesh_select_vert_flush(), blender::ed::curves::retrieve_selected_curves(), blender::geometry::sort_indices_by_weights(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_curves(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_grease_pencil_curves(), blender::tests::TEST_F(), and blender::tests::TEST_F().
|
inline |
Return true when the virtual array is stored as a span internally.
Definition at line 609 of file BLI_virtual_array.hh.
References blender::BLI_assert(), impl_, blender::CommonVArrayInfo::Span, and blender::CommonVArrayInfo::type.
Referenced by blender::ArrayState< T >::ArrayState(), blender::geometry::gather_all_fill_ids(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), get_internal_span(), blender::VMutableArray< T >::get_internal_span(), blender::ed::greasepencil::grease_pencil_stroke_smooth_exec(), blender::ed::sculpt_paint::greasepencil::simplify_stroke(), blender::ed::sculpt_paint::greasepencil::smooth_stroke(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::ed::sculpt_paint::greasepencil::trim_stroke_ends(), and blender::VArrayRangeSpans< T >::VArrayRangeSpans().
|
inline |
Get the nth last element.
Definition at line 586 of file BLI_virtual_array.hh.
|
inline |
Copy some indices of the virtual array into a span.
Definition at line 665 of file BLI_virtual_array.hh.
References blender::BLI_assert(), blender::MutableSpan< T >::data(), and impl_.
|
inline |
Copy the entire virtual array into a span.
Definition at line 659 of file BLI_virtual_array.hh.
References blender::IndexMask::IndexMask(), materialize(), and size().
Referenced by blender::geometry::create_result_ids(), blender::nodes::node_geo_points_to_curves_cc::curves_from_points(), blender::ED_mesh_split_faces(), blender::geometry::execute_realize_curve_task(), blender::geometry::execute_realize_pointcloud_task(), blender::ed::sculpt_paint::float_selection_ensure(), blender::ed::geometry::geometry_attribute_convert_exec(), blender::ed::greasepencil::join_geometries_with_transforms(), blender::ed::mesh::join_materials(), materialize(), blender::paintface_flush_flags(), blender::paintvert_flush_flags(), and blender::ed::geometry::store_attributes_to_shape_keys().
|
inline |
Copy some elements of the virtual array into a span.
Definition at line 683 of file BLI_virtual_array.hh.
References blender::MutableSpan< T >::data(), and impl_.
Referenced by blender::geometry::calculate_result_offsets(), blender::geometry::calculate_result_offsets(), blender::geometry::fillet_curves(), blender::array_utils::gather_group_to_group(), blender::nodes::node_geo_curve_topology_points_of_curve_cc::PointsOfCurveInput::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::ed::curves::retrieve_selected_curves(), and blender::tests::TEST_F().
|
inline |
Definition at line 688 of file BLI_virtual_array.hh.
References blender::MutableSpan< T >::data(), and impl_.
Referenced by blender::tests::TEST_F().
|
inline |
Definition at line 676 of file BLI_virtual_array.hh.
References blender::BLI_assert(), blender::MutableSpan< T >::data(), and impl_.
|
inline |
Definition at line 671 of file BLI_virtual_array.hh.
References blender::IndexMask::IndexMask(), materialize_to_uninitialized(), and size().
Referenced by blender::ArrayState< T >::ArrayState(), and materialize_to_uninitialized().
|
inline |
Return false when there is no virtual array implementation currently.
Definition at line 538 of file BLI_virtual_array.hh.
References impl_.
|
inline |
Get the element at a specific index.
Definition at line 548 of file BLI_virtual_array.hh.
References blender::BLI_assert(), impl_, size(), and T.
|
inline |
Return the size of the virtual array. It's allowed to call this method even when there is no virtual array. In this case 0 is returned.
Definition at line 569 of file BLI_virtual_array.hh.
References impl_.
Referenced by blender::ArrayState< T >::ArrayState(), blender::bke::CurvesGeometry::blend_read(), blender::array_utils::booleans_mix_calc(), blender::nodes::node_geo_proximity_cc::ProximityFunction::build_group_trees(), blender::bke::calculate_type_counts(), blender::array_utils::contains(), blender::io::usd::copy_blender_buffer_to_primvar(), blender::array_utils::count_booleans(), blender::array_utils::count_booleans(), blender::ed::greasepencil::create_curves_outline(), blender::io::alembic::create_geom_param_for_attribute(), blender::nodes::node_geo_points_to_curves_cc::curve_from_points(), blender::deform_drawing(), blender::VArrayDevirtualizer< T, UseSingle, UseSpan >::devirtualize(), blender::nodes::node_geo_curve_fill_cc::do_group_aware_cdt(), blender::io::alembic::ABCPointCloudWriter::do_write(), blender::draw::GSplatEvalCache::ensure_builtin_buffers(), blender::geometry::fit_poly_to_bezier_curves(), blender::ed::sculpt_paint::float_selection_ensure(), blender::index_mask::IndexMask::from_bools(), blender::index_mask::IndexMask::from_bools_inverse(), blender::VArray< T >::from_func(), blender::index_mask::IndexMask::from_group_ids(), blender::index_mask::IndexMask::from_group_ids(), blender::VArray< T >::from_single(), blender::VArray< T >::from_std_func(), blender::nodes::node_geo_sample_nearest_cc::get_closest_mesh_corners(), blender::nodes::node_geo_sample_nearest_cc::get_closest_mesh_faces(), blender::nodes::node_geo_sample_nearest_cc::get_closest_pointcloud_points(), blender::fn::FieldEvaluator::get_evaluated_as_mask(), blender::modifier::greasepencil::get_influence_vertex_weights(), blender::ed::greasepencil::grease_pencil_weight_invert_exec(), blender::GVMutableArray::GVMutableArray(), index_range(), blender::bke::curves::indices_for_type(), is_empty(), blender::ed::greasepencil::join_geometries_with_transforms(), last(), materialize(), materialize_to_uninitialized(), blender::bounds::min_max(), operator[](), blender::io::usd::populate_curve_widths(), blender::ArrayState< T >::same_as(), blender::VMutableArray< T >::set(), blender::bke::greasepencil::shapes_from_fill_ids(), blender::ed::geometry::store_attributes_to_shape_keys(), blender::bke::tests::TEST_F(), blender::fn::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::tests::TEST_F(), blender::geometry::trim_curves(), blender::VArray< T >::VArray(), and blender::ed::sculpt_paint::greasepencil::view_radii_from_point_selection().
|
inline |
See #GVArrayImpl::try_assign_GVArray.
Definition at line 694 of file BLI_virtual_array.hh.
References impl_.
|
protected |
Definition at line 513 of file BLI_virtual_array.hh.
Referenced by common_info(), emplace(), get_if_single(), get_implementation(), get_internal_single(), get_internal_span(), is_single(), is_span(), materialize(), materialize_compressed(), materialize_compressed_to_uninitialized(), materialize_to_uninitialized(), operator bool(), operator[](), size(), try_assign_GVArray(), VArrayCommon(), and VArrayCommon().