Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'intern/cycles/graph')
-rw-r--r--intern/cycles/graph/node.cpp16
-rw-r--r--intern/cycles/graph/node.h10
2 files changed, 26 insertions, 0 deletions
diff --git a/intern/cycles/graph/node.cpp b/intern/cycles/graph/node.cpp
index c437c6fda1e..14e66959f4f 100644
--- a/intern/cycles/graph/node.cpp
+++ b/intern/cycles/graph/node.cpp
@@ -26,10 +26,16 @@ CCL_NAMESPACE_BEGIN
/* Node Type */
+NodeOwner::~NodeOwner()
+{
+}
+
Node::Node(const NodeType *type_, ustring name_) : name(name_), type(type_)
{
assert(type);
+ owner = nullptr;
+
/* assign non-empty name, convenient for debugging */
if (name.empty()) {
name = type->name;
@@ -679,4 +685,14 @@ bool Node::is_a(const NodeType *type_)
return false;
}
+const NodeOwner *Node::get_owner() const
+{
+ return owner;
+}
+
+void Node::set_owner(const NodeOwner *owner_)
+{
+ owner_ = owner;
+}
+
CCL_NAMESPACE_END
diff --git a/intern/cycles/graph/node.h b/intern/cycles/graph/node.h
index 4473b8aca28..3c84dbdb4a7 100644
--- a/intern/cycles/graph/node.h
+++ b/intern/cycles/graph/node.h
@@ -31,6 +31,10 @@ struct Transform;
/* Node */
+struct NodeOwner {
+ virtual ~NodeOwner();
+};
+
struct Node {
explicit Node(const NodeType *type, ustring name = ustring());
virtual ~Node() = 0;
@@ -99,6 +103,12 @@ struct Node {
ustring name;
const NodeType *type;
+
+ const NodeOwner *get_owner() const;
+ void set_owner(const NodeOwner *owner_);
+
+ protected:
+ const NodeOwner *owner;
};
CCL_NAMESPACE_END