From 7e92acdd4f74c595198db05e13bc53bd384e715a Mon Sep 17 00:00:00 2001 From: imrn99 <95699343+imrn99@users.noreply.github.com> Date: Tue, 12 Nov 2024 11:31:47 +0100 Subject: [PATCH] fix atomically_two_sew --- honeycomb-core/src/cmap/dim2/link_and_sew.rs | 54 ++++++++------------ 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/honeycomb-core/src/cmap/dim2/link_and_sew.rs b/honeycomb-core/src/cmap/dim2/link_and_sew.rs index 6c96fa32b..b4d9d92d1 100644 --- a/honeycomb-core/src/cmap/dim2/link_and_sew.rs +++ b/honeycomb-core/src/cmap/dim2/link_and_sew.rs @@ -259,21 +259,19 @@ impl CMap2 { self.two_link_core(trans, lhs_dart_id, rhs_dart_id)?; // merge vertices & attributes from the old IDs to the new one // FIXME: VertexIdentifier should be cast to DartIdentifier - self.vertices.merge_core( - trans, - self.vertex_id(lhs_dart_id), - lhs_vid_old, - b1rhs_vid_old, - )?; + let lhs_vid_new = self.vertex_id_transac(trans, lhs_dart_id)?; + let eid_new = self.edge_id_transac(trans, lhs_dart_id)?; + self.vertices + .merge_core(trans, lhs_vid_new, lhs_vid_old, b1rhs_vid_old)?; self.attributes.merge_vertex_attributes_transac( trans, - self.vertex_id(lhs_dart_id), + lhs_vid_new, lhs_vid_old, b1rhs_vid_old, )?; self.attributes.merge_edge_attributes_transac( trans, - self.edge_id(lhs_dart_id), + eid_new, lhs_eid_old, rhs_eid_old, )?; @@ -288,22 +286,19 @@ impl CMap2 { // update the topology self.two_link_core(trans, lhs_dart_id, rhs_dart_id)?; // merge vertices & attributes from the old IDs to the new one - // FIXME: VertexIdentifier should be cast to DartIdentifier - self.vertices.merge_core( - trans, - self.vertex_id(rhs_dart_id), - b1lhs_vid_old, - rhs_vid_old, - )?; + let rhs_vid_new = self.vertex_id_transac(trans, rhs_dart_id)?; + let eid_new = self.edge_id_transac(trans, lhs_dart_id)?; + self.vertices + .merge_core(trans, rhs_vid_new, b1lhs_vid_old, rhs_vid_old)?; self.attributes.merge_vertex_attributes_transac( trans, - self.vertex_id(rhs_dart_id), + rhs_vid_new, b1lhs_vid_old, rhs_vid_old, )?; self.attributes.merge_edge_attributes_transac( trans, - self.edge_id(lhs_dart_id), + eid_new, lhs_eid_old, rhs_eid_old, )?; @@ -346,33 +341,28 @@ impl CMap2 { self.two_link_core(trans, lhs_dart_id, rhs_dart_id)?; // merge vertices & attributes from the old IDs to the new one // FIXME: VertexIdentifier should be cast to DartIdentifier - self.vertices.merge_core( - trans, - self.vertex_id(lhs_dart_id), - lhs_vid_old, - b1rhs_vid_old, - )?; - self.vertices.merge_core( - trans, - self.vertex_id(rhs_dart_id), - b1lhs_vid_old, - rhs_vid_old, - )?; + let lhs_vid_new = self.vertex_id_transac(trans, lhs_dart_id)?; + let rhs_vid_new = self.vertex_id_transac(trans, rhs_dart_id)?; + let eid_new = self.edge_id_transac(trans, lhs_dart_id)?; + self.vertices + .merge_core(trans, lhs_vid_new, lhs_vid_old, b1rhs_vid_old)?; + self.vertices + .merge_core(trans, rhs_vid_new, b1lhs_vid_old, rhs_vid_old)?; self.attributes.merge_vertex_attributes_transac( trans, - self.vertex_id(lhs_dart_id), + lhs_vid_new, lhs_vid_old, b1rhs_vid_old, )?; self.attributes.merge_vertex_attributes_transac( trans, - self.vertex_id(rhs_dart_id), + rhs_vid_new, b1lhs_vid_old, rhs_vid_old, )?; self.attributes.merge_edge_attributes_transac( trans, - self.edge_id(lhs_dart_id), + eid_new, lhs_eid_old, rhs_eid_old, )?;