Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/NOD_node_tree_ref.hh
| Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | private: | ||||
| friend NodeTreeRef; | friend NodeTreeRef; | ||||
| public: | public: | ||||
| const NodeTreeRef &tree() const; | const NodeTreeRef &tree() const; | ||||
| Span<const InputSocketRef *> inputs() const; | Span<const InputSocketRef *> inputs() const; | ||||
| Span<const OutputSocketRef *> outputs() const; | Span<const OutputSocketRef *> outputs() const; | ||||
| Span<const InternalLinkRef *> internal_links() const; | Span<const InternalLinkRef *> internal_links() const; | ||||
| Span<const SocketRef *> sockets(eNodeSocketInOut in_out) const; | |||||
| const InputSocketRef &input(int index) const; | const InputSocketRef &input(int index) const; | ||||
| const OutputSocketRef &output(int index) const; | const OutputSocketRef &output(int index) const; | ||||
| const InputSocketRef &input_by_identifier(StringRef identifier) const; | const InputSocketRef &input_by_identifier(StringRef identifier) const; | ||||
| const OutputSocketRef &output_by_identifier(StringRef identifier) const; | const OutputSocketRef &output_by_identifier(StringRef identifier) const; | ||||
| bool any_input_is_directly_linked() const; | |||||
| bool any_output_is_directly_linked() const; | |||||
| bool any_socket_is_directly_linked(eNodeSocketInOut in_out) const; | |||||
| bNode *bnode() const; | bNode *bnode() const; | ||||
| bNodeTree *btree() const; | bNodeTree *btree() const; | ||||
| PointerRNA *rna() const; | PointerRNA *rna() const; | ||||
| StringRefNull idname() const; | StringRefNull idname() const; | ||||
| StringRefNull name() const; | StringRefNull name() const; | ||||
| bNodeType *typeinfo() const; | bNodeType *typeinfo() const; | ||||
| const NodeDeclaration *declaration() const; | |||||
| int id() const; | int id() const; | ||||
| bool is_reroute_node() const; | bool is_reroute_node() const; | ||||
| bool is_group_node() const; | bool is_group_node() const; | ||||
| bool is_group_input_node() const; | bool is_group_input_node() const; | ||||
| bool is_group_output_node() const; | bool is_group_output_node() const; | ||||
| bool is_muted() const; | bool is_muted() const; | ||||
| ▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | public: | ||||
| Span<const InputSocketRef *> input_sockets() const; | Span<const InputSocketRef *> input_sockets() const; | ||||
| Span<const OutputSocketRef *> output_sockets() const; | Span<const OutputSocketRef *> output_sockets() const; | ||||
| Span<const LinkRef *> links() const; | Span<const LinkRef *> links() const; | ||||
| bool has_link_cycles() const; | bool has_link_cycles() const; | ||||
| bool has_undefined_nodes_or_sockets() const; | bool has_undefined_nodes_or_sockets() const; | ||||
| enum class ToposortDirection { | |||||
| LeftToRight, | |||||
| RightToLeft, | |||||
| }; | |||||
| Vector<const NodeRef *> toposort(ToposortDirection direction) const; | |||||
| bNodeTree *btree() const; | bNodeTree *btree() const; | ||||
| StringRefNull name() const; | StringRefNull name() const; | ||||
| std::string to_dot() const; | std::string to_dot() const; | ||||
| private: | private: | ||||
| /* Utility functions used during construction. */ | /* Utility functions used during construction. */ | ||||
| InputSocketRef &find_input_socket(Map<bNode *, NodeRef *> &node_mapping, | InputSocketRef &find_input_socket(Map<bNode *, NodeRef *> &node_mapping, | ||||
| ▲ Show 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | inline Span<const InputSocketRef *> NodeRef::inputs() const | ||||
| return inputs_; | return inputs_; | ||||
| } | } | ||||
| inline Span<const OutputSocketRef *> NodeRef::outputs() const | inline Span<const OutputSocketRef *> NodeRef::outputs() const | ||||
| { | { | ||||
| return outputs_; | return outputs_; | ||||
| } | } | ||||
| inline Span<const SocketRef *> NodeRef::sockets(const eNodeSocketInOut in_out) const | |||||
| { | |||||
| return in_out == SOCK_IN ? inputs_.as_span().cast<const SocketRef *>() : | |||||
| outputs_.as_span().cast<const SocketRef *>(); | |||||
| } | |||||
| inline Span<const InternalLinkRef *> NodeRef::internal_links() const | inline Span<const InternalLinkRef *> NodeRef::internal_links() const | ||||
| { | { | ||||
| return internal_links_; | return internal_links_; | ||||
| } | } | ||||
| inline const InputSocketRef &NodeRef::input(int index) const | inline const InputSocketRef &NodeRef::input(int index) const | ||||
| { | { | ||||
| return *inputs_[index]; | return *inputs_[index]; | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | inline StringRefNull NodeRef::name() const | ||||
| return bnode_->name; | return bnode_->name; | ||||
| } | } | ||||
| inline bNodeType *NodeRef::typeinfo() const | inline bNodeType *NodeRef::typeinfo() const | ||||
| { | { | ||||
| return bnode_->typeinfo; | return bnode_->typeinfo; | ||||
| } | } | ||||
| /* Returns a pointer because not all nodes have declarations currently. */ | |||||
| inline const NodeDeclaration *NodeRef::declaration() const | |||||
| { | |||||
| nodeDeclarationEnsure(this->tree().btree(), bnode_); | |||||
| return bnode_->declaration; | |||||
| } | |||||
| inline int NodeRef::id() const | inline int NodeRef::id() const | ||||
| { | { | ||||
| return id_; | return id_; | ||||
| } | } | ||||
| inline bool NodeRef::is_reroute_node() const | inline bool NodeRef::is_reroute_node() const | ||||
| { | { | ||||
| return bnode_->type == NODE_REROUTE; | return bnode_->type == NODE_REROUTE; | ||||
| ▲ Show 20 Lines • Show All 136 Lines • Show Last 20 Lines | |||||