34 #define NODE_SOCKET_API_BASE_METHODS(type_, name, string_name) \
35 const SocketType *get_##name##_socket() const \
37 static const SocketType *socket = type->find_input(ustring(string_name)); \
40 bool name##_is_modified() const \
42 const SocketType *socket = get_##name##_socket(); \
43 return socket_is_modified(*socket); \
45 void tag_##name##_modified() \
47 const SocketType *socket = get_##name##_socket(); \
48 socket_modified |= socket->modified_flag_bit; \
50 type_ const &get_##name() const \
52 const SocketType *socket = get_##name##_socket(); \
53 return get_socket_value<type_>(this, *socket); \
56 #define NODE_SOCKET_API_BASE(type_, name, string_name) \
61 NODE_SOCKET_API_BASE_METHODS(type_, name, string_name)
63 #define NODE_SOCKET_API(type_, name) \
64 NODE_SOCKET_API_BASE(type_, name, #name) \
65 void set_##name(type_ value) \
67 const SocketType *socket = get_##name##_socket(); \
68 this->set(*socket, value); \
71 #define NODE_SOCKET_API_ARRAY(type_, name) \
72 NODE_SOCKET_API_BASE(type_, name, #name) \
73 void set_##name(type_ &value) \
75 const SocketType *socket = get_##name##_socket(); \
76 this->set(*socket, value); \
80 const SocketType *socket = get_##name##_socket(); \
81 return get_socket_value<type_>(this, *socket); \
84 #define NODE_SOCKET_API_STRUCT_MEMBER(type_, name, member) \
85 NODE_SOCKET_API_BASE_METHODS(type_, name##_##member, #name "." #member) \
86 void set_##name##_##member(type_ value) \
88 const SocketType *socket = get_##name##_##member##_socket(); \
89 this->set(*socket, value); \
#define CCL_NAMESPACE_END
uint64_t SocketModifiedFlags
bool has_default_value(const SocketType &input) const
const array< float3 > & get_float3_array(const SocketType &input) const
static T & get_socket_value(const Node *node, const SocketType &socket)
bool equals(const Node &other) const
const array< float > & get_float_array(const SocketType &input) const
const array< int > & get_int_array(const SocketType &input) const
float get_float(const SocketType &input) const
Transform get_transform(const SocketType &input) const
void set(const SocketType &input, bool value)
void set_value(const SocketType &input, const Node &other, const SocketType &other_input)
float3 get_float3(const SocketType &input) const
void set_default_value(const SocketType &input)
const array< bool > & get_bool_array(const SocketType &input) const
void copy_value(const SocketType &input, const Node &other, const SocketType &other_input)
const array< Node * > & get_node_array(const SocketType &input) const
size_t get_total_size_in_bytes() const
SocketModifiedFlags socket_modified
bool get_bool(const SocketType &input) const
float2 get_float2(const SocketType &input) const
const array< ustring > & get_string_array(const SocketType &input) const
const array< float2 > & get_float2_array(const SocketType &input) const
bool socket_is_modified(const SocketType &input) const
ustring get_string(const SocketType &input) const
bool is_a(const NodeType *type)
void set_if_different(const SocketType &input, T value)
Node * get_node(const SocketType &input) const
const NodeOwner * get_owner() const
uint get_uint(const SocketType &input) const
Node(const NodeType *type, ustring name=ustring())
int get_int(const SocketType &input) const
const array< Transform > & get_transform_array(const SocketType &input) const
bool equals_value(const Node &other, const SocketType &input) const
void print_modified_sockets() const
void set_owner(const NodeOwner *owner_)