Blender V5.3
BKE_attribute.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include <functional>
12#include <optional>
13
14#include "BLI_function_ref.hh"
19#include "BLI_offset_indices.hh"
20#include "BLI_set.hh"
21
24
25namespace blender {
26
27struct ID;
28struct Mesh;
29struct PointCloud;
30namespace fn {
31namespace multi_function {
32class MultiFunction;
33}
34class GField;
35} // namespace fn
36
37namespace bke {
38
41
44
56
64
69 enum class Type {
71 Construct,
73 Value,
75 DefaultValue,
79 Shared,
80 };
83};
84
92
98
100 template<typename T>
102 {
103 }
105};
106
113
123
129 const void *data = nullptr;
131
136};
137
138/* Returns false when the iteration should be stopped. */
140 FunctionRef<bool(StringRefNull name, const AttributeMetaData &meta_data)>;
141
146template<typename T> struct AttributeReader {
155
161
162 const VArray<T> &operator*() const &
163 {
164 return this->varray;
165 }
166
168 {
169 return this->varray;
170 }
171
173 {
174 return std::move(this->varray);
175 }
176
177 operator bool() const
178 {
179 return this->varray;
180 }
181};
182
193
194 operator bool() const
195 {
196 return this->function != nullptr;
197 }
198
202};
203
209template<typename T> struct AttributeWriter {
223 std::function<void()> tag_modified_fn;
224
225 operator bool() const
226 {
227 return this->varray;
228 }
229
233 void finish()
234 {
235 if (this->tag_modified_fn) {
236 this->tag_modified_fn();
237 }
238 }
239};
240
246template<typename T> struct SpanAttributeWriter {
258 std::function<void()> tag_modified_fn;
259
261
262 SpanAttributeWriter(AttributeWriter<T> &&other, const bool copy_values_to_span)
263 : span(std::move(other.varray), copy_values_to_span),
264 domain(other.domain),
265 tag_modified_fn(std::move(other.tag_modified_fn))
266 {
267 }
268
269 operator bool() const
270 {
271 return span.varray();
272 }
273
279 void finish()
280 {
281 if (this->span.varray()) {
282 this->span.save();
283 }
284 if (this->tag_modified_fn) {
285 this->tag_modified_fn();
286 }
287 }
288};
289
297
298 operator bool() const
299 {
300 return this->varray;
301 }
302
303 const GVArray &operator*() const &
304 {
305 return this->varray;
306 }
307
309 {
310 return this->varray;
311 }
312
314 {
315 return std::move(this->varray);
316 }
317
318 template<typename T> AttributeReader<T> typed() const
319 {
320 return {varray.typed<T>(), domain, sharing_info};
321 }
322};
323
330 std::function<void()> tag_modified_fn;
331
332 operator bool() const
333 {
334 return this->varray;
335 }
336
337 void finish()
338 {
339 if (this->tag_modified_fn) {
340 this->tag_modified_fn();
341 }
342 }
343
344 template<typename T> AttributeWriter<T> typed() const
345 {
346 return {varray.typed<T>(), domain, tag_modified_fn};
347 }
348};
349
356 std::function<void()> tag_modified_fn;
357
359
360 GSpanAttributeWriter(GAttributeWriter &&other, const bool copy_values_to_span)
361 : span(std::move(other.varray), copy_values_to_span),
362 domain(other.domain),
363 tag_modified_fn(std::move(other.tag_modified_fn))
364 {
365 }
366
367 operator bool() const
368 {
369 return span.varray();
370 }
371
372 void finish()
373 {
374 if (this->span.varray()) {
375 this->span.save();
376 }
377 if (this->tag_modified_fn) {
378 this->tag_modified_fn();
379 }
380 }
381};
382
388 public:
396 std::optional<AttrStorageType> storage_type;
397 bool is_builtin = false;
398 mutable const AttributeAccessor *accessor = nullptr;
399
400 private:
401 FunctionRef<GAttributeReader()> get_fn_;
402 mutable bool stop_iteration_ = false;
403
404 public:
406 const AttrDomain domain,
407 const AttrType data_type,
408 const FunctionRef<GAttributeReader()> get_fn)
409 : name(name), domain(domain), data_type(data_type), get_fn_(get_fn)
410 {
411 }
412
414 void stop() const
415 {
416 stop_iteration_ = true;
417 }
418
419 bool is_stopped() const
420 {
421 return stop_iteration_;
422 }
423
426 {
427 return get_fn_();
428 }
429
431 GAttributeReader get(std::optional<AttrDomain> domain, std::optional<AttrType> data_type) const;
432
434 {
435 return this->get(domain, std::nullopt);
436 }
437
439 {
440 return this->get(std::nullopt, data_type);
441 }
442
443 template<typename T>
444 AttributeReader<T> get(const std::optional<AttrDomain> domain = std::nullopt) const
445 {
446 const CPPType &cpp_type = CPPType::get<T>();
448 return this->get(domain, data_type).typed<T>();
449 }
450};
451
461 bool (*domain_supported)(const void *owner, AttrDomain domain);
462 int (*domain_size)(const void *owner, AttrDomain domain);
463 std::optional<AttributeDomainAndType> (*builtin_domain_and_type)(const void *owner,
464 StringRef name);
465 GPointer (*get_builtin_default)(const void *owner, StringRef name);
466 std::optional<AttributeMetaData> (*lookup_meta_data)(const void *owner, StringRef name);
467 GAttributeReader (*lookup)(const void *owner, StringRef name);
468 GVArray (*adapt_domain)(const void *owner,
469 const GVArray &varray,
470 AttrDomain from_domain,
471 AttrDomain to_domain);
472 void (*foreach_attribute)(const void *owner,
473 FunctionRef<void(const AttributeIter &iter)> fn,
474 const AttributeAccessor &accessor);
475 AttributeValidator (*lookup_validator)(const void *owner, StringRef name);
477 bool (*remove)(void *owner, StringRef name);
478 bool (*add)(void *owner,
479 StringRef name,
480 AttrDomain domain,
481 AttrType data_type,
482 const AttributeInit &initializer);
483 Set<StringRef> (*rename)(void *owner, const Map<StringRef, StringRef> &map, bool overwrite);
484 bool (*assign_data)(void *owner, StringRef name, const AttributeInit &initializer);
485};
486
494 protected:
505 void *owner_;
510
511 public:
513 : owner_(const_cast<void *>(owner)), fn_(&fn)
514 {
515 }
516
520 static std::optional<AttributeAccessor> from_id(const ID &id);
521
525 bool contains(StringRef name) const
526 {
527 return this->lookup_meta_data(name).has_value();
528 }
529
533 std::optional<AttributeMetaData> lookup_meta_data(StringRef name) const
534 {
535 return fn_->lookup_meta_data(owner_, name);
536 }
537
541 bool domain_supported(const AttrDomain domain) const
542 {
543 return fn_->domain_supported(owner_, domain);
544 }
545
549 int domain_size(const AttrDomain domain) const
550 {
551 return fn_->domain_size(owner_, domain);
552 }
553
558 bool is_builtin(const StringRef name) const
559 {
560 return fn_->builtin_domain_and_type(owner_, name).has_value();
561 }
562
566 std::optional<AttributeDomainAndType> get_builtin_domain_and_type(const StringRef name) const
567 {
568 return fn_->builtin_domain_and_type(owner_, name);
569 }
570
576 {
577 BLI_assert(this->is_builtin(name));
578 return fn_->get_builtin_default(owner_, name);
579 }
580
586 {
587 return fn_->lookup(owner_, name);
588 }
589
595 std::optional<AttrDomain> domain,
596 std::optional<AttrType> data_type) const;
597
602 GAttributeReader lookup(const StringRef name, const AttrDomain domain) const
603 {
604 return this->lookup(name, domain, std::nullopt);
605 }
606
611 GAttributeReader lookup(const StringRef name, const AttrType data_type) const
612 {
613 return this->lookup(name, std::nullopt, data_type);
614 }
615
620 template<typename T>
622 const std::optional<AttrDomain> domain = std::nullopt) const
623 {
624 const CPPType &cpp_type = CPPType::get<T>();
625 const AttrType data_type = cpp_type_to_attribute_type(cpp_type);
626 return this->lookup(name, domain, data_type).typed<T>();
627 }
628
636 AttrDomain domain,
637 AttrType data_type,
638 const void *default_value = nullptr) const;
639
643 template<typename T>
645 const AttrDomain domain,
646 const T &default_value) const
647 {
648 if (AttributeReader<T> varray = this->lookup<T>(name, domain)) {
649 return varray;
650 }
651 return {VArray<T>::from_single(default_value, this->domain_size(domain)), domain};
652 }
653
658 {
659 return fn_->lookup_validator(owner_, name);
660 }
661
666 const AttrDomain from_domain,
667 const AttrDomain to_domain) const
668 {
669 return fn_->adapt_domain(owner_, varray, from_domain, to_domain);
670 }
671
675 template<typename T>
677 const AttrDomain from_domain,
678 const AttrDomain to_domain) const
679 {
680 return this->adapt_domain(GVArray(varray), from_domain, to_domain).typed<T>();
681 }
682
687 void foreach_attribute(const FunctionRef<void(const AttributeIter &)> fn) const
688 {
689 if (owner_ != nullptr) {
690 fn_->foreach_attribute(owner_, fn, *this);
691 }
692 }
693
698
700 bool has_anonymous() const;
701};
702
708 public:
710 : AttributeAccessor(owner, fn)
711 {
712 }
713
719
724
729 template<typename T> AttributeWriter<T> lookup_for_write(const StringRef name)
730 {
732 if (!attribute) {
733 return {};
734 }
735 if (!attribute.varray.type().is<T>()) {
736 return {};
737 }
738 return attribute.typed<T>();
739 }
740
745 {
747 if (attribute) {
748 return SpanAttributeWriter<T>{std::move(attribute), true};
749 }
750 return {};
751 }
752
757 bool rename(StringRef old_name, StringRef new_name, bool overwrite = false);
762 Set<StringRef> rename(const Map<StringRef, StringRef> &map, bool overwrite = false);
763
769 bool add(const StringRef name,
770 const AttrDomain domain,
771 const AttrType data_type,
772 const AttributeInit &initializer)
773 {
774 if (!this->domain_supported(domain)) {
775 return false;
776 }
777 if (this->contains(name)) {
778 return false;
779 }
780 if (name.is_empty()) {
781 return false;
782 }
783 return fn_->add(owner_, name, domain, data_type, initializer);
784 }
785 template<typename T>
786 bool add(const StringRef name, const AttrDomain domain, const AttributeInit &initializer)
787 {
788 const CPPType &cpp_type = CPPType::get<T>();
789 const AttrType data_type = cpp_type_to_attribute_type(cpp_type);
790 return this->add(name, domain, data_type, initializer);
791 }
792
793 bool add_override(const StringRef name,
794 const AttrDomain domain,
795 const AttrType data_type,
796 const AttributeInit &initializer)
797 {
798 if (name.is_empty()) {
799 return false;
800 }
801 if (!this->domain_supported(domain)) {
802 return false;
803 }
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) {
807 return this->assign_data(name, initializer);
808 }
809 if (!this->remove(name)) {
810 return false;
811 }
812 }
813 return this->add(name, domain, data_type, initializer);
814 }
815
816 bool assign_data(const StringRef name, const AttributeInit &initializer)
817 {
818 BLI_assert(this->contains(name));
819 return fn_->assign_data(owner_, name, initializer);
820 }
821
828 StringRef name,
829 AttrDomain domain,
830 AttrType data_type,
831 const AttributeInit &initializer = AttributeInitDefaultValue());
832
839 StringRef name,
840 AttrDomain domain,
841 AttrType data_type,
842 const AttributeInit &initializer = AttributeInitDefaultValue());
843
847 template<typename T>
849 const StringRef name,
850 const AttrDomain domain,
851 const AttributeInit &initializer = AttributeInitDefaultValue())
852 {
853 const CPPType &cpp_type = CPPType::get<T>();
854 const AttrType data_type = cpp_type_to_attribute_type(cpp_type);
855 return this->lookup_or_add_for_write(name, domain, data_type, initializer).typed<T>();
856 }
857
861 template<typename T>
863 const StringRef name,
864 const AttrDomain domain,
865 const AttributeInit &initializer = AttributeInitDefaultValue())
866 {
867 AttributeWriter<T> attribute = this->lookup_or_add_for_write<T>(name, domain, initializer);
868 if (attribute) {
869 return SpanAttributeWriter<T>{std::move(attribute), true};
870 }
871 return {};
872 }
873
885 AttrDomain domain,
886 AttrType data_type);
887
891 template<typename T>
893 const AttrDomain domain)
894 {
896 name, domain, AttributeInitConstruct());
897
898 if (attribute) {
899 return SpanAttributeWriter<T>{std::move(attribute), false};
900 }
901 return {};
902 }
903
912 StringRef name,
913 AttrDomain domain,
914 AttrType data_type,
915 const AttributeInit &initializer = AttributeInitDefaultValue());
916
925 AttrDomain domain,
926 AttrType data_type);
927
935 StringRef name,
936 AttrDomain domain,
937 AttrType data_type,
938 const AttributeInit &initializer = AttributeInitDefaultValue());
939
944 template<typename T>
946 const StringRef name,
947 const AttrDomain domain,
948 const AttributeInit &initializer = AttributeInitDefaultValue())
949 {
950 const CPPType &cpp_type = CPPType::get<T>();
951 const AttrType data_type = cpp_type_to_attribute_type(cpp_type);
952 return this->convert_or_add_for_write(name, domain, data_type, initializer).typed<T>();
953 }
954
959 template<typename T>
961 const StringRef name,
962 const AttrDomain domain,
963 const AttributeInit &initializer = AttributeInitDefaultValue())
964 {
965 AttributeWriter<T> attribute = this->convert_or_add_for_write<T>(name, domain, initializer);
967 return SpanAttributeWriter<T>{std::move(attribute), true};
968 }
969
983 AttrDomain domain,
984 AttrType data_type);
985
989 template<typename T>
991 const AttrDomain domain)
992 {
994 name, domain, AttributeInitConstruct());
995
996 if (attribute) {
997 return SpanAttributeWriter<T>{std::move(attribute), false};
998 }
999 return {};
1000 }
1001
1007 bool remove(const StringRef name)
1008 {
1009 return fn_->remove(owner_, name);
1010 }
1011
1015 void remove_anonymous();
1016};
1017
1019 /* Expect that if an attribute exists, it is stored as a contiguous array internally anyway. */
1024};
1025
1032 const AttributeAccessor src_attributes,
1033 MutableAttributeAccessor dst_attributes,
1034 Span<AttrDomain> domains,
1035 const AttributeFilter &attribute_filter = {});
1036
1037bool allow_procedural_attribute_access(StringRef attribute_name);
1038extern const char *no_procedural_access_message;
1039
1046
1047void gather_attributes(AttributeAccessor src_attributes,
1048 AttrDomain src_domain,
1049 AttrDomain dst_domain,
1050 const AttributeFilter &attribute_filter,
1051 const IndexMask &selection,
1052 MutableAttributeAccessor dst_attributes);
1053
1057void gather_attributes(AttributeAccessor src_attributes,
1058 AttrDomain src_domain,
1059 AttrDomain dst_domain,
1060 const AttributeFilter &attribute_filter,
1061 Span<int> indices,
1062 MutableAttributeAccessor dst_attributes);
1063
1070 AttrDomain src_domain,
1071 AttrDomain dst_domain,
1072 const AttributeFilter &attribute_filter,
1073 OffsetIndices<int> src_offsets,
1074 OffsetIndices<int> dst_offsets,
1075 const IndexMask &selection,
1076 MutableAttributeAccessor dst_attributes);
1077
1079 AttrDomain src_domain,
1080 AttrDomain dst_domain,
1081 const AttributeFilter &attribute_filter,
1082 OffsetIndices<int> dst_offsets,
1083 const IndexMask &src_selection,
1084 MutableAttributeAccessor dst_attributes);
1085
1086void copy_attributes(const AttributeAccessor src_attributes,
1087 AttrDomain src_domain,
1088 AttrDomain dst_domain,
1089 const AttributeFilter &attribute_filter,
1090 MutableAttributeAccessor dst_attributes);
1091
1093 AttrDomain src_domain,
1094 AttrDomain dst_domain,
1095 const AttributeFilter &attribute_filter,
1096 OffsetIndices<int> src_offsets,
1097 OffsetIndices<int> dst_offsets,
1098 const IndexMask &selection,
1099 MutableAttributeAccessor dst_attributes);
1100
1102 AttrDomain domain,
1103 const AttributeFilter &attribute_filter,
1104 IndexRange range);
1105
1110 MutableAttributeAccessor &attributes);
1111
1112} // namespace bke
1113} // namespace blender
static const CPPType & get()
const GVMutableArray & varray() const
GPointer()=default
GVArray()=default
VMutableArray< T > typed() const
const VMutableArray< T > & varray() const
Set(Allocator allocator={}) noexcept
Definition BLI_set.hh:168
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
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())
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
#define attribute(slot)
#define T
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)
BMesh Iterators.
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
AttributeInitShared(const void *data, const ImplicitSharingInfo &sharing_info)
const ImplicitSharingInfo * sharing_info
AttributeInitValue(const GPointer value)
AttributeInit(const Type type)
friend bool operator==(const AttributeMetaData &a, const AttributeMetaData &b)=default
const VArray< T > & operator*() const &
const ImplicitSharingInfo * sharing_info
const fn::multi_function::MultiFunction * function
fn::GField validate_field_if_necessary(const fn::GField &field) const
std::function< void()> tag_modified_fn
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)
std::function< void()> tag_modified_fn
SpanAttributeWriter(AttributeWriter< T > &&other, const bool copy_values_to_span)
std::function< void()> tag_modified_fn