|
Blender V4.5
|
#include <BLI_generic_virtual_array.hh>
Inherited by blender::GVArray, and blender::GVMutableArray.
Public Member Functions | |
| bool | may_have_ownership () const |
Protected Types | |
| using | Storage = Any<detail::GVArrayAnyExtraInfo, 40, 8> |
Protected Member Functions | |
| GVArrayCommon ()=default | |
Protected Attributes | |
| const GVArrayImpl * | impl_ = nullptr |
| Storage | storage_ |
#GVArrayCommon | |
| GVArrayCommon (const GVArrayCommon &other) | |
| GVArrayCommon (GVArrayCommon &&other) noexcept | |
| GVArrayCommon (const GVArrayImpl *impl) | |
| GVArrayCommon (std::shared_ptr< const GVArrayImpl > impl) | |
| ~GVArrayCommon () | |
| void | copy_from (const GVArrayCommon &other) |
| void | move_from (GVArrayCommon &&other) noexcept |
| const GVArrayImpl * | impl_from_storage () const |
| IndexRange | index_range () const |
| void | materialize (void *dst) const |
| void | materialize (const IndexMask &mask, void *dst) const |
| void | materialize_to_uninitialized (void *dst) const |
| void | materialize_to_uninitialized (const IndexMask &mask, void *dst) const |
| void | materialize_compressed (const IndexMask &mask, void *dst) const |
| void | materialize_compressed_to_uninitialized (const IndexMask &mask, void *dst) const |
| bool | is_span () const |
| GSpan | get_internal_span () const |
| bool | is_single () const |
| void | get_internal_single (void *r_value) const |
| void | get_internal_single_to_uninitialized (void *r_value) const |
Inline methods for #GVArrayCommon. | |
| template<typename ImplT, typename... Args> | |
| void | emplace (Args &&...args) |
| const CPPType & | type () const |
| operator bool () const | |
| int64_t | size () const |
| bool | is_empty () const |
| template<typename T> | |
| bool | try_assign_VArray (VArray< T > &varray) const |
| CommonVArrayInfo | common_info () const |
| void | get (int64_t index, void *r_value) const |
| template<typename T> | |
| T | get (int64_t index) const |
| void | get_to_uninitialized (int64_t index, void *r_value) const |
Utility class to reduce code duplication between GVArray and GVMutableArray. It pretty much follows VArrayCommon. Don't use this class outside of this header.
Definition at line 92 of file BLI_generic_virtual_array.hh.
|
protected |
See VArrayCommon for more information. The inline buffer is a bit larger here, because generic virtual array implementations often require a bit more space than typed ones.
Definition at line 98 of file BLI_generic_virtual_array.hh.
|
protecteddefault |
|
protected |
Definition at line 552 of file generic_virtual_array.cc.
References GVArrayCommon(), impl_, impl_from_storage(), and storage_.
|
protectednoexcept |
Definition at line 557 of file generic_virtual_array.cc.
References GVArrayCommon(), impl_, impl_from_storage(), and storage_.
|
protected |
Definition at line 564 of file generic_virtual_array.cc.
|
protected |
Definition at line 569 of file generic_virtual_array.cc.
|
protecteddefault |
References GVArrayCommon().
|
inline |
Definition at line 778 of file BLI_generic_virtual_array.hh.
References impl_.
Referenced by blender::bke::attribute_data_matches_varray(), blender::GVMutableArray::fill(), blender::GVArray::slice(), blender::GVArray::typed(), and blender::GVMutableArray::typed().
|
protected |
Definition at line 609 of file generic_virtual_array.cc.
References GVArrayCommon(), impl_, impl_from_storage(), and storage_.
Referenced by blender::GVMutableArray::operator GVArray(), blender::GVArray::operator=(), and blender::GVMutableArray::operator=().
|
inlineprotected |
Definition at line 722 of file BLI_generic_virtual_array.hh.
References emplace(), impl_, ptr, and storage_.
Referenced by emplace(), blender::GVArray::For(), blender::GVMutableArray::For(), blender::GVArray::GVArray(), blender::GVArray::GVArray(), and blender::GVArray::GVArray().
Returns a copy of the value at the given index. Usually a typed virtual array should be used instead, but sometimes this is simpler when only a few indices are needed.
Definition at line 744 of file BLI_generic_virtual_array.hh.
References BLI_assert, impl_, size(), T, and type().
|
inline |
Definition at line 737 of file BLI_generic_virtual_array.hh.
References BLI_assert, impl_, and size().
Referenced by blender::fn::multi_function::tests::GenericAppendFunction::call(), blender::ed::greasepencil::duplicate_layer_and_frames(), blender::GVectorArray::extend(), blender::nodes::node_fn_format_string_cc::format_with_fmt(), GVArrayCommon(), and transform_active_color_data().
| void blender::GVArrayCommon::get_internal_single | ( | void * | r_value | ) | const |
Copies the value that is used for every element into r_value, which is expected to point to initialized memory. This invokes undefined behavior if the virtual array would not return the same value for every index.
Definition at line 648 of file generic_virtual_array.cc.
References BLI_assert, blender::CPPType::copy_assign(), blender::CommonVArrayInfo::data, impl_, is_single(), and type().
Referenced by blender::bke::CurvesGeometry::adapt_domain(), blender::bke::adapt_mesh_attribute_domain(), and get_internal_single_to_uninitialized().
| void blender::GVArrayCommon::get_internal_single_to_uninitialized | ( | void * | r_value | ) | const |
Same as get_internal_single, but r_value points to initialized memory.
Definition at line 655 of file generic_virtual_array.cc.
References get_internal_single(), and impl_.
| GSpan blender::GVArrayCommon::get_internal_span | ( | ) | const |
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 635 of file generic_virtual_array.cc.
References BLI_assert, blender::CommonVArrayInfo::data, impl_, is_span(), this, and type().
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::ed::greasepencil::attributes_varrays_span_data_equal(), blender::bke::build_mesh_positions(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::bke::evaluate_attribute(), blender::bke::gather_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::geometry::prepare_attribute_fallbacks(), blender::geometry::preprocess_curves(), blender::geometry::preprocess_meshes(), blender::geometry::preprocess_pointclouds(), blender::ed::sculpt_paint::replace_attribute(), blender::bke::save_shared_attribute(), blender::save_shared_attribute(), blender::bke::try_add_shared_field_attribute(), blender::bke::try_direct_evaluate_point_data(), and blender::bke::try_sharing_point_data().
|
inline |
Definition at line 755 of file BLI_generic_virtual_array.hh.
References BLI_assert, impl_, and size().
Referenced by blender::bke::EvaluateOnDomainInput::get_varray_for_context(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_generation_items_group(), and blender::nodes::LazyFunctionForForeachGeometryElementZone::prepare_components().
|
protected |
Definition at line 661 of file generic_virtual_array.cc.
References storage_.
Referenced by copy_from(), GVArrayCommon(), GVArrayCommon(), and move_from().
| IndexRange blender::GVArrayCommon::index_range | ( | ) | const |
Definition at line 669 of file generic_virtual_array.cc.
References size().
Referenced by blender::bke::add_custom_data_layer_from_attribute_init(), and blender::array_utils::copy().
|
inline |
Definition at line 791 of file BLI_generic_virtual_array.hh.
References size().
Referenced by blender::bke::CurvesGeometry::adapt_domain(), blender::bke::adapt_mesh_attribute_domain(), and attr_create_generic().
| bool blender::GVArrayCommon::is_single | ( | ) | const |
Returns true when the virtual array returns the same value for every index.
Definition at line 642 of file generic_virtual_array.cc.
References impl_, blender::CommonVArrayInfo::Single, and blender::CommonVArrayInfo::type.
Referenced by blender::bke::CurvesGeometry::adapt_domain(), blender::bke::adapt_mesh_attribute_domain(), blender::fn::find_varying_fields(), and get_internal_single().
| bool blender::GVArrayCommon::is_span | ( | ) | const |
Returns true when the virtual array is stored as a span internally.
Definition at line 629 of file generic_virtual_array.cc.
References impl_, blender::CommonVArrayInfo::Span, and blender::CommonVArrayInfo::type.
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::ed::greasepencil::attributes_varrays_span_data_equal(), blender::bke::build_mesh_positions(), blender::nodes::node_geo_instances_to_points_cc::convert_instances_to_points(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::bke::evaluate_attribute(), blender::fn::evaluate_fields(), blender::bke::gather_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(), get_internal_span(), blender::GVMutableArray::get_internal_span(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), blender::geometry::prepare_attribute_fallbacks(), blender::bke::MutableAttributeAccessor::rename(), blender::ed::sculpt_paint::replace_attribute(), blender::bke::save_shared_attribute(), blender::save_shared_attribute(), blender::bke::bake::serialize_attributes(), blender::bke::try_add_shared_field_attribute(), blender::bke::try_direct_evaluate_point_data(), and blender::bke::try_sharing_point_data().
| void blender::GVArrayCommon::materialize | ( | const IndexMask & | mask, |
| void * | dst ) const |
Definition at line 583 of file generic_virtual_array.cc.
| void blender::GVArrayCommon::materialize | ( | void * | dst | ) | const |
Definition at line 578 of file generic_virtual_array.cc.
References impl_, and materialize().
Referenced by blender::ed::greasepencil::ensure_selection_domain(), blender::bke::evaluate_attribute(), face_corner_color_equalize_verts(), materialize(), blender::bke::save_shared_attribute(), blender::save_shared_attribute(), blender::bke::try_capture_fields_on_geometry(), and vpaint_init_vpaint().
| void blender::GVArrayCommon::materialize_compressed | ( | const IndexMask & | mask, |
| void * | dst ) const |
Definition at line 599 of file generic_virtual_array.cc.
| void blender::GVArrayCommon::materialize_compressed_to_uninitialized | ( | const IndexMask & | mask, |
| void * | dst ) const |
Definition at line 604 of file generic_virtual_array.cc.
| void blender::GVArrayCommon::materialize_to_uninitialized | ( | const IndexMask & | mask, |
| void * | dst ) const |
Definition at line 593 of file generic_virtual_array.cc.
References BLI_assert, impl_, and mask().
| void blender::GVArrayCommon::materialize_to_uninitialized | ( | void * | dst | ) | const |
Definition at line 588 of file generic_virtual_array.cc.
References impl_, and materialize_to_uninitialized().
Referenced by blender::bke::add_custom_data_layer_from_attribute_init(), blender::ed::geometry::convert_attribute(), and materialize_to_uninitialized().
|
protectednoexcept |
Definition at line 618 of file generic_virtual_array.cc.
References GVArrayCommon(), impl_, impl_from_storage(), and storage_.
Referenced by blender::GVMutableArray::operator GVArray(), blender::GVArray::operator=(), and blender::GVMutableArray::operator=().
|
inline |
Definition at line 773 of file BLI_generic_virtual_array.hh.
References impl_.
|
inline |
Definition at line 783 of file BLI_generic_virtual_array.hh.
References impl_.
Referenced by blender::nodes::node_geo_instance_on_points_cc::add_instances_from_component(), blender::fn::multi_function::ParamsBuilder::add_readonly_single_input(), blender::ed::greasepencil::attributes_varrays_not_equal(), blender::bke::call_convert_to_uninitialized_fn(), blender::ed::geometry::convert_attribute(), blender::array_utils::copy(), blender::array_utils::copy(), blender::fn::evaluate_fields(), blender::GVectorArray::extend(), blender::GVMutableArray::fill(), blender::nodes::node_fn_format_string_cc::format_strings(), blender::GVArray::ForSingle(), blender::GVArray::ForSingleDefault(), blender::GVArray::ForSingleRef(), get(), get(), get_to_uninitialized(), blender::GVArray::GVArray(), blender::GVArray::GVArray(), blender::GVArray::GVArray(), index_range(), is_empty(), blender::ed::geometry::MeshState::MeshState(), blender::bke::save_shared_attribute(), blender::save_shared_attribute(), blender::GVMutableArray::set_by_copy(), blender::GVMutableArray::set_by_move(), blender::GVMutableArray::set_by_relocate(), and vpaint_init_vpaint().
|
inline |
Definition at line 762 of file BLI_generic_virtual_array.hh.
References BLI_assert, impl_, and T.
Referenced by blender::GVArray::typed().
|
inline |
Definition at line 768 of file BLI_generic_virtual_array.hh.
References impl_.
Referenced by blender::ed::sculpt_paint::color::active_color_attribute(), blender::bke::adapt_curve_domain_curve_to_point(), blender::bke::adapt_curve_domain_point_to_curve(), blender::bke::CurvesGeometry::adapt_domain(), blender::bke::adapt_domain_and_type_if_necessary(), blender::bke::adapt_mesh_attribute_domain(), blender::bke::adapt_mesh_domain_corner_to_edge(), blender::bke::adapt_mesh_domain_corner_to_face(), blender::bke::adapt_mesh_domain_corner_to_point(), blender::bke::adapt_mesh_domain_edge_to_corner(), blender::bke::adapt_mesh_domain_edge_to_face(), blender::bke::adapt_mesh_domain_edge_to_point(), blender::bke::adapt_mesh_domain_face_to_corner(), blender::bke::adapt_mesh_domain_face_to_edge(), blender::bke::adapt_mesh_domain_face_to_point(), blender::bke::adapt_mesh_domain_point_to_corner(), blender::bke::adapt_mesh_domain_point_to_edge(), blender::bke::adapt_mesh_domain_point_to_face(), blender::fn::multi_function::ParamsBuilder::add_readonly_single_input(), blender::ed::spreadsheet::apply_row_filter(), attr_create_generic(), attr_create_generic(), blender::ed::greasepencil::attributes_varrays_not_equal(), bke_attribute_copy_if_exists(), BKE_attribute_duplicate(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), blender::fn::multi_function::tests::GenericAppendFunction::call(), blender::ed::geometry::convert_attribute(), blender::array_utils::copy(), blender::array_utils::copy(), copy_attributes(), blender::bke::copy_curve_domain_attribute_to_mesh(), blender::bke::copy_main_point_domain_attribute_to_mesh(), blender::bke::copy_with_checked_indices(), blender::ed::greasepencil::curves_geometry_is_equal(), blender::ed::greasepencil::ensure_selection_domain(), blender::bke::evaluate_attribute(), blender::fn::evaluate_fields(), blender::GVectorArray::extend(), blender::draw::extract_attribute(), blender::draw::extract_attribute_data(), blender::draw::extract_attribute_subdiv(), blender::ed::curves::extrude_curves(), blender::GVMutableArray::fill(), blender::GVArray::ForEmpty(), blender::GVArray::ForSingle(), blender::GVArray::ForSingleDefault(), blender::GVArray::ForSingleRef(), blender::array_utils::gather(), blender::bke::attribute_math::gather(), get(), get_internal_single(), get_internal_span(), blender::GVMutableArray::get_internal_span(), blender::bke::EvaluateAtIndexInput::get_varray_for_context(), 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_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::GVArray::GVArray(), blender::GVArray::GVArray(), blender::GVArray::GVArray(), blender::nodes::LazyFunctionForReduceForeachGeometryElement::handle_generation_items_group(), blender::bke::MutableAttributeAccessor::lookup_for_write(), blender::geometry::point_merge_by_distance(), blender::bke::MutableAttributeAccessor::rename(), blender::geometry::retrieve_attribute_spans(), blender::geometry::retrieve_attribute_spans(), blender::bke::mesh_surface_sample::sample_corner_attribute(), blender::bke::mesh_surface_sample::sample_face_attribute(), blender::bke::mesh_surface_sample::sample_point_attribute(), blender::bke::save_shared_attribute(), blender::save_shared_attribute(), blender::ed::curves::set_attribute_invoke(), blender::ed::pointcloud::set_attribute_invoke(), blender::GVArray::slice(), blender::bke::compare_geometry::sort_domain_using_attributes(), blender::nodes::node_geo_dual_mesh_cc::transfer_attributes(), transform_active_color_data(), blender::bke::DataTypeConversions::try_convert(), blender::bke::DataTypeConversions::try_convert(), blender::bke::try_sharing_point_data(), blender::GVMutableArray::typed(), blender::draw::pbvh::update_generic_attribute_mesh(), blender::bke::compare_geometry::verify_attributes_compatible(), vertex_paint_from_weight(), and vpaint_init_vpaint().
|
protected |
Definition at line 100 of file BLI_generic_virtual_array.hh.
Referenced by common_info(), copy_from(), emplace(), get(), get(), blender::GVArray::get_implementation(), get_internal_single(), get_internal_single_to_uninitialized(), get_internal_span(), blender::GVMutableArray::get_internal_span(), get_to_uninitialized(), GVArrayCommon(), GVArrayCommon(), GVArrayCommon(), GVArrayCommon(), is_single(), is_span(), materialize(), materialize(), materialize_compressed(), materialize_compressed_to_uninitialized(), materialize_to_uninitialized(), materialize_to_uninitialized(), move_from(), operator bool(), size(), try_assign_VArray(), blender::GVMutableArray::try_assign_VMutableArray(), type(), and blender::GVArray::typed().
|
protected |
Definition at line 101 of file BLI_generic_virtual_array.hh.
Referenced by copy_from(), emplace(), GVArrayCommon(), GVArrayCommon(), GVArrayCommon(), GVArrayCommon(), impl_from_storage(), and move_from().