Blender  V2.93
COM_SunBeamsNode.cc
Go to the documentation of this file.
1 /* This program is free software; you can redistribute it and/or
2  * modify it under the terms of the GNU General Public License
3  * as published by the Free Software Foundation; either version 2
4  * of the License, or (at your option) any later version.
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  *
11  * You should have received a copy of the GNU General Public License
12  * along with this program; if not, write to the Free Software Foundation,
13  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14  *
15  * Copyright 2014, Blender Foundation.
16  */
17 
18 #include "COM_SunBeamsNode.h"
19 #include "COM_SunBeamsOperation.h"
20 
21 namespace blender::compositor {
22 
23 SunBeamsNode::SunBeamsNode(bNode *editorNode) : Node(editorNode)
24 {
25  /* pass */
26 }
27 
29  const CompositorContext & /*context*/) const
30 {
31  NodeInput *inputSocket = this->getInputSocket(0);
32  NodeOutput *outputSocket = this->getOutputSocket(0);
34 
35  SunBeamsOperation *operation = new SunBeamsOperation();
36  operation->setData(*data);
37  converter.addOperation(operation);
38 
39  converter.mapInputSocket(inputSocket, operation->getInputSocket(0));
40  converter.mapOutputSocket(outputSocket, operation->getOutputSocket(0));
41 }
42 
43 } // namespace blender::compositor
Overall context of the compositor.
void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket)
void addOperation(NodeOperation *operation)
void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket)
NodeInput are sockets that can receive data/input.
Definition: COM_Node.h:210
NodeOperationInput * getInputSocket(unsigned int index)
NodeOperationOutput * getOutputSocket(unsigned int index=0)
NodeOutput are sockets that can send data/input.
Definition: COM_Node.h:258
NodeOutput * getOutputSocket(const unsigned int index=0) const
Definition: COM_Node.cc:108
bNode * getbNode() const
get the reference to the SDNA bNode struct
Definition: COM_Node.h:82
NodeInput * getInputSocket(const unsigned int index) const
Definition: COM_Node.cc:113
void convertToOperations(NodeConverter &converter, const CompositorContext &context) const override
convert node to operation
void setData(const NodeSunBeams &data)
void * storage