81#define ATTR_DOMAIN_NUM 7
213 return std::move(this->varray);
216 operator bool()
const
233 operator bool()
const
235 return this->function !=
nullptr;
264 operator bool()
const
274 if (this->tag_modified_fn) {
302 :
span(std::move(other.varray), copy_values_to_span),
308 operator bool()
const
310 return span.varray();
320 if (this->span.
varray()) {
323 if (this->tag_modified_fn) {
337 operator bool()
const
354 return std::move(this->varray);
371 operator bool()
const
378 if (this->tag_modified_fn) {
400 :
span(std::move(other.varray), copy_values_to_span),
406 operator bool()
const
408 return span.varray();
413 if (this->span.
varray()) {
416 if (this->tag_modified_fn) {
436 mutable bool stop_iteration_ =
false;
450 stop_iteration_ =
true;
455 return stop_iteration_;
469 return this->
get(domain, std::nullopt);
551 static std::optional<AttributeAccessor>
from_id(
const ID &
id);
568 return fn_->domain_supported(
owner_, domain);
585 return fn_->builtin_domain_and_type(
owner_, attribute_id).has_value();
603 return fn_->get_builtin_default(
owner_, attribute_id);
612 return fn_->lookup(
owner_, attribute_id);
620 std::optional<AttrDomain> domain,
621 std::optional<AttrType> data_type)
const;
629 return this->
lookup(attribute_id, domain, std::nullopt);
638 return this->
lookup(attribute_id, std::nullopt, data_type);
647 const std::optional<AttrDomain> domain = std::nullopt)
const
651 return this->
lookup(attribute_id, domain, data_type).
typed<
T>();
663 const void *default_value =
nullptr)
const;
671 const T &default_value)
const
684 return fn_->lookup_validator(
owner_, attribute_id);
694 return fn_->adapt_domain(
owner_, varray, from_domain, to_domain);
760 return attribute.
typed<
T>();
796 return fn_->add(
owner_, attribute_id, domain, data_type, initializer);
803 return this->
add(attribute_id, domain, data_type, initializer);
852 attribute_id, domain, initializer);
896 return fn_->remove(
owner_, attribute_id);
935 const AttributeFilter &attribute_filter,
937 MutableAttributeAccessor dst_attributes);
945 const AttributeFilter &attribute_filter,
947 MutableAttributeAccessor dst_attributes);
957 const AttributeFilter &attribute_filter,
961 MutableAttributeAccessor dst_attributes);
966 const AttributeFilter &attribute_filter,
969 MutableAttributeAccessor dst_attributes);
974 const AttributeFilter &attribute_filter,
975 MutableAttributeAccessor dst_attributes);
980 const AttributeFilter &attribute_filter,
984 MutableAttributeAccessor dst_attributes);
988 const AttributeFilter &attribute_filter,
995 MutableAttributeAccessor &attributes);
Generic geometry attributes built on CustomData.
#define BLI_STRUCT_EQUALITY_OPERATORS_2(Type, m1, m2)
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
static const CPPType & get()
const GVMutableArray & varray() const
const CPPType & type() const
VArray< T > typed() const
const VMutableArray< T > & varray() const
static VArray from_single(T value, const int64_t size)
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
bool is_builtin(const StringRef attribute_id) const
std::optional< AttributeDomainAndType > get_builtin_domain_and_type(const StringRef name) const
void foreach_attribute(const FunctionRef< void(const AttributeIter &)> fn) const
AttributeReader< T > lookup(const StringRef attribute_id, const std::optional< AttrDomain > domain=std::nullopt) const
AttributeValidator lookup_validator(const StringRef attribute_id) const
GPointer get_builtin_default(const StringRef attribute_id) const
bool contains(StringRef attribute_id) const
AttributeReader< T > lookup_or_default(const StringRef attribute_id, const AttrDomain domain, const T &default_value) const
static std::optional< AttributeAccessor > from_id(const ID &id)
GVArray adapt_domain(const GVArray &varray, const AttrDomain from_domain, const AttrDomain to_domain) const
GAttributeReader lookup(const StringRef attribute_id) const
VArray< T > adapt_domain(const VArray< T > &varray, const AttrDomain from_domain, const AttrDomain to_domain) const
Set< StringRefNull > all_ids() const
GAttributeReader lookup(const StringRef attribute_id, const AttrType data_type) const
GAttributeReader lookup(const StringRef attribute_id, const AttrDomain domain) const
bool domain_supported(const AttrDomain domain) const
AttributeAccessor(const void *owner, const AttributeAccessorFunctions &fn)
int domain_size(const AttrDomain domain) const
std::optional< AttributeMetaData > lookup_meta_data(StringRef attribute_id) const
const AttributeAccessorFunctions * fn_
GAttributeReader get(const AttrDomain domain) const
GAttributeReader get(const AttrType data_type) const
AttributeReader< T > get(const std::optional< AttrDomain > domain=std::nullopt) const
AttributeIter(const StringRefNull name, const AttrDomain domain, const AttrType data_type, const FunctionRef< GAttributeReader()> get_fn)
GAttributeReader get() const
const AttributeAccessor * accessor
SpanAttributeWriter< T > lookup_for_write_span(const StringRef attribute_id)
GAttributeWriter lookup_for_write(StringRef attribute_id)
bool add(const StringRef attribute_id, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
AttributeWriter< T > lookup_or_add_for_write(const StringRef attribute_id, const AttrDomain domain, const AttributeInit &initializer=AttributeInitDefaultValue())
bool remove(const StringRef attribute_id)
SpanAttributeWriter< T > lookup_or_add_for_write_only_span(const StringRef attribute_id, const AttrDomain domain)
GAttributeWriter lookup_or_add_for_write(StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bool rename(StringRef old_attribute_id, StringRef new_attribute_id)
bool add(const StringRef attribute_id, const AttrDomain domain, const AttributeInit &initializer)
AttributeWriter< T > lookup_for_write(const StringRef attribute_id)
MutableAttributeAccessor(void *owner, const AttributeAccessorFunctions &fn)
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef attribute_id, AttrDomain domain, AttrType data_type)
GSpanAttributeWriter lookup_for_write_span(StringRef attribute_id)
SpanAttributeWriter< T > lookup_or_add_for_write_span(const StringRef attribute_id, const AttrDomain domain, const AttributeInit &initializer=AttributeInitDefaultValue())
Vector< AttributeTransferData > retrieve_attributes_for_transfer(const AttributeAccessor src_attributes, MutableAttributeAccessor dst_attributes, AttrDomainMask domain_mask, const AttributeFilter &attribute_filter={})
FunctionRef< bool(StringRefNull attribute_id, const AttributeMetaData &meta_data)> AttributeForeachCallback
void fill_attribute_range_default(MutableAttributeAccessor dst_attributes, AttrDomain domain, const AttributeFilter &attribute_filter, IndexRange range)
void gather_attributes_to_groups(AttributeAccessor src_attributes, AttrDomain src_domain, AttrDomain dst_domain, const AttributeFilter &attribute_filter, OffsetIndices< int > dst_offsets, const IndexMask &src_selection, MutableAttributeAccessor dst_attributes)
bool allow_procedural_attribute_access(StringRef attribute_name)
eCustomDataType cpp_type_to_custom_data_type(const CPPType &type)
void copy_attributes(const AttributeAccessor src_attributes, AttrDomain src_domain, AttrDomain dst_domain, const AttributeFilter &attribute_filter, MutableAttributeAccessor dst_attributes)
const char * no_procedural_access_message
void gather_attributes(AttributeAccessor src_attributes, AttrDomain src_domain, AttrDomain dst_domain, const AttributeFilter &attribute_filter, const IndexMask &selection, MutableAttributeAccessor dst_attributes)
AttrType attribute_data_type_highest_complexity(Span< AttrType > data_types)
AttrDomain attribute_domain_highest_priority(Span< AttrDomain > domains)
void transform_custom_normal_attribute(const float4x4 &transform, MutableAttributeAccessor &attributes)
const CPPType * custom_data_type_to_cpp_type(eCustomDataType type)
void gather_attributes_group_to_group(AttributeAccessor src_attributes, AttrDomain src_domain, AttrDomain dst_domain, const AttributeFilter &attribute_filter, OffsetIndices< int > src_offsets, OffsetIndices< int > dst_offsets, const IndexMask &selection, MutableAttributeAccessor dst_attributes)
void copy_attributes_group_to_group(AttributeAccessor src_attributes, AttrDomain src_domain, AttrDomain dst_domain, const AttributeFilter &attribute_filter, OffsetIndices< int > src_offsets, OffsetIndices< int > dst_offsets, const IndexMask &selection, MutableAttributeAccessor dst_attributes)
AttrType cpp_type_to_attribute_type(const CPPType &type)
const CPPType & attribute_type_to_cpp_type(AttrType type)
MatBase< float, 4, 4 > float4x4
GPointer(* get_builtin_default)(const void *owner, StringRef attribute_id)
GVArray(* adapt_domain)(const void *owner, const GVArray &varray, AttrDomain from_domain, AttrDomain to_domain)
void(* foreach_attribute)(const void *owner, FunctionRef< void(const AttributeIter &iter)> fn, const AttributeAccessor &accessor)
bool(* remove)(void *owner, StringRef attribute_id)
bool(* domain_supported)(const void *owner, AttrDomain domain)
GAttributeWriter(* lookup_for_write)(void *owner, StringRef attribute_id)
bool(* add)(void *owner, StringRef attribute_id, AttrDomain domain, AttrType data_type, const AttributeInit &initializer)
AttributeValidator(* lookup_validator)(const void *owner, StringRef attribute_id)
std::optional< AttributeDomainAndType >(* builtin_domain_and_type)(const void *owner, StringRef attribute_id)
int(* domain_size)(const void *owner, AttrDomain domain)
GAttributeReader(* lookup)(const void *owner, StringRef attribute_id)
AttributeInitDefaultValue()
AttributeInitMoveArray(void *data)
AttributeInitShared(const void *data, const ImplicitSharingInfo &sharing_info)
const ImplicitSharingInfo * sharing_info
AttributeInitVArray(GVArray varray)
AttributeInit(const Type type)
const VArray< T > & operator*() const &
VArray< T > operator*() &&
VArray< T > & operator*() &
const ImplicitSharingInfo * sharing_info
AttributeMetaData meta_data
const fn::multi_function::MultiFunction * function
fn::GField validate_field_if_necessary(const fn::GField &field) const
std::function< void()> tag_modified_fn
VMutableArray< T > varray
const ImplicitSharingInfo * sharing_info
AttributeReader< T > typed() const
const GVArray & operator*() const &
AttributeWriter< T > typed() const
std::function< void()> tag_modified_fn
GSpanAttributeWriter(GAttributeWriter &&other, const bool copy_values_to_span)
GSpanAttributeWriter()=default
std::function< void()> tag_modified_fn
SpanAttributeWriter(AttributeWriter< T > &&other, const bool copy_values_to_span)
SpanAttributeWriter()=default
MutableVArraySpan< T > span
std::function< void()> tag_modified_fn