Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/depsgraph/intern/depsgraph.h
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/depsgraph/intern/depsgraph.h')
-rw-r--r--source/blender/depsgraph/intern/depsgraph.h195
1 files changed, 94 insertions, 101 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph.h b/source/blender/depsgraph/intern/depsgraph.h
index de01969e963..2dcbb6b5574 100644
--- a/source/blender/depsgraph/intern/depsgraph.h
+++ b/source/blender/depsgraph/intern/depsgraph.h
@@ -35,7 +35,7 @@
#include "BKE_main.h" /* for MAX_LIBARRAY */
-#include "BLI_threads.h" /* for SpinLock */
+#include "BLI_threads.h" /* for SpinLock */
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_physics.h"
@@ -63,34 +63,34 @@ struct TimeSourceNode;
/* Settings/Tags on Relationship.
* NOTE: Is a bitmask, allowing accumulation. */
enum RelationFlag {
- /* "cyclic" link - when detecting cycles, this relationship was the one
- * which triggers a cyclic relationship to exist in the graph. */
- RELATION_FLAG_CYCLIC = (1 << 0),
- /* Update flush will not go through this relation. */
- RELATION_FLAG_NO_FLUSH = (1 << 1),
- /* Only flush along the relation is update comes from a node which was
- * affected by user input. */
- RELATION_FLAG_FLUSH_USER_EDIT_ONLY = (1 << 2),
- /* The relation can not be killed by the cyclic dependencies solver. */
- RELATION_FLAG_GODMODE = (1 << 4),
- /* Relation will check existance before being added. */
- RELATION_CHECK_BEFORE_ADD = (1 << 5),
+ /* "cyclic" link - when detecting cycles, this relationship was the one
+ * which triggers a cyclic relationship to exist in the graph. */
+ RELATION_FLAG_CYCLIC = (1 << 0),
+ /* Update flush will not go through this relation. */
+ RELATION_FLAG_NO_FLUSH = (1 << 1),
+ /* Only flush along the relation is update comes from a node which was
+ * affected by user input. */
+ RELATION_FLAG_FLUSH_USER_EDIT_ONLY = (1 << 2),
+ /* The relation can not be killed by the cyclic dependencies solver. */
+ RELATION_FLAG_GODMODE = (1 << 4),
+ /* Relation will check existance before being added. */
+ RELATION_CHECK_BEFORE_ADD = (1 << 5),
};
/* B depends on A (A -> B) */
struct Relation {
- Relation(Node *from, Node *to, const char *description);
- ~Relation();
+ Relation(Node *from, Node *to, const char *description);
+ ~Relation();
- void unlink();
+ void unlink();
- /* the nodes in the relationship (since this is shared between the nodes) */
- Node *from; /* A */
- Node *to; /* B */
+ /* the nodes in the relationship (since this is shared between the nodes) */
+ Node *from; /* A */
+ Node *to; /* B */
- /* relationship attributes */
- const char *name; /* label for debugging */
- int flag; /* Bitmask of RelationFlag) */
+ /* relationship attributes */
+ const char *name; /* label for debugging */
+ int flag; /* Bitmask of RelationFlag) */
};
/* ********* */
@@ -98,112 +98,105 @@ struct Relation {
/* Dependency Graph object */
struct Depsgraph {
- // TODO(sergey): Go away from C++ container and use some native BLI.
- typedef vector<OperationNode *> OperationNodes;
- typedef vector<IDNode *> IDDepsNodes;
+ // TODO(sergey): Go away from C++ container and use some native BLI.
+ typedef vector<OperationNode *> OperationNodes;
+ typedef vector<IDNode *> IDDepsNodes;
- Depsgraph(Scene *scene,
- ViewLayer *view_layer,
- eEvaluationMode mode);
- ~Depsgraph();
+ Depsgraph(Scene *scene, ViewLayer *view_layer, eEvaluationMode mode);
+ ~Depsgraph();
- TimeSourceNode *add_time_source();
- TimeSourceNode *find_time_source() const;
+ TimeSourceNode *add_time_source();
+ TimeSourceNode *find_time_source() const;
- IDNode *find_id_node(const ID *id) const;
- IDNode *add_id_node(ID *id, ID *id_cow_hint = NULL);
- void clear_id_nodes();
- void clear_id_nodes_conditional(const std::function <bool (ID_Type id_type)>& filter);
+ IDNode *find_id_node(const ID *id) const;
+ IDNode *add_id_node(ID *id, ID *id_cow_hint = NULL);
+ void clear_id_nodes();
+ void clear_id_nodes_conditional(const std::function<bool(ID_Type id_type)> &filter);
- /* Add new relationship between two nodes. */
- Relation *add_new_relation(Node *from,
- Node *to,
- const char *description,
- int flags = 0);
+ /* Add new relationship between two nodes. */
+ Relation *add_new_relation(Node *from, Node *to, const char *description, int flags = 0);
- /* Check whether two nodes are connected by relation with given
- * description. Description might be NULL to check ANY relation between
- * given nodes. */
- Relation *check_nodes_connected(const Node *from,
- const Node *to,
- const char *description);
+ /* Check whether two nodes are connected by relation with given
+ * description. Description might be NULL to check ANY relation between
+ * given nodes. */
+ Relation *check_nodes_connected(const Node *from, const Node *to, const char *description);
- /* Tag a specific node as needing updates. */
- void add_entry_tag(OperationNode *node);
+ /* Tag a specific node as needing updates. */
+ void add_entry_tag(OperationNode *node);
- /* Clear storage used by all nodes. */
- void clear_all_nodes();
+ /* Clear storage used by all nodes. */
+ void clear_all_nodes();
- /* Copy-on-Write Functionality ........ */
+ /* Copy-on-Write Functionality ........ */
- /* For given original ID get ID which is created by CoW system. */
- ID *get_cow_id(const ID *id_orig) const;
+ /* For given original ID get ID which is created by CoW system. */
+ ID *get_cow_id(const ID *id_orig) const;
- /* Core Graph Functionality ........... */
+ /* Core Graph Functionality ........... */
- /* <ID : IDNode> mapping from ID blocks to nodes representing these
- * blocks, used for quick lookups. */
- GHash *id_hash;
+ /* <ID : IDNode> mapping from ID blocks to nodes representing these
+ * blocks, used for quick lookups. */
+ GHash *id_hash;
- /* Ordered list of ID nodes, order matches ID allocation order.
- * Used for faster iteration, especially for areas which are critical to
- * keep exact order of iteration. */
- IDDepsNodes id_nodes;
+ /* Ordered list of ID nodes, order matches ID allocation order.
+ * Used for faster iteration, especially for areas which are critical to
+ * keep exact order of iteration. */
+ IDDepsNodes id_nodes;
- /* Top-level time source node. */
- TimeSourceNode *time_source;
+ /* Top-level time source node. */
+ TimeSourceNode *time_source;
- /* Indicates whether relations needs to be updated. */
- bool need_update;
+ /* Indicates whether relations needs to be updated. */
+ bool need_update;
- /* Indicates which ID types were updated. */
- char id_type_updated[MAX_LIBARRAY];
+ /* Indicates which ID types were updated. */
+ char id_type_updated[MAX_LIBARRAY];
- /* Quick-Access Temp Data ............. */
+ /* Quick-Access Temp Data ............. */
- /* Nodes which have been tagged as "directly modified". */
- GSet *entry_tags;
+ /* Nodes which have been tagged as "directly modified". */
+ GSet *entry_tags;
- /* Convenience Data ................... */
+ /* Convenience Data ................... */
- /* XXX: should be collected after building (if actually needed?) */
- /* All operation nodes, sorted in order of single-thread traversal order. */
- OperationNodes operations;
+ /* XXX: should be collected after building (if actually needed?) */
+ /* All operation nodes, sorted in order of single-thread traversal order. */
+ OperationNodes operations;
- /* Spin lock for threading-critical operations.
- * Mainly used by graph evaluation. */
- SpinLock lock;
+ /* Spin lock for threading-critical operations.
+ * Mainly used by graph evaluation. */
+ SpinLock lock;
- /* Scene, layer, mode this dependency graph is built for. */
- Scene *scene;
- ViewLayer *view_layer;
- eEvaluationMode mode;
+ /* Scene, layer, mode this dependency graph is built for. */
+ Scene *scene;
+ ViewLayer *view_layer;
+ eEvaluationMode mode;
- /* Time at which dependency graph is being or was last evaluated. */
- float ctime;
+ /* Time at which dependency graph is being or was last evaluated. */
+ float ctime;
- /* Evaluated version of datablocks we access a lot.
- * Stored here to save us form doing hash lookup. */
- Scene *scene_cow;
+ /* Evaluated version of datablocks we access a lot.
+ * Stored here to save us form doing hash lookup. */
+ Scene *scene_cow;
- /* Active dependency graph is a dependency graph which is used by the
- * currently active window. When dependency graph is active, it is allowed
- * for evaluation functions to write animation f-curve result, drivers
- * result and other selective things (object matrix?) to original object.
- *
- * This way we simplify operators, which don't need to worry about where
- * to read stuff from. */
- bool is_active;
+ /* Active dependency graph is a dependency graph which is used by the
+ * currently active window. When dependency graph is active, it is allowed
+ * for evaluation functions to write animation f-curve result, drivers
+ * result and other selective things (object matrix?) to original object.
+ *
+ * This way we simplify operators, which don't need to worry about where
+ * to read stuff from. */
+ bool is_active;
- /* NOTE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */
- int debug_flags;
- string debug_name;
+ /* NOTE: Corresponds to G_DEBUG_DEPSGRAPH_* flags. */
+ int debug_flags;
+ string debug_name;
- bool debug_is_evaluating;
+ bool debug_is_evaluating;
- /* Cached list of colliders/effectors for collections and the scene
- * created along with relations, for fast lookup during evaluation. */
- GHash *physics_relations[DEG_PHYSICS_RELATIONS_NUM];
+ /* Cached list of colliders/effectors for collections and the scene
+ * created along with relations, for fast lookup during evaluation. */
+ GHash *physics_relations[DEG_PHYSICS_RELATIONS_NUM];
};
} // namespace DEG