[Bf-blender-cvs] [4fbf19f3fd0] temp-derived-node-tree-refactor: remove old derived node tree
Jacques Lucke
noreply at git.blender.org
Thu Mar 4 11:08:00 CET 2021
Commit: 4fbf19f3fd08935c31b2bb4f40fb0f9a9825d597
Author: Jacques Lucke
Date: Thu Mar 4 10:10:59 2021 +0100
Branches: temp-derived-node-tree-refactor
https://developer.blender.org/rB4fbf19f3fd08935c31b2bb4f40fb0f9a9825d597
remove old derived node tree
===================================================================
M source/blender/nodes/CMakeLists.txt
D source/blender/nodes/NOD_derived_node_tree.hh
M source/blender/nodes/NOD_geometry_exec.hh
M source/blender/nodes/NOD_node_tree_multi_function.hh
D source/blender/nodes/intern/derived_node_tree.cc
M source/blender/nodes/intern/node_geometry_exec.cc
===================================================================
diff --git a/source/blender/nodes/CMakeLists.txt b/source/blender/nodes/CMakeLists.txt
index e374f669d86..8d118c8ef3c 100644
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@ -296,7 +296,6 @@ set(SRC
texture/node_texture_tree.c
texture/node_texture_util.c
- intern/derived_node_tree.cc
intern/math_functions.cc
intern/node_common.c
intern/node_exec.c
@@ -317,7 +316,6 @@ set(SRC
NOD_common.h
NOD_composite.h
- NOD_derived_node_tree.hh
NOD_function.h
NOD_geometry.h
NOD_geometry_exec.hh
diff --git a/source/blender/nodes/NOD_derived_node_tree.hh b/source/blender/nodes/NOD_derived_node_tree.hh
deleted file mode 100644
index ea67f23eade..00000000000
--- a/source/blender/nodes/NOD_derived_node_tree.hh
+++ /dev/null
@@ -1,567 +0,0 @@
-/*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- */
-
-#pragma once
-
-/** \file
- * \ingroup nodes
- *
- * DerivedNodeTree provides a flattened view on a bNodeTree, i.e. node groups are inlined. It
- * builds on top of NodeTreeRef and supports similar queries efficiently.
- *
- * Every inlined node remembers its path to the parent ("call stack").
- *
- * Unlinked group node inputs are handled separately from other sockets.
- *
- * There is a dot graph exporter for debugging purposes.
- */
-
-#include "NOD_node_tree_ref.hh"
-
-#include "BLI_vector_set.hh"
-
-namespace blender::nodes {
-
-class DSocket;
-class DInputSocket;
-class DOutputSocket;
-class DNode;
-class DParentNode;
-class DGroupInput;
-class DerivedNodeTree;
-
-class DSocket : NonCopyable, NonMovable {
- protected:
- DNode *node_;
- const SocketRef *socket_ref_;
- int id_;
-
- friend DerivedNodeTree;
-
- public:
- const DNode &node() const;
-
- int id() const;
- int index() const;
-
- bool is_input() const;
- bool is_output() const;
-
- const DSocket &as_base() const;
- const DInputSocket &as_input() const;
- const DOutputSocket &as_output() const;
-
- PointerRNA *rna() const;
- StringRefNull idname() const;
- StringRefNull name() const;
- StringRefNull identifier() const;
- bNodeSocketType *typeinfo() const;
-
- const SocketRef &socket_ref() const;
- bNodeSocket *bsocket() const;
-
- bool is_available() const;
-};
-
-class DInputSocket : public DSocket {
- private:
- Vector<DOutputSocket *> linked_sockets_;
- Vector<DGroupInput *> linked_group_inputs_;
- bool is_multi_input_socket_;
-
- friend DerivedNodeTree;
-
- public:
- const InputSocketRef &socket_ref() const;
-
- Span<const DOutputSocket *> linked_sockets() const;
- Span<const DGroupInput *> linked_group_inputs() const;
-
- bool is_linked() const;
- bool is_multi_input_socket() const;
-};
-
-class DOutputSocket : public DSocket {
- private:
- Vector<DInputSocket *> linked_sockets_;
-
- friend DerivedNodeTree;
-
- public:
- const OutputSocketRef &socket_ref() const;
- Span<const DInputSocket *> linked_sockets() const;
-};
-
-class DGroupInput : NonCopyable, NonMovable {
- private:
- const InputSocketRef *socket_ref_;
- DParentNode *parent_;
- Vector<DInputSocket *> linked_sockets_;
- int id_;
-
- friend DerivedNodeTree;
-
- public:
- const InputSocketRef &socket_ref() const;
- bNodeSocket *bsocket() const;
- const DParentNode *parent() const;
- Span<const DInputSocket *> linked_sockets() const;
- int id() const;
- StringRefNull name() const;
-};
-
-class DNode : NonCopyable, NonMovable {
- private:
- const NodeRef *node_ref_;
- DParentNode *parent_;
-
- Span<DInputSocket *> inputs_;
- Span<DOutputSocket *> outputs_;
-
- int id_;
-
- friend DerivedNodeTree;
-
- public:
- const NodeRef &node_ref() const;
- const DParentNode *parent() const;
-
- Span<const DInputSocket *> inputs() const;
- Span<const DOutputSocket *> outputs() const;
-
- const DInputSocket &input(int index) const;
- const DOutputSocket &output(int index) const;
-
- const DInputSocket &input(int index, StringRef expected_name) const;
- const DOutputSocket &output(int index, StringRef expected_name) const;
-
- int id() const;
-
- PointerRNA *rna() const;
- StringRefNull idname() const;
- StringRefNull name() const;
- bNode *bnode() const;
- bNodeType *typeinfo() const;
-
- private:
- void destruct_with_sockets();
-};
-
-class DParentNode : NonCopyable, NonMovable {
- private:
- const NodeRef *node_ref_;
- DParentNode *parent_;
- int id_;
-
- friend DerivedNodeTree;
-
- public:
- const DParentNode *parent() const;
- const NodeRef &node_ref() const;
- int id() const;
-};
-
-class DerivedNodeTree : NonCopyable, NonMovable {
- private:
- LinearAllocator<> allocator_;
- Vector<DNode *> nodes_by_id_;
- Vector<DGroupInput *> group_inputs_;
- Vector<DParentNode *> parent_nodes_;
-
- Vector<DSocket *> sockets_by_id_;
- Vector<DInputSocket *> input_sockets_;
- Vector<DOutputSocket *> output_sockets_;
-
- MultiValueMap<const bNodeType *, DNode *> nodes_by_type_;
- VectorSet<const NodeTreeRef *> used_node_tree_refs_;
- bNodeTree *btree_;
-
- public:
- DerivedNodeTree(bNodeTree *btree, NodeTreeRefMap &node_tree_refs);
- ~DerivedNodeTree();
-
- bNodeTree *btree() const;
-
- Span<const DNode *> nodes() const;
- Span<const DNode *> nodes_by_type(StringRefNull idname) const;
- Span<const DNode *> nodes_by_type(const bNodeType *nodetype) const;
-
- Span<const DSocket *> sockets() const;
- Span<const DInputSocket *> input_sockets() const;
- Span<const DOutputSocket *> output_sockets() const;
-
- Span<const DGroupInput *> group_inputs() const;
-
- Span<const NodeTreeRef *> used_node_tree_refs() const;
-
- bool has_link_cycles() const;
-
- std::string to_dot() const;
-
- private:
- /* Utility functions used during construction. */
- void insert_nodes_and_links_in_id_order(const NodeTreeRef &tree_ref,
- DParentNode *parent,
- Vector<DNode *> &all_nodes);
- DNode &create_node(const NodeRef &node_ref,
- DParentNode *parent,
- MutableSpan<DSocket *> r_sockets_map);
- void expand_groups(Vector<DNode *> &all_nodes,
- Vector<DGroupInput *> &all_group_inputs,
- Vector<DParentNode *> &all_parent_nodes,
- NodeTreeRefMap &node_tree_refs);
- void expand_group_node(DNode &group_node,
- Vector<DNode *> &all_nodes,
- Vector<DGroupInput *> &all_group_inputs,
- Vector<DParentNode *> &all_parent_nodes,
- NodeTreeRefMap &node_tree_refs);
- void create_group_inputs_for_unlinked_inputs(DNode &node,
- Vector<DGroupInput *> &all_group_inputs);
- void relink_group_inputs(const NodeTreeRef &group_ref,
- Span<DNode *> nodes_by_id,
- DNode &group_node);
- void relink_group_outputs(const NodeTreeRef &group_ref,
- Span<DNode *> nodes_by_id,
- DNode &group_node);
- void remove_expanded_group_interfaces(Vector<DNode *> &all_nodes);
- void remove_unused_group_inputs(Vector<DGroupInput *> &all_group_inputs);
- void relink_and_remove_muted_nodes(Vector<DNode *> &all_nodes);
- void relink_muted_node(DNode &muted_node);
- void store_in_this_and_init_ids(Vector<DNode *> &&all_nodes,
- Vector<DGroupInput *> &&all_group_inputs,
- Vector<DParentNode *> &&all_parent_nodes);
-};
-
-namespace derived_node_tree_types {
-using nodes::DerivedNodeTree;
-using nodes::DGroupInput;
-using nodes::DInputSocket;
-using nodes::DNode;
-using nodes::DOutputSocket;
-using nodes::DParentNode;
-}; // namespace derived_node_tree_types
-
-/* --------------------------------------------------------------------
- * DSocket inline methods.
- */
-
-inline const DNode &DSocket::node() const
-{
- return *node_;
-}
-
-inline int DSocket::id() const
-{
- return id_;
-}
-
-inline int DSocket::index() const
-{
- return socket_ref_->index();
-}
-
-inline bool DSocket::is_input() const
-{
- return socket_ref_->is_input();
-}
-
-inline bool DSocket::is_output() const
-{
- return socket_ref_->is_output();
-}
-
-inline const DSocket &DSocket::as_base() const
-{
- return *this;
-}
-
-inline const DInputSocket &DSocket::as_input() const
-{
- return static_cast<const DInputSocket &>(*this);
-}
-
-inline const DOutputSocket &DSocket::as_output() const
-{
- return static_cast<const DOutputSocket &>(*this);
-}
-
-inline PointerRNA *DSocket::rna() const
-{
- return socket_ref_->rna();
-}
-
-inline StringRefNull DSocket::idname() const
-{
- return socket_ref_->idname();
-}
-
-inline StringRefNull DSocket::name() const
-{
- return socket_ref_->name();
-}
-
-inline StringRefNull DSocket::identifier() const
-{
- return socket_ref_->identifier();
-}
-
-inline bNodeSocketType *DSocket::typeinfo() const
-{
- return socket_ref_->bsocket()->typeinfo;
-}
-
-inline const SocketRef &DSocket::socket_ref() const
-{
- return *socket_ref_;
-}
-
-inline bNodeSocket *DSocket::bsocket() const
-{
- return socket_ref_->bsocket();
-}
-
-inline bool DSocket::is_available() const
-{
- return (socket_ref_->bsocket()->flag & SOCK_UNAVAIL) == 0;
-}
-
-/* --------------------------------------------------------------------
- * DInputSocket inline methods.
- */
-
-inline const InputSocketRef &DInputSocket::socket_ref() const
-{
- return socket_ref_->as_input();
-}
-
-inline Span<const DOutputSocket *> DInputSocket::link
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list