diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-20 18:27:08 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-20 18:29:13 +0300 |
commit | f87c157f2288b945504cd6751c41a1f48b84dff8 (patch) | |
tree | 5656ab83fae77b0fbc1aace7d8ade85937c1806e | |
parent | b2ef042793d8723a8e1b433cf64cdc3fe823ff61 (diff) |
Depsgraph: Move time source node to own file
11 files changed, 111 insertions, 25 deletions
diff --git a/source/blender/depsgraph/CMakeLists.txt b/source/blender/depsgraph/CMakeLists.txt index b76275566bd..868a26ae821 100644 --- a/source/blender/depsgraph/CMakeLists.txt +++ b/source/blender/depsgraph/CMakeLists.txt @@ -57,6 +57,7 @@ set(SRC intern/nodes/deg_node.cc intern/nodes/deg_node_component.cc intern/nodes/deg_node_operation.cc + intern/nodes/deg_node_time.cc intern/depsgraph.cc intern/depsgraph_build.cc intern/depsgraph_debug.cc @@ -83,6 +84,7 @@ set(SRC intern/nodes/deg_node.h intern/nodes/deg_node_component.h intern/nodes/deg_node_operation.h + intern/nodes/deg_node_time.h intern/depsgraph.h intern/depsgraph_intern.h intern/depsgraph_types.h diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 10d4d7a2e9c..2266469c691 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -104,6 +104,7 @@ extern "C" { #include "intern/nodes/deg_node.h" #include "intern/nodes/deg_node_component.h" #include "intern/nodes/deg_node_operation.h" +#include "intern/nodes/deg_node_time.h" #include "intern/depsgraph_intern.h" #include "intern/depsgraph_types.h" diff --git a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc index 528758daeb2..4f6b301bf9e 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_graphviz.cc @@ -41,6 +41,8 @@ extern "C" { #include "DEG_depsgraph_debug.h" #include "intern/depsgraph_intern.h" +#include "intern/nodes/deg_node_time.h" + #include "util/deg_util_foreach.h" /* ****************** */ diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 9a3b1788aa1..b71e1e1cd4e 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -59,6 +59,7 @@ extern "C" { #include "intern/nodes/deg_node.h" #include "intern/nodes/deg_node_component.h" #include "intern/nodes/deg_node_operation.h" +#include "intern/nodes/deg_node_time.h" #include "intern/depsgraph_intern.h" #include "util/deg_util_foreach.h" diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc index f6f3cd06708..4290ea12112 100644 --- a/source/blender/depsgraph/intern/depsgraph_debug.cc +++ b/source/blender/depsgraph/intern/depsgraph_debug.cc @@ -42,6 +42,8 @@ extern "C" { #include "DEG_depsgraph_build.h" #include "intern/depsgraph_intern.h" +#include "intern/nodes/deg_node_time.h" + #include "util/deg_util_foreach.h" bool DEG_debug_compare(const struct Depsgraph *graph1, diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc index 85a0d336d28..ab10f9730c0 100644 --- a/source/blender/depsgraph/intern/depsgraph_eval.cc +++ b/source/blender/depsgraph/intern/depsgraph_eval.cc @@ -49,6 +49,7 @@ extern "C" { #include "intern/nodes/deg_node.h" #include "intern/nodes/deg_node_operation.h" +#include "intern/nodes/deg_node_time.h" #include "intern/depsgraph.h" diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index 0f6fa2897ba..dfd2b723c01 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -51,8 +51,10 @@ extern "C" { #include "intern/nodes/deg_node.h" #include "intern/nodes/deg_node_component.h" #include "intern/nodes/deg_node_operation.h" +#include "intern/nodes/deg_node_time.h" #include "intern/depsgraph.h" #include "intern/depsgraph_intern.h" + #include "util/deg_util_foreach.h" namespace DEG { diff --git a/source/blender/depsgraph/intern/nodes/deg_node.cc b/source/blender/depsgraph/intern/nodes/deg_node.cc index 77182332e02..82c67652435 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node.cc @@ -47,7 +47,9 @@ extern "C" { #include "intern/nodes/deg_node_component.h" #include "intern/nodes/deg_node_operation.h" +#include "intern/nodes/deg_node_time.h" #include "intern/depsgraph_intern.h" + #include "util/deg_util_foreach.h" namespace DEG { @@ -102,16 +104,6 @@ string DepsNode::identifier() const /* ************* */ /* Generic Nodes */ -/* Time Source Node ============================================== */ - -void TimeSourceDepsNode::tag_update(Depsgraph *graph) -{ - foreach (DepsRelation *rel, outlinks) { - DepsNode *node = rel->to; - node->tag_update(graph); - } -} - /* Time Source Node ======================================= */ DEG_DEPSNODE_DEFINE(TimeSourceDepsNode, DEG_NODE_TYPE_TIMESOURCE, "Time Source"); diff --git a/source/blender/depsgraph/intern/nodes/deg_node.h b/source/blender/depsgraph/intern/nodes/deg_node.h index b9aa36bbd43..8f2cc3f374b 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node.h +++ b/source/blender/depsgraph/intern/nodes/deg_node.h @@ -114,21 +114,6 @@ struct DepsNode { struct ComponentDepsNode; struct IDDepsNode; -/* Time Source Node. */ -struct TimeSourceDepsNode : public DepsNode { - /* New "current time". */ - float cfra; - - /* time-offset relative to the "official" time source that this one has. */ - float offset; - - // TODO: evaluate() operation needed - - void tag_update(Depsgraph *graph); - - DEG_DEPSNODE_DECLARE; -}; - /* ID-Block Reference */ struct IDDepsNode : public DepsNode { struct ComponentIDKey { diff --git a/source/blender/depsgraph/intern/nodes/deg_node_time.cc b/source/blender/depsgraph/intern/nodes/deg_node_time.cc new file mode 100644 index 00000000000..230488b2328 --- /dev/null +++ b/source/blender/depsgraph/intern/nodes/deg_node_time.cc @@ -0,0 +1,46 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2013 Blender Foundation. + * All rights reserved. + * + * Original Author: Joshua Leung + * Contributor(s): None Yet + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/depsgraph/intern/nodes/deg_node_time.cc + * \ingroup depsgraph + */ + +#include "intern/nodes/deg_node_time.h" + +#include "intern/depsgraph_intern.h" +#include "util/deg_util_foreach.h" + +namespace DEG { + +void TimeSourceDepsNode::tag_update(Depsgraph *graph) +{ + foreach (DepsRelation *rel, outlinks) { + DepsNode *node = rel->to; + node->tag_update(graph); + } +} + +} // namespace DEG diff --git a/source/blender/depsgraph/intern/nodes/deg_node_time.h b/source/blender/depsgraph/intern/nodes/deg_node_time.h new file mode 100644 index 00000000000..93f3edef9cf --- /dev/null +++ b/source/blender/depsgraph/intern/nodes/deg_node_time.h @@ -0,0 +1,52 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) 2013 Blender Foundation. + * All rights reserved. + * + * Original Author: Joshua Leung + * Contributor(s): None Yet + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file depsgraph/intern/nodes/deg_node_time.h + * \ingroup depsgraph + */ + +#pragma once + +#include "intern/nodes/deg_node.h" + +namespace DEG { + +/* Time Source Node. */ +struct TimeSourceDepsNode : public DepsNode { + /* New "current time". */ + float cfra; + + /* time-offset relative to the "official" time source that this one has. */ + float offset; + + // TODO: evaluate() operation needed + + void tag_update(Depsgraph *graph); + + DEG_DEPSNODE_DECLARE; +}; + +} // namespace DEG |