2 * ***** BEGIN GPL LICENSE BLOCK *****
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * The Original Code is Copyright (C) 2013 Blender Foundation.
19 * All rights reserved.
21 * Original Author: Joshua Leung
22 * Contributor(s): None Yet
24 * ***** END GPL LICENSE BLOCK *****
27 /** \file blender/depsgraph/intern/nodes/deg_node_operation.cc
31 #include "intern/nodes/deg_node_operation.h"
33 #include "MEM_guardedalloc.h"
35 #include "BLI_utildefines.h"
36 #include "BLI_ghash.h"
38 #include "intern/depsgraph.h"
39 #include "intern/depsgraph_intern.h"
40 #include "intern/nodes/deg_node_id.h"
47 OperationDepsNode::OperationDepsNode() :
53 OperationDepsNode::~OperationDepsNode()
57 string OperationDepsNode::identifier() const
59 return string(DEG_OPNAMES[opcode]) + "(" + name + ")";
62 /* Full node identifier, including owner name.
63 * used for logging and debug prints.
65 string OperationDepsNode::full_identifier() const
67 string owner_str = "";
68 if (owner->type == DEG_NODE_TYPE_BONE) {
69 owner_str = string(owner->owner->name) + "." + owner->name;
72 owner_str = owner->owner->name;
74 return owner_str + "." + identifier();
77 void OperationDepsNode::tag_update(Depsgraph *graph)
79 if (flag & DEPSOP_FLAG_NEEDS_UPDATE) {
82 /* Tag for update, but also note that this was the source of an update. */
83 flag |= (DEPSOP_FLAG_NEEDS_UPDATE | DEPSOP_FLAG_DIRECTLY_MODIFIED);
84 graph->add_entry_tag(this);
87 void OperationDepsNode::set_as_entry()
89 BLI_assert(owner != NULL);
90 owner->set_entry_operation(this);
93 void OperationDepsNode::set_as_exit()
95 BLI_assert(owner != NULL);
96 owner->set_exit_operation(this);
99 DEG_DEPSNODE_DEFINE(OperationDepsNode, DEG_NODE_TYPE_OPERATION, "Operation");
100 static DepsNodeFactoryImpl<OperationDepsNode> DNTI_OPERATION;
102 void deg_register_operation_depsnodes()
104 deg_register_node_typeinfo(&DNTI_OPERATION);