46 #ifndef vtk_m_filter_scalar_topology_worklet_branch_decomposition_hierarchical_volumetric_branch_decomposer_CollapseBranchesWorklet_h
47 #define vtk_m_filter_scalar_topology_worklet_branch_decomposition_hierarchical_volumetric_branch_decomposer_CollapseBranchesWorklet_h
56 namespace scalar_topology
58 namespace hierarchical_volumetric_branch_decomposer
69 ExecObject findRegularByGlobal,
71 ExecObject findSuperArcBetweenNodes,
72 WholeArrayIn hierarchicalTreeRegular2supernode,
73 WholeArrayIn hierarchicalTreeWhichRound,
74 WholeArrayInOut branchRoot);
83 template <
typename ExecObjectType1,
84 typename ExecObjectType2,
85 typename InFieldPortalType,
86 typename InOutFieldPortalType>
91 const ExecObjectType1& findRegularByGlobal,
92 const ExecObjectType2&
93 findSuperArcBetweenNodes,
94 const InFieldPortalType& hierarchicalTreeRegular2supernodePortal,
95 const InFieldPortalType& hierarchicalTreeWhichRoundPortal,
96 const InOutFieldPortalType& branchRootPortal)
const
114 vtkm::Id bestUpLocalRegularId = findRegularByGlobal.FindRegularByGlobal(bestUpSupernodeId);
124 vtkm::Id bestDownLocalRegularId = findRegularByGlobal.FindRegularByGlobal(bestDownSupernodeId);
134 hierarchicalTreeRegular2supernodePortal.Get(bestUpLocalRegularId);
136 hierarchicalTreeRegular2supernodePortal.Get(bestDownLocalRegularId);
140 findSuperArcBetweenNodes.FindSuperArcBetweenNodes(bestUpLocalSupernodeId, supernode);
142 findSuperArcBetweenNodes.FindSuperArcBetweenNodes(bestDownLocalSupernodeId, supernode);
151 vtkm::Id bestUpRound = hierarchicalTreeWhichRoundPortal.Get(bestUpSuperarc);
152 vtkm::Id bestDownRound = hierarchicalTreeWhichRoundPortal.Get(bestDownSuperarc);
155 if ((bestUpRound > bestDownRound) ||
157 ((bestUpRound == bestDownRound) && (bestUpSuperarc > bestDownSuperarc)))
159 branchRootPortal.Set(bestDownSuperarc, bestUpSuperarc);
163 branchRootPortal.Set(bestUpSuperarc, bestDownSuperarc);