[Bf-blender-cvs] [849cae8] depsgraph_refactor: Prepare find_operation() for handling opcodes too
Joshua Leung
noreply at git.blender.org
Wed Dec 17 04:41:10 CET 2014
Commit: 849cae8f02c1ce4a6c3875bb957e4279ce6999ee
Author: Joshua Leung
Date: Tue Dec 16 01:41:52 2014 +1300
Branches: depsgraph_refactor
https://developer.blender.org/rB849cae8f02c1ce4a6c3875bb957e4279ce6999ee
Prepare find_operation() for handling opcodes too
Doesn't work yet, but is necessary to get the code compiling
===================================================================
M source/blender/depsgraph/intern/depsgraph_build.cpp
M source/blender/depsgraph/intern/depsnode_component.cpp
M source/blender/depsgraph/intern/depsnode_component.h
===================================================================
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cpp b/source/blender/depsgraph/intern/depsgraph_build.cpp
index e03bd9c..dcd19bc 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build.cpp
@@ -359,8 +359,7 @@ OperationDepsNode *DepsgraphRelationBuilder::find_node(const OperationKey &key)
if (!comp_node)
return NULL;
- // XXX...
- OperationDepsNode *op_node = comp_node->find_operation(key.name);
+ OperationDepsNode *op_node = comp_node->find_operation(key.opcode, key.name);
return op_node;
}
diff --git a/source/blender/depsgraph/intern/depsnode_component.cpp b/source/blender/depsgraph/intern/depsnode_component.cpp
index facede3..59306f8 100644
--- a/source/blender/depsgraph/intern/depsnode_component.cpp
+++ b/source/blender/depsgraph/intern/depsnode_component.cpp
@@ -85,15 +85,16 @@ ComponentDepsNode::~ComponentDepsNode()
clear_operations();
}
-OperationDepsNode *ComponentDepsNode::find_operation(const string &name) const
+OperationDepsNode *ComponentDepsNode::find_operation(eDepsOperation_Code opcode, const string &name) const
{
+ // FIXME: how to perform this lookup?
OperationMap::const_iterator it = this->operations.find(name);
return it != this->operations.end() ? it->second : NULL;
}
OperationDepsNode *ComponentDepsNode::add_operation(eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, const string &name)
{
- OperationDepsNode *op_node = find_operation(name);
+ OperationDepsNode *op_node = find_operation(opcode, name);
if (!op_node) {
DepsNodeFactory *factory = DEG_get_node_factory(DEPSNODE_TYPE_OPERATION);
op_node = (OperationDepsNode *)factory->create_node(this->owner->id, "", name);
diff --git a/source/blender/depsgraph/intern/depsnode_component.h b/source/blender/depsgraph/intern/depsnode_component.h
index a8a5f13..0d5403f 100644
--- a/source/blender/depsgraph/intern/depsnode_component.h
+++ b/source/blender/depsgraph/intern/depsnode_component.h
@@ -55,7 +55,8 @@ struct ComponentDepsNode : public DepsNode {
void copy(DepsgraphCopyContext *dcc, const ComponentDepsNode *src);
~ComponentDepsNode();
- OperationDepsNode *find_operation(const string &name) const;
+ OperationDepsNode *find_operation(eDepsOperation_Code opcode, const string &name) const;
+
/* Create a new node for representing an operation and add this to graph
* ! If an existing node is found, it will be modified. This helps when node may
* have been partially created earlier (e.g. parent ref before parent item is added)
@@ -66,6 +67,7 @@ struct ComponentDepsNode : public DepsNode {
* < name: Identifier for operation - used to find/locate it again
*/
OperationDepsNode *add_operation(eDepsOperation_Type optype, DepsEvalOperationCb op, eDepsOperation_Code opcode, const string &name);
+
void remove_operation(const string &name);
void clear_operations();
More information about the Bf-blender-cvs
mailing list