[Bf-blender-cvs] [ded4f92] depsgraph_refactor: Added back registration of operation nodes in the central Depsgraph container.

Lukas Tönne noreply at git.blender.org
Mon May 19 20:01:35 CEST 2014


Commit: ded4f9260de456833a75dadbb3f13b9a0f7024a1
Author: Lukas Tönne
Date:   Mon May 19 18:10:52 2014 +0200
https://developer.blender.org/rBded4f9260de456833a75dadbb3f13b9a0f7024a1

Added back registration of operation nodes in the central Depsgraph
container.

Ownership is still a bit mushy here, but at least this makes it easier
to apply algorithms on the operations with a single-level loop.

===================================================================

M	source/blender/depsgraph/intern/depsgraph.h
M	source/blender/depsgraph/intern/depsgraph_build.cpp
M	source/blender/depsgraph/intern/depsgraph_tag.cpp

===================================================================

diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h
index 808f338..cd54c33 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -160,7 +160,7 @@ struct Depsgraph {
 	
 	/* Convenience Data ................... */
 	/* XXX: should be collected after building (if actually needed?) */
-	OperationNodes all_opnodes; /* all operation nodes, sorted in order of single-thread traversal order */
+	OperationNodes operations; /* all operation nodes, sorted in order of single-thread traversal order */
 	
 	// XXX: additional stuff like eval contexts, mempools for allocating nodes from, etc.
 	
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cpp b/source/blender/depsgraph/intern/depsgraph_build.cpp
index f308748..2fda0ed 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build.cpp
@@ -222,6 +222,9 @@ OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(ComponentDepsNode *c
 {
 	OperationDepsNode *op_node = comp_node->add_operation(type, optype, op, description);
 	op_node->ptr = ptr;
+	
+	m_graph->operations.push_back(op_node);
+	
 	return op_node;
 }
 
@@ -233,6 +236,9 @@ OperationDepsNode *DepsgraphNodeBuilder::add_operation_node(IDDepsNode *id_node,
 	ComponentDepsNode *comp_node = id_node->add_component(factory->component_type());
 	OperationDepsNode *op_node = comp_node->add_operation(type, optype, op, description);
 	op_node->ptr = ptr;
+	
+	m_graph->operations.push_back(op_node);
+	
 	return op_node;
 }
 
@@ -263,7 +269,7 @@ void DepsgraphNodeBuilder::verify_entry_exit_operations(ComponentDepsNode *node)
 	}
 	else if (entry_ops.size() > 1) {
 		/* multiple entry ops, add a barrier node as a single entry point */
-		node->entry_operation = node->add_operation(DEPSNODE_TYPE_OP_NOOP, DEPSOP_TYPE_INIT, NULL, "Entry");
+		node->entry_operation = add_operation_node(node, DEPSNODE_TYPE_OP_NOOP, DEPSOP_TYPE_INIT, NULL, "Entry", PointerRNA_NULL);
 		for (OperationsVector::const_iterator it = entry_ops.begin(); it != entry_ops.end(); ++it) {
 			OperationDepsNode *op_node = *it;
 			m_graph->add_new_relation(node->entry_operation, op_node, DEPSREL_TYPE_OPERATION, "Component entry relation");
@@ -276,7 +282,7 @@ void DepsgraphNodeBuilder::verify_entry_exit_operations(ComponentDepsNode *node)
 	}
 	else if (exit_ops.size() > 1) {
 		/* multiple exit ops, add a barrier node as a single exit point */
-		node->exit_operation = node->add_operation(DEPSNODE_TYPE_OP_NOOP, DEPSOP_TYPE_OUT, NULL, "Exit");
+		node->exit_operation = add_operation_node(node, DEPSNODE_TYPE_OP_NOOP, DEPSOP_TYPE_OUT, NULL, "Exit", PointerRNA_NULL);
 		for (OperationsVector::const_iterator it = exit_ops.begin(); it != exit_ops.end(); ++it) {
 			OperationDepsNode *op_node = *it;
 			m_graph->add_new_relation(op_node, node->exit_operation, DEPSREL_TYPE_OPERATION, "Component exit relation");
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cpp b/source/blender/depsgraph/intern/depsgraph_tag.cpp
index 6cca5d2..215831e 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cpp
@@ -166,7 +166,7 @@ void DEG_graph_flush_updates(Depsgraph *graph)
 void DEG_graph_clear_tags(Depsgraph *graph)
 {
 	/* go over all operation nodes, clearing tags */
-	for (Depsgraph::OperationNodes::const_iterator it = graph->all_opnodes.begin(); it != graph->all_opnodes.end(); ++it) {
+	for (Depsgraph::OperationNodes::const_iterator it = graph->operations.begin(); it != graph->operations.end(); ++it) {
 		OperationDepsNode *node = *it;
 		
 		/* clear node's "pending update" settings */




More information about the Bf-blender-cvs mailing list