Cleanup: convert node_exec.h to c++ #107591
|
@ -75,7 +75,7 @@ set(SRC
|
|||
NOD_static_types.h
|
||||
NOD_texture.h
|
||||
intern/node_common.h
|
||||
intern/node_exec.h
|
||||
intern/node_exec.hh
|
||||
intern/node_util.hh
|
||||
)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "node_exec.h"
|
||||
#include "node_exec.hh"
|
||||
#include "node_util.hh"
|
||||
|
||||
static int node_exec_socket_use_stack(bNodeSocket *sock)
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
* Copyright 2007 Blender Foundation */
|
||||
|
||||
/** \file
|
||||
* \ingroup nodes
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BKE_node.h"
|
||||
|
||||
#include "node_util.hh"
|
||||
|
||||
#include "RNA_types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct bNode;
|
||||
struct bNodeStack;
|
||||
struct bNodeTree;
|
||||
|
||||
/* Node execution data */
|
||||
typedef struct bNodeExec {
|
||||
/** Back-pointer to node. */
|
||||
struct bNode *node;
|
||||
bNodeExecData data;
|
||||
|
||||
/** Free function, stored in exec itself to avoid dangling node pointer access. */
|
||||
NodeFreeExecFunction free_exec_fn;
|
||||
} bNodeExec;
|
||||
|
||||
/* Execution Data for each instance of node tree execution */
|
||||
typedef struct bNodeTreeExec {
|
||||
struct bNodeTree *nodetree; /* Back-pointer to node tree. */
|
||||
|
||||
int totnodes; /* total node count */
|
||||
struct bNodeExec *nodeexec; /* per-node execution data */
|
||||
|
||||
int stacksize;
|
||||
struct bNodeStack *stack; /* socket data stack */
|
||||
/* only used by material and texture trees to keep one stack for each thread */
|
||||
ListBase *threadstack; /* one instance of the stack for each thread */
|
||||
} bNodeTreeExec;
|
||||
|
||||
/* stores one stack copy for each thread (material and texture trees) */
|
||||
typedef struct bNodeThreadStack {
|
||||
struct bNodeThreadStack *next, *prev;
|
||||
struct bNodeStack *stack;
|
||||
bool used;
|
||||
} bNodeThreadStack;
|
||||
|
||||
/** For a given socket, find the actual stack entry. */
|
||||
struct bNodeStack *node_get_socket_stack(struct bNodeStack *stack, struct bNodeSocket *sock);
|
||||
void node_get_stack(struct bNode *node,
|
||||
struct bNodeStack *stack,
|
||||
struct bNodeStack **in,
|
||||
struct bNodeStack **out);
|
||||
|
||||
struct bNodeTreeExec *ntree_exec_begin(struct bNodeExecContext *context,
|
||||
struct bNodeTree *ntree,
|
||||
bNodeInstanceKey parent_key);
|
||||
void ntree_exec_end(struct bNodeTreeExec *exec);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
|
@ -0,0 +1,61 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-or-later
|
||||
* Copyright 2007 Blender Foundation */
|
||||
|
||||
/** \file
|
||||
* \ingroup nodes
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "DNA_listBase.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BKE_node.h"
|
||||
|
||||
#include "node_util.hh"
|
||||
|
||||
#include "RNA_types.h"
|
||||
|
||||
struct bNode;
|
||||
struct bNodeStack;
|
||||
struct bNodeTree;
|
||||
|
||||
/* Node execution data */
|
||||
struct bNodeExec {
|
||||
/** Back-pointer to node. */
|
||||
bNode *node;
|
||||
bNodeExecData data;
|
||||
|
||||
/** Free function, stored in exec itself to avoid dangling node pointer access. */
|
||||
NodeFreeExecFunction free_exec_fn;
|
||||
};
|
||||
|
||||
/* Execution Data for each instance of node tree execution */
|
||||
struct bNodeTreeExec {
|
||||
bNodeTree *nodetree; /* Back-pointer to node tree. */
|
||||
|
||||
int totnodes; /* total node count */
|
||||
bNodeExec *nodeexec; /* per-node execution data */
|
||||
|
||||
int stacksize;
|
||||
bNodeStack *stack; /* socket data stack */
|
||||
/* only used by material and texture trees to keep one stack for each thread */
|
||||
ListBase *threadstack; /* one instance of the stack for each thread */
|
||||
};
|
||||
|
||||
/* stores one stack copy for each thread (material and texture trees) */
|
||||
struct bNodeThreadStack {
|
||||
bNodeThreadStack *next, *prev;
|
||||
bNodeStack *stack;
|
||||
bool used;
|
||||
};
|
||||
|
||||
/** For a given socket, find the actual stack entry. */
|
||||
bNodeStack *node_get_socket_stack(struct bNodeStack *stack, struct bNodeSocket *sock);
|
||||
void node_get_stack(bNode *node, bNodeStack *stack, bNodeStack **in, bNodeStack **out);
|
||||
|
||||
bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context,
|
||||
bNodeTree *ntree,
|
||||
bNodeInstanceKey parent_key);
|
||||
void ntree_exec_end(bNodeTreeExec *exec);
|
|
@ -16,7 +16,7 @@ struct bNodeExecContext {
|
|||
};
|
||||
|
||||
struct bNodeExecData {
|
||||
void *data; /* custom data storage */
|
||||
void *data; /* custom data storage */
|
||||
bNodePreview *preview; /* optional preview image */
|
||||
};
|
||||
|
||||
|
@ -25,15 +25,9 @@ struct bNodeExecData {
|
|||
void node_free_curves(bNode *node);
|
||||
void node_free_standard_storage(bNode *node);
|
||||
|
||||
void node_copy_curves(bNodeTree *dest_ntree,
|
||||
bNode *dest_node,
|
||||
const bNode *src_node);
|
||||
void node_copy_standard_storage(bNodeTree *dest_ntree,
|
||||
bNode *dest_node,
|
||||
const bNode *src_node);
|
||||
void *node_initexec_curves(bNodeExecContext *context,
|
||||
bNode *node,
|
||||
bNodeInstanceKey key);
|
||||
void node_copy_curves(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node);
|
||||
void node_copy_standard_storage(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node);
|
||||
void *node_initexec_curves(bNodeExecContext *context, bNode *node, bNodeInstanceKey key);
|
||||
|
||||
/**** Updates ****/
|
||||
void node_sock_label(bNodeSocket *sock, const char *name);
|
||||
|
@ -41,26 +35,11 @@ void node_sock_label_clear(bNodeSocket *sock);
|
|||
void node_math_update(bNodeTree *ntree, bNode *node);
|
||||
|
||||
/**** Labels ****/
|
||||
void node_blend_label(const bNodeTree *ntree,
|
||||
const bNode *node,
|
||||
char *label,
|
||||
int maxlen);
|
||||
void node_image_label(const bNodeTree *ntree,
|
||||
const bNode *node,
|
||||
char *label,
|
||||
int maxlen);
|
||||
void node_math_label(const bNodeTree *ntree,
|
||||
const bNode *node,
|
||||
char *label,
|
||||
int maxlen);
|
||||
void node_vector_math_label(const bNodeTree *ntree,
|
||||
const bNode *node,
|
||||
char *label,
|
||||
int maxlen);
|
||||
void node_filter_label(const bNodeTree *ntree,
|
||||
const bNode *node,
|
||||
char *label,
|
||||
int maxlen);
|
||||
void node_blend_label(const bNodeTree *ntree, const bNode *node, char *label, int maxlen);
|
||||
void node_image_label(const bNodeTree *ntree, const bNode *node, char *label, int maxlen);
|
||||
void node_math_label(const bNodeTree *ntree, const bNode *node, char *label, int maxlen);
|
||||
void node_vector_math_label(const bNodeTree *ntree, const bNode *node, char *label, int maxlen);
|
||||
void node_filter_label(const bNodeTree *ntree, const bNode *node, char *label, int maxlen);
|
||||
void node_combsep_color_label(const ListBase *sockets, NodeCombSepColorMode mode);
|
||||
|
||||
/*** Link Handling */
|
||||
|
@ -71,23 +50,8 @@ void node_combsep_color_label(const ListBase *sockets, NodeCombSepColorMode mode
|
|||
bool node_insert_link_default(bNodeTree *ntree, bNode *node, bNodeLink *link);
|
||||
|
||||
float node_socket_get_float(bNodeTree *ntree, bNode *node, bNodeSocket *sock);
|
||||
void node_socket_set_float(bNodeTree *ntree,
|
||||
bNode *node,
|
||||
bNodeSocket *sock,
|
||||
float value);
|
||||
void node_socket_get_color(bNodeTree *ntree,
|
||||
bNode *node,
|
||||
bNodeSocket *sock,
|
||||
float *value);
|
||||
void node_socket_set_color(bNodeTree *ntree,
|
||||
bNode *node,
|
||||
bNodeSocket *sock,
|
||||
const float *value);
|
||||
void node_socket_get_vector(bNodeTree *ntree,
|
||||
bNode *node,
|
||||
bNodeSocket *sock,
|
||||
float *value);
|
||||
void node_socket_set_vector(bNodeTree *ntree,
|
||||
bNode *node,
|
||||
bNodeSocket *sock,
|
||||
const float *value);
|
||||
void node_socket_set_float(bNodeTree *ntree, bNode *node, bNodeSocket *sock, float value);
|
||||
void node_socket_get_color(bNodeTree *ntree, bNode *node, bNodeSocket *sock, float *value);
|
||||
void node_socket_set_color(bNodeTree *ntree, bNode *node, bNodeSocket *sock, const float *value);
|
||||
void node_socket_get_vector(bNodeTree *ntree, bNode *node, bNodeSocket *sock, float *value);
|
||||
void node_socket_set_vector(bNodeTree *ntree, bNode *node, bNodeSocket *sock, const float *value);
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
#include "NOD_common.h"
|
||||
|
||||
#include "node_common.h"
|
||||
#include "node_exec.h"
|
||||
#include "node_exec.hh"
|
||||
#include "node_shader_util.hh"
|
||||
#include "node_util.hh"
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include "RE_engine.h"
|
||||
|
||||
#include "node_exec.h"
|
||||
#include "node_exec.hh"
|
||||
|
||||
bool sh_node_poll_default(const bNodeType * /*ntype*/,
|
||||
const bNodeTree *ntree,
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#include "NOD_common.h"
|
||||
#include "node_common.h"
|
||||
#include "node_exec.h"
|
||||
#include "node_exec.hh"
|
||||
#include "node_shader_util.hh"
|
||||
|
||||
#include "RNA_access.h"
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "NOD_texture.h"
|
||||
#include "node_common.h"
|
||||
#include "node_exec.h"
|
||||
#include "node_exec.hh"
|
||||
#include "node_texture_util.hh"
|
||||
#include "node_util.hh"
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include "NOD_common.h"
|
||||
#include "node_common.h"
|
||||
#include "node_exec.h"
|
||||
#include "node_exec.hh"
|
||||
#include "node_texture_util.hh"
|
||||
|
||||
#include "RNA_access.h"
|
||||
|
|
Loading…
Reference in New Issue