[Bf-blender-cvs] [98d7dd6] depsgraph_refactor: Finally removed the get_node and add_new_node methods from Depsgraph.

Lukas Tönne noreply at git.blender.org
Sun Apr 13 11:58:35 CEST 2014


Commit: 98d7dd6d7f9b463fb81db37d4ae24b2dce75b6f1
Author: Lukas Tönne
Date:   Sun Apr 13 11:50:44 2014 +0200
https://developer.blender.org/rB98d7dd6d7f9b463fb81db37d4ae24b2dce75b6f1

Finally removed the get_node and add_new_node methods from Depsgraph.

These are replaced entirely by equivalent functions in the actual
container nodes now.

NOTE: Operation nodes are currently not collected in the `all_opnodes`
list. This should happen as a single step after the actual node
hierarchy is built, but currently is not really used anyway.

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

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

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

diff --git a/source/blender/depsgraph/intern/depsgraph.cpp b/source/blender/depsgraph/intern/depsgraph.cpp
index e825fa0..2b54465 100644
--- a/source/blender/depsgraph/intern/depsgraph.cpp
+++ b/source/blender/depsgraph/intern/depsgraph.cpp
@@ -78,52 +78,6 @@ static void find_node_criteria_from_pointer(const PointerRNA *ptr, const Propert
 	}
 }
 
-/* ************************************************** */
-/* Node Management */
-
-/* Get Node ----------------------------------------- */
-
-/* Get a matching node, creating one if need be */
-DepsNode *Depsgraph::get_node(const ID *id, const string &subdata, eDepsNode_Type type, const string &name)
-{
-	DepsNode *node;
-	
-	/* firstly try to get an existing node... */
-	node = find_node(id, subdata, type, name);
-	if (node == NULL) {
-		/* nothing exists, so create one instead! */
-		node = add_new_node(id, subdata, type, name);
-	}
-	
-	/* return the node - it must exist now... */
-	return node;
-}
-
-/* Add ------------------------------------------------ */
-
-/* Add a new node */
-DepsNode *Depsgraph::add_new_node(const ID *id, const string &subdata,
-                                  eDepsNode_Type type, const string &name)
-{
-	DepsNode *node;
-	
-	DepsNodeFactory *factory = DEG_get_node_factory(type);
-	BLI_assert(factory != NULL);
-	
-	/* create node data... */
-	node = factory->create_node(id, subdata, name);
-	
-	/* add node to operation-node list if it plays a part in the evaluation process */
-	if (ELEM(node->tclass, DEPSNODE_CLASS_GENERIC, DEPSNODE_CLASS_OPERATION)) {
-		this->all_opnodes.push_back(node);
-	}
-	
-	DEG_debug_build_node_added(node);
-	
-	/* return the newly created node matching the description */
-	return node;
-}
-
 /* Query Conditions from RNA ----------------------- */
 
 /* Convenience wrapper to find node given just pointer + property */
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h
index b53a1c3..39e9e48 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -124,24 +124,8 @@ struct Depsgraph {
 	 */
 	DepsNode *find_node_from_pointer(const PointerRNA *ptr, const PropertyRNA *prop);
 	
-	/* Create or find a node with data matching the requested characteristics
-	 * ! New nodes are created if no matching nodes exist...
-	 * ! Arguments are as for DEG_find_node()
-	 *
-	 * > returns: A node matching the required characteristics that exists in the graph
-	 */
-	DepsNode *get_node(const ID *id, const string &subdata, eDepsNode_Type type, const string &name);
-	
-	/* Create a new node and add to graph
-	 * ! Arguments are as for DEG_find_node()
-	 *
-	 * > returns: The new node created (of the specified type) which now exists in the graph already
-	 *            (i.e. even if an ID node was created first, the inner node would get created first)
-	 */
-	DepsNode *add_new_node(const ID *id, const string &subdata,
-	                       eDepsNode_Type type, const string &name);
-	
 	RootDepsNode *add_root_node();
+	
 	SubgraphDepsNode *add_subgraph_node(const ID *id);
 	void remove_subgraph_node(SubgraphDepsNode *subgraph_node);
 	void clear_subgraph_nodes();
@@ -167,6 +151,7 @@ struct Depsgraph {
 	EntryTags entry_tags;       /* nodes which have been tagged as "directly modified" */
 	
 	/* 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 */
 	
 	// XXX: additional stuff like eval contexts, mempools for allocating nodes from, etc.




More information about the Bf-blender-cvs mailing list