|
Blender V4.5
|
#include <FN_field.hh>
Inherits blender::NonMovable, and blender::NonCopyable.
Public Member Functions | |
| FieldEvaluator (const FieldContext &context, const IndexMask *mask) | |
| FieldEvaluator (const FieldContext &context, const int64_t size) | |
| ~FieldEvaluator () | |
| void | set_selection (Field< bool > selection) |
| template<typename T > | |
| int | add_with_destination (Field< T > field, VMutableArray< T > dst) |
| template<typename T > | |
| int | add_with_destination (Field< T > field, MutableSpan< T > dst) |
| template<typename T > | |
| int | add (Field< T > field, VArray< T > *varray_ptr) |
| const GVArray & | get_evaluated (const int field_index) const |
| template<typename T > | |
| VArray< T > | get_evaluated (const int field_index) |
#FieldEvaluator | |
| int | add_with_destination (GField field, GVMutableArray dst) |
| int | add_with_destination (GField field, GMutableSpan dst) |
| int | add (GField field, GVArray *varray_ptr) |
| int | add (GField field) |
| void | evaluate () |
| IndexMask | get_evaluated_selection_as_mask () const |
| IndexMask | get_evaluated_as_mask (int field_index) |
Utility class that makes it easier to evaluate fields.
Definition at line 336 of file FN_field.hh.
|
inline |
Takes mask by pointer because the mask has to live longer than the evaluator.
Definition at line 358 of file FN_field.hh.
|
inline |
Construct a field evaluator for all indices less than size.
Definition at line 364 of file FN_field.hh.
|
inline |
Definition at line 369 of file FN_field.hh.
References BLI_assert.
|
inline |
| field | Field to add to the evaluator. |
| varray_ptr | Once evaluate is called, the resulting virtual array will be will be assigned to the given position. |
Definition at line 427 of file FN_field.hh.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), and blender::Vector< T, InlineBufferCapacity, Allocator >::append_and_get_index().
| int blender::fn::FieldEvaluator::add | ( | GField | field | ) |
Definition at line 762 of file field.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append().
Definition at line 751 of file field.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append().
Referenced by blender::nodes::node_geo_uv_pack_islands_cc::construct_uv_gvarray(), blender::nodes::node_geo_uv_unwrap_cc::construct_uv_gvarray(), blender::nodes::node_geo_points_to_curves_cc::curves_from_points(), blender::nodes::node_geo_split_to_instances_cc::do_common_split(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::nodes::node_geo_merge_layers_cc::get_layers_map_by_id(), blender::nodes::node_geo_merge_layers_cc::get_layers_map_by_name(), blender::bke::EvaluateAtIndexInput::get_varray_for_context(), blender::nodes::node_geo_accumulate_field_cc::AccumulateFieldInput::get_varray_for_context(), blender::nodes::node_geo_accumulate_field_cc::TotalFieldInput::get_varray_for_context(), blender::nodes::node_geo_blur_attribute_cc::BlurAttributeFieldInput::get_varray_for_context(), blender::nodes::node_geo_field_average_cc::FieldAverageInput::get_varray_for_context(), blender::nodes::node_geo_field_min_and_max_cc::FieldMinMaxInput::get_varray_for_context(), blender::nodes::node_geo_field_variance_cc::FieldVarianceInput::get_varray_for_context(), blender::nodes::node_geo_input_curve_handles_cc::HandlePositionFieldInput::get_varray_for_context(), blender::nodes::node_geo_proximity_cc::ProximityFunction::init_for_mesh(), blender::nodes::node_geo_attribute_statistic_cc::node_geo_exec(), blender::nodes::node_geo_flip_faces_cc::node_geo_exec(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), blender::nodes::node_geo_sample_index_cc::node_geo_exec(), blender::nodes::node_geo_set_mesh_normal_cc::node_geo_exec(), blender::geometry::separate_mesh_selection(), and blender::nodes::node_geo_sort_elements_cc::sorted_indices().
|
inline |
| field | Field to add to the evaluator. |
| dst | Mutable span that the evaluated result for this field is be written into. |
Definition at line 414 of file FN_field.hh.
References add_with_destination().
|
inline |
Same as add_with_destination but typed.
Definition at line 395 of file FN_field.hh.
References add_with_destination().
| int blender::fn::FieldEvaluator::add_with_destination | ( | GField | field, |
| GMutableSpan | dst ) |
| field | Field to add to the evaluator. |
| dst | Mutable span that the evaluated result for this field is be written into. |
Definition at line 746 of file field.cc.
References add_with_destination(), and blender::GVMutableArray::ForSpan().
| int blender::fn::FieldEvaluator::add_with_destination | ( | GField | field, |
| GVMutableArray | dst ) |
| field | Field to add to the evaluator. |
| dst | Mutable virtual array that the evaluated result for this field is be written into. |
Definition at line 738 of file field.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append().
Referenced by add_with_destination(), add_with_destination(), add_with_destination(), blender::bke::curves_normals_point_domain_calc(), blender::bke::EvaluateOnDomainInput::get_varray_for_context(), blender::nodes::node_geo_blur_attribute_cc::BlurAttributeFieldInput::get_varray_for_context(), blender::nodes::node_geo_set_mesh_normal_cc::node_geo_exec(), blender::nodes::node_geo_volume_cube_cc::node_geo_exec(), and blender::nodes::node_geo_set_position_cc::set_instances_position().
| void blender::fn::FieldEvaluator::evaluate | ( | ) |
Evaluate all fields on the evaluator. This can only be called once.
Definition at line 783 of file field.cc.
References BLI_assert, BLI_assert_msg, blender::fn::evaluate_fields(), blender::fn::evaluate_selection(), and info.
Referenced by blender::nodes::node_geo_points_to_curves_cc::curves_from_points(), blender::bke::curves_normals_point_domain_calc(), blender::nodes::node_geo_split_to_instances_cc::do_common_split(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::nodes::node_geo_blur_attribute_cc::BlurAttributeFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_curve_handles_cc::HandlePositionFieldInput::get_varray_for_context(), blender::nodes::node_geo_flip_faces_cc::node_geo_exec(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), blender::nodes::node_geo_sample_index_cc::node_geo_exec(), blender::nodes::node_geo_set_mesh_normal_cc::node_geo_exec(), blender::nodes::node_geo_volume_cube_cc::node_geo_exec(), blender::geometry::separate_grease_pencil_layer_selection(), blender::geometry::separate_mesh_selection(), blender::nodes::node_geo_set_curve_normal_cc::set_curve_normal(), blender::nodes::node_geo_set_position_cc::set_instances_position(), and blender::nodes::node_geo_sort_elements_cc::sorted_indices().
|
inline |
Definition at line 454 of file FN_field.hh.
References get_evaluated(), and blender::GVArray::typed().
|
inline |
Definition at line 448 of file FN_field.hh.
References BLI_assert.
Referenced by blender::nodes::node_geo_points_to_curves_cc::curves_from_points(), blender::nodes::node_geo_split_to_instances_cc::do_common_split(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), get_evaluated(), get_evaluated_as_mask(), blender::nodes::node_geo_blur_attribute_cc::BlurAttributeFieldInput::get_varray_for_context(), blender::nodes::node_geo_input_curve_handles_cc::HandlePositionFieldInput::get_varray_for_context(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), blender::nodes::node_geo_sample_index_cc::node_geo_exec(), blender::geometry::separate_mesh_selection(), and blender::nodes::node_geo_sort_elements_cc::sorted_indices().
| IndexMask blender::fn::FieldEvaluator::get_evaluated_as_mask | ( | int | field_index | ) |
Retrieve the output of an evaluated boolean field and convert it to a mask, which can be used to avoid calculations for unnecessary elements later on. The evaluator will own the indices in some cases, so it must live at least as long as the returned mask.
Definition at line 804 of file field.cc.
References get_evaluated(), blender::VArrayCommon< T >::get_internal_single(), blender::fn::index_mask_from_selection(), blender::VArrayCommon< T >::is_single(), blender::VArrayCommon< T >::size(), and blender::GVArray::typed().
Referenced by blender::nodes::node_geo_flip_faces_cc::node_geo_exec(), and blender::nodes::node_geo_set_mesh_normal_cc::node_geo_exec().
| IndexMask blender::fn::FieldEvaluator::get_evaluated_selection_as_mask | ( | ) | const |
Definition at line 817 of file field.cc.
References BLI_assert.
Referenced by blender::nodes::node_geo_split_to_instances_cc::do_common_split(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), blender::geometry::separate_grease_pencil_layer_selection(), blender::nodes::node_geo_set_curve_normal_cc::set_curve_normal(), blender::nodes::node_geo_set_position_cc::set_instances_position(), and blender::nodes::node_geo_sort_elements_cc::sorted_indices().
|
inline |
The selection field is evaluated first to determine which indices of the other fields should be evaluated. Calling this method multiple times will just replace the previously set selection field. Only the elements selected by both this selection and the selection provided in the constructor are calculated. If no selection field is set, it is assumed that all indices passed to the constructor are selected.
Definition at line 383 of file FN_field.hh.
Referenced by blender::nodes::node_geo_distribute_points_on_faces_cc::calc_full_density_factors_with_selection(), blender::nodes::node_geo_curves_to_grease_pencil_cc::curve_instances_to_grease_pencil_layers(), blender::nodes::node_geo_split_to_instances_cc::do_common_split(), blender::nodes::node_geo_duplicate_elements_cc::duplicate_faces(), blender::nodes::node_geo_mesh_to_points_cc::geometry_set_mesh_to_points(), blender::nodes::node_geo_grease_pencil_to_curves_cc::node_geo_exec(), blender::nodes::node_geo_realize_instances_cc::node_geo_exec(), blender::geometry::separate_grease_pencil_layer_selection(), blender::nodes::node_geo_set_curve_normal_cc::set_curve_normal(), blender::nodes::node_geo_set_id_cc::set_id_in_component(), blender::nodes::node_geo_set_position_cc::set_instances_position(), and blender::nodes::node_geo_sort_elements_cc::sorted_indices().