Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/NOD_node_declaration.hh
| Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | protected: | ||||
| std::string name_; | std::string name_; | ||||
| std::string identifier_; | std::string identifier_; | ||||
| std::string description_; | std::string description_; | ||||
| bool hide_label_ = false; | bool hide_label_ = false; | ||||
| bool hide_value_ = false; | bool hide_value_ = false; | ||||
| bool is_multi_input_ = false; | bool is_multi_input_ = false; | ||||
| bool no_mute_links_ = false; | bool no_mute_links_ = false; | ||||
| bool is_attribute_name_ = false; | bool is_attribute_name_ = false; | ||||
| bool is_default_link_socket_ = false; | |||||
| InputSocketFieldType input_field_type_ = InputSocketFieldType::None; | InputSocketFieldType input_field_type_ = InputSocketFieldType::None; | ||||
| OutputFieldDependency output_field_dependency_; | OutputFieldDependency output_field_dependency_; | ||||
| friend NodeDeclarationBuilder; | friend NodeDeclarationBuilder; | ||||
| template<typename SocketDecl> friend class SocketDeclarationBuilder; | template<typename SocketDecl> friend class SocketDeclarationBuilder; | ||||
| public: | public: | ||||
| virtual ~SocketDeclaration() = default; | virtual ~SocketDeclaration() = default; | ||||
| virtual bNodeSocket &build(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out) const = 0; | virtual bNodeSocket &build(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out) const = 0; | ||||
| virtual bool matches(const bNodeSocket &socket) const = 0; | virtual bool matches(const bNodeSocket &socket) const = 0; | ||||
| virtual bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const; | virtual bNodeSocket &update_or_build(bNodeTree &ntree, bNode &node, bNodeSocket &socket) const; | ||||
| StringRefNull name() const; | StringRefNull name() const; | ||||
| StringRefNull description() const; | StringRefNull description() const; | ||||
| StringRefNull identifier() const; | StringRefNull identifier() const; | ||||
| bool is_attribute_name() const; | bool is_attribute_name() const; | ||||
| bool is_default_link_socket() const; | |||||
| InputSocketFieldType input_field_type() const; | InputSocketFieldType input_field_type() const; | ||||
| const OutputFieldDependency &output_field_dependency() const; | const OutputFieldDependency &output_field_dependency() const; | ||||
| protected: | protected: | ||||
| void set_common_flags(bNodeSocket &socket) const; | void set_common_flags(bNodeSocket &socket) const; | ||||
| bool matches_common_data(const bNodeSocket &socket) const; | bool matches_common_data(const bNodeSocket &socket) const; | ||||
| }; | }; | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | public: | ||||
| } | } | ||||
| Self &is_attribute_name(bool value = true) | Self &is_attribute_name(bool value = true) | ||||
| { | { | ||||
| decl_->is_attribute_name_ = value; | decl_->is_attribute_name_ = value; | ||||
| return *(Self *)this; | return *(Self *)this; | ||||
| } | } | ||||
| Self &is_default_link_socket(bool value = true) | |||||
| { | |||||
| decl_->is_default_link_socket_ = value; | |||||
| return *(Self *)this; | |||||
| } | |||||
| /** The input socket allows passing in a field. */ | /** The input socket allows passing in a field. */ | ||||
| Self &supports_field() | Self &supports_field() | ||||
| { | { | ||||
| decl_->input_field_type_ = InputSocketFieldType::IsSupported; | decl_->input_field_type_ = InputSocketFieldType::IsSupported; | ||||
| return *(Self *)this; | return *(Self *)this; | ||||
| } | } | ||||
| /** The input supports a field and is a field by default when nothing is connected. */ | /** The input supports a field and is a field by default when nothing is connected. */ | ||||
| ▲ Show 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | inline StringRefNull SocketDeclaration::description() const | ||||
| return description_; | return description_; | ||||
| } | } | ||||
| inline bool SocketDeclaration::is_attribute_name() const | inline bool SocketDeclaration::is_attribute_name() const | ||||
| { | { | ||||
| return is_attribute_name_; | return is_attribute_name_; | ||||
| } | } | ||||
| inline bool SocketDeclaration::is_default_link_socket() const | |||||
| { | |||||
| return is_default_link_socket_; | |||||
| } | |||||
| inline InputSocketFieldType SocketDeclaration::input_field_type() const | inline InputSocketFieldType SocketDeclaration::input_field_type() const | ||||
| { | { | ||||
| return input_field_type_; | return input_field_type_; | ||||
| } | } | ||||
| inline const OutputFieldDependency &SocketDeclaration::output_field_dependency() const | inline const OutputFieldDependency &SocketDeclaration::output_field_dependency() const | ||||
| { | { | ||||
| return output_field_dependency_; | return output_field_dependency_; | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||