diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-31 14:56:40 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2019-01-31 16:31:41 +0300 |
commit | c1da8e3b28f95188f9e9152383856c95f29586b4 (patch) | |
tree | 611acd206bfb126f076e78caa047b14bcd3673b6 /source/blender/depsgraph/intern/builder/deg_builder_nodes.h | |
parent | 7ccef23c4d010d4b4f83efe2cd6c82ff26824a10 (diff) |
Depsgraph: Comb code to a better state all over
Some summary of changes:
- Don't use DEG prefix for types and enumerator values:
the code is already inside DEG namespace.
- Put code where it locally belongs to: avoid having one
single header file with all sort of definitions in it.
- Take advantage of modern C++11 enabled by default.
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_nodes.h')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.h | 124 |
1 files changed, 59 insertions, 65 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h index 1db3f5d4e99..7c683f1da97 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.h @@ -31,11 +31,12 @@ #pragma once #include "intern/builder/deg_builder_map.h" -#include "intern/depsgraph_types.h" +#include "intern/depsgraph_type.h" #include "DEG_depsgraph.h" -#include "intern/nodes/deg_node_id.h" +#include "intern/node/deg_node_id.h" +#include "intern/node/deg_node_operation.h" struct Base; struct CacheFile; @@ -73,12 +74,12 @@ struct PropertyRNA; namespace DEG { -struct ComponentDepsNode; -struct DepsNode; +struct ComponentNode; +struct Node; struct Depsgraph; -struct IDDepsNode; -struct OperationDepsNode; -struct TimeSourceDepsNode; +struct IDNode; +struct OperationNode; +struct TimeSourceNode; struct DepsgraphNodeBuilder { DepsgraphNodeBuilder(Main *bmain, Depsgraph *graph); @@ -87,8 +88,7 @@ struct DepsgraphNodeBuilder { /* For given original ID get ID which is created by CoW system. */ ID *get_cow_id(const ID *id_orig) const; /* Similar to above, but for the cases when there is no ID node we create - * one. - */ + * one. */ ID *ensure_cow_id(ID *id_orig); /* Helper wrapper function which wraps get_cow_id with a needed type cast. */ @@ -106,59 +106,59 @@ struct DepsgraphNodeBuilder { void begin_build(); void end_build(); - IDDepsNode *add_id_node(ID *id); - IDDepsNode *find_id_node(ID *id); - TimeSourceDepsNode *add_time_source(); + IDNode *add_id_node(ID *id); + IDNode *find_id_node(ID *id); + TimeSourceNode *add_time_source(); - ComponentDepsNode *add_component_node(ID *id, - eDepsNode_Type comp_type, - const char *comp_name = ""); + ComponentNode *add_component_node(ID *id, + NodeType comp_type, + const char *comp_name = ""); - OperationDepsNode *add_operation_node(ComponentDepsNode *comp_node, - const DepsEvalOperationCb& op, - eDepsOperation_Code opcode, - const char *name = "", - int name_tag = -1); - OperationDepsNode *add_operation_node(ID *id, - eDepsNode_Type comp_type, - const char *comp_name, - const DepsEvalOperationCb& op, - eDepsOperation_Code opcode, - const char *name = "", - int name_tag = -1); - OperationDepsNode *add_operation_node(ID *id, - eDepsNode_Type comp_type, - const DepsEvalOperationCb& op, - eDepsOperation_Code opcode, - const char *name = "", - int name_tag = -1); + OperationNode *add_operation_node(ComponentNode *comp_node, + const DepsEvalOperationCb& op, + OperationCode opcode, + const char *name = "", + int name_tag = -1); + OperationNode *add_operation_node(ID *id, + NodeType comp_type, + const char *comp_name, + const DepsEvalOperationCb& op, + OperationCode opcode, + const char *name = "", + int name_tag = -1); + OperationNode *add_operation_node(ID *id, + NodeType comp_type, + const DepsEvalOperationCb& op, + OperationCode opcode, + const char *name = "", + int name_tag = -1); - OperationDepsNode *ensure_operation_node(ID *id, - eDepsNode_Type comp_type, - const DepsEvalOperationCb& op, - eDepsOperation_Code opcode, - const char *name = "", - int name_tag = -1); + OperationNode *ensure_operation_node(ID *id, + NodeType comp_type, + const DepsEvalOperationCb& op, + OperationCode opcode, + const char *name = "", + int name_tag = -1); bool has_operation_node(ID *id, - eDepsNode_Type comp_type, + NodeType comp_type, const char *comp_name, - eDepsOperation_Code opcode, + OperationCode opcode, const char *name = "", int name_tag = -1); - OperationDepsNode *find_operation_node(ID *id, - eDepsNode_Type comp_type, - const char *comp_name, - eDepsOperation_Code opcode, - const char *name = "", + OperationNode *find_operation_node(ID *id, + NodeType comp_type, + const char *comp_name, + OperationCode opcode, + const char *name = "", int name_tag = -1); - OperationDepsNode *find_operation_node(ID *id, - eDepsNode_Type comp_type, - eDepsOperation_Code opcode, - const char *name = "", - int name_tag = -1); + OperationNode *find_operation_node(ID *id, + NodeType comp_type, + OperationCode opcode, + const char *name = "", + int name_tag = -1); void build_id(ID *id); void build_layer_collections(ListBase *lb); @@ -224,14 +224,12 @@ struct DepsgraphNodeBuilder { void build_speaker(Speaker *speaker); /* Per-ID information about what was already in the dependency graph. - * Allows to re-use certain values, to speed up following evaluation. - */ + * Allows to re-use certain values, to speed up following evaluation. */ struct IDInfo { /* Copy-on-written pointer of the corresponding ID. */ ID *id_cow; /* Mask of visible components from previous state of the - * dependency graph. - */ + * dependency graph. */ IDComponentsMask previously_visible_components_mask; /* Special evaluation flag mask from the previous depsgraph. */ uint32_t previous_eval_flags; @@ -242,12 +240,11 @@ struct DepsgraphNodeBuilder { protected: /* Allows to identify an operation which was tagged for update at the time * relations are being updated. We can not reuse operation node pointer - * since it will change during dependency graph construction. - */ + * since it will change during dependency graph construction. */ struct SavedEntryTag { ID *id_orig; - eDepsNode_Type component_type; - eDepsOperation_Code opcode; + NodeType component_type; + OperationCode opcode; const char *name; int name_tag; }; @@ -276,21 +273,18 @@ protected: ViewLayer *view_layer_; int view_layer_index_; /* NOTE: Collection are possibly built recursively, so be careful when - * setting the current state. - */ + * setting the current state. */ Collection *collection_; /* Accumulated flag over the hierarchy opf currently building collections. * Denotes whether all the hierarchy from parent of collection_ to the - * very root is visible (aka not restricted.). - */ + * very root is visible (aka not restricted.). */ bool is_parent_collection_visible_; /* Indexed by original ID, values are IDInfo. */ GHash *id_info_hash_; /* Set of IDs which were already build. Makes it easier to keep track of - * what was already built and what was not. - */ + * what was already built and what was not. */ BuilderMap built_map_; }; |