Changeset View
Changeset View
Standalone View
Standalone View
source/blender/functions/intern/field.cc
| Show First 20 Lines • Show All 513 Lines • ▼ Show 20 Lines | const GVArray *FieldContext::get_varray_for_input(const FieldInput &field_input, | ||||
| * the context here. */ | * the context here. */ | ||||
| return field_input.get_varray_for_context(*this, mask, scope); | return field_input.get_varray_for_context(*this, mask, scope); | ||||
| } | } | ||||
| IndexFieldInput::IndexFieldInput() : FieldInput(CPPType::get<int>(), "Index") | IndexFieldInput::IndexFieldInput() : FieldInput(CPPType::get<int>(), "Index") | ||||
| { | { | ||||
| } | } | ||||
| const GVArray *IndexFieldInput::get_varray_for_context(const fn::FieldContext &UNUSED(context), | GVArray *IndexFieldInput::get_index_varray(IndexMask mask, ResourceScope &scope) | ||||
| IndexMask mask, | |||||
| ResourceScope &scope) const | |||||
| { | { | ||||
| /* TODO: Investigate a similar method to IndexRange::as_span() */ | |||||
| auto index_func = [](int i) { return i; }; | auto index_func = [](int i) { return i; }; | ||||
| return &scope.construct< | return &scope.construct< | ||||
| fn::GVArray_For_EmbeddedVArray<int, VArray_For_Func<int, decltype(index_func)>>>( | fn::GVArray_For_EmbeddedVArray<int, VArray_For_Func<int, decltype(index_func)>>>( | ||||
| mask.min_array_size(), mask.min_array_size(), index_func); | mask.min_array_size(), mask.min_array_size(), index_func); | ||||
| } | } | ||||
| const GVArray *IndexFieldInput::get_varray_for_context(const fn::FieldContext &UNUSED(context), | |||||
| IndexMask mask, | |||||
| ResourceScope &scope) const | |||||
| { | |||||
| /* TODO: Investigate a similar method to IndexRange::as_span() */ | |||||
| return get_index_varray(mask, scope); | |||||
| } | |||||
| /* -------------------------------------------------------------------- | /* -------------------------------------------------------------------- | ||||
| * FieldOperation. | * FieldOperation. | ||||
| */ | */ | ||||
| FieldOperation::FieldOperation(std::shared_ptr<const MultiFunction> function, | FieldOperation::FieldOperation(std::shared_ptr<const MultiFunction> function, | ||||
| Vector<GField> inputs) | Vector<GField> inputs) | ||||
| : FieldOperation(*function, std::move(inputs)) | : FieldOperation(*function, std::move(inputs)) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines | |||||