Depsgraph: Rename DAG > DEG functions from depsgraph_query.cc
This commit is contained in:
parent
bdbf4471a6
commit
3b24ece297
|
@ -50,25 +50,25 @@ bool DEG_id_type_tagged(struct Main *bmain, short idtype);
|
|||
short DEG_get_eval_flags_for_id(struct Depsgraph *graph, struct ID *id);
|
||||
|
||||
/* Get scene the despgraph is created for. */
|
||||
struct Scene *DAG_get_scene(struct Depsgraph *graph);
|
||||
struct Scene *DEG_get_scene(struct Depsgraph *graph);
|
||||
|
||||
/* Get scene layer the despgraph is created for. */
|
||||
struct SceneLayer *DAG_get_scene_layer(struct Depsgraph *graph);
|
||||
struct SceneLayer *DEG_get_scene_layer(struct Depsgraph *graph);
|
||||
|
||||
/* Get the object as properly evaluated by depsgraph. */
|
||||
struct Object *DAG_get_object(struct Depsgraph *depsgraph, struct Object *ob);
|
||||
struct Object *DEG_get_object(struct Depsgraph *depsgraph, struct Object *ob);
|
||||
|
||||
/* ************************ DAG iterators ********************* */
|
||||
|
||||
void DAG_objects_iterator_begin(struct BLI_Iterator *iter, void *data_in);
|
||||
void DAG_objects_iterator_next(struct BLI_Iterator *iter);
|
||||
void DAG_objects_iterator_end(struct BLI_Iterator *iter);
|
||||
void DEG_objects_iterator_begin(struct BLI_Iterator *iter, void *data_in);
|
||||
void DEG_objects_iterator_next(struct BLI_Iterator *iter);
|
||||
void DEG_objects_iterator_end(struct BLI_Iterator *iter);
|
||||
|
||||
/* Temporary hacky solution waiting for cow depsgrpah implementation. */
|
||||
/* Temporary hacky solution waiting for cow depsgraph implementation. */
|
||||
#define DEG_OBJECT_ITER(graph_, instance_) \
|
||||
ITER_BEGIN(DAG_objects_iterator_begin, \
|
||||
DAG_objects_iterator_next, \
|
||||
DAG_objects_iterator_end, \
|
||||
ITER_BEGIN(DEG_objects_iterator_begin, \
|
||||
DEG_objects_iterator_next, \
|
||||
DEG_objects_iterator_end, \
|
||||
graph_, Object *, instance_)
|
||||
|
||||
#define DEG_OBJECT_ITER_END \
|
||||
|
|
|
@ -74,22 +74,22 @@ short DEG_get_eval_flags_for_id(Depsgraph *graph, ID *id)
|
|||
return id_node->eval_flags;
|
||||
}
|
||||
|
||||
Scene *DAG_get_scene(Depsgraph *graph)
|
||||
Scene *DEG_get_scene(Depsgraph *graph)
|
||||
{
|
||||
DEG::Depsgraph *deg_graph = reinterpret_cast<DEG::Depsgraph *>(graph);
|
||||
return deg_graph->scene;
|
||||
}
|
||||
|
||||
SceneLayer *DAG_get_scene_layer(Depsgraph *graph)
|
||||
SceneLayer *DEG_get_scene_layer(Depsgraph *graph)
|
||||
{
|
||||
Scene *scene = DAG_get_scene(graph);
|
||||
Scene *scene = DEG_get_scene(graph);
|
||||
if (scene) {
|
||||
return BKE_scene_layer_context_active(scene);
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Object *DAG_get_object(Depsgraph * /*depsgraph*/, Object *ob)
|
||||
Object *DEG_get_object(Depsgraph * /*depsgraph*/, Object *ob)
|
||||
{
|
||||
/* XXX TODO */
|
||||
return ob;
|
||||
|
@ -97,41 +97,41 @@ Object *DAG_get_object(Depsgraph * /*depsgraph*/, Object *ob)
|
|||
|
||||
/* ************************ DAG ITERATORS ********************* */
|
||||
|
||||
typedef struct DAGObjectsIteratorData {
|
||||
typedef struct DEGObjectsIteratorData {
|
||||
Depsgraph *graph;
|
||||
Scene *scene;
|
||||
SceneLayer *scene_layer;
|
||||
Base *base;
|
||||
int flag;
|
||||
} DAGObjectsIteratorData;
|
||||
} DEGObjectsIteratorData;
|
||||
|
||||
void DAG_objects_iterator_begin(BLI_Iterator *iter, void *data_in)
|
||||
void DEG_objects_iterator_begin(BLI_Iterator *iter, void *data_in)
|
||||
{
|
||||
SceneLayer *scene_layer;
|
||||
Depsgraph *graph = (Depsgraph *) data_in;
|
||||
DAGObjectsIteratorData *data = (DAGObjectsIteratorData *)
|
||||
MEM_callocN(sizeof(DAGObjectsIteratorData), __func__);
|
||||
DEGObjectsIteratorData *data = (DEGObjectsIteratorData *)
|
||||
MEM_callocN(sizeof(DEGObjectsIteratorData), __func__);
|
||||
iter->data = data;
|
||||
iter->valid = true;
|
||||
|
||||
data->graph = graph;
|
||||
data->scene = DAG_get_scene(graph);
|
||||
scene_layer = DAG_get_scene_layer(graph);
|
||||
data->scene = DEG_get_scene(graph);
|
||||
scene_layer = DEG_get_scene_layer(graph);
|
||||
data->flag = ~(BASE_FROM_SET);
|
||||
|
||||
Base base = {(Base *)scene_layer->object_bases.first, NULL};
|
||||
data->base = &base;
|
||||
DAG_objects_iterator_next(iter);
|
||||
DEG_objects_iterator_next(iter);
|
||||
}
|
||||
|
||||
void DAG_objects_iterator_next(BLI_Iterator *iter)
|
||||
void DEG_objects_iterator_next(BLI_Iterator *iter)
|
||||
{
|
||||
DAGObjectsIteratorData *data = (DAGObjectsIteratorData *)iter->data;
|
||||
DEGObjectsIteratorData *data = (DEGObjectsIteratorData *)iter->data;
|
||||
Base *base = data->base->next;
|
||||
|
||||
while (base) {
|
||||
if ((base->flag & BASE_VISIBLED) != 0) {
|
||||
Object *ob = DAG_get_object(data->graph, base->object);
|
||||
Object *ob = DEG_get_object(data->graph, base->object);
|
||||
iter->current = ob;
|
||||
|
||||
/* Flushing depsgraph data. */
|
||||
|
@ -155,7 +155,7 @@ void DAG_objects_iterator_next(BLI_Iterator *iter)
|
|||
|
||||
Base base = {(Base *)scene_layer->object_bases.first, NULL};
|
||||
data->base = &base;
|
||||
DAG_objects_iterator_next(iter);
|
||||
DEG_objects_iterator_next(iter);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -163,9 +163,9 @@ void DAG_objects_iterator_next(BLI_Iterator *iter)
|
|||
iter->valid = false;
|
||||
}
|
||||
|
||||
void DAG_objects_iterator_end(BLI_Iterator *iter)
|
||||
void DEG_objects_iterator_end(BLI_Iterator *iter)
|
||||
{
|
||||
DAGObjectsIteratorData *data = (DAGObjectsIteratorData *)iter->data;
|
||||
DEGObjectsIteratorData *data = (DEGObjectsIteratorData *)iter->data;
|
||||
if (data) {
|
||||
MEM_freeN(data);
|
||||
}
|
||||
|
|
|
@ -2821,8 +2821,8 @@ void DRW_draw_render_loop(
|
|||
struct Depsgraph *graph,
|
||||
ARegion *ar, View3D *v3d)
|
||||
{
|
||||
Scene *scene = DAG_get_scene(graph);
|
||||
SceneLayer *sl = DAG_get_scene_layer(graph);
|
||||
Scene *scene = DEG_get_scene(graph);
|
||||
SceneLayer *sl = DEG_get_scene_layer(graph);
|
||||
RegionView3D *rv3d = ar->regiondata;
|
||||
|
||||
bool cache_is_dirty;
|
||||
|
@ -2944,8 +2944,8 @@ void DRW_draw_select_loop(
|
|||
ARegion *ar, View3D *v3d,
|
||||
bool UNUSED(use_obedit_skip), bool UNUSED(use_nearest), const rcti *rect)
|
||||
{
|
||||
Scene *scene = DAG_get_scene(graph);
|
||||
SceneLayer *sl = DAG_get_scene_layer(graph);
|
||||
Scene *scene = DEG_get_scene(graph);
|
||||
SceneLayer *sl = DEG_get_scene_layer(graph);
|
||||
#ifndef USE_GPU_SELECT
|
||||
UNUSED_VARS(vc, scene, sl, v3d, ar, rect);
|
||||
#else
|
||||
|
@ -3057,8 +3057,8 @@ void DRW_draw_depth_loop(
|
|||
Depsgraph *graph,
|
||||
ARegion *ar, View3D *v3d)
|
||||
{
|
||||
Scene *scene = DAG_get_scene(graph);
|
||||
SceneLayer *sl = DAG_get_scene_layer(graph);
|
||||
Scene *scene = DEG_get_scene(graph);
|
||||
SceneLayer *sl = DEG_get_scene_layer(graph);
|
||||
RegionView3D *rv3d = ar->regiondata;
|
||||
|
||||
/* backup (_never_ use rv3d->viewport) */
|
||||
|
|
|
@ -695,7 +695,7 @@ void ED_view3d_draw_depth(
|
|||
struct Depsgraph *graph,
|
||||
ARegion *ar, View3D *v3d, bool alphaoverride)
|
||||
{
|
||||
Scene *scene = DAG_get_scene(graph);
|
||||
Scene *scene = DEG_get_scene(graph);
|
||||
RegionView3D *rv3d = ar->regiondata;
|
||||
|
||||
short zbuf = v3d->zbuf;
|
||||
|
|
|
@ -4937,7 +4937,7 @@ void ED_view3d_autodist_init(
|
|||
break;
|
||||
case 1:
|
||||
{
|
||||
Scene *scene = DAG_get_scene(graph);
|
||||
Scene *scene = DEG_get_scene(graph);
|
||||
ED_view3d_draw_depth_gpencil(scene, ar, v3d);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -655,7 +655,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, SceneLayer *sl, Object *obe
|
|||
/* 1. draw shadow mesh */
|
||||
|
||||
if (sima->flag & SI_DRAWSHADOW) {
|
||||
Object *ob_cage = DAG_get_object(depsgraph, obedit);
|
||||
Object *ob_cage = DEG_get_object(depsgraph, obedit);
|
||||
/* XXX TODO: Need to check if shadow mesh is different than original mesh. */
|
||||
bool is_cage_like_final_meshes = (ob_cage == obedit);
|
||||
|
||||
|
|
|
@ -88,19 +88,19 @@ static void rna_Depsgraph_objects_begin(CollectionPropertyIterator *iter, Pointe
|
|||
{
|
||||
Depsgraph *graph = (Depsgraph *)ptr->data;
|
||||
iter->internal.custom = MEM_callocN(sizeof(BLI_Iterator), __func__);
|
||||
DAG_objects_iterator_begin(iter->internal.custom, graph);
|
||||
DEG_objects_iterator_begin(iter->internal.custom, graph);
|
||||
iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
|
||||
}
|
||||
|
||||
static void rna_Depsgraph_objects_next(CollectionPropertyIterator *iter)
|
||||
{
|
||||
DAG_objects_iterator_next(iter->internal.custom);
|
||||
DEG_objects_iterator_next(iter->internal.custom);
|
||||
iter->valid = ((BLI_Iterator *)iter->internal.custom)->valid;
|
||||
}
|
||||
|
||||
static void rna_Depsgraph_objects_end(CollectionPropertyIterator *iter)
|
||||
{
|
||||
DAG_objects_iterator_end(iter->internal.custom);
|
||||
DEG_objects_iterator_end(iter->internal.custom);
|
||||
MEM_freeN(iter->internal.custom);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue