108 set(input, ustring(value));
195 return get_socket_value<bool>(
this, input);
201 return get_socket_value<int>(
this, input);
207 return get_socket_value<uint>(
this, input);
213 return get_socket_value<float>(
this, input);
219 return get_socket_value<float2>(
this, input);
225 return get_socket_value<float3>(
this, input);
231 return get_socket_value<ustring>(
this, input);
235 int intvalue = get_socket_value<int>(
this, input);
236 return (enm.
exists(intvalue)) ? enm[intvalue] : ustring();
247 return get_socket_value<Transform>(
this, input);
253 return get_socket_value<Node *>(
this, input);
260 return get_socket_value<array<bool>>(
this, input);
266 return get_socket_value<array<int>>(
this, input);
272 return get_socket_value<array<float>>(
this, input);
278 return get_socket_value<array<float2>>(
this, input);
284 return get_socket_value<array<float3>>(
this, input);
290 return get_socket_value<array<ustring>>(
this, input);
296 return get_socket_value<array<Transform>>(
this, input);
302 return get_socket_value<array<Node *>>(
this, input);
310 void *dst = &get_socket_value<char>(
this, input);
311 return memcmp(dst, src, input.
size()) == 0;
318 if (socket.
size() > 0) {
319 memcpy(dst, src, socket.
size());
336 assert(socket.
type == other_socket.
type);
339 switch (socket.
type) {
341 copy_array<bool>(
this, socket, &other, other_socket);
344 copy_array<float>(
this, socket, &other, other_socket);
347 copy_array<int>(
this, socket, &other, other_socket);
350 copy_array<float3>(
this, socket, &other, other_socket);
353 copy_array<float3>(
this, socket, &other, other_socket);
356 copy_array<float3>(
this, socket, &other, other_socket);
359 copy_array<float3>(
this, socket, &other, other_socket);
362 copy_array<float2>(
this, socket, &other, other_socket);
365 copy_array<ustring>(
this, socket, &other, other_socket);
368 copy_array<Transform>(
this, socket, &other, other_socket);
371 copy_array<void *>(
this, socket, &other, other_socket);
379 const void *src = ((
char *)&other) + other_socket.
struct_offset;
381 memcpy(dst, src, socket.
size());
387 assert(socket.
type == other_socket.
type);
391 switch (socket.
type) {
425 switch (socket.
type) {
427 set(socket, get_socket_value<bool>(&other, socket));
430 set(socket, get_socket_value<float>(&other, socket));
433 set(socket, get_socket_value<int>(&other, socket));
436 set(socket, get_socket_value<uint>(&other, socket));
442 set(socket, get_socket_value<float3>(&other, socket));
445 set(socket, get_socket_value<float2>(&other, socket));
448 set(socket, get_socket_value<ustring>(&other, socket));
451 set(socket, get_socket_value<int>(&other, socket));
454 set(socket, get_socket_value<Transform>(&other, socket));
457 set(socket, get_socket_value<Node *>(&other, socket));
484 switch (socket.
type) {
486 return is_value_equal<bool>(
this, &other, socket);
488 return is_value_equal<float>(
this, &other, socket);
490 return is_value_equal<int>(
this, &other, socket);
492 return is_value_equal<uint>(
this, &other, socket);
494 return is_value_equal<float3>(
this, &other, socket);
496 return is_value_equal<float3>(
this, &other, socket);
498 return is_value_equal<float3>(
this, &other, socket);
500 return is_value_equal<float3>(
this, &other, socket);
502 return is_value_equal<float2>(
this, &other, socket);
506 return is_value_equal<ustring>(
this, &other, socket);
508 return is_value_equal<int>(
this, &other, socket);
510 return is_value_equal<Transform>(
this, &other, socket);
512 return is_value_equal<void *>(
this, &other, socket);
515 return is_array_equal<bool>(
this, &other, socket);
517 return is_array_equal<float>(
this, &other, socket);
519 return is_array_equal<int>(
this, &other, socket);
521 return is_array_equal<float3>(
this, &other, socket);
523 return is_array_equal<float3>(
this, &other, socket);
525 return is_array_equal<float3>(
this, &other, socket);
527 return is_array_equal<float3>(
this, &other, socket);
529 return is_array_equal<float2>(
this, &other, socket);
531 return is_array_equal<ustring>(
this, &other, socket);
533 return is_array_equal<Transform>(
this, &other, socket);
535 return is_array_equal<void *>(
this, &other, socket);
576 for (
size_t i = 0; i <
a.size(); i++) {
585 for (
size_t i = 0; i <
a.size(); i++) {
599 switch (socket.
type) {
601 value_hash<bool>(
this, socket, md5);
604 value_hash<float>(
this, socket, md5);
607 value_hash<int>(
this, socket, md5);
610 value_hash<uint>(
this, socket, md5);
613 float3_hash(
this, socket, md5);
616 float3_hash(
this, socket, md5);
619 float3_hash(
this, socket, md5);
622 float3_hash(
this, socket, md5);
625 value_hash<float2>(
this, socket, md5);
630 value_hash<ustring>(
this, socket, md5);
633 value_hash<int>(
this, socket, md5);
636 value_hash<Transform>(
this, socket, md5);
639 value_hash<void *>(
this, socket, md5);
643 array_hash<bool>(
this, socket, md5);
646 array_hash<float>(
this, socket, md5);
649 array_hash<int>(
this, socket, md5);
652 float3_array_hash(
this, socket, md5);
655 float3_array_hash(
this, socket, md5);
658 float3_array_hash(
this, socket, md5);
661 float3_array_hash(
this, socket, md5);
664 array_hash<float2>(
this, socket, md5);
667 array_hash<ustring>(
this, socket, md5);
670 array_hash<Transform>(
this, socket, md5);
673 array_hash<void *>(
this, socket, md5);
684 template<
typename T>
size_t array_size_in_bytes(
const Node *
node,
const SocketType &socket)
687 return a.size() *
sizeof(
T);
694 size_t total_size = 0;
696 switch (socket.
type) {
711 total_size += socket.
size();
715 total_size += array_size_in_bytes<bool>(
this, socket);
718 total_size += array_size_in_bytes<float>(
this, socket);
721 total_size += array_size_in_bytes<int>(
this, socket);
724 total_size += array_size_in_bytes<float3>(
this, socket);
727 total_size += array_size_in_bytes<float3>(
this, socket);
730 total_size += array_size_in_bytes<float3>(
this, socket);
733 total_size += array_size_in_bytes<float3>(
this, socket);
736 total_size += array_size_in_bytes<float2>(
this, socket);
739 total_size += array_size_in_bytes<ustring>(
this, socket);
742 total_size += array_size_in_bytes<Transform>(
this, socket);
745 total_size += array_size_in_bytes<void *>(
this, socket);
798 if (get_socket_value<T>(
this, input) == value) {
802 get_socket_value<T>(
this, input) = value;
814 get_socket_value<array<T>>(
this, input).steal_data(value);
820 printf(
"Node : %s\n",
name.c_str());
823 printf(
"-- socket modified : %s\n", socket.
name.c_str());
typedef float(TangentPoint)[2]
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void append(const uint8_t *data, int size)
#define CCL_NAMESPACE_END
static bool is_socket_array_float3(const SocketType &socket)
static bool is_array_equal(const Node *node, const Node *other, const SocketType &socket)
static bool is_value_equal(const Node *node, const Node *other, const SocketType &socket)
static bool is_socket_float3(const SocketType &socket)
static void copy_array(const Node *node, const SocketType &socket, const Node *other, const SocketType &other_socket)
bool exists(ustring x) const
vector< SocketType, std::allocator< SocketType > > inputs
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_)
const void * default_value
const NodeEnum * enum_values
SocketModifiedFlags modified_flag_bit