Blender  V2.93
source/blender/depsgraph/intern/builder/pipeline.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2020 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "deg_builder_cache.h"
27 
28 #include "intern/depsgraph_type.h"
29 
30 struct Depsgraph;
31 struct Main;
32 struct Scene;
33 struct ViewLayer;
34 
35 namespace blender {
36 namespace deg {
37 
38 struct Depsgraph;
39 class DepsgraphNodeBuilder;
40 class DepsgraphRelationBuilder;
41 
42 /* Base class for Depsgraph Builder pipelines.
43  *
44  * Basically it runs through the following steps:
45  * - sanity check
46  * - build nodes
47  * - build relations
48  * - finalize
49  */
51  public:
53  virtual ~AbstractBuilderPipeline() = default;
54 
55  void build();
56 
57  protected:
63 
64  virtual unique_ptr<DepsgraphNodeBuilder> construct_node_builder();
65  virtual unique_ptr<DepsgraphRelationBuilder> construct_relation_builder();
66 
67  virtual void build_step_sanity_check();
68  void build_step_nodes();
69  void build_step_relations();
70  void build_step_finalize();
71 
73  virtual void build_relations(DepsgraphRelationBuilder &relation_builder) = 0;
74 };
75 
76 } // namespace deg
77 } // namespace blender
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
virtual unique_ptr< DepsgraphRelationBuilder > construct_relation_builder()
virtual unique_ptr< DepsgraphNodeBuilder > construct_node_builder()
virtual void build_nodes(DepsgraphNodeBuilder &node_builder)=0
virtual ~AbstractBuilderPipeline()=default
virtual void build_relations(DepsgraphRelationBuilder &relation_builder)=0
Depsgraph * graph
DepsgraphNodeBuilder * node_builder
Definition: BKE_main.h:116