Differential D16858 Diff 59011 source/blender/nodes/geometry/nodes/node_geo_mesh_topology_edges_of_vertex.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_mesh_topology_edges_of_vertex.cc
| Show All 19 Lines | b.add_input<decl::Float>(N_("Weights")) | ||||
| .hide_value() | .hide_value() | ||||
| .description( | .description( | ||||
| N_("Values used to sort the edges connected to the vertex. Uses indices by default")); | N_("Values used to sort the edges connected to the vertex. Uses indices by default")); | ||||
| b.add_input<decl::Int>(N_("Sort Index")) | b.add_input<decl::Int>(N_("Sort Index")) | ||||
| .min(0) | .min(0) | ||||
| .supports_field() | .supports_field() | ||||
| .description(N_("Which of the sorted edges to output")); | .description(N_("Which of the sorted edges to output")); | ||||
| b.add_output<decl::Int>(N_("Edge Index")) | b.add_output<decl::Int>(N_("Edge Index")) | ||||
| .dependent_field() | .field_source_reference_all() | ||||
| .description(N_("An edge connected to the face, chosen by the sort index")); | .description(N_("An edge connected to the face, chosen by the sort index")); | ||||
| b.add_output<decl::Int>(N_("Total")) | b.add_output<decl::Int>(N_("Total")) | ||||
| .dependent_field() | .field_source() | ||||
| .reference_pass({0}) | |||||
| .description(N_("The number of edges connected to each vertex")); | .description(N_("The number of edges connected to each vertex")); | ||||
| } | } | ||||
| static void convert_span(const Span<int> src, MutableSpan<int64_t> dst) | static void convert_span(const Span<int> src, MutableSpan<int64_t> dst) | ||||
| { | { | ||||
| for (const int i : src.index_range()) { | for (const int i : src.index_range()) { | ||||
| dst[i] = src[i]; | dst[i] = src[i]; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | threading::parallel_for(mask.index_range(), 1024, [&](const IndexRange range) { | ||||
| const int index_in_sort_wrapped = mod_i(index_in_sort, edges.size()); | const int index_in_sort_wrapped = mod_i(index_in_sort, edges.size()); | ||||
| edge_of_vertex[selection_i] = edge_indices[sort_indices[index_in_sort_wrapped]]; | edge_of_vertex[selection_i] = edge_indices[sort_indices[index_in_sort_wrapped]]; | ||||
| } | } | ||||
| }); | }); | ||||
| return VArray<int>::ForContainer(std::move(edge_of_vertex)); | return VArray<int>::ForContainer(std::move(edge_of_vertex)); | ||||
| } | } | ||||
| void for_each_field_input_recursive(FunctionRef<void(const FieldInput &)> fn) const | |||||
| { | |||||
| vert_index_.node().for_each_field_input_recursive(fn); | |||||
| sort_index_.node().for_each_field_input_recursive(fn); | |||||
| sort_weight_.node().for_each_field_input_recursive(fn); | |||||
| } | |||||
| uint64_t hash() const final | uint64_t hash() const final | ||||
| { | { | ||||
| return 98762349875636; | return 98762349875636; | ||||
| } | } | ||||
| bool is_equal_to(const fn::FieldNode &other) const final | bool is_equal_to(const fn::FieldNode &other) const final | ||||
| { | { | ||||
| if (const auto *typed = dynamic_cast<const EdgesOfVertInput *>(&other)) { | if (const auto *typed = dynamic_cast<const EdgesOfVertInput *>(&other)) { | ||||
| ▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines | |||||