|
Blender V4.5
|
#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 () |
Public Attributes | |
| friend | AttributeStorage |
Data and metadata for a single geometry attribute.
Definition at line 30 of file BKE_attribute_storage.hh.
| using blender::bke::Attribute::DataVariant = std::variant<ArrayData, SingleData> |
Definition at line 52 of file BKE_attribute_storage.hh.
|
inline |
Low level access to the data stored for the attribute. The variant's type will correspond to the storage type.
Definition at line 203 of file BKE_attribute_storage.hh.
Referenced by blender::bke::attribute_storage_blend_write_prepare(), blender::bke::convert_storage_to_customdata(), data_for_write(), 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 92 of file attribute_storage.cc.
References blender::CPPType::alignment, blender::bke::attribute_type_to_cpp_type(), BLI_assert_unreachable, blender::CPPType::copy_construct_n(), blender::bke::create_sharing_info_for_array(), data(), MEM_malloc_arrayN_aligned, and blender::CPPType::size.
Referenced by 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 198 of file BKE_attribute_storage.hh.
Referenced by blender::bke::attribute_storage_blend_write_prepare(), blender::bke::convert_storage_to_customdata(), and blender::bke::tests::TEST().
|
inline |
Which part of a geometry the attribute corresponds to.
Definition at line 193 of file BKE_attribute_storage.hh.
Referenced by blender::bke::attribute_storage_blend_write_prepare(), blender::bke::convert_storage_to_customdata(), 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 188 of file BKE_attribute_storage.hh.
Referenced by blender::bke::attribute_storage_blend_write_prepare(), and blender::bke::convert_storage_to_customdata().
| 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 80 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().
| friend blender::bke::Attribute::AttributeStorage |
Definition at line 53 of file BKE_attribute_storage.hh.