[Bf-blender-cvs] [45b9ceac71f] simulation-tree: store incident links in virtual node tree
Jacques Lucke
noreply at git.blender.org
Tue Feb 25 18:01:43 CET 2020
Commit: 45b9ceac71f0a8920d401c8511e1093749536d21
Author: Jacques Lucke
Date: Tue Feb 25 11:22:51 2020 +0100
Branches: simulation-tree
https://developer.blender.org/rB45b9ceac71f0a8920d401c8511e1093749536d21
store incident links in virtual node tree
===================================================================
M source/blender/blenkernel/BKE_virtual_node_tree.h
M source/blender/blenkernel/intern/virtual_node_tree.cc
===================================================================
diff --git a/source/blender/blenkernel/BKE_virtual_node_tree.h b/source/blender/blenkernel/BKE_virtual_node_tree.h
index 86d96e569f6..78f8d960f39 100644
--- a/source/blender/blenkernel/BKE_virtual_node_tree.h
+++ b/source/blender/blenkernel/BKE_virtual_node_tree.h
@@ -39,6 +39,7 @@ class VSocket : BLI::NonCopyable, BLI::NonMovable {
protected:
LinearAllocatedVector<VSocket *> m_linked_sockets;
LinearAllocatedVector<VSocket *> m_directly_linked_sockets;
+ LinearAllocatedVector<bNodeLink *> m_incident_links;
VNode *m_node;
bool m_is_input;
bNodeSocket *m_bsocket;
@@ -51,6 +52,7 @@ class VSocket : BLI::NonCopyable, BLI::NonMovable {
public:
ArrayRef<const VSocket *> linked_sockets() const;
ArrayRef<const VSocket *> directly_linked_sockets() const;
+ ArrayRef<bNodeLink *> incident_links() const;
const VNode &node() const;
const VirtualNodeTree &tree() const;
@@ -165,6 +167,11 @@ inline ArrayRef<const VSocket *> VSocket::directly_linked_sockets() const
return m_directly_linked_sockets.as_ref();
}
+inline ArrayRef<bNodeLink *> VSocket::incident_links() const
+{
+ return m_incident_links;
+}
+
inline const VirtualNodeTree &VSocket::tree() const
{
return m_node->tree();
diff --git a/source/blender/blenkernel/intern/virtual_node_tree.cc b/source/blender/blenkernel/intern/virtual_node_tree.cc
index 81698d0e524..37d796f081c 100644
--- a/source/blender/blenkernel/intern/virtual_node_tree.cc
+++ b/source/blender/blenkernel/intern/virtual_node_tree.cc
@@ -70,6 +70,8 @@ VirtualNodeTree::VirtualNodeTree(bNodeTree *btree) : m_btree(btree)
from_vsocket.m_directly_linked_sockets.append(&to_vsocket, m_allocator);
to_vsocket.m_directly_linked_sockets.append(&from_vsocket, m_allocator);
+ from_vsocket.m_incident_links.append(blink, m_allocator);
+ to_vsocket.m_incident_links.append(blink, m_allocator);
}
for (VOutputSocket *socket : vtree.m_output_sockets) {
More information about the Bf-blender-cvs
mailing list