[Bf-blender-cvs] [c79504e] depsgraph_cleanup: Depsgraph: Remove unused node copying routines

Sergey Sharybin noreply at git.blender.org
Thu May 26 10:02:44 CEST 2016


Commit: c79504ec4625a1a5983665d0935ce0b1061d5775
Author: Sergey Sharybin
Date:   Wed May 25 17:43:39 2016 +0200
Branches: depsgraph_cleanup
https://developer.blender.org/rBc79504ec4625a1a5983665d0935ce0b1061d5775

Depsgraph: Remove unused node copying routines

Once again, was never used, tested or anything.

Even had asserts to prevent from from use.

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

M	source/blender/depsgraph/intern/depsgraph_intern.h
M	source/blender/depsgraph/intern/depsgraph_query.cc
M	source/blender/depsgraph/intern/depsnode.cc
M	source/blender/depsgraph/intern/depsnode.h
M	source/blender/depsgraph/intern/depsnode_component.cc
M	source/blender/depsgraph/intern/depsnode_component.h

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

diff --git a/source/blender/depsgraph/intern/depsgraph_intern.h b/source/blender/depsgraph/intern/depsgraph_intern.h
index 0ac8bb3..ffaab1c 100644
--- a/source/blender/depsgraph/intern/depsgraph_intern.h
+++ b/source/blender/depsgraph/intern/depsgraph_intern.h
@@ -55,41 +55,6 @@ void DEG_graph_build_from_group(Depsgraph *graph, struct Main *bmain, struct Gro
 /* Build subgraph for group */
 DepsNode *DEG_graph_build_group_subgraph(Depsgraph *graph_main, struct Main *bmain, struct Group *group);
 
-/* Graph Copying ========================================================= */
-/* (Part of the Filtering API) */
-
-/**
- * Depsgraph Copying Context (dcc)
- *
- * Keeps track of node relationships/links/etc. during the copy
- * operation so that they can be safely remapped...
- */
-typedef struct DepsgraphCopyContext {
-	struct GHash *nodes_hash;   /* <DepsNode, DepsNode> mapping from src node to dst node */
-	struct GHash *rels_hash;    // XXX: same for relationships?
-
-	// XXX: filtering criteria...
-} DepsgraphCopyContext;
-
-/* Internal Filtering API ---------------------------------------------- */
-
-/* Create filtering context */
-// XXX: needs params for conditions?
-DepsgraphCopyContext *DEG_filter_init(void);
-
-/* Free filtering context once filtering is done */
-void DEG_filter_cleanup(DepsgraphCopyContext *dcc);
-
-
-/* Data Copy Operations ------------------------------------------------ */
-
-/**
- * Make a (deep) copy of provided node and it's little subgraph
- * \warning Newly created node is not added to the existing graph
- * \param dcc: Context info for helping resolve links
- */
-DepsNode *DEG_copy_node(DepsgraphCopyContext *dcc, const DepsNode *src);
-
 /* Node Types Handling ================================================= */
 
 /* "Typeinfo" for Node Types ------------------------------------------- */
@@ -101,7 +66,6 @@ struct DepsNodeFactory {
 	virtual const char *tname() const = 0;
 
 	virtual DepsNode *create_node(const ID *id, const string &subdata, const string &name) const = 0;
-	virtual DepsNode *copy_node(DepsgraphCopyContext *dcc, const DepsNode *copy) const = 0;
 };
 
 template <class NodeType>
@@ -129,22 +93,6 @@ struct DepsNodeFactoryImpl : public DepsNodeFactory {
 
 		return node;
 	}
-
-	virtual DepsNode *copy_node(DepsgraphCopyContext *dcc, const DepsNode *copy) const
-	{
-		BLI_assert(copy->type == type());
-		DepsNode *node = OBJECT_GUARDED_NEW(NodeType);
-
-		/* populate base node settings */
-		node->type = type();
-		node->tclass = tclass();
-		// XXX: need to review the name here, as we can't have exact duplicates...
-		node->name = copy->name;
-
-		node->copy(dcc, static_cast<const NodeType *>(copy));
-
-		return node;
-	}
 };
 
 /* Typeinfo Management -------------------------------------------------- */
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc
index dd673bb..5bf6b73 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -33,16 +33,11 @@
 #include "MEM_guardedalloc.h"
 
 extern "C" {
-#include "BLI_utildefines.h"
-#include "BLI_ghash.h"
-
 #include "BKE_main.h"
 
 #include "DEG_depsgraph_query.h"
 } /* extern "C" */
 
-#include "depsnode.h"
-#include "depsnode_operation.h"
 #include "depsgraph_intern.h"
 
 bool DEG_id_type_tagged(Main *bmain, short idtype)
diff --git a/source/blender/depsgraph/intern/depsnode.cc b/source/blender/depsgraph/intern/depsnode.cc
index 1e7e3cd..a9116d6 100644
--- a/source/blender/depsgraph/intern/depsnode.cc
+++ b/source/blender/depsgraph/intern/depsnode.cc
@@ -158,30 +158,6 @@ IDDepsNode::~IDDepsNode()
 	clear_components();
 }
 
-/* Copy 'id' node. */
-void IDDepsNode::copy(DepsgraphCopyContext *dcc, const IDDepsNode *src)
-{
-	(void)src;  /* Ignored. */
-	/* Iterate over items in original hash, adding them to new hash. */
-	for (IDDepsNode::ComponentMap::const_iterator it = this->components.begin();
-	     it != this->components.end();
-	     ++it)
-	{
-		/* Get current <type : component> mapping. */
-		ComponentIDKey c_key    = it->first;
-		DepsNode *old_component = it->second;
-
-		/* Make a copy of component. */
-		ComponentDepsNode *component = (ComponentDepsNode *)DEG_copy_node(dcc, old_component);
-
-		/* Add new node to hash... */
-		this->components[c_key] = component;
-	}
-
-	// TODO: perform a second loop to fix up links?
-	BLI_assert(!"Not expected to be used");
-}
-
 ComponentDepsNode *IDDepsNode::find_component(eDepsNode_Type type,
                                               const string &name) const
 {
@@ -281,21 +257,9 @@ SubgraphDepsNode::~SubgraphDepsNode()
 	}
 }
 
-/* Copy 'subgraph' node - Assume that the subgraph doesn't get copied for now... */
-void SubgraphDepsNode::copy(DepsgraphCopyContext * /*dcc*/,
-                            const SubgraphDepsNode * /*src*/)
-{
-	//const SubgraphDepsNode *src_node = (const SubgraphDepsNode *)src;
-	//SubgraphDepsNode *dst_node       = (SubgraphDepsNode *)dst;
-
-	/* for now, subgraph itself isn't copied... */
-	BLI_assert(!"Not expected to be used");
-}
-
 DEG_DEPSNODE_DEFINE(SubgraphDepsNode, DEPSNODE_TYPE_SUBGRAPH, "Subgraph Node");
 static DepsNodeFactoryImpl<SubgraphDepsNode> DNTI_SUBGRAPH;
 
-
 void DEG_register_base_depsnodes()
 {
 	DEG_register_node_typeinfo(&DNTI_ROOT);
diff --git a/source/blender/depsgraph/intern/depsnode.h b/source/blender/depsgraph/intern/depsnode.h
index 5a149f9..91f897c 100644
--- a/source/blender/depsgraph/intern/depsnode.h
+++ b/source/blender/depsgraph/intern/depsnode.h
@@ -93,8 +93,6 @@ struct DepsNode {
 
 	virtual void init(const ID * /*id*/,
 	                  const string &/*subdata*/) {}
-	virtual void copy(DepsgraphCopyContext * /*dcc*/,
-	                  const DepsNode * /*src*/) {}
 
 	virtual void tag_update(Depsgraph * /*graph*/) {}
 
@@ -176,7 +174,6 @@ struct IDDepsNode : public DepsNode {
 	                      component_key_hash> ComponentMap;
 
 	void init(const ID *id, const string &subdata);
-	void copy(DepsgraphCopyContext *dcc, const IDDepsNode *src);
 	~IDDepsNode();
 
 	ComponentDepsNode *find_component(eDepsNode_Type type,
@@ -209,7 +206,6 @@ struct IDDepsNode : public DepsNode {
 /* Subgraph Reference. */
 struct SubgraphDepsNode : public DepsNode {
 	void init(const ID *id, const string &subdata);
-	void copy(DepsgraphCopyContext *dcc, const SubgraphDepsNode *src);
 	~SubgraphDepsNode();
 
 	/* Instanced graph. */
diff --git a/source/blender/depsgraph/intern/depsnode_component.cc b/source/blender/depsgraph/intern/depsnode_component.cc
index a47a0d2..d45e727 100644
--- a/source/blender/depsgraph/intern/depsnode_component.cc
+++ b/source/blender/depsgraph/intern/depsnode_component.cc
@@ -63,33 +63,6 @@ void ComponentDepsNode::init(const ID * /*id*/,
 	// XXX: maybe this needs a special API?
 }
 
-/* Copy 'component' node */
-void ComponentDepsNode::copy(DepsgraphCopyContext * /*dcc*/,
-                             const ComponentDepsNode * /*src*/)
-{
-#if 0 // XXX: remove all this
-	/* duplicate list of operation nodes */
-	this->operations.clear();
-
-	for (OperationMap::const_iterator it = src->operations.begin(); it != src->operations.end(); ++it) {
-		const string &pchan_name = it->first;
-		OperationDepsNode *src_op = it->second;
-
-		/* recursive copy */
-		DepsNodeFactory *factory = DEG_node_get_factory(src_op);
-		OperationDepsNode *dst_op = (OperationDepsNode *)factory->copy_node(dcc, src_op);
-		this->operations[pchan_name] = dst_op;
-
-		/* fix links... */
-		// ...
-	}
-
-	/* copy evaluation contexts */
-	//
-#endif
-	BLI_assert(!"Not expected to be called");
-}
-
 /* Free 'component' node */
 ComponentDepsNode::~ComponentDepsNode()
 {
diff --git a/source/blender/depsgraph/intern/depsnode_component.h b/source/blender/depsgraph/intern/depsnode_component.h
index a08c775..e9e55a4 100644
--- a/source/blender/depsgraph/intern/depsnode_component.h
+++ b/source/blender/depsgraph/intern/depsnode_component.h
@@ -106,7 +106,6 @@ struct ComponentDepsNode : public DepsNode {
 	~ComponentDepsNode();
 
 	void init(const ID *id, const string &subdata);
-	void copy(DepsgraphCopyContext *dcc, const ComponentDepsNode *src);
 
 	string identifier() const;




More information about the Bf-blender-cvs mailing list