Blender
V3.3
|
#include <BLI_generic_virtual_array.hh>
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 (IndexMask mask, void *dst) const |
void | materialize_compressed_to_uninitialized (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 93 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 99 of file BLI_generic_virtual_array.hh.
|
protecteddefault |
|
protected |
Definition at line 521 of file generic_virtual_array.cc.
References impl_, and impl_from_storage().
|
protectednoexcept |
Definition at line 526 of file generic_virtual_array.cc.
|
protected |
Definition at line 533 of file generic_virtual_array.cc.
|
protected |
Definition at line 538 of file generic_virtual_array.cc.
|
protecteddefault |
|
inline |
Definition at line 777 of file BLI_generic_virtual_array.hh.
References blender::GVArrayImpl::common_info(), and impl_.
Referenced by blender::VArrayImpl_For_GVArray< T >::common_info(), blender::GVArrayImpl_For_SlicedGVArray::common_info(), blender::GVMutableArray::fill(), blender::GMutableVArraySpan::GMutableVArraySpan(), blender::GVArraySpan::GVArraySpan(), blender::GVArray::slice(), blender::GVArray::typed(), and blender::GVMutableArray::typed().
|
protected |
Definition at line 578 of file generic_virtual_array.cc.
References impl_, impl_from_storage(), and storage_.
Referenced by blender::GVMutableArray::operator GVArray(), blender::GVArray::operator=(), and blender::GVMutableArray::operator=().
|
inlineprotected |
Definition at line 721 of file BLI_generic_virtual_array.hh.
References impl_, ptr, and storage_.
Referenced by blender::GVMutableArray::For().
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 743 of file BLI_generic_virtual_array.hh.
References BLI_assert, blender::GVArrayImpl::get(), impl_, size(), T, and type().
Definition at line 736 of file BLI_generic_virtual_array.hh.
References BLI_assert, blender::GVArrayImpl::get(), impl_, and size().
Referenced by blender::fn::tests::GenericAppendFunction::call(), blender::GVectorArray::extend(), blender::VArrayImpl_For_GVArray< T >::get(), blender::GVArrayImpl_For_SlicedGVArray::get(), and blender::GVVectorArray_For_SingleGVArray::get_vector_element_impl().
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 617 of file generic_virtual_array.cc.
References BLI_assert, blender::GVArrayImpl::common_info(), blender::CPPType::copy_assign(), blender::CommonVArrayInfo::data, impl_, is_single(), and type().
Referenced by get_internal_single_to_uninitialized().
Same as get_internal_single
, but r_value
points to initialized memory.
Definition at line 624 of file generic_virtual_array.cc.
References blender::CPPType::default_construct(), get_internal_single(), impl_, and blender::GVArrayImpl::type().
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 604 of file generic_virtual_array.cc.
References BLI_assert, blender::GVArrayImpl::common_info(), blender::CommonVArrayInfo::data, impl_, is_span(), and type().
Referenced by blender::geometry::preprocess_curves(), blender::geometry::preprocess_meshes(), blender::geometry::preprocess_pointclouds(), blender::geometry::retrieve_attribute_spans(), and blender::geometry::retrieve_generic_point_attributes().
Definition at line 754 of file BLI_generic_virtual_array.hh.
References BLI_assert, blender::GVArrayImpl::get_to_uninitialized(), impl_, and size().
Referenced by blender::GVArrayImpl_For_SlicedGVArray::get_to_uninitialized().
|
protected |
Definition at line 630 of file generic_virtual_array.cc.
References blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::extra_info(), blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::get(), blender::Any< ExtraInfo, InlineBufferCapacity, Alignment >::has_value(), and storage_.
Referenced by copy_from(), and GVArrayCommon().
IndexRange blender::GVArrayCommon::index_range | ( | ) | const |
Definition at line 638 of file generic_virtual_array.cc.
References size().
Referenced by blender::bke::add_builtin_type_custom_data_layer_from_init(), and blender::bke::add_custom_data_layer_from_attribute_init().
|
inline |
Definition at line 790 of file BLI_generic_virtual_array.hh.
References size().
Referenced by adapt_curve_attribute_domain(), and blender::bke::CurvesGeometry::adapt_domain().
bool blender::GVArrayCommon::is_single | ( | ) | const |
Returns true when the virtual array returns the same value for every index.
Definition at line 611 of file generic_virtual_array.cc.
References blender::GVArrayImpl::common_info(), impl_, blender::CommonVArrayInfo::Single, and blender::CommonVArrayInfo::type.
Referenced by 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 598 of file generic_virtual_array.cc.
References blender::GVArrayImpl::common_info(), impl_, blender::CommonVArrayInfo::Span, and blender::CommonVArrayInfo::type.
Referenced by blender::fn::evaluate_fields(), get_internal_span(), and blender::GVMutableArray::get_internal_span().
Definition at line 552 of file generic_virtual_array.cc.
References impl_, mask(), and blender::GVArrayImpl::materialize().
Definition at line 547 of file generic_virtual_array.cc.
References impl_, and blender::GVArrayImpl::size().
Referenced by face_corner_color_equalize_vertices(), and blender::VArrayImpl_For_GVArray< T >::materialize().
Definition at line 568 of file generic_virtual_array.cc.
References impl_, mask(), and blender::GVArrayImpl::materialize_compressed().
Referenced by blender::VArrayImpl_For_GVArray< T >::materialize_compressed().
void blender::GVArrayCommon::materialize_compressed_to_uninitialized | ( | IndexMask | mask, |
void * | dst | ||
) | const |
Definition at line 573 of file generic_virtual_array.cc.
References impl_, mask(), and blender::GVArrayImpl::materialize_compressed_to_uninitialized().
Referenced by blender::GVArrayImpl_For_SlicedGVArray::materialize_compressed_to_uninitialized(), and blender::VArrayImpl_For_GVArray< T >::materialize_compressed_to_uninitialized().
void blender::GVArrayCommon::materialize_to_uninitialized | ( | const IndexMask | mask, |
void * | dst | ||
) | const |
Definition at line 562 of file generic_virtual_array.cc.
References BLI_assert, impl_, mask(), blender::GVArrayImpl::materialize_to_uninitialized(), and blender::GVArrayImpl::size().
Definition at line 557 of file generic_virtual_array.cc.
References impl_, and blender::GVArrayImpl::size().
Referenced by blender::bke::add_builtin_type_custom_data_layer_from_init(), blender::bke::add_custom_data_layer_from_attribute_init(), ED_geometry_attribute_convert(), blender::ed::geometry::geometry_attribute_convert_exec(), blender::GMutableVArraySpan::GMutableVArraySpan(), blender::GVArraySpan::GVArraySpan(), and blender::VArrayImpl_For_GVArray< T >::materialize_to_uninitialized().
bool blender::GVArrayCommon::may_have_ownership | ( | ) | const |
|
protectednoexcept |
Definition at line 587 of file generic_virtual_array.cc.
Referenced by blender::GVMutableArray::operator GVArray().
|
inline |
Definition at line 772 of file BLI_generic_virtual_array.hh.
|
inline |
Definition at line 782 of file BLI_generic_virtual_array.hh.
References impl_, and blender::GVArrayImpl::size().
Referenced by adapt_mesh_attribute_domain(), blender::fn::MFParamsBuilder::add_readonly_single_input(), ED_geometry_attribute_convert(), blender::fn::evaluate_fields(), blender::GVectorArray::extend(), blender::GVMutableArray::fill(), blender::GVArray::ForSingle(), blender::GVArray::ForSingleDefault(), blender::GVArray::ForSingleRef(), blender::ed::geometry::geometry_attribute_convert_exec(), get(), get_to_uninitialized(), blender::GVVectorArray_For_SingleGVArray::get_vector_size_impl(), blender::GMutableVArraySpan::GMutableVArraySpan(), blender::GVArray::GVArray(), blender::GVArrayImpl_For_SlicedGVArray::GVArrayImpl_For_SlicedGVArray(), blender::GVArraySpan::GVArraySpan(), index_range(), is_empty(), 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::GVMutableArray::set_by_copy(), blender::GVMutableArray::set_by_move(), blender::GVMutableArray::set_by_relocate(), and blender::ed::spreadsheet::ColumnValues::size().
|
inline |
Definition at line 761 of file BLI_generic_virtual_array.hh.
References BLI_assert, impl_, blender::CPPType::is(), T, blender::GVArrayImpl::try_assign_VArray(), and blender::GVArrayImpl::type().
Referenced by blender::GVArray::typed().
|
inline |
Definition at line 767 of file BLI_generic_virtual_array.hh.
References impl_, and blender::GVArrayImpl::type().
Referenced by blender::bke::adapt_curve_domain_curve_to_point(), blender::bke::adapt_curve_domain_point_to_curve(), blender::bke::adapt_curve_domain_point_to_spline(), blender::bke::adapt_curve_domain_spline_to_point(), 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::MFParamsBuilder::add_readonly_single_input(), blender::ed::spreadsheet::apply_row_filter(), blender::fn::tests::GenericAppendFunction::call(), blender::nodes::node_geo_duplicate_elements_cc::copy_attributes_without_id(), blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id(), blender::nodes::node_geo_duplicate_elements_cc::copy_edge_attributes_without_id(), blender::nodes::node_geo_duplicate_elements_cc::copy_face_attributes_without_id(), blender::geometry::create_curve_from_vert_indices(), blender::nodes::node_geo_raycast_cc::RaycastFunction::create_signature(), ED_geometry_attribute_convert(), blender::fn::evaluate_fields(), blender::GVectorArray::extend(), blender::GVMutableArray::fill(), blender::GVArray::ForEmpty(), blender::GVArray::ForSingle(), blender::GVArray::ForSingleDefault(), blender::GVArray::ForSingleRef(), blender::ed::geometry::geometry_attribute_convert_exec(), get(), get_internal_single(), get_internal_span(), blender::GVMutableArray::get_internal_span(), blender::GVArray::GVArray(), blender::bke::AttributeAccessor::lookup(), blender::geometry::point_merge_by_distance(), 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::GVArray::slice(), blender::nodes::node_geo_dual_mesh_cc::transfer_attributes(), transform_active_color(), blender::bke::DataTypeConversions::try_convert(), blender::ed::spreadsheet::ColumnValues::type(), blender::GVMutableArray::typed(), blender::VArrayImpl_For_GVArray< T >::VArrayImpl_For_GVArray(), vertex_paint_from_weight(), and blender::VMutableArrayImpl_For_GVMutableArray< T >::VMutableArrayImpl_For_GVMutableArray().
|
protected |
Definition at line 101 of file BLI_generic_virtual_array.hh.
Referenced by common_info(), copy_from(), emplace(), 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(), is_single(), is_span(), materialize(), materialize_compressed(), materialize_compressed_to_uninitialized(), materialize_to_uninitialized(), size(), try_assign_VArray(), blender::GVMutableArray::try_assign_VMutableArray(), type(), and blender::GVArray::typed().
|
protected |
Definition at line 102 of file BLI_generic_virtual_array.hh.
Referenced by copy_from(), emplace(), GVArrayCommon(), and impl_from_storage().