Differential D15954 Diff 56253 source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc
| Show First 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | public: | ||||
| bool is_equal_to(const fn::FieldNode &other) const override | bool is_equal_to(const fn::FieldNode &other) const override | ||||
| { | { | ||||
| if (const EdgeVerticesFieldInput *other_field = dynamic_cast<const EdgeVerticesFieldInput *>( | if (const EdgeVerticesFieldInput *other_field = dynamic_cast<const EdgeVerticesFieldInput *>( | ||||
| &other)) { | &other)) { | ||||
| return vertex_ == other_field->vertex_; | return vertex_ == other_field->vertex_; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| std::optional<eAttrDomain> preferred_domain(const Mesh & /*mesh*/) const override | |||||
| { | |||||
| return ATTR_DOMAIN_EDGE; | |||||
| } | |||||
| }; | }; | ||||
| static VArray<float3> construct_edge_positions_gvarray(const Mesh &mesh, | static VArray<float3> construct_edge_positions_gvarray(const Mesh &mesh, | ||||
| const VertexNumber vertex, | const VertexNumber vertex, | ||||
| const eAttrDomain domain) | const eAttrDomain domain) | ||||
| { | { | ||||
| const Span<MVert> verts = mesh.verts(); | const Span<MVert> verts = mesh.verts(); | ||||
| const Span<MEdge> edges = mesh.edges(); | const Span<MEdge> edges = mesh.edges(); | ||||
| Show All 38 Lines | public: | ||||
| bool is_equal_to(const fn::FieldNode &other) const override | bool is_equal_to(const fn::FieldNode &other) const override | ||||
| { | { | ||||
| if (const EdgePositionFieldInput *other_field = dynamic_cast<const EdgePositionFieldInput *>( | if (const EdgePositionFieldInput *other_field = dynamic_cast<const EdgePositionFieldInput *>( | ||||
| &other)) { | &other)) { | ||||
| return vertex_ == other_field->vertex_; | return vertex_ == other_field->vertex_; | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| std::optional<eAttrDomain> preferred_domain(const Mesh & /*mesh*/) const override | |||||
| { | |||||
| return ATTR_DOMAIN_EDGE; | |||||
| } | |||||
| }; | }; | ||||
| static void node_geo_exec(GeoNodeExecParams params) | static void node_geo_exec(GeoNodeExecParams params) | ||||
| { | { | ||||
| Field<int> vertex_field_1{std::make_shared<EdgeVerticesFieldInput>(VERTEX_ONE)}; | Field<int> vertex_field_1{std::make_shared<EdgeVerticesFieldInput>(VERTEX_ONE)}; | ||||
| Field<int> vertex_field_2{std::make_shared<EdgeVerticesFieldInput>(VERTEX_TWO)}; | Field<int> vertex_field_2{std::make_shared<EdgeVerticesFieldInput>(VERTEX_TWO)}; | ||||
| Field<float3> position_field_1{std::make_shared<EdgePositionFieldInput>(VERTEX_ONE)}; | Field<float3> position_field_1{std::make_shared<EdgePositionFieldInput>(VERTEX_ONE)}; | ||||
| Field<float3> position_field_2{std::make_shared<EdgePositionFieldInput>(VERTEX_TWO)}; | Field<float3> position_field_2{std::make_shared<EdgePositionFieldInput>(VERTEX_TWO)}; | ||||
| Show All 19 Lines | |||||