diff options
author | Jacques Lucke <jacques@blender.org> | 2021-03-03 18:37:38 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-03-03 18:37:38 +0300 |
commit | 422901585b0c01c7fed395a973151d5d563416cc (patch) | |
tree | 33f348caf33e133688cbda8d8b1a06c8c59699c1 | |
parent | 940704beb3f07a16243bb9438f436f56d1e669c0 (diff) |
cleanup naming
-rw-r--r-- | source/blender/nodes/NOD_XXX_node_tree.hh | 73 | ||||
-rw-r--r-- | source/blender/nodes/NOD_geometry_exec.hh | 2 | ||||
-rw-r--r-- | source/blender/nodes/intern/node_geometry_exec.cc | 14 | ||||
-rw-r--r-- | source/blender/nodes/intern/xxx_node_tree.cc | 24 |
4 files changed, 57 insertions, 56 deletions
diff --git a/source/blender/nodes/NOD_XXX_node_tree.hh b/source/blender/nodes/NOD_XXX_node_tree.hh index e9f5dfa8685..d1446857442 100644 --- a/source/blender/nodes/NOD_XXX_node_tree.hh +++ b/source/blender/nodes/NOD_XXX_node_tree.hh @@ -49,7 +49,7 @@ class XXXNodeTreeContext { struct XXXNode { const XXXNodeTreeContext *context = nullptr; - const NodeRef *node = nullptr; + const NodeRef *node_ref = nullptr; XXXNode() = default; XXXNode(const XXXNodeTreeContext *context, const NodeRef *node); @@ -65,7 +65,7 @@ struct XXXNode { struct XXXSocket { const XXXNodeTreeContext *context = nullptr; - const SocketRef *socket = nullptr; + const SocketRef *socket_ref = nullptr; XXXSocket() = default; XXXSocket(const XXXNodeTreeContext *context, const SocketRef *socket); @@ -83,7 +83,7 @@ struct XXXSocket { struct XXXInputSocket { const XXXNodeTreeContext *context = nullptr; - const InputSocketRef *socket = nullptr; + const InputSocketRef *socket_ref = nullptr; XXXInputSocket() = default; XXXInputSocket(const XXXNodeTreeContext *context, const InputSocketRef *socket); @@ -103,7 +103,7 @@ struct XXXInputSocket { struct XXXOutputSocket { const XXXNodeTreeContext *context = nullptr; - const OutputSocketRef *socket = nullptr; + const OutputSocketRef *socket_ref = nullptr; XXXOutputSocket() = default; XXXOutputSocket(const XXXNodeTreeContext *context, const OutputSocketRef *socket); @@ -183,15 +183,15 @@ inline bool XXXNodeTreeContext::is_root() const * XXXNode inline methods. */ -inline XXXNode::XXXNode(const XXXNodeTreeContext *context, const NodeRef *node) - : context(context), node(node) +inline XXXNode::XXXNode(const XXXNodeTreeContext *context, const NodeRef *node_ref) + : context(context), node_ref(node_ref) { - BLI_assert(node == nullptr || &node->tree() == &context->tree()); + BLI_assert(node_ref == nullptr || &node_ref->tree() == &context->tree()); } inline bool operator==(const XXXNode &a, const XXXNode &b) { - return a.context == b.context && a.node == b.node; + return a.context == b.context && a.node_ref == b.node_ref; } inline bool operator!=(const XXXNode &a, const XXXNode &b) @@ -201,42 +201,43 @@ inline bool operator!=(const XXXNode &a, const XXXNode &b) inline XXXNode::operator bool() const { - return node != nullptr; + return node_ref != nullptr; } inline const NodeRef *XXXNode::operator->() const { - return node; + return node_ref; } inline uint64_t XXXNode::hash() const { - return DefaultHash<const XXXNodeTreeContext *>{}(context) ^ DefaultHash<const NodeRef *>{}(node); + return DefaultHash<const XXXNodeTreeContext *>{}(context) ^ + DefaultHash<const NodeRef *>{}(node_ref); } /* -------------------------------------------------------------------- * XXXSocket inline methods. */ -inline XXXSocket::XXXSocket(const XXXNodeTreeContext *context, const SocketRef *socket) - : context(context), socket(socket) +inline XXXSocket::XXXSocket(const XXXNodeTreeContext *context, const SocketRef *socket_ref) + : context(context), socket_ref(socket_ref) { - BLI_assert(socket == nullptr || &socket->tree() == &context->tree()); + BLI_assert(socket_ref == nullptr || &socket_ref->tree() == &context->tree()); } inline XXXSocket::XXXSocket(const XXXInputSocket &input_socket) - : context(input_socket.context), socket(input_socket.socket) + : context(input_socket.context), socket_ref(input_socket.socket_ref) { } inline XXXSocket::XXXSocket(const XXXOutputSocket &output_socket) - : context(output_socket.context), socket(output_socket.socket) + : context(output_socket.context), socket_ref(output_socket.socket_ref) { } inline bool operator==(const XXXSocket &a, const XXXSocket &b) { - return a.context == b.context && a.socket == b.socket; + return a.context == b.context && a.socket_ref == b.socket_ref; } inline bool operator!=(const XXXSocket &a, const XXXSocket &b) @@ -246,18 +247,18 @@ inline bool operator!=(const XXXSocket &a, const XXXSocket &b) inline XXXSocket::operator bool() const { - return socket != nullptr; + return socket_ref != nullptr; } inline const SocketRef *XXXSocket::operator->() const { - return socket; + return socket_ref; } inline uint64_t XXXSocket::hash() const { return DefaultHash<const XXXNodeTreeContext *>{}(context) ^ - DefaultHash<const SocketRef *>{}(socket); + DefaultHash<const SocketRef *>{}(socket_ref); } /* -------------------------------------------------------------------- @@ -265,21 +266,21 @@ inline uint64_t XXXSocket::hash() const */ inline XXXInputSocket::XXXInputSocket(const XXXNodeTreeContext *context, - const InputSocketRef *socket) - : context(context), socket(socket) + const InputSocketRef *socket_ref) + : context(context), socket_ref(socket_ref) { - BLI_assert(socket == nullptr || &socket->tree() == &context->tree()); + BLI_assert(socket_ref == nullptr || &socket_ref->tree() == &context->tree()); } inline XXXInputSocket::XXXInputSocket(const XXXSocket &base_socket) - : context(base_socket.context), socket(&base_socket.socket->as_input()) + : context(base_socket.context), socket_ref(&base_socket.socket_ref->as_input()) { - BLI_assert(socket == nullptr || &socket->tree() == &context->tree()); + BLI_assert(socket_ref == nullptr || &socket_ref->tree() == &context->tree()); } inline bool operator==(const XXXInputSocket &a, const XXXInputSocket &b) { - return a.context == b.context && a.socket == b.socket; + return a.context == b.context && a.socket_ref == b.socket_ref; } inline bool operator!=(const XXXInputSocket &a, const XXXInputSocket &b) @@ -289,18 +290,18 @@ inline bool operator!=(const XXXInputSocket &a, const XXXInputSocket &b) inline XXXInputSocket::operator bool() const { - return socket != nullptr; + return socket_ref != nullptr; } inline const InputSocketRef *XXXInputSocket::operator->() const { - return socket; + return socket_ref; } inline uint64_t XXXInputSocket::hash() const { return DefaultHash<const XXXNodeTreeContext *>{}(context) ^ - DefaultHash<const InputSocketRef *>{}(socket); + DefaultHash<const InputSocketRef *>{}(socket_ref); } /* -------------------------------------------------------------------- @@ -308,19 +309,19 @@ inline uint64_t XXXInputSocket::hash() const */ inline XXXOutputSocket::XXXOutputSocket(const XXXNodeTreeContext *context, - const OutputSocketRef *socket) - : context(context), socket(socket) + const OutputSocketRef *socket_ref) + : context(context), socket_ref(socket_ref) { } inline XXXOutputSocket::XXXOutputSocket(const XXXSocket &base_socket) - : context(base_socket.context), socket(&base_socket.socket->as_output()) + : context(base_socket.context), socket_ref(&base_socket.socket_ref->as_output()) { } inline bool operator==(const XXXOutputSocket &a, const XXXOutputSocket &b) { - return a.context == b.context && a.socket == b.socket; + return a.context == b.context && a.socket_ref == b.socket_ref; } inline bool operator!=(const XXXOutputSocket &a, const XXXOutputSocket &b) @@ -330,18 +331,18 @@ inline bool operator!=(const XXXOutputSocket &a, const XXXOutputSocket &b) inline XXXOutputSocket::operator bool() const { - return socket != nullptr; + return socket_ref != nullptr; } inline const OutputSocketRef *XXXOutputSocket::operator->() const { - return socket; + return socket_ref; } inline uint64_t XXXOutputSocket::hash() const { return DefaultHash<const XXXNodeTreeContext *>{}(context) ^ - DefaultHash<const OutputSocketRef *>{}(socket); + DefaultHash<const OutputSocketRef *>{}(socket_ref); } /* -------------------------------------------------------------------- diff --git a/source/blender/nodes/NOD_geometry_exec.hh b/source/blender/nodes/NOD_geometry_exec.hh index a449d3b0fa8..05c0f8b73e1 100644 --- a/source/blender/nodes/NOD_geometry_exec.hh +++ b/source/blender/nodes/NOD_geometry_exec.hh @@ -183,7 +183,7 @@ class GeoNodeExecParams { */ const bNode &node() const { - return *node_.node->bnode(); + return *node_->bnode(); } const PersistentDataHandleMap &handle_map() const diff --git a/source/blender/nodes/intern/node_geometry_exec.cc b/source/blender/nodes/intern/node_geometry_exec.cc index 92437bbd195..27b5e885545 100644 --- a/source/blender/nodes/intern/node_geometry_exec.cc +++ b/source/blender/nodes/intern/node_geometry_exec.cc @@ -30,7 +30,7 @@ namespace blender::nodes { void GeoNodeExecParams::error_message_add(const NodeWarningType type, std::string message) const { - bNodeTree *btree_cow = node_.node->btree(); + bNodeTree *btree_cow = node_->btree(); BLI_assert(btree_cow != nullptr); if (btree_cow == nullptr) { return; @@ -40,12 +40,12 @@ void GeoNodeExecParams::error_message_add(const NodeWarningType type, std::strin const NodeTreeEvaluationContext context(*self_object_, *modifier_); BKE_nodetree_error_message_add( - *btree_original, context, *node_.node->bnode(), type, std::move(message)); + *btree_original, context, *node_->bnode(), type, std::move(message)); } const bNodeSocket *GeoNodeExecParams::find_available_socket(const StringRef name) const { - for (const InputSocketRef *socket : node_.node->inputs()) { + for (const InputSocketRef *socket : node_->inputs()) { if (socket->is_available() && socket->name() == name) { return socket->bsocket(); } @@ -176,7 +176,7 @@ void GeoNodeExecParams::check_extract_input(StringRef identifier, const CPPType *requested_type) const { bNodeSocket *found_socket = nullptr; - for (const InputSocketRef *socket : node_.node->inputs()) { + for (const InputSocketRef *socket : node_->inputs()) { if (socket->identifier() == identifier) { found_socket = socket->bsocket(); break; @@ -186,7 +186,7 @@ void GeoNodeExecParams::check_extract_input(StringRef identifier, if (found_socket == nullptr) { std::cout << "Did not find an input socket with the identifier '" << identifier << "'.\n"; std::cout << "Possible identifiers are: "; - for (const InputSocketRef *socket : node_.node->inputs()) { + for (const InputSocketRef *socket : node_->inputs()) { if (socket->is_available()) { std::cout << "'" << socket->identifier() << "', "; } @@ -218,7 +218,7 @@ void GeoNodeExecParams::check_extract_input(StringRef identifier, void GeoNodeExecParams::check_set_output(StringRef identifier, const CPPType &value_type) const { bNodeSocket *found_socket = nullptr; - for (const OutputSocketRef *socket : node_.node->outputs()) { + for (const OutputSocketRef *socket : node_->outputs()) { if (socket->identifier() == identifier) { found_socket = socket->bsocket(); break; @@ -228,7 +228,7 @@ void GeoNodeExecParams::check_set_output(StringRef identifier, const CPPType &va if (found_socket == nullptr) { std::cout << "Did not find an output socket with the identifier '" << identifier << "'.\n"; std::cout << "Possible identifiers are: "; - for (const OutputSocketRef *socket : node_.node->outputs()) { + for (const OutputSocketRef *socket : node_->outputs()) { if (socket->is_available()) { std::cout << "'" << socket->identifier() << "', "; } diff --git a/source/blender/nodes/intern/xxx_node_tree.cc b/source/blender/nodes/intern/xxx_node_tree.cc index 796e805847d..8c26c521019 100644 --- a/source/blender/nodes/intern/xxx_node_tree.cc +++ b/source/blender/nodes/intern/xxx_node_tree.cc @@ -65,62 +65,62 @@ void XXXNodeTree::destruct_context_recursively(XXXNodeTreeContext *context) XXXOutputSocket XXXInputSocket::get_corresponding_group_node_output() const { BLI_assert(*this); - BLI_assert(socket->node().is_group_output_node()); - BLI_assert(socket->index() < socket->node().inputs().size() - 1); + BLI_assert(socket_ref->node().is_group_output_node()); + BLI_assert(socket_ref->index() < socket_ref->node().inputs().size() - 1); const XXXNodeTreeContext *parent_context = context->parent_context(); const NodeRef *parent_node = context->parent_node(); BLI_assert(parent_context != nullptr); BLI_assert(parent_node != nullptr); - const int socket_index = socket->index(); + const int socket_index = socket_ref->index(); return {parent_context, &parent_node->output(socket_index)}; } XXXOutputSocket XXXInputSocket::get_corresponding_group_input_socket() const { BLI_assert(*this); - BLI_assert(socket->node().is_group_node()); + BLI_assert(socket_ref->node().is_group_node()); - const XXXNodeTreeContext *child_context = context->child_context(socket->node()); + const XXXNodeTreeContext *child_context = context->child_context(socket_ref->node()); BLI_assert(child_context != nullptr); const NodeTreeRef &child_tree = child_context->tree(); Span<const NodeRef *> group_input_nodes = child_tree.nodes_by_type("NodeGroupInput"); BLI_assert(!group_input_nodes.is_empty()); - const int socket_index = socket->index(); + const int socket_index = socket_ref->index(); return {child_context, &group_input_nodes[0]->output(socket_index)}; } XXXInputSocket XXXOutputSocket::get_corresponding_group_node_input() const { BLI_assert(*this); - BLI_assert(socket->node().is_group_input_node()); - BLI_assert(socket->index() < socket->node().outputs().size() - 1); + BLI_assert(socket_ref->node().is_group_input_node()); + BLI_assert(socket_ref->index() < socket_ref->node().outputs().size() - 1); const XXXNodeTreeContext *parent_context = context->parent_context(); const NodeRef *parent_node = context->parent_node(); BLI_assert(parent_context != nullptr); BLI_assert(parent_node != nullptr); - const int socket_index = socket->index(); + const int socket_index = socket_ref->index(); return {parent_context, &parent_node->input(socket_index)}; } XXXInputSocket XXXOutputSocket::get_corresponding_group_output_socket() const { BLI_assert(*this); - BLI_assert(socket->node().is_group_node()); + BLI_assert(socket_ref->node().is_group_node()); - const XXXNodeTreeContext *child_context = context->child_context(socket->node()); + const XXXNodeTreeContext *child_context = context->child_context(socket_ref->node()); BLI_assert(child_context != nullptr); const NodeTreeRef &child_tree = child_context->tree(); Span<const NodeRef *> group_output_nodes = child_tree.nodes_by_type("NodeGroupOutput"); BLI_assert(!group_output_nodes.is_empty()); - const int socket_index = socket->index(); + const int socket_index = socket_ref->index(); return {child_context, &group_output_nodes[0]->input(socket_index)}; } |