|
Blender
V2.93
|
#include <BKE_attribute_access.hh>
Inherited by blender::bke::ArrayWriteAttribute< T >, blender::bke::DerivedArrayWriteAttribute< StructT, ElemT, GetFunc, SetFunc >, blender::bke::TemporaryWriteAttribute, and blender::bke::VertexWeightWriteAttribute.
Public Member Functions | |
| WriteAttribute (AttributeDomain domain, const CPPType &cpp_type, const int64_t size) | |
| AttributeDomain | domain () const |
| const CPPType & | cpp_type () const |
| CustomDataType | custom_data_type () const |
| int64_t | size () const |
| void | get (const int64_t index, void *r_value) const |
| void | set (const int64_t index, const void *value) |
| template<typename T > | |
| MutableSpan< T > | get_span () |
| template<typename T > | |
| MutableSpan< T > | get_span_for_write_only () |
Protected Member Functions | |
| virtual void | get_internal (const int64_t index, void *r_value) const =0 |
| virtual void | set_internal (const int64_t index, const void *value)=0 |
Protected Attributes | |
| const AttributeDomain | domain_ |
| const CPPType & | cpp_type_ |
| const CustomDataType | custom_data_type_ |
| const int64_t | size_ |
| void * | array_buffer_ = nullptr |
| bool | array_is_temporary_ = false |
| bool | array_should_be_applied_ = false |
Attribute Accessor implementations | |
| virtual | ~WriteAttribute () |
| fn::GMutableSpan | get_span () |
| fn::GMutableSpan | get_span_for_write_only () |
| void | apply_span () |
| virtual void | initialize_span (const bool write_only) |
| virtual void | apply_span_if_necessary () |
This exists for similar reasons as the ReadAttribute class, except that it does not deal with interpolation between domains.
Definition at line 122 of file BKE_attribute_access.hh.
|
inline |
Definition at line 137 of file BKE_attribute_access.hh.
|
virtual |
Definition at line 89 of file attribute_access.cc.
References array_buffer_, array_is_temporary_, array_should_be_applied_, CLOG_ERROR, cpp_type_, blender::fn::CPPType::destruct_n(), LOG, MEM_freeN, and size_.
| void blender::bke::WriteAttribute::apply_span | ( | ) |
Definition at line 143 of file attribute_access.cc.
References apply_span_if_necessary(), and array_should_be_applied_.
Referenced by blender::bke::TypedWriteAttribute< T >::apply_span().
|
protectedvirtual |
Reimplemented in blender::bke::ArrayWriteAttribute< T >, and blender::bke::TemporaryWriteAttribute.
Definition at line 149 of file attribute_access.cc.
References array_buffer_, BLI_assert, cpp_type_, POINTER_OFFSET, set_internal(), blender::fn::CPPType::size(), and size_.
Referenced by apply_span().
|
inline |
Definition at line 152 of file BKE_attribute_access.hh.
References cpp_type_.
Referenced by OutputAttributePtr::save(), and blender::bke::TypedWriteAttribute< T >::TypedWriteAttribute().
|
inline |
Definition at line 157 of file BKE_attribute_access.hh.
References custom_data_type_.
|
inline |
Definition at line 147 of file BKE_attribute_access.hh.
References domain_.
|
inline |
Definition at line 167 of file BKE_attribute_access.hh.
References BLI_assert, get_internal(), and size_.
Referenced by initialize_span(), OutputAttributePtr::operator->(), and blender::bke::TypedWriteAttribute< T >::operator[]().
|
protectedpure virtual |
| fn::GMutableSpan blender::bke::WriteAttribute::get_span | ( | ) |
Get a mutable span that can be modified. When all modifications to the attribute are done, apply_span should be called.
Definition at line 103 of file attribute_access.cc.
References array_buffer_, array_should_be_applied_, cpp_type_, initialize_span(), and size_.
Referenced by blender::nodes::execute_on_component(), get_span(), blender::bke::TypedWriteAttribute< T >::get_span(), and blender::nodes::randomize_attribute_on_component().
|
inline |
Definition at line 187 of file BKE_attribute_access.hh.
References get_span(), T, and blender::fn::GMutableSpan::typed().
| fn::GMutableSpan blender::bke::WriteAttribute::get_span_for_write_only | ( | ) |
Definition at line 115 of file attribute_access.cc.
References array_buffer_, array_should_be_applied_, cpp_type_, initialize_span(), and size_.
Referenced by blender::nodes::attribute_compare_calc(), blender::nodes::attribute_convert_calc(), blender::nodes::attribute_math_calc(), blender::nodes::calculate_sphere_uvs(), blender::nodes::calculate_uvs(), blender::nodes::clamp_attribute(), blender::nodes::combine_attributes(), blender::nodes::compute_special_attributes(), blender::nodes::copy_attributes_based_on_mask(), blender::nodes::execute_on_component(), blender::nodes::fill_attribute(), get_span_for_write_only(), blender::bke::TypedWriteAttribute< T >::get_span_for_write_only(), blender::nodes::interpolate_existing_attributes(), blender::nodes::randomize_attribute_on_component(), and blender::nodes::separate_attribute().
|
inline |
Definition at line 192 of file BKE_attribute_access.hh.
References get_span_for_write_only(), T, and blender::fn::GMutableSpan::typed().
|
protectedvirtual |
Definition at line 127 of file attribute_access.cc.
References blender::fn::CPPType::alignment(), array_buffer_, array_is_temporary_, blender::fn::CPPType::construct_default_n(), cpp_type_, get(), MEM_mallocN_aligned, POINTER_OFFSET, blender::fn::CPPType::size(), and size_.
Referenced by get_span(), and get_span_for_write_only().
|
inline |
Definition at line 173 of file BKE_attribute_access.hh.
References BLI_assert, set_internal(), and size_.
Referenced by blender::bke::TypedWriteAttribute< T >::set().
|
protectedpure virtual |
|
inline |
Definition at line 162 of file BKE_attribute_access.hh.
References size_.
Referenced by blender::bke::TypedWriteAttribute< T >::size().
|
protected |
Definition at line 130 of file BKE_attribute_access.hh.
Referenced by apply_span_if_necessary(), get_span(), get_span_for_write_only(), blender::bke::TemporaryWriteAttribute::initialize_span(), blender::bke::ArrayWriteAttribute< T >::initialize_span(), initialize_span(), and ~WriteAttribute().
|
protected |
Definition at line 132 of file BKE_attribute_access.hh.
Referenced by blender::bke::TemporaryWriteAttribute::initialize_span(), blender::bke::ArrayWriteAttribute< T >::initialize_span(), initialize_span(), and ~WriteAttribute().
|
protected |
Definition at line 134 of file BKE_attribute_access.hh.
Referenced by apply_span(), get_span(), get_span_for_write_only(), and ~WriteAttribute().
|
protected |
Definition at line 125 of file BKE_attribute_access.hh.
Referenced by apply_span_if_necessary(), cpp_type(), get_span(), get_span_for_write_only(), initialize_span(), blender::bke::TemporaryWriteAttribute::~TemporaryWriteAttribute(), and ~WriteAttribute().
|
protected |
Definition at line 126 of file BKE_attribute_access.hh.
Referenced by custom_data_type().
|
protected |
Definition at line 124 of file BKE_attribute_access.hh.
Referenced by domain().
|
protected |
Definition at line 127 of file BKE_attribute_access.hh.
Referenced by apply_span_if_necessary(), get(), get_span(), get_span_for_write_only(), initialize_span(), set(), size(), and ~WriteAttribute().