Depsgraph: Replace LIB_TAG_DOIT with hash lookup
[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/builder/deg_builder_map.h"
34 #include "intern/depsgraph_types.h"
35
36 struct Base;
37 struct CacheFile;
38 struct bGPdata;
39 struct ListBase;
40 struct GHash;
41 struct ID;
42 struct Image;
43 struct FCurve;
44 struct Group;
45 struct Key;
46 struct Main;
47 struct Material;
48 struct Mask;
49 struct MTex;
50 struct MovieClip;
51 struct bNodeTree;
52 struct Object;
53 struct bPoseChannel;
54 struct bConstraint;
55 struct Scene;
56 struct Tex;
57 struct World;
58
59 struct PropertyRNA;
60
61 namespace DEG {
62
63 struct Depsgraph;
64 struct DepsNode;
65 struct IDDepsNode;
66 struct TimeSourceDepsNode;
67 struct ComponentDepsNode;
68 struct OperationDepsNode;
69
70 struct DepsgraphNodeBuilder {
71         DepsgraphNodeBuilder(Main *bmain, Depsgraph *graph);
72         ~DepsgraphNodeBuilder();
73
74         void begin_build();
75
76         IDDepsNode *add_id_node(ID *id);
77         TimeSourceDepsNode *add_time_source();
78
79         ComponentDepsNode *add_component_node(ID *id,
80                                               eDepsNode_Type comp_type,
81                                               const char *comp_name = "");
82
83         OperationDepsNode *add_operation_node(ComponentDepsNode *comp_node,
84                                               const DepsEvalOperationCb& op,
85                                               eDepsOperation_Code opcode,
86                                               const char *name = "",
87                                               int name_tag = -1);
88         OperationDepsNode *add_operation_node(ID *id,
89                                               eDepsNode_Type comp_type,
90                                               const char *comp_name,
91                                               const DepsEvalOperationCb& op,
92                                               eDepsOperation_Code opcode,
93                                               const char *name = "",
94                                               int name_tag = -1);
95         OperationDepsNode *add_operation_node(ID *id,
96                                               eDepsNode_Type comp_type,
97                                               const DepsEvalOperationCb& op,
98                                               eDepsOperation_Code opcode,
99                                               const char *name = "",
100                                               int name_tag = -1);
101
102         bool has_operation_node(ID *id,
103                                 eDepsNode_Type comp_type,
104                                 const char *comp_name,
105                                 eDepsOperation_Code opcode,
106                                 const char *name = "",
107                                 int name_tag = -1);
108
109         OperationDepsNode *find_operation_node(ID *id,
110                                                eDepsNode_Type comp_type,
111                                                const char *comp_name,
112                                                eDepsOperation_Code opcode,
113                                                const char *name = "",
114                                                int name_tag = -1);
115
116         OperationDepsNode *find_operation_node(ID *id,
117                                                eDepsNode_Type comp_type,
118                                                eDepsOperation_Code opcode,
119                                                const char *name = "",
120                                                int name_tag = -1);
121
122         void build_scene(Scene *scene);
123         void build_group(Base *base, Group *group);
124         void build_object(Base *base, Object *object);
125         void build_object_data(Object *object);
126         void build_object_transform(Object *object);
127         void build_object_constraints(Object *object);
128         void build_pose_constraints(Object *object, bPoseChannel *pchan);
129         void build_rigidbody(Scene *scene);
130         void build_particles(Object *object);
131         void build_cloth(Object *object);
132         void build_animdata(ID *id);
133         OperationDepsNode *build_driver(ID *id, FCurve *fcurve);
134         void build_ik_pose(Object *object,
135                            bPoseChannel *pchan,
136                            bConstraint *con);
137         void build_splineik_pose(Object *object,
138                                  bPoseChannel *pchan,
139                                  bConstraint *con);
140         void build_rig(Object *object);
141         void build_proxy_rig(Object *object);
142         void build_shapekeys(Key *key);
143         void build_obdata_geom(Object *object);
144         void build_camera(Object *object);
145         void build_lamp(Object *object);
146         void build_nodetree(bNodeTree *ntree);
147         void build_material(Material *ma);
148         void build_texture(Tex *tex);
149         void build_texture_stack(MTex **texture_stack);
150         void build_image(Image *image);
151         void build_world(World *world);
152         void build_compositor(Scene *scene);
153         void build_gpencil(bGPdata *gpd);
154         void build_cachefile(CacheFile *cache_file);
155         void build_mask(Mask *mask);
156         void build_movieclip(MovieClip *clip);
157
158 protected:
159         /* State which never changes, same for the whole builder time. */
160         Main *bmain_;
161         Depsgraph *graph_;
162
163         /* State which demotes currently built entities. */
164         Scene *scene_;
165
166         BuilderMap built_map_;
167 };
168
169 }  // namespace DEG