|
Blender V5.0
|
#include <BLI_virtual_array.hh>
Inherited by blender::VArray< T >, and blender::VMutableArray< T >.
Protected Types | |
| using | Storage = Any<blender::detail::VArrayAnyExtraInfo<T>, 24, 8> |
Protected Member Functions | |
| VArrayCommon ()=default | |
| VArrayCommon (const VArrayCommon &other) | |
| VArrayCommon (VArrayCommon &&other) noexcept | |
| VArrayCommon (const VArrayImpl< T > *impl) | |
| VArrayCommon (std::shared_ptr< const VArrayImpl< T > > impl) | |
| template<typename ImplT, typename... Args> | |
| void | emplace (Args &&...args) |
| void | copy_from (const VArrayCommon &other) |
| void | move_from (VArrayCommon &&other) noexcept |
| const VArrayImpl< T > * | impl_from_storage () const |
Protected Attributes | |
| const VArrayImpl< T > * | impl_ = nullptr |
| Storage | storage_ |
Utility class to reduce code duplication for methods available on VArray and VMutableArray. Deriving VMutableArray from VArray would have some issues:
Definition at line 556 of file BLI_virtual_array.hh.
|
protected |
Store the virtual array implementation in an Any. This makes it easy to avoid a memory allocation if the implementation is small enough and is copyable. This is the case for the most common virtual arrays. Other virtual array implementations are typically stored as #std::shared_ptr. That works even when the implementation itself is not copyable and makes copying VArrayCommon cheaper.
Definition at line 565 of file BLI_virtual_array.hh.
|
protecteddefault |
|
inlineprotected |
Copy constructor.
Definition at line 583 of file BLI_virtual_array.hh.
References impl_, impl_from_storage(), storage_, and VArrayCommon().
|
inlineprotectednoexcept |
Move constructor.
Definition at line 589 of file BLI_virtual_array.hh.
References impl_, impl_from_storage(), and VArrayCommon().
|
inlineprotected |
Wrap an existing VArrayImpl and don't take ownership of it. This should rarely be used in practice.
Definition at line 600 of file BLI_virtual_array.hh.
|
inlineprotected |
Wrap an existing VArrayImpl that is contained in a #std::shared_ptr. This takes ownership.
Definition at line 608 of file BLI_virtual_array.hh.
|
inline |
Definition at line 735 of file BLI_virtual_array.hh.
References BLI_assert, and impl_.
Referenced by blender::array_utils::booleans_mix_calc(), 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(), and blender::GVMutableArray::GVMutableArray().
|
inlineprotected |
Utility to implement a copy assignment operator in a subclass.
Definition at line 638 of file BLI_virtual_array.hh.
References impl_, impl_from_storage(), storage_, and VArrayCommon().
Referenced by blender::VMutableArray< float >::operator VArray< float >(), blender::VArray< T >::operator=(), and blender::VMutableArray< T >::operator=().
|
inlineprotected |
Replace the contained VArrayImpl.
Definition at line 618 of file BLI_virtual_array.hh.
References emplace(), impl_, ptr, and storage_.
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 712 of file BLI_virtual_array.hh.
References T.
Referenced by blender::io::alembic::ABCCurveWriter::create_alembic_objects(), blender::io::alembic::ABCCurveWriter::do_write(), and blender::io::usd::USDCurvesWriter::do_write().
|
inline |
Same as the operator[] but is sometimes easier to use when one has a pointer to a virtual array.
Definition at line 693 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(), blender::fn::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), VArrayCommon(), and blender::io::obj::OBJWriter::write_vertex_coords().
|
inline |
Return the value that is returned for every index, if the array is stored as a single value.
Definition at line 782 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::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_menu_switch_cc::MenuSwitchFn::call(), blender::io::usd::copy_blender_buffer_to_primvar(), blender::index_mask::IndexMask::from_group_ids(), blender::geometry::gather_attributes_to_propagate(), blender::nodes::node_geo_scale_elements_cc::gather_mean(), blender::ed::greasepencil::grease_pencil_material_lock_unselected_exec(), blender::bounds::max(), blender::geometry::mesh_copy_selection(), blender::ed::greasepencil::retrieve_visible_points(), and blender::nodes::node_geo_material_selection_cc::select_by_material().
|
inline |
Definition at line 832 of file BLI_virtual_array.hh.
References impl_.
|
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 772 of file BLI_virtual_array.hh.
References BLI_assert, blender::CommonVArrayInfo::data, impl_, is_single(), and T.
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), BKE_mesh_material_index_used(), 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::fn::FieldEvaluator::get_evaluated_as_mask(), blender::nodes::node_geo_input_curve_handles_cc::HandlePositionFieldInput::get_varray_for_context(), 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().
|
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 753 of file BLI_virtual_array.hh.
References BLI_assert, blender::CommonVArrayInfo::data, impl_, is_span(), and T.
Referenced by blender::ArrayState< T >::ArrayState(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::geometry::preprocess_pointclouds(), blender::ed::sculpt_paint::greasepencil::simplify_stroke(), blender::tests::TEST(), and blender::ed::sculpt_paint::greasepencil::trim_stroke_ends().
|
inlineprotected |
Get a pointer to the virtual array implementation that is currently stored in storage_, or null.
Definition at line 661 of file BLI_virtual_array.hh.
References storage_.
Referenced by copy_from(), move_from(), VArrayCommon(), and VArrayCommon().
|
inline |
Definition at line 730 of file BLI_virtual_array.hh.
References size().
Referenced by blender::array_utils::booleans_mix_calc(), blender::array_utils::copy(), blender::bke::copy_with_checked_indices(), blender::nodes::node_geo_sample_index_cc::copy_with_clamped_indices(), blender::array_utils::count_booleans(), blender::index_mask::IndexMask::from_bools(), blender::index_mask::IndexMask::from_bools_inverse(), 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(), paintface_reveal(), blender::io::usd::populate_curve_widths(), and blender::nodes::node_geo_interpolate_curves_cc::separate_guides_by_group().
|
inline |
True when the size is zero or when there is no virtual array.
Definition at line 725 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::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(), and blender::tests::TEST().
|
inline |
Return true when the virtual array returns the same value for every index.
Definition at line 761 of file BLI_virtual_array.hh.
References BLI_assert, impl_, blender::CommonVArrayInfo::Single, and blender::CommonVArrayInfo::type.
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), BKE_mesh_material_index_used(), BKE_sculpt_sync_face_visibility_to_grids(), blender::io::obj::OBJMesh::calc_face_order(), blender::geometry::convert_curves_to_nurbs(), 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::ed::curves::duplicate_points(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_face_regions(), blender::fn::FieldEvaluator::get_evaluated_as_mask(), get_internal_single(), blender::io::usd::get_loops_polys(), blender::nodes::node_geo_curve_topology_points_of_curve_cc::PointsOfCurveInput::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::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_sort_elements_cc::sorted_indices(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_curves(), blender::nodes::node_geo_curve_subdivide_cc::subdivide_grease_pencil_curves(), blender::tests::TEST(), and blender::tests::TEST().
|
inline |
Return true when the virtual array is stored as a span internally.
Definition at line 742 of file BLI_virtual_array.hh.
References BLI_assert, impl_, blender::CommonVArrayInfo::Span, and blender::CommonVArrayInfo::type.
Referenced by blender::ArrayState< T >::ArrayState(), 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(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), blender::tests::TEST(), and blender::ed::sculpt_paint::greasepencil::trim_stroke_ends().
|
inline |
Get the nth last element.
Definition at line 719 of file BLI_virtual_array.hh.
|
inline |
Copy some indices of the virtual array into a span.
Definition at line 798 of file BLI_virtual_array.hh.
References BLI_assert, blender::MutableSpan< T >::data(), impl_, and mask().
|
inline |
Copy the entire virtual array into a span.
Definition at line 792 of file BLI_virtual_array.hh.
References materialize(), and size().
Referenced by blender::nodes::node_geo_points_to_curves_cc::curves_from_points(), ED_mesh_split_faces(), blender::geometry::execute_realize_pointcloud_task(), blender::ed::sculpt_paint::float_selection_ensure(), blender::ed::geometry::geometry_attribute_convert_exec(), blender::draw::grease_pencil_weight_batch_ensure(), handle_curves_knot_mode(), blender::ed::greasepencil::join_geometries_with_transforms(), blender::ed::mesh::join_materials(), materialize(), paintface_flush_flags(), 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 816 of file BLI_virtual_array.hh.
References blender::MutableSpan< T >::data(), impl_, and mask().
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().
|
inline |
Definition at line 821 of file BLI_virtual_array.hh.
References blender::MutableSpan< T >::data(), impl_, and mask().
Referenced by blender::tests::TEST().
|
inline |
Definition at line 809 of file BLI_virtual_array.hh.
References BLI_assert, blender::MutableSpan< T >::data(), impl_, and mask().
|
inline |
Definition at line 804 of file BLI_virtual_array.hh.
References materialize_to_uninitialized(), and size().
Referenced by blender::ArrayState< T >::ArrayState(), and materialize_to_uninitialized().
|
inlineprotectednoexcept |
Utility to implement a move assignment operator in a subclass.
Definition at line 648 of file BLI_virtual_array.hh.
References impl_, impl_from_storage(), storage_, and VArrayCommon().
Referenced by blender::VMutableArray< float >::operator VArray< float >(), blender::VArray< T >::operator=(), and blender::VMutableArray< T >::operator=().
|
inline |
Return false when there is no virtual array implementation currently.
Definition at line 671 of file BLI_virtual_array.hh.
References impl_.
|
inline |
Get the element at a specific index.
Definition at line 681 of file BLI_virtual_array.hh.
References 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 702 of file BLI_virtual_array.hh.
References impl_.
Referenced by blender::ArrayState< T >::ArrayState(), blender::array_utils::booleans_mix_calc(), blender::ed::sculpt_paint::greasepencil::calculate_view_radii(), blender::array_utils::contains(), blender::array_utils::copy(), 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::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::ed::sculpt_paint::face_set::duplicate_face_sets(), 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::get_closest_in_bvhtree(), 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(), is_empty(), blender::ed::greasepencil::join_geometries_with_transforms(), last(), materialize(), materialize_to_uninitialized(), operator[](), blender::io::usd::populate_curve_widths(), blender::ArrayState< T >::same_as(), blender::VMutableArray< T >::set(), blender::ed::geometry::store_attributes_to_shape_keys(), blender::bke::NormalsCache::store_varray(), 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(), blender::geometry::trim_curves(), blender::VArray< T >::VArray(), and blender::io::obj::OBJWriter::write_vertex_coords().
|
inline |
See #GVArrayImpl::try_assign_GVArray.
Definition at line 827 of file BLI_virtual_array.hh.
References impl_.
|
protected |
Pointer to the currently contained virtual array implementation. This is allowed to be null.
Definition at line 570 of file BLI_virtual_array.hh.
Referenced by common_info(), copy_from(), 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(), move_from(), operator bool(), operator[](), size(), try_assign_GVArray(), VArrayCommon(), VArrayCommon(), VArrayCommon(), and VArrayCommon().
|
protected |
Does the memory management for the virtual array implementation. It contains one of the following:
Definition at line 578 of file BLI_virtual_array.hh.
Referenced by copy_from(), emplace(), impl_from_storage(), move_from(), VArrayCommon(), VArrayCommon(), and VArrayCommon().