From 44bac4c8ccf19cb5941435115b8f89a9d14e9c23 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 1 Jun 2022 14:38:06 +1000 Subject: Cleanup: use 'e' prefix for enum types - CustomDataType -> eCustomDataType - CustomDataMask -> eCustomDataMask - AttributeDomain -> eAttrDomain - NamedAttributeUsage -> eNamedAttrUsage --- source/blender/modifiers/intern/MOD_nodes.cc | 31 ++++++++++++++-------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'source/blender/modifiers') diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index c1e16e1b8e5..73db56186de 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -119,8 +119,8 @@ using blender::nodes::InputSocketFieldType; using blender::threading::EnumerableThreadSpecific; using namespace blender::fn::multi_function_types; using namespace blender::nodes::derived_node_tree_types; +using geo_log::eNamedAttrUsage; using geo_log::GeometryAttributeInfo; -using geo_log::NamedAttributeUsage; static void initData(ModifierData *md) { @@ -921,7 +921,7 @@ struct OutputAttributeInfo { struct OutputAttributeToStore { GeometryComponentType component_type; - AttributeDomain domain; + eAttrDomain domain; StringRefNull name; GMutableSpan data; }; @@ -930,10 +930,10 @@ struct OutputAttributeToStore { * The output attributes are organized based on their domain, because attributes on the same domain * can be evaluated together. */ -static MultiValueMap find_output_attributes_to_store( +static MultiValueMap find_output_attributes_to_store( const NodesModifierData &nmd, const NodeRef &output_node, Span output_values) { - MultiValueMap outputs_by_domain; + MultiValueMap outputs_by_domain; for (const InputSocketRef *socket : output_node.inputs().drop_front(1).drop_back(1)) { if (!socket_type_has_attribute_toggle(*socket->bsocket())) { continue; @@ -960,7 +960,7 @@ static MultiValueMap find_output_attribute const bNodeSocket *interface_socket = (const bNodeSocket *)BLI_findlink( &nmd.node_group->outputs, socket->index()); - const AttributeDomain domain = (AttributeDomain)interface_socket->attribute_domain; + const eAttrDomain domain = (eAttrDomain)interface_socket->attribute_domain; OutputAttributeInfo output_info; output_info.field = std::move(field); output_info.name = attribute_name; @@ -975,7 +975,7 @@ static MultiValueMap find_output_attribute */ static Vector compute_attributes_to_store( const GeometrySet &geometry, - const MultiValueMap &outputs_by_domain) + const MultiValueMap &outputs_by_domain) { Vector attributes_to_store; for (const GeometryComponentType component_type : {GEO_COMPONENT_TYPE_MESH, @@ -987,7 +987,7 @@ static Vector compute_attributes_to_store( } const GeometryComponent &component = *geometry.get_component_for_read(component_type); for (const auto item : outputs_by_domain.items()) { - const AttributeDomain domain = item.key; + const eAttrDomain domain = item.key; const Span outputs_info = item.value; if (!component.attribute_domain_supported(domain)) { continue; @@ -1016,7 +1016,8 @@ static void store_computed_output_attributes( { for (const OutputAttributeToStore &store : attributes_to_store) { GeometryComponent &component = geometry.get_component_for_write(store.component_type); - const CustomDataType data_type = blender::bke::cpp_type_to_custom_data_type(store.data.type()); + const eCustomDataType data_type = blender::bke::cpp_type_to_custom_data_type( + store.data.type()); const std::optional meta_data = component.attribute_get_meta_data( store.name); @@ -1057,7 +1058,7 @@ static void store_output_attributes(GeometrySet &geometry, { /* All new attribute values have to be computed before the geometry is actually changed. This is * necessary because some fields might depend on attributes that are overwritten. */ - MultiValueMap outputs_by_domain = + MultiValueMap outputs_by_domain = find_output_attributes_to_store(nmd, output_node, output_values); Vector attributes_to_store = compute_attributes_to_store( geometry, outputs_by_domain); @@ -1664,7 +1665,7 @@ static void internal_dependencies_panel_draw(const bContext *UNUSED(C), Panel *p return; } const geo_log::ModifierLog &log = *static_cast(nmd->runtime_eval_log); - Map usage_by_attribute; + Map usage_by_attribute; log.foreach_node_log([&](const geo_log::NodeLog &node_log) { for (const geo_log::UsedNamedAttribute &used_attribute : node_log.used_named_attributes()) { usage_by_attribute.lookup_or_add_as(used_attribute.name, @@ -1679,7 +1680,7 @@ static void internal_dependencies_panel_draw(const bContext *UNUSED(C), Panel *p struct NameWithUsage { StringRefNull name; - NamedAttributeUsage usage; + eNamedAttrUsage usage; }; Vector sorted_used_attribute; @@ -1694,20 +1695,20 @@ static void internal_dependencies_panel_draw(const bContext *UNUSED(C), Panel *p for (const NameWithUsage &attribute : sorted_used_attribute) { const StringRefNull attribute_name = attribute.name; - const NamedAttributeUsage usage = attribute.usage; + const eNamedAttrUsage usage = attribute.usage; /* #uiLayoutRowWithHeading doesn't seem to work in this case. */ uiLayout *split = uiLayoutSplit(layout, 0.4f, false); std::stringstream ss; Vector usages; - if ((usage & NamedAttributeUsage::Read) != NamedAttributeUsage::None) { + if ((usage & eNamedAttrUsage::Read) != eNamedAttrUsage::None) { usages.append(TIP_("Read")); } - if ((usage & NamedAttributeUsage::Write) != NamedAttributeUsage::None) { + if ((usage & eNamedAttrUsage::Write) != eNamedAttrUsage::None) { usages.append(TIP_("Write")); } - if ((usage & NamedAttributeUsage::Remove) != NamedAttributeUsage::None) { + if ((usage & eNamedAttrUsage::Remove) != eNamedAttrUsage::None) { usages.append(TIP_("Remove")); } for (const int i : usages.index_range()) { -- cgit v1.2.3