24#define NODE_SOCKET_API_BASE_METHODS(type_, name, string_name) \
25 const SocketType *get_##name##_socket() const \
29 const Node *self_node = this; \
30 static const SocketType *socket = self_node->type->find_input(ustring(string_name)); \
33 bool name##_is_modified() const \
35 const SocketType *socket = get_##name##_socket(); \
36 return socket_is_modified(*socket); \
38 void tag_##name##_modified() \
40 const SocketType *socket = get_##name##_socket(); \
41 socket_modified |= socket->modified_flag_bit; \
43 type_ const &get_##name() const \
45 const SocketType *socket = get_##name##_socket(); \
46 return get_socket_value<type_>(this, *socket); \
49#define NODE_SOCKET_API_BASE(type_, name, string_name) \
54 NODE_SOCKET_API_BASE_METHODS(type_, name, string_name)
56#define NODE_SOCKET_API(type_, name) \
57 NODE_SOCKET_API_BASE(type_, name, #name) \
58 void set_##name(type_ value) \
60 const SocketType *socket = get_##name##_socket(); \
61 this->set(*socket, value); \
64#define NODE_SOCKET_API_ARRAY(type_, name) \
65 NODE_SOCKET_API_BASE(type_, name, #name) \
66 void set_##name(type_ &value) \
68 const SocketType *socket = get_##name##_socket(); \
69 this->set(*socket, value); \
73 const SocketType *socket = get_##name##_socket(); \
74 return get_socket_value<type_>(this, *socket); \
77#define NODE_SOCKET_API_STRUCT_MEMBER(type_, name, member) \
78 NODE_SOCKET_API_BASE_METHODS(type_, name##_##member, #name "." #member) \
79 void set_##name##_##member(type_ value) \
81 const SocketType *socket = get_##name##_##member##_socket(); \
82 this->set(*socket, value); \
92 explicit Node(
const NodeType *type, ustring name = ustring());
110 template<
class ValueType, std::enable_if_t<std::is_enum_v<ValueType>,
bool> = true>
113 static_assert(
sizeof(ValueType) <=
sizeof(
int),
"Enumerator type should fit int");
114 set(input,
static_cast<int>(value));
#define CCL_NAMESPACE_END
uint64_t SocketModifiedFlags
unsigned __int64 uint64_t
bool has_default_value(const SocketType &input) const
const array< float3 > & get_float3_array(const SocketType &input) const
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)
uint64_t get_uint64(const SocketType &input) const
void set_value(const SocketType &input, const Node &other, const SocketType &other_input)
void dereference_all_used_nodes()
float3 get_float3(const SocketType &input) const
void set_default_value(const SocketType &input)
static T & get_socket_value(const Node *node, const SocketType &socket)
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
int reference_count() 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
void clear_reference_count()
bool equals_value(const Node &other, const SocketType &input) const
void print_modified_sockets() const
void set_owner(const NodeOwner *owner_)