Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/NOD_socket_declarations.hh
| Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | |||||
| }; | }; | ||||
| class VectorBuilder : public SocketDeclarationBuilder<Vector> { | class VectorBuilder : public SocketDeclarationBuilder<Vector> { | ||||
| public: | public: | ||||
| VectorBuilder &default_value(const float3 value); | VectorBuilder &default_value(const float3 value); | ||||
| VectorBuilder &subtype(PropertySubType subtype); | VectorBuilder &subtype(PropertySubType subtype); | ||||
| VectorBuilder &min(const float min); | VectorBuilder &min(const float min); | ||||
| VectorBuilder &max(const float max); | VectorBuilder &max(const float max); | ||||
| VectorBuilder &compact(); | |||||
| }; | }; | ||||
| class BoolBuilder; | class BoolBuilder; | ||||
| class Bool : public SocketDeclaration { | class Bool : public SocketDeclaration { | ||||
| private: | private: | ||||
| bool default_value_ = false; | bool default_value_ = false; | ||||
| friend BoolBuilder; | friend BoolBuilder; | ||||
| ▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| class Image : public IDSocketDeclaration { | class Image : public IDSocketDeclaration { | ||||
| public: | public: | ||||
| using Builder = SocketDeclarationBuilder<Image>; | using Builder = SocketDeclarationBuilder<Image>; | ||||
| Image(); | Image(); | ||||
| }; | }; | ||||
| class ShaderBuilder; | |||||
| class Shader : public SocketDeclaration { | |||||
| private: | |||||
| friend ShaderBuilder; | |||||
| public: | |||||
| using Builder = ShaderBuilder; | |||||
| bNodeSocket &build(bNodeTree &ntree, bNode &node, eNodeSocketInOut in_out) const override; | |||||
| bool matches(const bNodeSocket &socket) const override; | |||||
| }; | |||||
| class ShaderBuilder : public SocketDeclarationBuilder<Shader> { | |||||
| }; | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name #FloatBuilder Inline Methods | /** \name #FloatBuilder Inline Methods | ||||
| * \{ */ | * \{ */ | ||||
| inline FloatBuilder &FloatBuilder::min(const float value) | inline FloatBuilder &FloatBuilder::min(const float value) | ||||
| { | { | ||||
| decl_->soft_min_value_ = value; | decl_->soft_min_value_ = value; | ||||
| return *this; | return *this; | ||||
| ▲ Show 20 Lines • Show All 72 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| inline VectorBuilder &VectorBuilder::max(const float max) | inline VectorBuilder &VectorBuilder::max(const float max) | ||||
| { | { | ||||
| decl_->soft_max_value_ = max; | decl_->soft_max_value_ = max; | ||||
| return *this; | return *this; | ||||
| } | } | ||||
| inline VectorBuilder &VectorBuilder::compact() | |||||
| { | |||||
| decl_->compact_ = true; | |||||
| return *this; | |||||
| } | |||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name #BoolBuilder Inline Methods | /** \name #BoolBuilder Inline Methods | ||||
| * \{ */ | * \{ */ | ||||
| inline BoolBuilder &BoolBuilder::default_value(const bool value) | inline BoolBuilder &BoolBuilder::default_value(const bool value) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
| inline Image::Image() : IDSocketDeclaration("NodeSocketImage") | inline Image::Image() : IDSocketDeclaration("NodeSocketImage") | ||||
| { | { | ||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| } // namespace blender::nodes::decl | } // namespace blender::nodes::decl | ||||
| /* -------------------------------------------------------------------- */ | |||||
| /** \name External Template Instantiations | |||||
| * | |||||
| * Defined in `intern/extern_implementations.cc`. | |||||
| * \{ */ | |||||
| namespace blender::nodes { | |||||
| #define MAKE_EXTERN_SOCKET_DECLARATION(TYPE) \ | |||||
| extern template class SocketDeclarationBuilder<TYPE>; \ | |||||
| extern template TYPE::Builder &NodeDeclarationBuilder::add_input<TYPE>(StringRef, StringRef); \ | |||||
| extern template TYPE::Builder &NodeDeclarationBuilder::add_output<TYPE>(StringRef, StringRef); | |||||
| MAKE_EXTERN_SOCKET_DECLARATION(decl::Float) | |||||
| MAKE_EXTERN_SOCKET_DECLARATION(decl::Int) | |||||
| MAKE_EXTERN_SOCKET_DECLARATION(decl::Vector) | |||||
| MAKE_EXTERN_SOCKET_DECLARATION(decl::Bool) | |||||
| MAKE_EXTERN_SOCKET_DECLARATION(decl::Color) | |||||
| MAKE_EXTERN_SOCKET_DECLARATION(decl::String) | |||||
| } // namespace blender::nodes | |||||
| /** \} */ | |||||