[Bf-blender-cvs] [eb4fe7d] depsgraph_refactor: Moved the validate_links and sort functions into the Depsgraph class as methods.
Lukas Tönne
noreply at git.blender.org
Mon Apr 14 13:52:20 CEST 2014
Commit: eb4fe7d59640d1c7e3513f47ffa347a667393c6e
Author: Lukas Tönne
Date: Mon Apr 14 12:30:08 2014 +0200
https://developer.blender.org/rBeb4fe7d59640d1c7e3513f47ffa347a667393c6e
Moved the validate_links and sort functions into the Depsgraph class as
methods.
These are not used and disabled atm, just keeping them around for now
in case they are still needed later.
===================================================================
M source/blender/depsgraph/intern/depsgraph.cpp
M source/blender/depsgraph/intern/depsgraph.h
M source/blender/depsgraph/intern/depsgraph_core.cpp
M source/blender/depsgraph/intern/depsgraph_intern.h
===================================================================
diff --git a/source/blender/depsgraph/intern/depsgraph.cpp b/source/blender/depsgraph/intern/depsgraph.cpp
index 87b3153..1240d49 100644
--- a/source/blender/depsgraph/intern/depsgraph.cpp
+++ b/source/blender/depsgraph/intern/depsgraph.cpp
@@ -209,6 +209,41 @@ DepsRelation *Depsgraph::add_new_relation(DepsNode *from, DepsNode *to,
return rel;
}
+/* Ensure that all implicit constraints between nodes are satisfied
+ * (e.g. components are only allowed to be executed in a certain order)
+ */
+void Depsgraph::validate_links()
+{
+ /* go over each ID node to recursively call validate_links()
+ * on it, which should be enough to ensure that all of those
+ * subtrees are valid
+ */
+ for (Depsgraph::IDNodeMap::const_iterator it = this->id_hash.begin(); it != this->id_hash.end(); ++it) {
+ DepsNode *node = it->second;
+ node->validate_links(this);
+ }
+}
+
+/* Sort nodes to determine evaluation order for operation nodes
+ * where dependency relationships won't get violated.
+ */
+void Depsgraph::sort()
+{
+#if 0
+ void *ctx = NULL; // XXX: temp struct for keeping track of visited nodes, etc.?
+
+ /* 1) traverse graph from root
+ * - note when each graph was visited (within its peers)
+ * - tag/knock out relationships leading to cyclic dependencies
+ */
+ DEG_graph_traverse(graph, DEG_Filter_ExecutableNodes, NULL,
+ tag_nodes_for_sorting, ctx);
+
+
+ /* 2) tweak order of nodes within each set of links */
+#endif
+}
+
/* ************************************************** */
/* Relationships Management */
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h
index 39e9e48..6b67ac1 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -140,6 +140,16 @@ struct Depsgraph {
eDepsRelation_Type type,
const string &description);
+ /* Ensure that all implicit constraints between nodes are satisfied
+ * (e.g. components are only allowed to be executed in a certain order)
+ */
+ void validate_links();
+
+ /* Sort nodes to determine evaluation order for operation nodes
+ * where dependency relationships won't get violated.
+ */
+ void sort();
+
/* Core Graph Functionality ........... */
IDNodeMap id_hash; /* <ID : IDDepsNode> mapping from ID blocks to nodes representing these blocks (for quick lookups) */
diff --git a/source/blender/depsgraph/intern/depsgraph_core.cpp b/source/blender/depsgraph/intern/depsgraph_core.cpp
index ac47c88..e90bd48 100644
--- a/source/blender/depsgraph/intern/depsgraph_core.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_core.cpp
@@ -53,49 +53,6 @@ extern "C" {
#include "depsgraph_intern.h"
/* ************************************************** */
-/* Validity + Integrity */
-
-/* Ensure that all implicit constraints between nodes are satisfied
- * (e.g. components are only allowed to be executed in a certain order)
- */
-void DEG_graph_validate_links(Depsgraph *graph)
-{
- BLI_assert(graph != NULL);
-
- /* go over each ID node to recursively call validate_links()
- * on it, which should be enough to ensure that all of those
- * subtrees are valid
- */
- for (Depsgraph::IDNodeMap::const_iterator it = graph->id_hash.begin(); it != graph->id_hash.end(); ++it) {
- DepsNode *node = it->second;
- node->validate_links(graph);
- }
-}
-
-/* ************************************************** */
-/* Low-Level Graph Traversal and Sorting */
-
-/* Sort nodes to determine evaluation order for operation nodes
- * where dependency relationships won't get violated.
- */
-void DEG_graph_sort(Depsgraph *graph)
-{
-#if 0
- void *ctx = NULL; // XXX: temp struct for keeping track of visited nodes, etc.?
-
- /* 1) traverse graph from root
- * - note when each graph was visited (within its peers)
- * - tag/knock out relationships leading to cyclic dependencies
- */
- DEG_graph_traverse(graph, DEG_Filter_ExecutableNodes, NULL,
- tag_nodes_for_sorting, ctx);
-
-
- /* 2) tweak order of nodes within each set of links */
-#endif
-}
-
-/* ************************************************** */
/* Update Tagging/Flushing */
/* Low-Level Tagging -------------------------------- */
diff --git a/source/blender/depsgraph/intern/depsgraph_intern.h b/source/blender/depsgraph/intern/depsgraph_intern.h
index 13ced33..4097c0d 100644
--- a/source/blender/depsgraph/intern/depsgraph_intern.h
+++ b/source/blender/depsgraph/intern/depsgraph_intern.h
@@ -45,21 +45,6 @@ struct Main;
struct Group;
struct Scene;
-/* Low-Level Querying ============================================== */
-
-/* Graph Validity -------------------------------------------------- */
-
-/* Ensure that all implicit constraints between nodes are satisfied
- * (e.g. components are only allowed to be executed in a certain order)
- */
-void DEG_graph_validate_links(Depsgraph *graph);
-
-
-/* Sort nodes to determine evaluation order for operation nodes
- * where dependency relationships won't get violated.
- */
-void DEG_graph_sort(Depsgraph *graph);
-
/* Graph Building ======================================================== */
/* Build depsgraph for the given group, and dump results in given graph container
More information about the Bf-blender-cvs
mailing list