~ubuntu-branches/ubuntu/gutsy/blender/gutsy-security

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/BKE_depsgraph.h

  • Committer: Bazaar Package Importer
  • Author(s): Florian Ernst
  • Date: 2005-11-06 12:40:03 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051106124003-3pgs7tcg5rox96xg
Tags: 2.37a-1.1
* Non-maintainer upload.
* Split out parts of 01_SConstruct_debian.dpatch again: root_build_dir
  really needs to get adjusted before the clean target runs - closes: #333958,
  see #288882 for reference

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**
 
2
 * $Id: BKE_depsgraph.h,v 1.2 2005/04/30 23:29:10 stiv Exp $
 
3
 *
 
4
 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
 
5
 *
 
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
 
12
 * about this.
 
13
 *
 
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.
 
18
 *
 
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.
 
22
 *
 
23
 * The Original Code is Copyright (C) 2004 Blender Foundation.
 
24
 * All rights reserved.
 
25
 *
 
26
 * Contributor(s): none yet.
 
27
 *
 
28
 * ***** END GPL/BL DUAL LICENSE BLOCK *****
 
29
 */
 
30
 
 
31
#ifndef DEPSGRAPH_API
 
32
#define DEPSGRAPH_API
 
33
 
 
34
/*
 
35
#define DEPS_DEBUG
 
36
*/
 
37
 
 
38
struct Scene;
 
39
struct DagNodeQueue;
 
40
struct DagForest;
 
41
struct DagNode;
 
42
 
 
43
typedef enum { 
 
44
        DAG_RL_SCENE                            = 1,
 
45
        DAG_RL_DATA                                     = 2,
 
46
        DAG_RL_PARENT                           = 4,
 
47
        DAG_RL_TRACK                            = 8,
 
48
        DAG_RL_PATH                                     = 16,
 
49
        DAG_RL_CONSTRAINT                       = 32,
 
50
        DAG_RL_HOOK                                     = 64,
 
51
        DAG_RL_DATA_CONSTRAINT          = 128,
 
52
        DAG_NO_RELATION                         = 256
 
53
} dag_rel_type;
 
54
 
 
55
 
 
56
typedef enum {
 
57
        DAG_RL_SCENE_MASK                       = 1,
 
58
        DAG_RL_DATA_MASK                        = 2,
 
59
        DAG_RL_PARENT_MASK                      = 4,
 
60
        DAG_RL_TRACK_MASK                       = 8,
 
61
        DAG_RL_PATH_MASK                        = 16,
 
62
        DAG_RL_CONSTRAINT_MASK          = 32,
 
63
        DAG_RL_HOOK_MASK                        = 64,
 
64
        DAG_RL_DATA_CONSTRAINT_MASK     = 128,
 
65
        DAG_RL_ALL_BUT_DATA_MASK        = 253,
 
66
        DAG_RL_ALL_MASK                         = 255
 
67
} dag_rel_type_mask;
 
68
 
 
69
typedef void (*graph_action_func)(void * ob, void **data);
 
70
 
 
71
// queues are returned by all BFS & DFS queries
 
72
// opaque type
 
73
void    *pop_ob_queue(struct DagNodeQueue *queue);
 
74
int             queue_count(struct DagNodeQueue *queue);
 
75
void    queue_delete(struct DagNodeQueue *queue);
 
76
 
 
77
// queries
 
78
struct DagForest        *build_dag(struct Scene *sce, short mask);
 
79
void                            free_forest(struct DagForest *Dag);
 
80
 
 
81
// note :
 
82
// the meanings of the 2 returning values is a bit different :
 
83
// BFS return 1 for cross-edges and back-edges. the latter are considered harmfull, not the former
 
84
// DFS return 1 only for back-edges
 
85
int pre_and_post_BFS(struct DagForest *dag, short mask, graph_action_func pre_func, graph_action_func post_func, void **data);
 
86
int pre_and_post_DFS(struct DagForest *dag, short mask, graph_action_func pre_func, graph_action_func post_func, void **data);
 
87
 
 
88
int pre_and_post_source_BFS(struct DagForest *dag, short mask, struct DagNode *source, graph_action_func pre_func, graph_action_func post_func, void **data);
 
89
int pre_and_post_source_DFS(struct DagForest *dag, short mask, struct DagNode *source, graph_action_func pre_func, graph_action_func post_func, void **data);
 
90
 
 
91
struct DagNodeQueue *get_obparents(struct DagForest     *dag, void *ob); 
 
92
struct DagNodeQueue *get_first_ancestors(struct DagForest       *dag, void *ob); 
 
93
struct DagNodeQueue *get_all_childs(struct DagForest    *dag, void *ob); //
 
94
dag_rel_type            are_obs_related(struct DagForest        *dag, void *ob1, void *ob2);
 
95
int                                     is_acyclic(struct DagForest     *dag); //
 
96
//int                                   get_cycles(struct DagForest     *dag, struct DagNodeQueue **queues, int *count); //
 
97
void                            topo_sort_baselist(struct Scene *sce);
 
98
 
 
99
void    boundbox_deps(void);
 
100
void    draw_all_deps(void);
 
101
 
 
102
 
 
103
#endif