Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/graph/node.h
| Show All 39 Lines | #define NODE_SOCKET_API_BASE_METHODS(type_, name, string_name) \ | ||||
| bool name##_is_modified() const \ | bool name##_is_modified() const \ | ||||
| { \ | { \ | ||||
| const SocketType *socket = get_##name##_socket(); \ | const SocketType *socket = get_##name##_socket(); \ | ||||
| return socket_is_modified(*socket); \ | return socket_is_modified(*socket); \ | ||||
| } \ | } \ | ||||
| void tag_##name##_modified() \ | void tag_##name##_modified() \ | ||||
| { \ | { \ | ||||
| const SocketType *socket = get_##name##_socket(); \ | const SocketType *socket = get_##name##_socket(); \ | ||||
| socket_modified |= socket->modified_flag_bit; \ | socket_modified |= socket->get_modified_flag_bit(); \ | ||||
| } \ | } \ | ||||
| type_ const &get_##name() const \ | type_ const &get_##name() const \ | ||||
| { \ | { \ | ||||
| const SocketType *socket = get_##name##_socket(); \ | const SocketType *socket = get_##name##_socket(); \ | ||||
| return get_socket_value<type_>(this, *socket); \ | return get_socket_value<type_>(this, *socket); \ | ||||
| } | } | ||||
| #define NODE_SOCKET_API_BASE(type_, name, string_name) \ | #define NODE_SOCKET_API_BASE(type_, name, string_name) \ | ||||
| ▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Lines | struct Node { | ||||
| bool is_modified(); | bool is_modified(); | ||||
| void tag_modified(); | void tag_modified(); | ||||
| void clear_modified(); | void clear_modified(); | ||||
| void print_modified_sockets() const; | void print_modified_sockets() const; | ||||
| ustring name; | const NodeType *get_type() const | ||||
| const NodeType *type; | { | ||||
| return type; | |||||
| } | |||||
| const NodeOwner *get_owner() const; | const NodeOwner *get_owner() const; | ||||
| void set_owner(const NodeOwner *owner_); | void set_owner(const NodeOwner *owner_); | ||||
| GET_SET(ustring, name) | |||||
| protected: | protected: | ||||
| const NodeType *type; | |||||
| const NodeOwner *owner; | const NodeOwner *owner; | ||||
| template<typename T> static T &get_socket_value(const Node *node, const SocketType &socket) | template<typename T> static T &get_socket_value(const Node *node, const SocketType &socket) | ||||
| { | { | ||||
| return (T &)*(((char *)node) + socket.struct_offset); | return (T &)*(((char *)node) + socket.get_struct_offset()); | ||||
| } | } | ||||
| SocketModifiedFlags socket_modified; | SocketModifiedFlags socket_modified; | ||||
| template<typename T> void set_if_different(const SocketType &input, T value); | template<typename T> void set_if_different(const SocketType &input, T value); | ||||
| template<typename T> void set_if_different(const SocketType &input, array<T> &value); | template<typename T> void set_if_different(const SocketType &input, array<T> &value); | ||||
| }; | }; | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||