Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc
| Show First 20 Lines • Show All 279 Lines • ▼ Show 20 Lines | if (const AccumulateFieldInput *other_accumulate = dynamic_cast<const AccumulateFieldInput *>( | ||||
| &other)) { | &other)) { | ||||
| return input_ == other_accumulate->input_ && | return input_ == other_accumulate->input_ && | ||||
| group_index_ == other_accumulate->group_index_ && | group_index_ == other_accumulate->group_index_ && | ||||
| source_domain_ == other_accumulate->source_domain_ && | source_domain_ == other_accumulate->source_domain_ && | ||||
| accumulation_mode_ == other_accumulate->accumulation_mode_; | accumulation_mode_ == other_accumulate->accumulation_mode_; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| std::optional<eAttrDomain> preferred_domain( | |||||
| const GeometryComponent & /*component*/) const override | |||||
| { | |||||
| return source_domain_; | |||||
| } | |||||
| }; | }; | ||||
| template<typename T> class TotalFieldInput final : public bke::GeometryFieldInput { | template<typename T> class TotalFieldInput final : public bke::GeometryFieldInput { | ||||
| private: | private: | ||||
| Field<T> input_; | Field<T> input_; | ||||
| Field<int> group_index_; | Field<int> group_index_; | ||||
| eAttrDomain source_domain_; | eAttrDomain source_domain_; | ||||
| ▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | public: | ||||
| bool is_equal_to(const fn::FieldNode &other) const override | bool is_equal_to(const fn::FieldNode &other) const override | ||||
| { | { | ||||
| if (const TotalFieldInput *other_field = dynamic_cast<const TotalFieldInput *>(&other)) { | if (const TotalFieldInput *other_field = dynamic_cast<const TotalFieldInput *>(&other)) { | ||||
| return input_ == other_field->input_ && group_index_ == other_field->group_index_ && | return input_ == other_field->input_ && group_index_ == other_field->group_index_ && | ||||
| source_domain_ == other_field->source_domain_; | source_domain_ == other_field->source_domain_; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| std::optional<eAttrDomain> preferred_domain( | |||||
| const GeometryComponent & /*component*/) const override | |||||
| { | |||||
| return source_domain_; | |||||
| } | |||||
| }; | }; | ||||
| template<typename T> std::string identifier_suffix() | template<typename T> std::string identifier_suffix() | ||||
| { | { | ||||
| if constexpr (std::is_same_v<T, int>) { | if constexpr (std::is_same_v<T, int>) { | ||||
| return "Int"; | return "Int"; | ||||
| } | } | ||||
| if constexpr (std::is_same_v<T, float>) { | if constexpr (std::is_same_v<T, float>) { | ||||
| ▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines | |||||