Base refactor 3/4
[blender.git] / source / blender / depsgraph / intern / builder / deg_builder_nodes.h
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2013 Blender Foundation.
19  * All rights reserved.
20  *
21  * Original Author: Lukas Toenne
22  * Contributor(s): None Yet
23  *
24  * ***** END GPL LICENSE BLOCK *****
25  */
26
27 /** \file blender/depsgraph/intern/builder/deg_builder_nodes.h
28  *  \ingroup depsgraph
29  */
30
31 #pragma once
32
33 #include "intern/depsgraph_types.h"
34
35 /* XXX: Temporary solution to get proper Baselegacy. */
36 #include "DNA_scene_types.h"
37
38 struct BaseLegacy;
39 struct CacheFile;
40 struct bGPdata;
41 struct ListBase;
42 struct GHash;
43 struct ID;
44 struct Image;
45 struct FCurve;
46 struct Group;
47 struct Key;
48 struct Main;
49 struct Material;
50 struct Mask;
51 struct MTex;
52 struct MovieClip;
53 struct bNodeTree;
54 struct Object;
55 struct bPoseChannel;
56 struct bConstraint;
57 struct Scene;
58 struct Tex;
59 struct World;
60
61 struct PropertyRNA;
62
63 namespace DEG {
64
65 struct Depsgraph;
66 struct DepsNode;
67 struct RootDepsNode;
68 struct SubgraphDepsNode;
69 struct IDDepsNode;
70 struct TimeSourceDepsNode;
71 struct ComponentDepsNode;
72 struct OperationDepsNode;
73
74 struct DepsgraphNodeBuilder {
75         DepsgraphNodeBuilder(Main *bmain, Depsgraph *graph);
76         ~DepsgraphNodeBuilder();
77
78         void begin_build(Main *bmain);
79
80         RootDepsNode *add_root_node();
81         IDDepsNode *add_id_node(ID *id);
82         TimeSourceDepsNode *add_time_source(ID *id);
83
84         ComponentDepsNode *add_component_node(ID *id,
85                                               eDepsNode_Type comp_type,
86                                               const char *comp_name = "");
87
88         OperationDepsNode *add_operation_node(ComponentDepsNode *comp_node,
89                                               eDepsOperation_Type optype,
90                                               DepsEvalOperationCb op,
91                                               eDepsOperation_Code opcode,
92                                               const char *name = "",
93                                               int name_tag = -1);
94         OperationDepsNode *add_operation_node(ID *id,
95                                               eDepsNode_Type comp_type,
96                                               const char *comp_name,
97                                               eDepsOperation_Type optype,
98                                               DepsEvalOperationCb op,
99                                               eDepsOperation_Code opcode,
100                                               const char *name = "",
101                                               int name_tag = -1);
102         OperationDepsNode *add_operation_node(ID *id,
103                                               eDepsNode_Type comp_type,
104                                               eDepsOperation_Type optype,
105                                               DepsEvalOperationCb op,
106                                               eDepsOperation_Code opcode,
107                                               const char *name = "",
108                                               int name_tag = -1);
109
110         bool has_operation_node(ID *id,
111                                 eDepsNode_Type comp_type,
112                                 const char *comp_name,
113                                 eDepsOperation_Code opcode,
114                                 const char *name = "",
115                                 int name_tag = -1);
116
117         OperationDepsNode *find_operation_node(ID *id,
118                                                eDepsNode_Type comp_type,
119                                                const char *comp_name,
120                                                eDepsOperation_Code opcode,
121                                                const char *name = "",
122                                                int name_tag = -1);
123
124         OperationDepsNode *find_operation_node(ID *id,
125                                                eDepsNode_Type comp_type,
126                                                eDepsOperation_Code opcode,
127                                                const char *name = "",
128                                                int name_tag = -1);
129
130         void build_scene(Main *bmain, Scene *scene);
131         SubgraphDepsNode *build_subgraph(Group *group);
132         void build_group(Scene *scene, BaseLegacy *base, Group *group);
133         void build_object(Scene *scene, BaseLegacy *base, Object *ob);
134         void build_object_transform(Scene *scene, Object *ob);
135         void build_object_constraints(Scene *scene, Object *ob);
136         void build_pose_constraints(Object *ob, bPoseChannel *pchan);
137         void build_rigidbody(Scene *scene);
138         void build_particles(Scene *scene, Object *ob);
139         void build_animdata(ID *id);
140         OperationDepsNode *build_driver(ID *id, FCurve *fcurve);
141         void build_ik_pose(Scene *scene,
142                            Object *ob,
143                            bPoseChannel *pchan,
144                            bConstraint *con);
145         void build_splineik_pose(Scene *scene,
146                                  Object *ob,
147                                  bPoseChannel *pchan,
148                                  bConstraint *con);
149         void build_rig(Scene *scene, Object *ob);
150         void build_proxy_rig(Object *ob);
151         void build_shapekeys(Key *key);
152         void build_obdata_geom(Scene *scene, Object *ob);
153         void build_camera(Object *ob);
154         void build_lamp(Object *ob);
155         void build_nodetree(bNodeTree *ntree);
156         void build_material(Material *ma);
157         void build_texture(Tex *tex);
158         void build_texture_stack(MTex **texture_stack);
159         void build_image(Image *image);
160         void build_world(World *world);
161         void build_compositor(Scene *scene);
162         void build_gpencil(bGPdata *gpd);
163         void build_cachefile(CacheFile *cache_file);
164         void build_mask(Mask *mask);
165         void build_movieclip(MovieClip *clip);
166
167 protected:
168         Main *m_bmain;
169         Depsgraph *m_graph;
170 };
171
172 }  // namespace DEG