Blender V4.3
BKE_compute_contexts.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
11#include <optional>
12
14
15struct bNode;
16struct bNodeTree;
17
18namespace blender::bke {
19
21 private:
22 static constexpr const char *s_static_type = "MODIFIER";
23
29 std::string modifier_name_;
30
31 public:
33
35 {
36 return modifier_name_;
37 }
38
39 private:
40 void print_current_in_line(std::ostream &stream) const override;
41};
42
44 private:
45 static constexpr const char *s_static_type = "NODE_GROUP";
46
47 int32_t node_id_;
52 const bNodeTree *caller_tree_ = nullptr;
53 const bNode *caller_group_node_ = nullptr;
54
55 public:
58 const std::optional<ComputeContextHash> &cached_hash = {});
60 const bNode &node,
61 const bNodeTree &caller_tree);
62
64 {
65 return node_id_;
66 }
67
68 const bNode *caller_group_node() const
69 {
70 return caller_group_node_;
71 }
72
73 const bNodeTree *caller_tree() const
74 {
75 return caller_tree_;
76 }
77
78 private:
79 void print_current_in_line(std::ostream &stream) const override;
80};
81
83 private:
84 static constexpr const char *s_static_type = "SIMULATION_ZONE";
85
86 int32_t output_node_id_;
87
88 public:
91
93 {
94 return output_node_id_;
95 }
96
97 private:
98 void print_current_in_line(std::ostream &stream) const override;
99};
100
102 private:
103 static constexpr const char *s_static_type = "REPEAT_ZONE";
104
105 int32_t output_node_id_;
106 int iteration_;
107
108 public:
111
113 {
114 return output_node_id_;
115 }
116
117 int iteration() const
118 {
119 return iteration_;
120 }
121
122 private:
123 void print_current_in_line(std::ostream &stream) const override;
124};
125
127 private:
128 static constexpr const char *s_static_type = "FOREACH_GEOMETRY_ELEMENT_ZONE";
129
130 int32_t output_node_id_;
131 int index_;
132
133 public:
136 int index);
138 const bNode &node,
139 int index);
140
142 {
143 return output_node_id_;
144 }
145
146 int index() const
147 {
148 return index_;
149 }
150
151 private:
152 void print_current_in_line(std::ostream &stream) const override;
153};
154
156 private:
157 static constexpr const char *s_static_type = "OPERATOR";
158
159 public:
162
163 private:
164 void print_current_in_line(std::ostream &stream) const override;
165};
166
167} // namespace blender::bke
const ComputeContext * parent() const
ForeachGeometryElementZoneComputeContext(const ComputeContext *parent, int32_t output_node_id, int index)
GroupNodeComputeContext(const ComputeContext *parent, int32_t node_id, const std::optional< ComputeContextHash > &cached_hash={})
ModifierComputeContext(const ComputeContext *parent, std::string modifier_name)
RepeatZoneComputeContext(const ComputeContext *parent, int32_t output_node_id, int iteration)
SimulationZoneComputeContext(const ComputeContext *parent, int output_node_id)
signed int int32_t
Definition stdint.h:77