diff options
author | Campbell Barton <campbell@blender.org> | 2022-06-01 07:38:06 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-06-01 08:38:48 +0300 |
commit | 44bac4c8ccf19cb5941435115b8f89a9d14e9c23 (patch) | |
tree | 2bd7698ca3e1e382b078e274566dbad0ae82214c /source/blender/editors/space_node | |
parent | ca346d2176737b6aa296617452a8a6cacb7a970a (diff) |
Cleanup: use 'e' prefix for enum types
- CustomDataType -> eCustomDataType
- CustomDataMask -> eCustomDataMask
- AttributeDomain -> eAttrDomain
- NamedAttributeUsage -> eNamedAttrUsage
Diffstat (limited to 'source/blender/editors/space_node')
3 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index e0ff4212a94..7b8413b656a 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -75,7 +75,7 @@ using blender::GPointer; using blender::fn::GField; namespace geo_log = blender::nodes::geometry_nodes_eval_log; -using geo_log::NamedAttributeUsage; +using geo_log::eNamedAttrUsage; extern "C" { /* XXX interface.h */ @@ -1695,7 +1695,7 @@ struct NodeExtraInfoRow { }; struct NamedAttributeTooltipArg { - Map<std::string, NamedAttributeUsage> usage_by_attribute; + Map<std::string, eNamedAttrUsage> usage_by_attribute; }; static char *named_attribute_tooltip(bContext *UNUSED(C), void *argN, const char *UNUSED(tip)) @@ -1707,7 +1707,7 @@ static char *named_attribute_tooltip(bContext *UNUSED(C), void *argN, const char struct NameWithUsage { StringRefNull name; - NamedAttributeUsage usage; + eNamedAttrUsage usage; }; Vector<NameWithUsage> sorted_used_attribute; @@ -1722,16 +1722,16 @@ static char *named_attribute_tooltip(bContext *UNUSED(C), void *argN, const char for (const NameWithUsage &attribute : sorted_used_attribute) { const StringRefNull name = attribute.name; - const NamedAttributeUsage usage = attribute.usage; + const eNamedAttrUsage usage = attribute.usage; ss << " \u2022 \"" << name << "\": "; Vector<std::string> 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()) { @@ -1749,7 +1749,7 @@ static char *named_attribute_tooltip(bContext *UNUSED(C), void *argN, const char } static NodeExtraInfoRow row_from_used_named_attribute( - const Map<std::string, NamedAttributeUsage> &usage_by_attribute_name) + const Map<std::string, eNamedAttrUsage> &usage_by_attribute_name) { const int attributes_num = usage_by_attribute_name.size(); @@ -1777,7 +1777,7 @@ static std::optional<NodeExtraInfoRow> node_get_accessed_attributes_row(const Sp return std::nullopt; } - Map<std::string, NamedAttributeUsage> usage_by_attribute; + Map<std::string, eNamedAttrUsage> usage_by_attribute; tree_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, @@ -1807,7 +1807,7 @@ static std::optional<NodeExtraInfoRow> node_get_accessed_attributes_row(const Sp if (node_log == nullptr) { return std::nullopt; } - Map<std::string, NamedAttributeUsage> usage_by_attribute; + Map<std::string, eNamedAttrUsage> usage_by_attribute; for (const geo_log::UsedNamedAttribute &used_attribute : node_log->used_named_attributes()) { usage_by_attribute.lookup_or_add_as(used_attribute.name, used_attribute.usage) |= used_attribute.usage; diff --git a/source/blender/editors/space_node/node_geometry_attribute_search.cc b/source/blender/editors/space_node/node_geometry_attribute_search.cc index ed981603293..f08e23c8371 100644 --- a/source/blender/editors/space_node/node_geometry_attribute_search.cc +++ b/source/blender/editors/space_node/node_geometry_attribute_search.cc @@ -128,7 +128,7 @@ static void attribute_search_update_fn( * Some custom data types don't correspond to node types and therefore can't be * used by the named attribute input node. Find the best option or fallback to float. */ -static CustomDataType data_type_in_attribute_input_node(const CustomDataType type) +static eCustomDataType data_type_in_attribute_input_node(const eCustomDataType type) { switch (type) { case CD_PROP_FLOAT: @@ -187,7 +187,7 @@ static void attribute_search_exec_fn(bContext *C, void *data_v, void *item_v) /* For the attribute input node, also adjust the type and links connected to the output. */ if (node->type == GEO_NODE_INPUT_NAMED_ATTRIBUTE && item->data_type.has_value()) { NodeGeometryInputNamedAttribute &storage = *(NodeGeometryInputNamedAttribute *)node->storage; - const CustomDataType new_type = data_type_in_attribute_input_node(*item->data_type); + const eCustomDataType new_type = data_type_in_attribute_input_node(*item->data_type); if (new_type != storage.data_type) { storage.data_type = new_type; /* Make the output socket with the new type on the attribute input node active. */ diff --git a/source/blender/editors/space_node/node_relationships.cc b/source/blender/editors/space_node/node_relationships.cc index 5796a712205..e10bedb18f4 100644 --- a/source/blender/editors/space_node/node_relationships.cc +++ b/source/blender/editors/space_node/node_relationships.cc @@ -454,7 +454,7 @@ static bool socket_can_be_viewed(const OutputSocketRef &socket) SOCK_RGBA); } -static CustomDataType socket_type_to_custom_data_type(const eNodeSocketDatatype socket_type) +static eCustomDataType socket_type_to_custom_data_type(const eNodeSocketDatatype socket_type) { switch (socket_type) { case SOCK_FLOAT: @@ -491,7 +491,7 @@ static bNodeSocket *node_link_viewer_get_socket(bNodeTree &ntree, return viewer_socket; } NodeGeometryViewer *storage = (NodeGeometryViewer *)viewer_node.storage; - const CustomDataType data_type = socket_type_to_custom_data_type( + const eCustomDataType data_type = socket_type_to_custom_data_type( (eNodeSocketDatatype)src_socket.type); BLI_assert(data_type != CD_AUTO_FROM_NAME); storage->data_type = data_type; |