174 return std::move(this->varray);
177 operator bool()
const
194 operator bool()
const
196 return this->function !=
nullptr;
225 operator bool()
const
235 if (this->tag_modified_fn) {
236 this->tag_modified_fn();
263 :
span(std::move(other.varray), copy_values_to_span),
269 operator bool()
const
281 if (this->span.
varray()) {
284 if (this->tag_modified_fn) {
285 this->tag_modified_fn();
298 operator bool()
const
315 return std::move(this->varray);
332 operator bool()
const
339 if (this->tag_modified_fn) {
340 this->tag_modified_fn();
361 :
span(std::move(other.varray), copy_values_to_span),
367 operator bool()
const
374 if (this->span.
varray()) {
377 if (this->tag_modified_fn) {
378 this->tag_modified_fn();
402 mutable bool stop_iteration_ =
false;
416 stop_iteration_ =
true;
421 return stop_iteration_;
520 static std::optional<AttributeAccessor>
from_id(
const ID &
id);
595 std::optional<AttrDomain> domain,
596 std::optional<AttrType> data_type)
const;
604 return this->
lookup(name, domain, std::nullopt);
613 return this->
lookup(name, std::nullopt, data_type);
622 const std::optional<AttrDomain> domain = std::nullopt)
const
626 return this->
lookup(name, domain, data_type).
typed<
T>();
638 const void *default_value =
nullptr)
const;
646 const T &default_value)
const
783 return fn_->
add(
owner_, name, domain, data_type, initializer);
790 return this->
add(name, domain, data_type, initializer);
804 const std::optional<AttributeMetaData> old_meta = this->
lookup_meta_data(name);
805 if (old_meta.has_value()) {
806 if (old_meta->domain == domain && old_meta->data_type == data_type) {
809 if (!this->
remove(name)) {
813 return this->
add(name, domain, data_type, initializer);
static const CPPType & get()
const GVMutableArray & varray() const
VArray< T > typed() const
VMutableArray< T > typed() const
const VMutableArray< T > & varray() const
Set(Allocator allocator={}) noexcept
static VArray from_single(T value, const int64_t size)
GAttributeReader lookup_or_default(StringRef name, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
Set< StringRefNull > all_names() const
AttributeValidator lookup_validator(const StringRef name) const
std::optional< AttributeDomainAndType > get_builtin_domain_and_type(const StringRef name) const
GAttributeReader lookup(const StringRef name, const AttrDomain domain) const
void foreach_attribute(const FunctionRef< void(const AttributeIter &)> fn) const
AttributeReader< T > lookup_or_default(const StringRef name, const AttrDomain domain, const T &default_value) const
bool contains(StringRef name) 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 name, const AttrType data_type) const
VArray< T > adapt_domain(const VArray< T > &varray, const AttrDomain from_domain, const AttrDomain to_domain) const
std::optional< AttributeMetaData > lookup_meta_data(StringRef name) const
bool domain_supported(const AttrDomain domain) const
GAttributeReader lookup(const StringRef name) const
AttributeReader< T > lookup(const StringRef name, const std::optional< AttrDomain > domain=std::nullopt) const
AttributeAccessor(const void *owner, const AttributeAccessorFunctions &fn)
int domain_size(const AttrDomain domain) const
GPointer get_builtin_default(const StringRef name) const
bool has_anonymous() const
const AttributeAccessorFunctions * fn_
bool is_builtin(const StringRef name) const
std::optional< AttrStorageType > storage_type
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
AttributeWriter< T > lookup_or_add_for_write(const StringRef name, const AttrDomain domain, const AttributeInit &initializer=AttributeInitDefaultValue())
AttributeWriter< T > convert_or_add_for_write(const StringRef name, const AttrDomain domain, const AttributeInit &initializer=AttributeInitDefaultValue())
SpanAttributeWriter< T > lookup_for_write_span(const StringRef name)
SpanAttributeWriter< T > lookup_or_add_for_write_only_span(const StringRef name, const AttrDomain domain)
bool add(const StringRef name, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bool add(const StringRef name, const AttrDomain domain, const AttributeInit &initializer)
SpanAttributeWriter< T > convert_or_add_for_write_span(const StringRef name, const AttrDomain domain, const AttributeInit &initializer=AttributeInitDefaultValue())
bool remove(const StringRef name)
GAttributeWriter lookup_or_add_for_write(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
GSpanAttributeWriter convert_or_add_for_write_span(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
GAttributeWriter convert_or_add_for_write(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
GAttributeWriter lookup_for_write(StringRef name)
SpanAttributeWriter< T > convert_or_add_for_write_only_span(const StringRef name, const AttrDomain domain)
bool assign_data(const StringRef name, const AttributeInit &initializer)
SpanAttributeWriter< T > lookup_or_add_for_write_span(const StringRef name, const AttrDomain domain, const AttributeInit &initializer=AttributeInitDefaultValue())
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef name, AttrDomain domain, AttrType data_type)
GSpanAttributeWriter convert_or_add_for_write_only_span(StringRef name, AttrDomain domain, AttrType data_type)
GAttributeWriter convert_or_add_for_write_only(StringRef name, AttrDomain domain, AttrType data_type)
MutableAttributeAccessor(void *owner, const AttributeAccessorFunctions &fn)
AttributeWriter< T > lookup_for_write(const StringRef name)
bool add_override(const StringRef name, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
GSpanAttributeWriter lookup_for_write_span(StringRef name)
bool rename(StringRef old_name, StringRef new_name, bool overwrite=false)
constexpr bool is_empty() const
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)
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
Vector< AttributeTransferData > retrieve_attributes_for_transfer(const AttributeAccessor src_attributes, MutableAttributeAccessor dst_attributes, Span< AttrDomain > domains, const AttributeFilter &attribute_filter={})
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)
FunctionRef< bool(StringRefNull name, const AttributeMetaData &meta_data)> AttributeForeachCallback
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)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
MatBase< float, 4, 4 > float4x4
bool(*) add(void *owner, StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer)
void(*) foreach_attribute(const void *owner, FunctionRef< void(const AttributeIter &iter)> fn, const AttributeAccessor &accessor)
int(*) domain_size(const void *owner, AttrDomain domain)
std::optional< AttributeDomainAndType >(*) builtin_domain_and_type(const void *owner, StringRef name)
GAttributeReader(*) lookup(const void *owner, StringRef name)
std::optional< AttributeMetaData >(*) lookup_meta_data(const void *owner, StringRef name)
GPointer(*) get_builtin_default(const void *owner, StringRef name)
AttributeValidator(*) lookup_validator(const void *owner, StringRef name)
bool(*) assign_data(void *owner, StringRef name, const AttributeInit &initializer)
GAttributeWriter(*) lookup_for_write(void *owner, StringRef name)
bool(*) remove(void *owner, StringRef name)
GVArray(*) adapt_domain(const void *owner, const GVArray &varray, AttrDomain from_domain, AttrDomain to_domain)
bool(*) domain_supported(const void *owner, AttrDomain domain)
Set< StringRef >(*) rename(void *owner, const Map< StringRef, StringRef > &map, bool overwrite)
friend bool operator==(const AttributeDomainAndType &a, const AttributeDomainAndType &b)=default
AttributeInitDefaultValue()
AttributeInitShared(const void *data, const ImplicitSharingInfo &sharing_info)
const ImplicitSharingInfo * sharing_info
AttributeInitVArray(GVArray varray)
AttributeInitValue(const GPointer value)
AttributeInitValue(const T &value)
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