53 #ifndef vtk_m_worklet_contourtree_augmented_active_graph_set_arcs_slide_vertices_h
54 #define vtk_m_worklet_contourtree_augmented_active_graph_set_arcs_slide_vertices_h
63 namespace contourtree_augmented
65 namespace active_graph_inc
73 WholeArrayIn treeArcs,
76 WholeArrayIn treeFirstSuperchild,
77 WholeArrayIn treeSupernodes,
78 WholeArrayInOut treeSuperparents);
91 template <
typename InFieldPortalType,
typename InOutFieldPortalType>
94 const InFieldPortalType& meshExtremaPortal,
95 const InFieldPortalType& treeFirstSuperchildPortal,
96 const InFieldPortalType& treeSupernodesPortal,
97 const InOutFieldPortalType& treeSuperparentsPortal)
const
106 vtkm::Id fromID = meshExtremaPortal.Get(nodeID);
123 vtkm::Id leftSupernodeID = treeFirstSuperchildPortal.Get(hyperID);
124 vtkm::Id leftNodeID = treeSupernodesPortal.Get(leftSupernodeID);
137 if (
IsJoinGraph ? (nodeID < leftNodeID) : (nodeID > leftNodeID))
139 treeSuperparentsPortal.Set(nodeID, leftSupernodeID);
151 rightSupernodeID = treeFirstSuperchildPortal.Get(hyperID + 1) - 1;
158 rightSupernodeID = treeFirstSuperchildPortal.Get(hyperID - 1) - 1;
164 while (leftSupernodeID != rightSupernodeID - 1)
166 vtkm::Id midSupernodeID = (leftSupernodeID + rightSupernodeID) / 2;
167 vtkm::Id midNodeID = treeSupernodesPortal.Get(midSupernodeID);
169 if (
IsJoinGraph ? (midNodeID > nodeID) : (midNodeID < nodeID))
170 rightSupernodeID = midSupernodeID;
172 leftSupernodeID = midSupernodeID;
176 treeSuperparentsPortal.Set(nodeID, rightSupernodeID);