24namespace multi_function {
50#define ATTR_DOMAIN_NUM 7
126 void *data =
nullptr;
136 const void *data =
nullptr;
181 return std::move(this->varray);
184 operator bool()
const
201 operator bool()
const
203 return this->function !=
nullptr;
232 operator bool()
const
242 if (this->tag_modified_fn) {
270 :
span(std::move(other.varray), copy_values_to_span),
271 domain(other.domain),
276 operator bool()
const
278 return span.varray();
288 if (this->span.
varray()) {
291 if (this->tag_modified_fn) {
305 operator bool()
const
322 return std::move(this->varray);
339 operator bool()
const
346 if (this->tag_modified_fn) {
368 :
span(std::move(other.varray), copy_values_to_span),
369 domain(other.domain),
374 operator bool()
const
381 if (this->span.
varray()) {
384 if (this->tag_modified_fn) {
404 mutable bool stop_iteration_ =
false;
418 stop_iteration_ =
true;
423 return stop_iteration_;
434 std::optional<eCustomDataType>
data_type)
const;
438 return this->
get(domain, std::nullopt);
478 bool (*add)(
void *owner,
511 :
owner_(const_cast<void *>(owner)),
fn_(&fn)
518 static std::optional<AttributeAccessor>
from_id(
const ID &
id);
569 std::optional<AttrDomain> domain,
570 std::optional<eCustomDataType> data_type)
const;
578 return this->
lookup(attribute_id, domain, std::nullopt);
587 return this->
lookup(attribute_id, std::nullopt, data_type);
596 const std::optional<AttrDomain> domain = std::nullopt)
const
600 return this->
lookup(attribute_id, domain, data_type).
typed<T>();
612 const void *default_value =
nullptr)
const;
620 const T &default_value)
const
706 if (!attribute.varray.type().is<T>()) {
709 return attribute.typed<T>();
742 return fn_->
add(
owner_, attribute_id, domain, data_type, initializer);
749 return this->
add(attribute_id, domain, data_type, initializer);
798 attribute_id, domain, initializer);
878 AttrDomain src_domain,
879 AttrDomain dst_domain,
880 const AttributeFilter &attribute_filter,
882 MutableAttributeAccessor dst_attributes);
888 AttrDomain src_domain,
889 AttrDomain dst_domain,
890 const AttributeFilter &attribute_filter,
892 MutableAttributeAccessor dst_attributes);
900 AttrDomain src_domain,
901 AttrDomain dst_domain,
902 const AttributeFilter &attribute_filter,
906 MutableAttributeAccessor dst_attributes);
909 AttrDomain src_domain,
910 AttrDomain dst_domain,
911 const AttributeFilter &attribute_filter,
914 MutableAttributeAccessor dst_attributes);
917 AttrDomain src_domain,
918 AttrDomain dst_domain,
919 const AttributeFilter &attribute_filter,
920 MutableAttributeAccessor dst_attributes);
923 AttrDomain src_domain,
924 AttrDomain dst_domain,
925 const AttributeFilter &attribute_filter,
929 MutableAttributeAccessor dst_attributes);
933 const AttributeFilter &attribute_filter,
Generic geometry attributes built on CustomData.
#define BLI_STRUCT_EQUALITY_OPERATORS_2(Type, m1, m2)
static const CPPType & get()
const GVMutableArray & varray() const
VArray< T > typed() const
VMutableArray< T > typed() const
const VMutableArray< T > & varray() const
static VArray ForSingle(T value, const int64_t size)
GAttributeReader lookup(const StringRef attribute_id, const eCustomDataType data_type) const
bool is_builtin(const StringRef attribute_id) 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
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
std::optional< AttributeMetaData > lookup_meta_data(const StringRef attribute_id) const
GAttributeReader lookup_or_default(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const void *default_value=nullptr) 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
bool contains(const StringRef attribute_id) const
const AttributeAccessorFunctions * fn_
GAttributeReader get(const AttrDomain domain) const
AttributeReader< T > get(const std::optional< AttrDomain > domain=std::nullopt) const
eCustomDataType data_type
GAttributeReader get(const eCustomDataType data_type) const
AttributeIter(const StringRefNull name, const AttrDomain domain, const eCustomDataType data_type, const FunctionRef< GAttributeReader()> get_fn)
GAttributeReader get() const
const AttributeAccessor * accessor
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
GAttributeWriter lookup_or_add_for_write(StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
SpanAttributeWriter< T > lookup_for_write_span(const StringRef attribute_id)
GAttributeWriter lookup_for_write(StringRef attribute_id)
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)
bool add(const StringRef attribute_id, const AttrDomain domain, const eCustomDataType data_type, const AttributeInit &initializer)
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, eCustomDataType 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())
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
Vector< AttributeTransferData > retrieve_attributes_for_transfer(const AttributeAccessor src_attributes, MutableAttributeAccessor dst_attributes, AttrDomainMask domain_mask, const AttributeFilter &attribute_filter={})
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)
eCustomDataType attribute_data_type_highest_complexity(Span< eCustomDataType > data_types)
AttrDomain attribute_domain_highest_priority(Span< AttrDomain > domains)
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)
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(* is_builtin)(const void *owner, StringRef attribute_id)
AttributeValidator(* lookup_validator)(const void *owner, StringRef attribute_id)
bool(* add)(void *owner, StringRef attribute_id, AttrDomain domain, eCustomDataType data_type, const AttributeInit &initializer)
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)
eCustomDataType data_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