Blender  V2.93
COM_NodeConverter.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  * Copyright 2013, Blender Foundation.
17  */
18 
19 #pragma once
20 
21 #ifdef WITH_CXX_GUARDEDALLOC
22 # include "MEM_guardedalloc.h"
23 #endif
24 
25 namespace blender::compositor {
26 
27 class NodeInput;
28 class NodeOutput;
29 
30 class NodeOperation;
31 class NodeOperationInput;
32 class NodeOperationOutput;
33 class NodeOperationBuilder;
34 
35 class ViewerOperation;
36 
44  public:
46 
51  void addOperation(NodeOperation *operation);
52 
60  void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket);
69  void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket);
70 
76  NodeOperationOutput *addInputProxy(NodeInput *input, bool use_conversion);
82  NodeOperationInput *addOutputProxy(NodeOutput *output, bool use_conversion);
83 
85  void addInputValue(NodeOperationInput *input, float value);
87  void addInputColor(NodeOperationInput *input, const float value[4]);
89  void addInputVector(NodeOperationInput *input, const float value[3]);
90 
92  void addOutputValue(NodeOutput *output, float value);
94  void addOutputColor(NodeOutput *output, const float value[4]);
96  void addOutputVector(NodeOutput *output, const float value[3]);
97 
100 
104  void addNodeInputPreview(NodeInput *input);
105 
111 
113  void registerViewer(ViewerOperation *viewer);
116 
117  private:
119  NodeOperationBuilder *m_builder;
120 
121 #ifdef WITH_CXX_GUARDEDALLOC
122  MEM_CXX_CLASS_ALLOC_FUNCS("COM:NodeCompiler")
123 #endif
124 };
125 
126 } // namespace blender::compositor
Read Guarded memory(de)allocation.
#define output
NodeOperation * setInvalidOutput(NodeOutput *output)
void addOutputVector(NodeOutput *output, const float value[3])
void addOutputValue(NodeOutput *output, float value)
void mapInputSocket(NodeInput *node_socket, NodeOperationInput *operation_socket)
void addPreview(NodeOperationOutput *output)
void addNodeInputPreview(NodeInput *input)
void addInputValue(NodeOperationInput *input, float value)
void addOutputColor(NodeOutput *output, const float value[4])
void addOperation(NodeOperation *operation)
void addInputVector(NodeOperationInput *input, const float value[3])
NodeOperationOutput * addInputProxy(NodeInput *input, bool use_conversion)
void mapOutputSocket(NodeOutput *node_socket, NodeOperationOutput *operation_socket)
void addInputColor(NodeOperationInput *input, const float value[4])
NodeConverter(NodeOperationBuilder *builder)
void registerViewer(ViewerOperation *viewer)
NodeOperationInput * addOutputProxy(NodeOutput *output, bool use_conversion)
void addLink(NodeOperationOutput *from, NodeOperationInput *to)
ViewerOperation * active_viewer() const
NodeInput are sockets that can receive data/input.
Definition: COM_Node.h:210
NodeOperation contains calculation logic.
NodeOutput are sockets that can send data/input.
Definition: COM_Node.h:258
StackEntry * from