18 .structure_type(StructureType::Field);
19 b.add_input<
decl::Int>(
"Next Vertex Index"_ustr)
22 .structure_type(StructureType::Field);
24 .structure_type(StructureType::Field)
25 .propagate_references();
37 [&](
const int start_vert) {
39 for (
int current_vert = start_vert; !vert_selection[current_vert];
40 current_vert = next_indices[current_vert])
42 if (!vert_range.
contains(current_vert)) [[unlikely]] {
45 vert_selection[current_vert] =
true;
52 for (const int i : range) {
53 const int2 edge = edges[i];
54 if (!(vert_selection[edge[0]] && vert_selection[edge[1]])) {
57 if (edge[0] == next_indices[edge[1]] || edge[1] == next_indices[edge[0]]) {
58 r_edge_selection[i] = true;
72 start_vertices_(start_verts),
73 next_vertex_(next_vertex)
83 evaluator.
add(next_vertex_);
84 evaluator.
add(start_vertices_);
88 if (start_verts.is_empty()) {
95 return mesh.attributes().adapt_domain<
bool>(
107 static constexpr int8_t id = 0;
109 hash.add(deep_hash_cache.
ensure(start_vertices_));
110 hash.add(deep_hash_cache.
ensure(next_vertex_));
115 return AttrDomain::Edge;
134 ntype.
ui_name =
"Edge Paths to Selection";
135 ntype.
ui_description =
"Output a selection of edges by following paths across mesh edges";
#define GEO_NODE_EDGE_PATHS_TO_SELECTION
#define NOD_REGISTER_NODE(REGISTER_FUNC)
constexpr bool contains(int64_t value) const
constexpr IndexRange index_range() const
static VArray from_container(ContainerT container)
int add(GField field, GVArray *varray_ptr)
IndexMask get_evaluated_as_mask(int field_index)
const GVArray & get_evaluated(const int field_index) const
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
static Field from_input(Args &&...args)
T extract_input(const UString identifier)
void set_output(const UString identifier, T &&value)
void node_register_type(bNodeType &ntype)
constexpr ParallelGrainSize grain_size(int grain_size)
static void node_register()
static void edge_paths_to_selection(const Mesh &src_mesh, const IndexMask &start_selection, const Span< int > next_indices, MutableSpan< bool > r_edge_selection)
static void node_declare(NodeDeclarationBuilder &b)
static void node_geo_exec(GeoNodeExecParams params)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
void geo_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
static constexpr int _160
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare
UniqueHash ensure(const GFieldRef &field)