Cleanup: Remove static struct without data.
This commit is contained in:
parent
f3fb1df192
commit
b12be5a872
|
@ -115,9 +115,9 @@
|
|||
#include "COM_ViewerNode.h"
|
||||
#include "COM_ZCombineNode.h"
|
||||
|
||||
bool Converter::is_fast_node(bNode *b_node)
|
||||
bool COM_bnode_is_fast_node(const bNode &b_node)
|
||||
{
|
||||
return !ELEM(b_node->type,
|
||||
return !ELEM(b_node.type,
|
||||
CMP_NODE_BLUR,
|
||||
CMP_NODE_VECBLUR,
|
||||
CMP_NODE_BILATERALBLUR,
|
||||
|
@ -132,7 +132,7 @@ bool Converter::is_fast_node(bNode *b_node)
|
|||
CMP_NODE_DENOISE);
|
||||
}
|
||||
|
||||
Node *Converter::convert(bNode *b_node)
|
||||
Node *COM_convert_bnode(bNode *b_node)
|
||||
{
|
||||
Node *node = nullptr;
|
||||
|
||||
|
@ -419,7 +419,7 @@ Node *Converter::convert(bNode *b_node)
|
|||
return node;
|
||||
}
|
||||
|
||||
NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperationInput *to)
|
||||
NodeOperation *COM_convert_data_type(NodeOperationOutput *from, NodeOperationInput *to)
|
||||
{
|
||||
DataType fromDatatype = from->getDataType();
|
||||
DataType toDatatype = to->getDataType();
|
||||
|
@ -446,9 +446,9 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
void Converter::convertResolution(NodeOperationBuilder &builder,
|
||||
NodeOperationOutput *fromSocket,
|
||||
NodeOperationInput *toSocket)
|
||||
void COM_convert_resolution(NodeOperationBuilder &builder,
|
||||
NodeOperationOutput *fromSocket,
|
||||
NodeOperationInput *toSocket)
|
||||
{
|
||||
InputResizeMode mode = toSocket->getResizeMode();
|
||||
|
||||
|
|
|
@ -31,56 +31,36 @@ class NodeOperationOutput;
|
|||
class NodeOperationBuilder;
|
||||
|
||||
/**
|
||||
* \brief Conversion methods for the compositor
|
||||
* \brief Wraps a bNode in its Node instance.
|
||||
*
|
||||
* For all nodetypes a wrapper class is created.
|
||||
*
|
||||
* \note When adding a new node to blender, this method needs to be changed to return the correct
|
||||
* Node instance.
|
||||
*
|
||||
* \see Node
|
||||
*/
|
||||
class Converter {
|
||||
public:
|
||||
/**
|
||||
* \brief Convert/wraps a bNode in its Node instance.
|
||||
*
|
||||
* For all nodetypes a wrapper class is created.
|
||||
*
|
||||
* \note When adding a new node to blender, this method needs to be changed to return the correct
|
||||
* Node instance.
|
||||
*
|
||||
* \see Node
|
||||
*/
|
||||
static Node *convert(bNode *b_node);
|
||||
Node *COM_convert_bnode(bNode *b_node);
|
||||
|
||||
/**
|
||||
* \brief True if the node is considered 'fast'.
|
||||
*
|
||||
* Slow nodes will be skipped if fast execution is required.
|
||||
*/
|
||||
static bool is_fast_node(bNode *b_node);
|
||||
/**
|
||||
* \brief True if the node is considered 'fast'.
|
||||
*
|
||||
* Slow nodes will be skipped if fast execution is required.
|
||||
*/
|
||||
bool COM_bnode_is_fast_node(const bNode &b_node);
|
||||
|
||||
/**
|
||||
* \brief This method will add a datetype conversion rule when the to-socket does not support the
|
||||
* from-socket actual data type.
|
||||
*
|
||||
* \note this method is called when conversion is needed.
|
||||
*
|
||||
* \param link: the NodeLink what needs conversion
|
||||
* \param system: the ExecutionSystem to add the conversion to.
|
||||
* \see NodeLink - a link between two sockets
|
||||
*/
|
||||
static NodeOperation *convertDataType(NodeOperationOutput *from, NodeOperationInput *to);
|
||||
/**
|
||||
* \brief This function will add a datetype conversion rule when the to-socket does not support the
|
||||
* from-socket actual data type.
|
||||
*/
|
||||
NodeOperation *COM_convert_data_type(NodeOperationOutput *from, NodeOperationInput *to);
|
||||
|
||||
/**
|
||||
* \brief This method will add a resolution rule based on the settings of the NodeInput.
|
||||
*
|
||||
* \note Conversion logic is implemented in this method
|
||||
* \see InputSocketResizeMode for the possible conversions.
|
||||
*
|
||||
* \param link: the NodeLink what needs conversion
|
||||
* \param system: the ExecutionSystem to add the conversion to.
|
||||
* \see NodeLink - a link between two sockets
|
||||
*/
|
||||
static void convertResolution(NodeOperationBuilder &builder,
|
||||
NodeOperationOutput *fromSocket,
|
||||
NodeOperationInput *toSocket);
|
||||
|
||||
#ifdef WITH_CXX_GUARDEDALLOC
|
||||
MEM_CXX_CLASS_ALLOC_FUNCS("COM:Converter")
|
||||
#endif
|
||||
};
|
||||
/**
|
||||
* \brief This function will add a resolution rule based on the settings of the NodeInput.
|
||||
*
|
||||
* \note Conversion logic is implemented in this function.
|
||||
* \see InputSocketResizeMode for the possible conversions.
|
||||
*/
|
||||
void COM_convert_resolution(NodeOperationBuilder &builder,
|
||||
NodeOperationOutput *fromSocket,
|
||||
NodeOperationInput *toSocket);
|
||||
|
|
|
@ -79,7 +79,7 @@ class ExecutionGroup;
|
|||
* - [@ref InputSocketResizeMode.COM_SC_NO_RESIZE]:
|
||||
* Bottom left of the images are aligned.
|
||||
*
|
||||
* \see Converter.convertDataType Datatype conversions
|
||||
* \see COM_convert_data_type Datatype conversions
|
||||
* \see Converter.convertResolution Image size conversions
|
||||
*
|
||||
* \section EM_Step4 Step4: group operations in executions groups
|
||||
|
|
|
@ -132,7 +132,7 @@ void NodeGraph::add_bNode(const CompositorContext &context,
|
|||
}
|
||||
|
||||
/* replace slow nodes with proxies for fast execution */
|
||||
if (context.isFastCalculation() && !Converter::is_fast_node(b_node)) {
|
||||
if (context.isFastCalculation() && !COM_bnode_is_fast_node(*b_node)) {
|
||||
add_proxies_skip(b_ntree, b_node, key, is_active_group);
|
||||
return;
|
||||
}
|
||||
|
@ -146,7 +146,7 @@ void NodeGraph::add_bNode(const CompositorContext &context,
|
|||
}
|
||||
else {
|
||||
/* regular nodes, handled in Converter */
|
||||
Node *node = Converter::convert(b_node);
|
||||
Node *node = COM_convert_bnode(b_node);
|
||||
if (node) {
|
||||
add_node(node, b_ntree, key, is_active_group);
|
||||
}
|
||||
|
|
|
@ -288,7 +288,7 @@ void NodeOperationBuilder::add_datatype_conversions()
|
|||
}
|
||||
for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
NodeOperation *converter = Converter::convertDataType(link.from(), link.to());
|
||||
NodeOperation *converter = COM_convert_data_type(link.from(), link.to());
|
||||
if (converter) {
|
||||
addOperation(converter);
|
||||
|
||||
|
@ -446,7 +446,7 @@ void NodeOperationBuilder::determineResolutions()
|
|||
}
|
||||
for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); ++it) {
|
||||
const Link &link = *it;
|
||||
Converter::convertResolution(*this, link.from(), link.to());
|
||||
COM_convert_resolution(*this, link.from(), link.to());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue