diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-24 17:32:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-11-24 17:32:29 +0300 |
commit | d80c1e1e110bde06c9a5f6ae6566278d8641b756 (patch) | |
tree | 08181bed37d0dedb621b054f781af8e3f17d7fa3 /source/blender/depsgraph | |
parent | d8f33fc81855c8474586140f206b59ac6d92b124 (diff) |
Depsgraph: Use get_ prefix for function which expect operation to exists
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 8 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.h | 29 |
2 files changed, 17 insertions, 20 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 50f0f7532fd..89b1848cd85 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -224,7 +224,7 @@ DepsgraphRelationBuilder::DepsgraphRelationBuilder(Main *bmain, { } -TimeSourceDepsNode *DepsgraphRelationBuilder::find_node( +TimeSourceDepsNode *DepsgraphRelationBuilder::get_node( const TimeSourceKey &key) const { if (key.id) { @@ -236,7 +236,7 @@ TimeSourceDepsNode *DepsgraphRelationBuilder::find_node( } } -ComponentDepsNode *DepsgraphRelationBuilder::find_node( +ComponentDepsNode *DepsgraphRelationBuilder::get_node( const ComponentKey &key) const { IDDepsNode *id_node = graph_->find_id_node(key.id); @@ -250,7 +250,7 @@ ComponentDepsNode *DepsgraphRelationBuilder::find_node( return node; } -OperationDepsNode *DepsgraphRelationBuilder::find_node( +OperationDepsNode *DepsgraphRelationBuilder::get_node( const OperationKey &key) const { IDDepsNode *id_node = graph_->find_id_node(key.id); @@ -276,7 +276,7 @@ OperationDepsNode *DepsgraphRelationBuilder::find_node( return op_node; } -DepsNode *DepsgraphRelationBuilder::find_node(const RNAPathKey &key) const +DepsNode *DepsgraphRelationBuilder::get_node(const RNAPathKey &key) const { return graph_->find_node_from_pointer(&key.ptr, key.prop); } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h index 2bb087a1359..8392b0f1c08 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -245,10 +245,10 @@ struct DepsgraphRelationBuilder Depsgraph *getGraph(); protected: - TimeSourceDepsNode *find_node(const TimeSourceKey &key) const; - ComponentDepsNode *find_node(const ComponentKey &key) const; - OperationDepsNode *find_node(const OperationKey &key) const; - DepsNode *find_node(const RNAPathKey &key) const; + TimeSourceDepsNode *get_node(const TimeSourceKey &key) const; + ComponentDepsNode *get_node(const ComponentKey &key) const; + OperationDepsNode *get_node(const OperationKey &key) const; + DepsNode *get_node(const RNAPathKey &key) const; OperationDepsNode *has_node(const OperationKey &key) const; void add_time_relation(TimeSourceDepsNode *timesrc, @@ -293,7 +293,7 @@ struct DepsNodeHandle template <typename KeyType> OperationDepsNode *DepsgraphRelationBuilder::find_operation_node(const KeyType& key) { - DepsNode *node = find_node(key); + DepsNode *node = get_node(key); return node != NULL ? node->get_exit_operation() : NULL; } @@ -302,8 +302,8 @@ void DepsgraphRelationBuilder::add_relation(const KeyFrom &key_from, const KeyTo &key_to, const char *description) { - DepsNode *node_from = find_node(key_from); - DepsNode *node_to = find_node(key_to); + DepsNode *node_from = get_node(key_from); + DepsNode *node_to = get_node(key_to); OperationDepsNode *op_from = node_from ? node_from->get_exit_operation() : NULL; OperationDepsNode *op_to = node_to ? node_to->get_entry_operation() : NULL; if (op_from && op_to) { @@ -312,7 +312,6 @@ void DepsgraphRelationBuilder::add_relation(const KeyFrom &key_from, else { if (!op_from) { /* XXX TODO handle as error or report if needed */ - node_from = find_node(key_from); fprintf(stderr, "add_relation(%s) - Could not find op_from (%s)\n", description, key_from.identifier().c_str()); } @@ -337,14 +336,12 @@ void DepsgraphRelationBuilder::add_relation(const TimeSourceKey &key_from, const KeyTo &key_to, const char *description) { - TimeSourceDepsNode *time_from = find_node(key_from); - DepsNode *node_to = find_node(key_to); + TimeSourceDepsNode *time_from = get_node(key_from); + DepsNode *node_to = get_node(key_to); OperationDepsNode *op_to = node_to ? node_to->get_entry_operation() : NULL; - if (time_from && op_to) { + if (time_from != NULL && op_to != NULL) { add_time_relation(time_from, op_to, description); } - else { - } } template <typename KeyType> @@ -353,10 +350,10 @@ void DepsgraphRelationBuilder::add_node_handle_relation( const DepsNodeHandle *handle, const char *description) { - DepsNode *node_from = find_node(key_from); + DepsNode *node_from = get_node(key_from); OperationDepsNode *op_from = node_from ? node_from->get_exit_operation() : NULL; OperationDepsNode *op_to = handle->node->get_entry_operation(); - if (op_from && op_to) { + if (op_from != NULL && op_to != NULL) { add_operation_relation(op_from, op_to, description); } else { @@ -376,7 +373,7 @@ DepsNodeHandle DepsgraphRelationBuilder::create_node_handle( const KeyType &key, const char *default_name) { - return DepsNodeHandle(this, find_node(key), default_name); + return DepsNodeHandle(this, get_node(key), default_name); } } // namespace DEG |