Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_geometry_fields.hh
| Show First 20 Lines • Show All 139 Lines • ▼ Show 20 Lines | |||||||||||
| class GeometryFieldInput : public fn::FieldInput { | class GeometryFieldInput : public fn::FieldInput { | ||||||||||
| public: | public: | ||||||||||
| using fn::FieldInput::FieldInput; | using fn::FieldInput::FieldInput; | ||||||||||
| GVArray get_varray_for_context(const fn::FieldContext &context, | GVArray get_varray_for_context(const fn::FieldContext &context, | ||||||||||
| IndexMask mask, | IndexMask mask, | ||||||||||
| ResourceScope &scope) const override; | ResourceScope &scope) const override; | ||||||||||
| virtual GVArray get_varray_for_context(const GeometryFieldContext &context, | virtual GVArray get_varray_for_context(const GeometryFieldContext &context, | ||||||||||
| IndexMask mask) const = 0; | IndexMask mask) const = 0; | ||||||||||
| virtual std::optional<eAttrDomain> preferred_domain(const GeometryComponent &component) const; | |||||||||||
| }; | }; | ||||||||||
| class MeshFieldInput : public fn::FieldInput { | class MeshFieldInput : public fn::FieldInput { | ||||||||||
| public: | public: | ||||||||||
| using fn::FieldInput::FieldInput; | using fn::FieldInput::FieldInput; | ||||||||||
| GVArray get_varray_for_context(const fn::FieldContext &context, | GVArray get_varray_for_context(const fn::FieldContext &context, | ||||||||||
| IndexMask mask, | IndexMask mask, | ||||||||||
| ResourceScope &scope) const override; | ResourceScope &scope) const override; | ||||||||||
| virtual GVArray get_varray_for_context(const Mesh &mesh, | virtual GVArray get_varray_for_context(const Mesh &mesh, | ||||||||||
| eAttrDomain domain, | eAttrDomain domain, | ||||||||||
| IndexMask mask) const = 0; | IndexMask mask) const = 0; | ||||||||||
| virtual std::optional<eAttrDomain> preferred_domain(const Mesh &mesh) const; | |||||||||||
| }; | }; | ||||||||||
| class CurvesFieldInput : public fn::FieldInput { | class CurvesFieldInput : public fn::FieldInput { | ||||||||||
| public: | public: | ||||||||||
| using fn::FieldInput::FieldInput; | using fn::FieldInput::FieldInput; | ||||||||||
| GVArray get_varray_for_context(const fn::FieldContext &context, | GVArray get_varray_for_context(const fn::FieldContext &context, | ||||||||||
| IndexMask mask, | IndexMask mask, | ||||||||||
| ResourceScope &scope) const override; | ResourceScope &scope) const override; | ||||||||||
| virtual GVArray get_varray_for_context(const CurvesGeometry &curves, | virtual GVArray get_varray_for_context(const CurvesGeometry &curves, | ||||||||||
| eAttrDomain domain, | eAttrDomain domain, | ||||||||||
| IndexMask mask) const = 0; | IndexMask mask) const = 0; | ||||||||||
| virtual std::optional<eAttrDomain> preferred_domain(const CurvesGeometry &curves) const; | |||||||||||
| }; | }; | ||||||||||
| class PointCloudFieldInput : public fn::FieldInput { | class PointCloudFieldInput : public fn::FieldInput { | ||||||||||
| public: | public: | ||||||||||
| using fn::FieldInput::FieldInput; | using fn::FieldInput::FieldInput; | ||||||||||
| GVArray get_varray_for_context(const fn::FieldContext &context, | GVArray get_varray_for_context(const fn::FieldContext &context, | ||||||||||
| IndexMask mask, | IndexMask mask, | ||||||||||
| ResourceScope &scope) const override; | ResourceScope &scope) const override; | ||||||||||
| Show All 35 Lines | public: | ||||||||||
| GVArray get_varray_for_context(const GeometryFieldContext &context, | GVArray get_varray_for_context(const GeometryFieldContext &context, | ||||||||||
| IndexMask mask) const override; | IndexMask mask) const override; | ||||||||||
| std::string socket_inspection_name() const override; | std::string socket_inspection_name() const override; | ||||||||||
| uint64_t hash() const override; | uint64_t hash() const override; | ||||||||||
| bool is_equal_to(const fn::FieldNode &other) const override; | bool is_equal_to(const fn::FieldNode &other) const override; | ||||||||||
| std::optional<eAttrDomain> preferred_domain(const GeometryComponent &component) const override; | |||||||||||
| }; | }; | ||||||||||
| class IDAttributeFieldInput : public GeometryFieldInput { | class IDAttributeFieldInput : public GeometryFieldInput { | ||||||||||
| public: | public: | ||||||||||
| IDAttributeFieldInput() : GeometryFieldInput(CPPType::get<int>()) | IDAttributeFieldInput() : GeometryFieldInput(CPPType::get<int>()) | ||||||||||
| { | { | ||||||||||
| category_ = Category::Generated; | category_ = Category::Generated; | ||||||||||
| } | } | ||||||||||
| ▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | public: | ||||||||||
| GVArray get_varray_for_context(const GeometryFieldContext &context, | GVArray get_varray_for_context(const GeometryFieldContext &context, | ||||||||||
| IndexMask mask) const override; | IndexMask mask) const override; | ||||||||||
| std::string socket_inspection_name() const override; | std::string socket_inspection_name() const override; | ||||||||||
| uint64_t hash() const override; | uint64_t hash() const override; | ||||||||||
| bool is_equal_to(const fn::FieldNode &other) const override; | bool is_equal_to(const fn::FieldNode &other) const override; | ||||||||||
| std::optional<eAttrDomain> preferred_domain(const GeometryComponent &component) const override; | |||||||||||
| }; | }; | ||||||||||
| class CurveLengthFieldInput final : public CurvesFieldInput { | class CurveLengthFieldInput final : public CurvesFieldInput { | ||||||||||
| public: | public: | ||||||||||
| CurveLengthFieldInput(); | CurveLengthFieldInput(); | ||||||||||
| GVArray get_varray_for_context(const CurvesGeometry &curves, | GVArray get_varray_for_context(const CurvesGeometry &curves, | ||||||||||
| eAttrDomain domain, | eAttrDomain domain, | ||||||||||
| IndexMask mask) const final; | IndexMask mask) const final; | ||||||||||
| uint64_t hash() const override; | uint64_t hash() const override; | ||||||||||
| bool is_equal_to(const fn::FieldNode &other) const override; | bool is_equal_to(const fn::FieldNode &other) const override; | ||||||||||
| }; | }; | ||||||||||
| bool try_capture_field_on_geometry(GeometryComponent &component, | |||||||||||
| const AttributeIDRef &attribute_id, | |||||||||||
| const eAttrDomain domain, | |||||||||||
| const fn::GField &field); | |||||||||||
| /** | |||||||||||
| * Try to find the geometry domain that the field should be evaluated on. If it is not obvious | |||||||||||
HooglyBooglyUnsubmitted Not Done Inline Actions
HooglyBoogly: | |||||||||||
| * which domain is correct, none is returned. | |||||||||||
| */ | |||||||||||
| std::optional<eAttrDomain> try_detect_field_domain(const GeometryComponent &component, | |||||||||||
Not Done Inline Actions
HooglyBoogly: | |||||||||||
| const fn::GField &field); | |||||||||||
| } // namespace blender::bke | } // namespace blender::bke | ||||||||||