Differential D16083 Diff 56395 source/blender/nodes/geometry/nodes/node_geo_input_mesh_vertex_neighbors.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_input_mesh_vertex_neighbors.cc
| Show First 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | uint64_t hash() const override | ||||
| /* Some random constant hash. */ | /* Some random constant hash. */ | ||||
| return 23574528465; | return 23574528465; | ||||
| } | } | ||||
| bool is_equal_to(const fn::FieldNode &other) const override | bool is_equal_to(const fn::FieldNode &other) const override | ||||
| { | { | ||||
| return dynamic_cast<const VertexCountFieldInput *>(&other) != nullptr; | return dynamic_cast<const VertexCountFieldInput *>(&other) != nullptr; | ||||
| } | } | ||||
| std::optional<eAttrDomain> preferred_domain(const Mesh & /*mesh*/) const override | |||||
| { | |||||
| return ATTR_DOMAIN_POINT; | |||||
| } | |||||
| }; | }; | ||||
| static VArray<int> construct_face_count_gvarray(const Mesh &mesh, const eAttrDomain domain) | static VArray<int> construct_face_count_gvarray(const Mesh &mesh, const eAttrDomain domain) | ||||
| { | { | ||||
| const Span<MLoop> loops = mesh.loops(); | const Span<MLoop> loops = mesh.loops(); | ||||
| if (domain == ATTR_DOMAIN_POINT) { | if (domain == ATTR_DOMAIN_POINT) { | ||||
| Array<int> vertices(mesh.totvert, 0); | Array<int> vertices(mesh.totvert, 0); | ||||
| for (const int i : loops.index_range()) { | for (const int i : loops.index_range()) { | ||||
| Show All 24 Lines | uint64_t hash() const override | ||||
| /* Some random constant hash. */ | /* Some random constant hash. */ | ||||
| return 3462374322; | return 3462374322; | ||||
| } | } | ||||
| bool is_equal_to(const fn::FieldNode &other) const override | bool is_equal_to(const fn::FieldNode &other) const override | ||||
| { | { | ||||
| return dynamic_cast<const VertexFaceCountFieldInput *>(&other) != nullptr; | return dynamic_cast<const VertexFaceCountFieldInput *>(&other) != nullptr; | ||||
| } | } | ||||
| std::optional<eAttrDomain> preferred_domain(const Mesh & /*mesh*/) const override | |||||
| { | |||||
| return ATTR_DOMAIN_POINT; | |||||
| } | |||||
| }; | }; | ||||
| static void node_geo_exec(GeoNodeExecParams params) | static void node_geo_exec(GeoNodeExecParams params) | ||||
| { | { | ||||
| Field<int> vertex_field{std::make_shared<VertexCountFieldInput>()}; | Field<int> vertex_field{std::make_shared<VertexCountFieldInput>()}; | ||||
| Field<int> face_field{std::make_shared<VertexFaceCountFieldInput>()}; | Field<int> face_field{std::make_shared<VertexFaceCountFieldInput>()}; | ||||
| params.set_output("Vertex Count", std::move(vertex_field)); | params.set_output("Vertex Count", std::move(vertex_field)); | ||||
| Show All 16 Lines | |||||