|
Blender V5.0
|
#include <BKE_attribute_storage.hh>
Classes | |
| struct | ArrayData |
| struct | SingleData |
Public Types | |
| using | DataVariant = std::variant<ArrayData, SingleData> |
Public Member Functions | |
| StringRefNull | name () const |
| AttrDomain | domain () const |
| AttrType | data_type () const |
| AttrStorageType | storage_type () const |
| const DataVariant & | data () const |
| DataVariant & | data_for_write () |
| void | assign_data (DataVariant &&data) |
Public Attributes | |
| friend | AttributeStorage |
Data and metadata for a single geometry attribute.
Definition at line 33 of file BKE_attribute_storage.hh.
| using blender::bke::Attribute::DataVariant = std::variant<ArrayData, SingleData> |
Definition at line 61 of file BKE_attribute_storage.hh.
|
inline |
Replace the attribute's data without first making the existing data mutable.
Definition at line 244 of file BKE_attribute_storage.hh.
References data().
Referenced by blender::geometry::reorder_attribute_domain(), reorder_attribute_domain(), blender::geometry::reorder_attribute_groups(), blender::bke::AttributeStorage::resize(), and shrink_attribute_storage().
|
inline |
Low level access to the data stored for the attribute. The variant's type will correspond to the storage type.
Definition at line 239 of file BKE_attribute_storage.hh.
Referenced by assign_data(), blender::bke::attribute_storage_blend_write_prepare(), blender::bke::attribute_to_reader(), blender::bke::convert_storage_to_customdata(), data_for_write(), blender::bke::Attribute::SingleData::from_value(), blender::bke::get_span_attribute(), blender::bke::get_varray_attribute(), blender::geometry::reorder_attribute_domain(), reorder_attribute_domain(), blender::geometry::reorder_attribute_groups(), blender::bke::AttributeStorage::resize(), shrink_attribute_storage(), blender::ed::pointcloud::undo::step_decode(), and blender::bke::tests::TEST().
| Attribute::DataVariant & Attribute::data_for_write | ( | ) |
The same as data(), but if the attribute data is shared initially, it will be unshared and made mutable.
Definition at line 168 of file attribute_storage.cc.
References blender::bke::attribute_type_to_cpp_type(), BLI_assert, blender::CPPType::copy_construct_n(), blender::bke::Attribute::ArrayData::data, data(), blender::bke::Attribute::ArrayData::from_uninitialized(), and blender::bke::Attribute::SingleData::from_value().
Referenced by blender::bke::attribute_to_writer(), blender::bke::get_mutable_attribute(), blender::bke::tests::TEST(), and blender::bke::tests::TEST().
|
inline |
The data type exposed to the user. Depending on the storage type, the actual internal values may not be the same type.
Definition at line 234 of file BKE_attribute_storage.hh.
Referenced by blender::bke::AttributeStorage::add(), blender::bke::attribute_storage_blend_write_prepare(), blender::bke::attribute_to_reader(), blender::bke::attribute_to_writer(), blender::bke::convert_storage_to_customdata(), blender::bke::curves::get_curves_accessor_functions(), blender::bke::greasepencil::get_grease_pencil_accessor_functions(), blender::bke::get_instances_accessor_functions(), blender::bke::get_pointcloud_accessor_functions(), blender::bke::get_varray_attribute(), blender::geometry::reorder_attribute_domain(), reorder_attribute_domain(), blender::geometry::reorder_attribute_groups(), blender::bke::AttributeStorage::resize(), shrink_attribute_storage(), blender::bke::tests::TEST(), blender::bke::write_array_data(), and blender::bke::write_shared_array().
|
inline |
Which part of a geometry the attribute corresponds to.
Definition at line 229 of file BKE_attribute_storage.hh.
Referenced by blender::bke::AttributeStorage::add(), blender::bke::attribute_storage_blend_write_prepare(), blender::bke::attribute_to_writer(), blender::bke::AttributeStorage::blend_read(), blender::bke::convert_storage_to_customdata(), blender::bke::curves::get_curves_accessor_functions(), blender::bke::greasepencil::get_grease_pencil_accessor_functions(), blender::bke::get_instances_accessor_functions(), blender::bke::get_pointcloud_accessor_functions(), blender::bke::get_span_attribute(), blender::bke::get_varray_attribute(), blender::geometry::reorder_attribute_domain(), reorder_attribute_domain(), blender::geometry::reorder_attribute_groups(), blender::bke::AttributeStorage::resize(), and blender::bke::tests::TEST().
|
inline |
Unique name across all domains.
The C++ wrapper needs to be the same size as the DNA struct.
Definition at line 224 of file BKE_attribute_storage.hh.
Referenced by blender::bke::attribute_storage_blend_write_prepare(), blender::bke::attribute_to_writer(), BKE_attributes_active_name_get(), blender::bke::convert_storage_to_customdata(), blender::ed::geometry::geometry_attribute_add_exec(), blender::bke::curves::get_curves_accessor_functions(), blender::bke::greasepencil::get_grease_pencil_accessor_functions(), blender::bke::get_instances_accessor_functions(), and blender::bke::get_pointcloud_accessor_functions().
| AttrStorageType Attribute::storage_type | ( | ) | const |
The method used to store the data. This gives flexibility to optimize the internal storage even though conceptually the attribute is an array of values.
Definition at line 156 of file attribute_storage.cc.
References blender::bke::Array, BLI_assert_unreachable, and blender::bke::Single.
Referenced by blender::bke::attribute_storage_blend_write_prepare(), blender::bke::attribute_to_reader(), blender::bke::attribute_to_writer(), blender::bke::get_varray_attribute(), blender::geometry::reorder_attribute_domain(), reorder_attribute_domain(), blender::geometry::reorder_attribute_groups(), blender::bke::AttributeStorage::resize(), and shrink_attribute_storage().
| friend blender::bke::Attribute::AttributeStorage |
Definition at line 62 of file BKE_attribute_storage.hh.
Referenced by blender::bke::AttributeStorage::operator=(), and blender::bke::AttributeStorage::operator=().