From cb5bfb32ba01705cf88e2c21eb61f7b9b24688da Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Mon, 29 Jun 2020 15:19:56 +0200 Subject: Depsgraph: introduce blender::deg namespace Reviewers: sergey Differential Revision: https://developer.blender.org/D8150 --- source/blender/depsgraph/intern/depsgraph_query.cc | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'source/blender/depsgraph/intern/depsgraph_query.cc') diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc b/source/blender/depsgraph/intern/depsgraph_query.cc index 3c760e71197..0b6014c18f1 100644 --- a/source/blender/depsgraph/intern/depsgraph_query.cc +++ b/source/blender/depsgraph/intern/depsgraph_query.cc @@ -47,39 +47,41 @@ #include "intern/eval/deg_eval_copy_on_write.h" #include "intern/node/deg_node_id.h" +namespace deg = blender::deg; + struct Scene *DEG_get_input_scene(const Depsgraph *graph) { - const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + const deg::Depsgraph *deg_graph = reinterpret_cast(graph); return deg_graph->scene; } struct ViewLayer *DEG_get_input_view_layer(const Depsgraph *graph) { - const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + const deg::Depsgraph *deg_graph = reinterpret_cast(graph); return deg_graph->view_layer; } eEvaluationMode DEG_get_mode(const Depsgraph *graph) { - const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + const deg::Depsgraph *deg_graph = reinterpret_cast(graph); return deg_graph->mode; } float DEG_get_ctime(const Depsgraph *graph) { - const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + const deg::Depsgraph *deg_graph = reinterpret_cast(graph); return deg_graph->ctime; } bool DEG_id_type_updated(const Depsgraph *graph, short id_type) { - const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + const deg::Depsgraph *deg_graph = reinterpret_cast(graph); return deg_graph->id_type_updated[BKE_idtype_idcode_to_index(id_type)] != 0; } bool DEG_id_type_any_updated(const Depsgraph *graph) { - const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + const deg::Depsgraph *deg_graph = reinterpret_cast(graph); /* Loop over all ID types. */ for (int id_type_index = 0; id_type_index < MAX_LIBARRAY; id_type_index++) { @@ -93,7 +95,7 @@ bool DEG_id_type_any_updated(const Depsgraph *graph) bool DEG_id_type_any_exists(const Depsgraph *depsgraph, short id_type) { - const DEG::Depsgraph *deg_graph = reinterpret_cast(depsgraph); + const deg::Depsgraph *deg_graph = reinterpret_cast(depsgraph); return deg_graph->id_type_exist[BKE_idtype_idcode_to_index(id_type)] != 0; } @@ -108,8 +110,8 @@ uint32_t DEG_get_eval_flags_for_id(const Depsgraph *graph, ID *id) return 0; } - const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); - const DEG::IDNode *id_node = deg_graph->find_id_node(DEG_get_original_id(id)); + const deg::Depsgraph *deg_graph = reinterpret_cast(graph); + const deg::IDNode *id_node = deg_graph->find_id_node(DEG_get_original_id(id)); if (id_node == nullptr) { /* TODO(sergey): Does it mean we need to check set scene? */ return 0; @@ -131,8 +133,8 @@ void DEG_get_customdata_mask_for_object(const Depsgraph *graph, return; } - const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); - const DEG::IDNode *id_node = deg_graph->find_id_node(DEG_get_original_id(&ob->id)); + const deg::Depsgraph *deg_graph = reinterpret_cast(graph); + const deg::IDNode *id_node = deg_graph->find_id_node(DEG_get_original_id(&ob->id)); if (id_node == nullptr) { /* TODO(sergey): Does it mean we need to check set scene? */ return; @@ -147,17 +149,17 @@ void DEG_get_customdata_mask_for_object(const Depsgraph *graph, Scene *DEG_get_evaluated_scene(const Depsgraph *graph) { - const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + const deg::Depsgraph *deg_graph = reinterpret_cast(graph); Scene *scene_cow = deg_graph->scene_cow; /* TODO(sergey): Shall we expand data-block here? Or is it OK to assume * that caller is OK with just a pointer in case scene is not updated yet? */ - BLI_assert(scene_cow != nullptr && DEG::deg_copy_on_write_is_expanded(&scene_cow->id)); + BLI_assert(scene_cow != nullptr && deg::deg_copy_on_write_is_expanded(&scene_cow->id)); return scene_cow; } ViewLayer *DEG_get_evaluated_view_layer(const Depsgraph *graph) { - const DEG::Depsgraph *deg_graph = reinterpret_cast(graph); + const deg::Depsgraph *deg_graph = reinterpret_cast(graph); Scene *scene_cow = DEG_get_evaluated_scene(graph); if (scene_cow == nullptr) { return nullptr; /* Happens with new, not-yet-built/evaluated graphes. */ @@ -184,8 +186,8 @@ ID *DEG_get_evaluated_id(const Depsgraph *depsgraph, ID *id) /* TODO(sergey): This is a duplicate of Depsgraph::get_cow_id(), * but here we never do assert, since we don't know nature of the * incoming ID data-block. */ - const DEG::Depsgraph *deg_graph = (const DEG::Depsgraph *)depsgraph; - const DEG::IDNode *id_node = deg_graph->find_id_node(id); + const deg::Depsgraph *deg_graph = (const deg::Depsgraph *)depsgraph; + const deg::IDNode *id_node = deg_graph->find_id_node(id); if (id_node == nullptr) { return id; } @@ -309,7 +311,7 @@ bool DEG_is_evaluated_object(const Object *object) bool DEG_is_fully_evaluated(const struct Depsgraph *depsgraph) { - const DEG::Depsgraph *deg_graph = (const DEG::Depsgraph *)depsgraph; + const deg::Depsgraph *deg_graph = (const deg::Depsgraph *)depsgraph; /* Check whether relations are up to date. */ if (deg_graph->need_update) { return false; -- cgit v1.2.3