Blender  V3.3
COM_RotateNode.cc
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2011 Blender Foundation. */
3 
4 #include "COM_RotateNode.h"
5 
6 #include "COM_RotateOperation.h"
8 
9 namespace blender::compositor {
10 
11 RotateNode::RotateNode(bNode *editor_node) : Node(editor_node)
12 {
13  /* pass */
14 }
15 
17  const CompositorContext &context) const
18 {
19  NodeInput *input_socket = this->get_input_socket(0);
20  NodeInput *input_degree_socket = this->get_input_socket(1);
21  NodeOutput *output_socket = this->get_output_socket(0);
22  RotateOperation *operation = new RotateOperation();
23  converter.add_operation(operation);
24 
26  switch (context.get_execution_model()) {
28  SetSamplerOperation *sampler_op = new SetSamplerOperation();
29  sampler_op->set_sampler(sampler);
30  converter.add_operation(sampler_op);
31  converter.add_link(sampler_op->get_output_socket(), operation->get_input_socket(0));
32  converter.map_input_socket(input_socket, sampler_op->get_input_socket(0));
33  break;
34  }
36  operation->set_sampler(sampler);
37  converter.map_input_socket(input_socket, operation->get_input_socket(0));
38  break;
39  }
40  }
41 
42  converter.map_input_socket(input_degree_socket, operation->get_input_socket(1));
43  converter.map_output_socket(output_socket, operation->get_output_socket(0));
44 }
45 
46 } // namespace blender::compositor
Overall context of the compositor.
void add_link(NodeOperationOutput *from, NodeOperationInput *to)
void map_output_socket(NodeOutput *node_socket, NodeOperationOutput *operation_socket)
void add_operation(NodeOperation *operation)
void map_input_socket(NodeInput *node_socket, NodeOperationInput *operation_socket)
NodeInput are sockets that can receive data/input.
Definition: COM_Node.h:190
NodeOperationOutput * get_output_socket(unsigned int index=0)
NodeOperationInput * get_input_socket(unsigned int index)
NodeOutput are sockets that can send data/input.
Definition: COM_Node.h:238
NodeOutput * get_output_socket(unsigned int index=0) const
Definition: COM_Node.cc:84
bNode * get_bnode() const
get the reference to the SDNA bNode struct
Definition: COM_Node.h:64
NodeInput * get_input_socket(unsigned int index) const
Definition: COM_Node.cc:89
RotateNode(bNode *editor_node)
void convert_to_operations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
void set_sampler(PixelSampler sampler)
depth_tx sampler(1, ImageType::FLOAT_2D, "combined_tx") .sampler(2
short custom1