2
* $Id: depsgraph.c,v 1.2 2005/05/21 21:52:58 lukep Exp $
4
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version. The Blender
10
* Foundation also sells licenses for use in proprietary software under
11
* the Blender License. See http://www.blender.org/BL/ for information
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software Foundation,
21
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23
* The Original Code is Copyright (C) 2004 Blender Foundation.
24
* All rights reserved.
26
* Contributor(s): none yet.
28
* ***** END GPL/BL DUAL LICENSE BLOCK *****
36
#include "BLI_winstuff.h"
39
//#include "BMF_Api.h"
41
#include "BLI_blenlib.h"
42
#include "BLI_arithb.h"
45
#include "DNA_object_types.h"
46
#include "DNA_oops_types.h"
47
#include "DNA_scene_types.h"
48
#include "DNA_action_types.h"
49
#include "DNA_screen_types.h"
50
#include "DNA_space_types.h"
51
#include "DNA_view2d_types.h"
53
#include "BKE_utildefines.h"
54
#include "BKE_global.h"
56
#include "MEM_guardedalloc.h"
60
#include "depsgraph_private.h"
62
/* Queue and stack operations for dag traversal
64
* the queue store a list of freenodes to avoid successives alloc/dealloc
67
DagNodeQueue * queue_create (int slots)
70
DagNodeQueueElem * elem;
73
queue = MEM_mallocN(sizeof(DagNodeQueue),"DAG queue");
74
queue->freenodes = MEM_mallocN(sizeof(DagNodeQueue),"DAG queue");
77
queue->first = queue->last = NULL;
78
elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem3");
81
queue->freenodes->first = queue->freenodes->last = elem;
83
for (i = 1; i <slots;i++) {
84
elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem4");
87
queue->freenodes->last->next = elem;
88
queue->freenodes->last = elem;
90
queue->freenodes->count = slots;
94
void queue_raz(DagNodeQueue *queue)
96
DagNodeQueueElem * elem;
99
if (queue->freenodes->last)
100
queue->freenodes->last->next = elem;
102
queue->freenodes->first = queue->freenodes->last = elem;
105
queue->freenodes->count++;
109
queue->freenodes->count++;
111
queue->freenodes->last = elem;
115
void queue_delete(DagNodeQueue *queue)
117
DagNodeQueueElem * elem;
118
DagNodeQueueElem * temp;
127
elem = queue->freenodes->first;
134
MEM_freeN(queue->freenodes);
138
/* insert in queue, remove in front */
139
void push_queue(DagNodeQueue *queue, DagNode *node)
141
DagNodeQueueElem * elem;
145
fprintf(stderr,"pushing null node \n");
148
/*fprintf(stderr,"BFS push : %s %d\n",((ID *) node->ob)->name, queue->count);*/
150
elem = queue->freenodes->first;
152
queue->freenodes->first = elem->next;
153
if ( queue->freenodes->last == elem) {
154
queue->freenodes->last = NULL;
155
queue->freenodes->first = NULL;
157
queue->freenodes->count--;
158
} else { /* alllocating more */
159
elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem1");
162
queue->freenodes->first = queue->freenodes->last = elem;
164
for (i = 1; i <DAGQUEUEALLOC;i++) {
165
elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem2");
168
queue->freenodes->last->next = elem;
169
queue->freenodes->last = elem;
171
queue->freenodes->count = DAGQUEUEALLOC;
173
elem = queue->freenodes->first;
174
queue->freenodes->first = elem->next;
178
if (queue->last != NULL)
179
queue->last->next = elem;
181
if (queue->first == NULL) {
188
/* insert in front, remove in front */
189
void push_stack(DagNodeQueue *queue, DagNode *node)
191
DagNodeQueueElem * elem;
194
elem = queue->freenodes->first;
196
queue->freenodes->first = elem->next;
197
if ( queue->freenodes->last == elem) {
198
queue->freenodes->last = NULL;
199
queue->freenodes->first = NULL;
201
queue->freenodes->count--;
202
} else { /* alllocating more */
203
elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem1");
206
queue->freenodes->first = queue->freenodes->last = elem;
208
for (i = 1; i <DAGQUEUEALLOC;i++) {
209
elem = MEM_mallocN(sizeof(DagNodeQueueElem),"DAG queue elem2");
212
queue->freenodes->last->next = elem;
213
queue->freenodes->last = elem;
215
queue->freenodes->count = DAGQUEUEALLOC;
217
elem = queue->freenodes->first;
218
queue->freenodes->first = elem->next;
220
elem->next = queue->first;
223
if (queue->last == NULL)
229
DagNode * pop_queue(DagNodeQueue *queue)
231
DagNodeQueueElem * elem;
236
queue->first = elem->next;
237
if (queue->last == elem) {
242
if (queue->freenodes->last)
243
queue->freenodes->last->next=elem;
244
queue->freenodes->last=elem;
245
if (queue->freenodes->first == NULL)
246
queue->freenodes->first=elem;
250
queue->freenodes->count++;
253
fprintf(stderr,"return null \n");
258
void *pop_ob_queue(struct DagNodeQueue *queue) {
259
return(pop_queue(queue)->ob);
262
DagNode * get_top_node_queue(DagNodeQueue *queue)
264
return queue->first->node;
267
int queue_count(struct DagNodeQueue *queue){
272
DagForest * dag_init()
276
forest = MEM_mallocN(sizeof(DagForest),"DAG root");
277
forest->DagNode.first = NULL;
278
forest->DagNode.last = NULL;
279
forest->numNodes = 0;
283
struct DagForest *build_dag(struct Scene *sce, short mask)
302
// add base node for scene. scene is always the first node in DAG
303
scenenode = dag_add_node(dag, sce);
305
/* targets in object struct yet to be added. should even they ?
312
base = sce->base.first;
313
while(base) { // add all objects in any case
315
ob= (Object *) base->object;
317
node = dag_get_node(dag,ob);
319
if ((ob->data) && (mask&DAG_RL_DATA_MASK)) {
320
node2 = dag_get_node(dag,ob->data);
321
dag_add_relation(dag,node,node2,DAG_RL_DATA);
322
node2->first_ancestor = ob;
323
node2->ancestor_count += 1;
325
if ((ob->type == OB_ARMATURE) && (mask&DAG_RL_DATA_CONSTRAINT_MASK)) { // add armature constraints to datas
331
for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next){
332
for (con = pchan->constraints.first; con; con=con->next){
333
if (constraint_has_target(con)) {
334
target = get_constraint_target(con);
335
if (strcmp(target->id.name, ob->id.name) != 0) {
336
//fprintf(stderr,"armature target :%s \n", target->id.name);
337
node3 = dag_get_node(dag,target);
338
dag_add_relation(dag,node3,node2,DAG_RL_CONSTRAINT);
346
if ((ob->hooks.first) && (mask&DAG_RL_HOOK)) {
349
for(hook= ob->hooks.first; hook; hook= hook->next) {
351
node3 = dag_get_node(dag,hook->parent);
352
dag_add_relation(dag,node3,node2,DAG_RL_HOOK);
356
} else { // add armature constraints to object itself
357
if ((ob->type == OB_ARMATURE) && (mask&DAG_RL_DATA_CONSTRAINT_MASK)) {
363
for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next){
364
for (con = pchan->constraints.first; con; con=con->next){
365
if (constraint_has_target(con)) {
366
target = get_constraint_target(con);
367
if (strcmp(target->id.name, ob->id.name) != 0) {
368
//fprintf(stderr,"armature target :%s \n", target->id.name);
369
node3 = dag_get_node(dag,target);
370
dag_add_relation(dag,node3,node,DAG_RL_CONSTRAINT);
377
if ((ob->hooks.first) && (mask&DAG_RL_HOOK)) {
380
for(hook= ob->hooks.first; hook; hook= hook->next) {
382
node3 = dag_get_node(dag,hook->parent);
383
dag_add_relation(dag,node3,node,DAG_RL_HOOK);
389
if ((ob->parent) && (mask&DAG_RL_PARENT_MASK)){
390
node2 = dag_get_node(dag,ob->parent);
391
dag_add_relation(dag,node2,node,DAG_RL_PARENT);
394
if ((ob->track) && (mask&DAG_RL_TRACK_MASK)){
395
node2 = dag_get_node(dag,ob->track);
396
dag_add_relation(dag,node2,node,DAG_RL_TRACK);
400
if ((ob->path) && (mask&DAG_RL_PATH_MASK)){
401
node2 = dag_get_node(dag,ob->track);
402
dag_add_relation(dag,node2,node,DAG_RL_PATH);
407
/* Count constraints */
408
if (mask & DAG_RL_CONSTRAINT_MASK) {
410
for (con = ob->constraints.first; con; con=con->next){
411
if (constraint_has_target(con)) {
412
node2 = dag_get_node(dag,get_constraint_target(con));
413
dag_add_relation(dag,node2,node,DAG_RL_CONSTRAINT);
422
dag_add_relation(dag,scenenode,node,DAG_RL_SCENE);
428
// cycle detection and solving
429
// solve_cycles(dag);
435
void free_forest(DagForest *Dag)
436
{ /* remove all nodes and deps */
440
DagNode *itN = Dag->DagNode.first;
453
Dag->DagNode.first = NULL;
454
Dag->DagNode.last = NULL;
459
DagNode * dag_find_node (DagForest *forest,void * fob)
461
DagNode *node = forest->DagNode.first;
471
/* no checking of existance, use dag_find_node first or dag_get_node */
472
DagNode * dag_add_node (DagForest *forest,void * fob)
476
node = MEM_mallocN(sizeof(DagNode),"DAG node");
479
node->color = DAG_WHITE;
486
node->first_ancestor = NULL;
487
node->ancestor_count = 0;
489
node->type = GS(((ID *) fob)->name);
490
if (forest->numNodes) {
491
((DagNode *) forest->DagNode.last)->next = node;
492
forest->DagNode.last = node;
495
forest->DagNode.last = node;
496
forest->DagNode.first = node;
497
forest->numNodes = 1;
503
DagNode * dag_get_node (DagForest *forest,void * fob)
507
node = dag_find_node (forest, fob);
509
node = dag_add_node(forest, fob);
515
DagNode * dag_get_sub_node (DagForest *forest,void * fob)
518
DagAdjList *mainchild, *prev=NULL;
520
mainchild = ((DagNode *) forest->DagNode.first)->child;
521
/* remove from first node (scene) adj list if present */
523
if (mainchild->node == fob) {
525
prev->next = mainchild->next;
526
MEM_freeN(mainchild);
529
((DagNode *) forest->DagNode.first)->child = mainchild->next;
530
MEM_freeN(mainchild);
535
mainchild = mainchild->next;
537
node = dag_find_node (forest, fob);
539
node = dag_add_node(forest, fob);
543
void dag_add_relation(DagForest *forest, DagNode *fob1, DagNode *fob2, dag_rel_type rel)
545
DagAdjList *itA = fob1->child;
547
while (itA) { /* search if relation exist already */
548
if (itA->node == fob2) {
549
if (itA->type == rel) {
556
/* create new relation and insert at head */
557
itA = MEM_mallocN(sizeof(DagAdjList),"DAG adj list");
561
itA->next = fob1->child;
567
* MainDAG is the DAG of all objects in current scene
568
* used only for drawing there is one also in each scene
570
static DagForest * MainDag = NULL;
572
DagForest *getMainDag(void)
578
void setMainDag(DagForest *dag)
586
* in theory we should sweep the whole array
587
* but in our case the first node is the scene
588
* and is linked to every other object
590
* for general case we will need to add outer loop
594
* ToDo : change pos kludge
597
/* adjust levels for drawing in oops space */
601
DagNodeQueue *nqueue;
607
/* fprintf(stderr,"starting BFS \n ------------\n"); */
608
nqueue = queue_create(DAGQUEUEALLOC);
609
for ( i=0; i<50; i++)
613
* dagnode.first is alway the root (scene)
615
node = MainDag->DagNode.first;
617
node->color = DAG_WHITE;
618
node->BFS_dist = 9999;
623
node = MainDag->DagNode.first;
624
if (node->color == DAG_WHITE) {
625
node->color = DAG_GRAY;
627
push_queue(nqueue,node);
628
while(nqueue->count) {
629
node = pop_queue(nqueue);
631
minheight = pos[node->BFS_dist];
634
if((itA->node->color == DAG_WHITE) ) {
635
itA->node->color = DAG_GRAY;
636
itA->node->BFS_dist = node->BFS_dist + 1;
637
itA->node->k = minheight;
638
push_queue(nqueue,itA->node);
642
fprintf(stderr,"bfs not dag tree edge color :%i \n",itA->node->color);
648
if (pos[node->BFS_dist] > node->k ) {
649
pos[node->BFS_dist] += 1;
650
node->k = pos[node->BFS_dist];
652
pos[node->BFS_dist] = node->k +1;
654
set_node_xy(node, DEPSX*2*node->BFS_dist, pos[node->BFS_dist]*DEPSY*2);
655
node->color = DAG_BLACK;
657
fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
661
queue_delete(nqueue);
664
int pre_and_post_BFS(DagForest *dag, short mask, graph_action_func pre_func, graph_action_func post_func, void **data) {
667
node = dag->DagNode.first;
668
return pre_and_post_source_BFS(dag, mask, node, pre_func, post_func, data);
672
int pre_and_post_source_BFS(DagForest *dag, short mask, DagNode *source, graph_action_func pre_func, graph_action_func post_func, void **data)
675
DagNodeQueue *nqueue;
678
/* fprintf(stderr,"starting BFS \n ------------\n"); */
681
* dagnode.first is alway the root (scene)
683
node = dag->DagNode.first;
684
nqueue = queue_create(DAGQUEUEALLOC);
686
node->color = DAG_WHITE;
687
node->BFS_dist = 9999;
692
if (node->color == DAG_WHITE) {
693
node->color = DAG_GRAY;
695
pre_func(node->ob,data);
697
while(nqueue->count) {
698
node = pop_queue(nqueue);
702
if((itA->node->color == DAG_WHITE) && (itA->type & mask)) {
703
itA->node->color = DAG_GRAY;
704
itA->node->BFS_dist = node->BFS_dist + 1;
705
push_queue(nqueue,itA->node);
706
pre_func(node->ob,data);
709
else { // back or cross edge
714
post_func(node->ob,data);
715
node->color = DAG_BLACK;
717
fprintf(stderr,"BFS node : %20s %i %5.0f %5.0f\n",((ID *) node->ob)->name,node->BFS_dist, node->x, node->y);
721
queue_delete(nqueue);
725
/* non recursive version of DFS, return queue -- outer loop present to catch odd cases (first level cycles)*/
726
DagNodeQueue * graph_dfs(void)
729
DagNodeQueue *nqueue;
730
DagNodeQueue *retqueue;
740
*fprintf(stderr,"starting DFS \n ------------\n");
742
nqueue = queue_create(DAGQUEUEALLOC);
743
retqueue = queue_create(MainDag->numNodes);
744
for ( i=0; i<50; i++)
748
* dagnode.first is alway the root (scene)
750
node = MainDag->DagNode.first;
752
node->color = DAG_WHITE;
753
node->DFS_dist = 9999;
754
node->DFS_dvtm = node->DFS_fntm = 9999;
761
node = MainDag->DagNode.first;
764
if (node->color == DAG_WHITE) {
765
node->color = DAG_GRAY;
767
node->DFS_dvtm = time;
769
push_stack(nqueue,node);
771
while(nqueue->count) {
772
//graph_print_queue(nqueue);
775
node = get_top_node_queue(nqueue);
777
minheight = pos[node->DFS_dist];
781
if((itA->node->color == DAG_WHITE) ) {
782
itA->node->DFS_dvtm = time;
783
itA->node->color = DAG_GRAY;
786
itA->node->DFS_dist = node->DFS_dist + 1;
787
itA->node->k = minheight;
788
push_stack(nqueue,itA->node);
792
if (itA->node->color == DAG_GRAY) { // back edge
793
fprintf(stderr,"dfs back edge :%15s %15s \n",((ID *) node->ob)->name, ((ID *) itA->node->ob)->name);
795
} else if (itA->node->color == DAG_BLACK) {
797
/* already processed node but we may want later to change distance either to shorter to longer.
798
* DFS_dist is the first encounter
800
/*if (node->DFS_dist >= itA->node->DFS_dist)
801
itA->node->DFS_dist = node->DFS_dist + 1;
803
fprintf(stderr,"dfs forward or cross edge :%15s %i-%i %15s %i-%i \n",
804
((ID *) node->ob)->name,
807
((ID *) itA->node->ob)->name,
809
itA->node->DFS_fntm);
812
fprintf(stderr,"dfs unknown edge \n");
818
node = pop_queue(nqueue);
819
node->color = DAG_BLACK;
821
node->DFS_fntm = time;
823
if (node->DFS_dist > maxpos)
824
maxpos = node->DFS_dist;
825
if (pos[node->DFS_dist] > node->k ) {
826
pos[node->DFS_dist] += 1;
827
node->k = pos[node->DFS_dist];
829
pos[node->DFS_dist] = node->k +1;
831
set_node_xy(node, DEPSX*2*node->DFS_dist, pos[node->DFS_dist]*DEPSY*2);
834
fprintf(stderr,"DFS node : %20s %i %i %i %i\n",((ID *) node->ob)->name,node->BFS_dist, node->DFS_dist, node->DFS_dvtm, node->DFS_fntm );
836
push_stack(retqueue,node);
843
// fprintf(stderr,"i size : %i \n", maxpos);
845
queue_delete(nqueue);
849
int pre_and_post_DFS(DagForest *dag, short mask, graph_action_func pre_func, graph_action_func post_func, void **data) {
852
node = dag->DagNode.first;
853
return pre_and_post_source_DFS(dag, mask, node, pre_func, post_func, data);
856
int pre_and_post_source_DFS(DagForest *dag, short mask, DagNode *source, graph_action_func pre_func, graph_action_func post_func, void **data)
859
DagNodeQueue *nqueue;
865
*fprintf(stderr,"starting DFS \n ------------\n");
867
nqueue = queue_create(DAGQUEUEALLOC);
870
* dagnode.first is alway the root (scene)
872
node = dag->DagNode.first;
874
node->color = DAG_WHITE;
875
node->DFS_dist = 9999;
876
node->DFS_dvtm = node->DFS_fntm = 9999;
885
if (node->color == DAG_WHITE) {
886
node->color = DAG_GRAY;
888
node->DFS_dvtm = time;
890
push_stack(nqueue,node);
891
pre_func(node->ob,data);
893
while(nqueue->count) {
895
node = get_top_node_queue(nqueue);
899
if((itA->node->color == DAG_WHITE) && (itA->type & mask) ) {
900
itA->node->DFS_dvtm = time;
901
itA->node->color = DAG_GRAY;
904
itA->node->DFS_dist = node->DFS_dist + 1;
905
push_stack(nqueue,itA->node);
906
pre_func(node->ob,data);
911
if (itA->node->color == DAG_GRAY) {// back edge
914
// else if (itA->node->color == DAG_BLACK) { // cross or forward
921
node = pop_queue(nqueue);
922
node->color = DAG_BLACK;
924
node->DFS_fntm = time;
926
post_func(node->ob,data);
932
queue_delete(nqueue);
936
// sort the base list on place
937
void topo_sort_baselist(struct Scene *sce){
939
DagNodeQueue *nqueue;
946
tempbase.first= tempbase.last= 0;
948
build_dag(sce,DAG_RL_ALL_BUT_DATA_MASK);
950
nqueue = queue_create(DAGQUEUEALLOC);
952
node = sce->theDag->DagNode.first;
954
node->color = DAG_WHITE;
960
node = sce->theDag->DagNode.first;
962
node->color = DAG_GRAY;
964
push_stack(nqueue,node);
966
while(nqueue->count) {
969
node = get_top_node_queue(nqueue);
973
if((itA->node->color == DAG_WHITE) ) {
974
itA->node->DFS_dvtm = time;
975
itA->node->color = DAG_GRAY;
978
push_stack(nqueue,itA->node);
987
node = pop_queue(nqueue);
988
if (node->ob == sce) // we are done
990
node->color = DAG_BLACK;
993
base = sce->base.first;
994
while (base->object != node->ob)
996
BLI_remlink(&sce->base,base);
997
BLI_addhead(&tempbase,base);
1002
// temporal correction for circular dependancies
1003
base = sce->base.first;
1005
BLI_remlink(&sce->base,base);
1006
BLI_addhead(&tempbase,base);
1007
base = sce->base.first;
1010
sce->base = tempbase;
1011
queue_delete(nqueue);
1015
// used to get the obs owning a datablock
1016
struct DagNodeQueue *get_obparents(struct DagForest *dag, void *ob)
1018
DagNode * node, *node1;
1019
DagNodeQueue *nqueue;
1022
node = dag_find_node(dag,ob);
1023
if (node->ancestor_count == 1) { // simple case
1024
nqueue = queue_create(1);
1025
push_queue(nqueue,node);
1026
} else { // need to go over the whole dag for adj list
1027
nqueue = queue_create(node->ancestor_count);
1029
node1 = dag->DagNode.first;
1031
if (node1->DFS_fntm > node->DFS_fntm) { // a parent is finished after child. must check adj list
1033
while(itA != NULL) {
1034
if ((itA->node == node) && (itA->type == DAG_RL_DATA)) {
1035
push_queue(nqueue,node);
1040
node1 = node1->next;
1046
struct DagNodeQueue *get_first_ancestors(struct DagForest *dag, void *ob)
1048
DagNode * node, *node1;
1049
DagNodeQueue *nqueue;
1052
node = dag_find_node(dag,ob);
1054
// need to go over the whole dag for adj list
1055
nqueue = queue_create(node->ancestor_count);
1057
node1 = dag->DagNode.first;
1059
if (node1->DFS_fntm > node->DFS_fntm) {
1061
while(itA != NULL) {
1062
if (itA->node == node) {
1063
push_queue(nqueue,node);
1068
node1 = node1->next;
1074
// standard DFS list
1075
struct DagNodeQueue *get_all_childs(struct DagForest *dag, void *ob)
1078
DagNodeQueue *nqueue;
1079
DagNodeQueue *retqueue;
1084
nqueue = queue_create(DAGQUEUEALLOC);
1085
retqueue = queue_create(MainDag->numNodes);
1087
node = dag->DagNode.first;
1089
node->color = DAG_WHITE;
1095
node = dag_find_node(dag,ob);
1097
node->color = DAG_GRAY;
1099
push_stack(nqueue,node);
1101
while(nqueue->count) {
1104
node = get_top_node_queue(nqueue);
1107
while(itA != NULL) {
1108
if((itA->node->color == DAG_WHITE) ) {
1109
itA->node->DFS_dvtm = time;
1110
itA->node->color = DAG_GRAY;
1113
push_stack(nqueue,itA->node);
1121
node = pop_queue(nqueue);
1122
node->color = DAG_BLACK;
1125
push_stack(retqueue,node);
1129
queue_delete(nqueue);
1133
dag_rel_type are_obs_related(struct DagForest *dag, void *ob1, void *ob2) {
1137
node = dag_find_node(dag,ob1);
1140
while(itA != NULL) {
1141
if((itA->node->ob == ob2) ) {
1142
return itA->node->type;
1146
return DAG_NO_RELATION;
1149
int is_acyclic( DagForest *dag) {
1150
return dag->is_acyclic;
1153
void set_node_xy(DagNode *node, float x, float y)
1160
/* debug test functions */
1162
void graph_print_queue(DagNodeQueue *nqueue)
1164
DagNodeQueueElem *queueElem;
1166
queueElem = nqueue->first;
1168
fprintf(stderr,"** %s %i %i-%i ",((ID *) queueElem->node->ob)->name,queueElem->node->color,queueElem->node->DFS_dvtm,queueElem->node->DFS_fntm);
1169
queueElem = queueElem->next;
1171
fprintf(stderr,"\n");
1174
void graph_print_queue_dist(DagNodeQueue *nqueue)
1176
DagNodeQueueElem *queueElem;
1179
queueElem = nqueue->first;
1180
max = queueElem->node->DFS_fntm;
1183
fprintf(stderr,"** %25s %2.2i-%2.2i ",((ID *) queueElem->node->ob)->name,queueElem->node->DFS_dvtm,queueElem->node->DFS_fntm);
1184
while (count < queueElem->node->DFS_dvtm-1) { fputc(' ',stderr); count++;}
1186
while (count < queueElem->node->DFS_fntm-2) { fputc('-',stderr); count++;}
1190
queueElem = queueElem->next;
1192
fprintf(stderr,"\n");
1195
void graph_print_adj_list(void)
1200
node = (getMainDag())->DagNode.first;
1202
fprintf(stderr,"node : %s col: %i",((ID *) node->ob)->name, node->color);
1205
fprintf(stderr,"-- %s ",((ID *) itA->node->ob)->name);
1209
fprintf(stderr,"\n");