Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_geometry_set.hh
| Show First 20 Lines • Show All 206 Lines • ▼ Show 20 Lines | blender::fn::GVArray attribute_get_for_read(const blender::bke::AttributeIDRef &attribute_id, | ||||
| const CustomDataType data_type, | const CustomDataType data_type, | ||||
| const void *default_value = nullptr) const; | const void *default_value = nullptr) const; | ||||
| /* Use instead of the method above when the type is known at compile time for type safety. */ | /* Use instead of the method above when the type is known at compile time for type safety. */ | ||||
| template<typename T> | template<typename T> | ||||
| blender::VArray<T> attribute_get_for_read(const blender::bke::AttributeIDRef &attribute_id, | blender::VArray<T> attribute_get_for_read(const blender::bke::AttributeIDRef &attribute_id, | ||||
| const AttributeDomain domain, | const AttributeDomain domain, | ||||
| const T &default_value) const | const T &default_value) const | ||||
| { | { | ||||
| const blender::fn::CPPType &cpp_type = blender::fn::CPPType::get<T>(); | const blender::CPPType &cpp_type = blender::CPPType::get<T>(); | ||||
| const CustomDataType type = blender::bke::cpp_type_to_custom_data_type(cpp_type); | const CustomDataType type = blender::bke::cpp_type_to_custom_data_type(cpp_type); | ||||
| return this->attribute_get_for_read(attribute_id, domain, type, &default_value) | return this->attribute_get_for_read(attribute_id, domain, type, &default_value) | ||||
| .template typed<T>(); | .template typed<T>(); | ||||
| } | } | ||||
| /** | /** | ||||
| * Returns an "output attribute", which is essentially a mutable virtual array with some commonly | * Returns an "output attribute", which is essentially a mutable virtual array with some commonly | ||||
| * used convince features. The returned output attribute might be empty if requested attribute | * used convince features. The returned output attribute might be empty if requested attribute | ||||
| Show All 11 Lines | blender::bke::OutputAttribute attribute_try_get_for_output( | ||||
| const void *default_value = nullptr); | const void *default_value = nullptr); | ||||
| /* Use instead of the method above when the type is known at compile time for type safety. */ | /* Use instead of the method above when the type is known at compile time for type safety. */ | ||||
| template<typename T> | template<typename T> | ||||
| blender::bke::OutputAttribute_Typed<T> attribute_try_get_for_output( | blender::bke::OutputAttribute_Typed<T> attribute_try_get_for_output( | ||||
| const blender::bke::AttributeIDRef &attribute_id, | const blender::bke::AttributeIDRef &attribute_id, | ||||
| const AttributeDomain domain, | const AttributeDomain domain, | ||||
| const T default_value) | const T default_value) | ||||
| { | { | ||||
| const blender::fn::CPPType &cpp_type = blender::fn::CPPType::get<T>(); | const blender::CPPType &cpp_type = blender::CPPType::get<T>(); | ||||
| const CustomDataType data_type = blender::bke::cpp_type_to_custom_data_type(cpp_type); | const CustomDataType data_type = blender::bke::cpp_type_to_custom_data_type(cpp_type); | ||||
| return this->attribute_try_get_for_output(attribute_id, domain, data_type, &default_value); | return this->attribute_try_get_for_output(attribute_id, domain, data_type, &default_value); | ||||
| } | } | ||||
| /** | /** | ||||
| * Same as #attribute_try_get_for_output, but should be used when the original values in the | * Same as #attribute_try_get_for_output, but should be used when the original values in the | ||||
| * attributes are not read, i.e. the attribute is used only for output. The can be faster because | * attributes are not read, i.e. the attribute is used only for output. The can be faster because | ||||
| * it can avoid interpolation and conversion of existing values. Since values are not read from | * it can avoid interpolation and conversion of existing values. Since values are not read from | ||||
| * this attribute, no default value is necessary. | * this attribute, no default value is necessary. | ||||
| */ | */ | ||||
| blender::bke::OutputAttribute attribute_try_get_for_output_only( | blender::bke::OutputAttribute attribute_try_get_for_output_only( | ||||
| const blender::bke::AttributeIDRef &attribute_id, | const blender::bke::AttributeIDRef &attribute_id, | ||||
| AttributeDomain domain, | AttributeDomain domain, | ||||
| const CustomDataType data_type); | const CustomDataType data_type); | ||||
| /* Use instead of the method above when the type is known at compile time for type safety. */ | /* Use instead of the method above when the type is known at compile time for type safety. */ | ||||
| template<typename T> | template<typename T> | ||||
| blender::bke::OutputAttribute_Typed<T> attribute_try_get_for_output_only( | blender::bke::OutputAttribute_Typed<T> attribute_try_get_for_output_only( | ||||
| const blender::bke::AttributeIDRef &attribute_id, const AttributeDomain domain) | const blender::bke::AttributeIDRef &attribute_id, const AttributeDomain domain) | ||||
| { | { | ||||
| const blender::fn::CPPType &cpp_type = blender::fn::CPPType::get<T>(); | const blender::CPPType &cpp_type = blender::CPPType::get<T>(); | ||||
| const CustomDataType data_type = blender::bke::cpp_type_to_custom_data_type(cpp_type); | const CustomDataType data_type = blender::bke::cpp_type_to_custom_data_type(cpp_type); | ||||
| return this->attribute_try_get_for_output_only(attribute_id, domain, data_type); | return this->attribute_try_get_for_output_only(attribute_id, domain, data_type); | ||||
| } | } | ||||
| private: | private: | ||||
| virtual const blender::bke::ComponentAttributeProviders *get_attribute_providers() const; | virtual const blender::bke::ComponentAttributeProviders *get_attribute_providers() const; | ||||
| virtual blender::fn::GVArray attribute_try_adapt_domain_impl(const blender::fn::GVArray &varray, | virtual blender::fn::GVArray attribute_try_adapt_domain_impl(const blender::fn::GVArray &varray, | ||||
| ▲ Show 20 Lines • Show All 902 Lines • Show Last 20 Lines | |||||